Programming with Singular and Plural Non-deterministic Functions

被引:5
作者
Riesco, Adrian [1 ]
Rodriguez-Hortala, Juan [1 ]
机构
[1] Univ Complutense Madrid, Dept Sistemas Informat & Computac, E-28040 Madrid, Spain
来源
PEPM '10: PROCEEDINGS OF THE 2010 ACM SIGPLAN WORKSHOP ON PARTIAL EVALUATION AND PROGRAM MANIPULATION | 2010年
关键词
Non-deterministic functions; Semantics; Program transformation; Term rewriting; Maude; REWRITING LOGIC; SEMANTICS; LANGUAGES;
D O I
10.1145/1706356.1706373
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Non-strict non-deterministic functions are one of the most distinctive features of functional-logic languages. Traditionally, two semantic alternatives have been considered for this kind of functions: call-time choice and run-time choice. While the former is the standard choice of modern implementations of FLP, the latter lacks some basic properties mainly compositionality that have prevented its use in practical FLP implementations. Recently, a new compositional plural semantics for FLP has been proposed. Although this semantics allows an elegant encoding of some problems in particular those with an implicit manipulation of sets of values, call-time choice still remains the best option for many common programming patterns. In this paper we explore the expressive possibilities of the combination of singular and plural non-determinism. After formalizing the intended semantics by means of a logic calculus, several significant examples exploiting the capabilities of the semantics are presented. These examples have been tested and developed in a Maude-based prototype whose implementation is outlined.
引用
收藏
页码:83 / 92
页数:10
相关论文
共 28 条
[1]   Operational semantics for declarative multi-paradigm languages [J].
Albert, E ;
Hanus, M ;
Huch, F ;
Oliver, J ;
Vidal, G .
JOURNAL OF SYMBOLIC COMPUTATION, 2005, 40 (01) :795-829
[2]  
Brassel B, 2007, LECT NOTES COMPUT SC, V4807, P122
[3]  
CABALLERO R, 2003, J FUNCTIONAL LOGIC P
[4]  
Clavel M, 2007, SPRINGER LNCS, V4350, DOI 10.1007/978-3-540-71999-1.
[5]   Reflection in membership equational logic, many-sorted equational logic, Horn logic with equality, and rewriting logic [J].
Clavel, Manuel ;
Meseguer, Jose ;
Palomino, Miguel .
THEORETICAL COMPUTER SCIENCE, 2007, 373 (1-2) :70-91
[6]  
Escobar S, 2004, LECT NOTES COMPUT SC, V2998, P147
[7]  
Fischer S., 2009, P 14 ACM SIGPLAN INT, P11
[8]   An approach to declarative programming based on a rewriting logic [J].
González-Moreno, JC ;
Hortalá-González, MT ;
López-Fraguas, FJ ;
Rodríguez-Artalejo, M .
JOURNAL OF LOGIC PROGRAMMING, 1999, 40 (01) :47-87
[9]  
GONZALEZMORENO JC, 1997, P ICLP 97, P153
[10]  
Hanus M., 2005, FUNCTIONAL LOGIC PRO