Results 1  10
of
29
Operational Semantics for Declarative MultiParadigm Languages
 Journal of Symbolic Computation
, 2005
"... Abstract. In this paper we define an operational semantics for functional logic languages covering notions like laziness, sharing, concurrency, nondeterminism, etc. Such a semantics is not only important to provide appropriate language definitions to reason about programs and check the correctness ..."
Abstract

Cited by 65 (29 self)
 Add to MetaCart
(Show Context)
Abstract. In this paper we define an operational semantics for functional logic languages covering notions like laziness, sharing, concurrency, nondeterminism, etc. Such a semantics is not only important to provide appropriate language definitions to reason about programs and check the correctness of implementations but it is also a basis to develop languagespecific tools, like program tracers, profilers, optimizers, etc. First, we define a &quot;bigstep &quot; semantics in natural style to relate expressions and their evaluated results. Since this semantics is not sufficient to cover concurrency, search strategies, or to reason about costs associated to particular computations, we also define a &quot;smallstep &quot; operational semantics covering the features of modern functional logic languages.
Efficient Local Unfolding with Ancestor Stacks for Full Prolog
 In Proc. of LOPSTR’04
, 2005
"... Abstract. The integration of powerful partial evaluation methods into practical compilers for logic programs is still far from reality. This is related both to 1) efficiency issues and to 2) the complications of dealing with practical programs. Regarding efficiency, the most successful unfolding rul ..."
Abstract

Cited by 17 (14 self)
 Add to MetaCart
(Show Context)
Abstract. The integration of powerful partial evaluation methods into practical compilers for logic programs is still far from reality. This is related both to 1) efficiency issues and to 2) the complications of dealing with practical programs. Regarding efficiency, the most successful unfolding rules used nowadays are based on structural orders applied over (covering) ancestors, i.e., a subsequence of the atoms selected during a derivation. Unfortunately, maintaining the structure of the ancestor relation during unfolding introduces significant overhead. We propose an efficient, practical local unfolding rule based on the notion of covering ancestors which can be used in combination with any structural order and allows a stackbased implementation without losing any opportunities for specialization. Regarding the second issue, we propose assertionbased techniques which allow our approach to deal with real programs that include (Prolog) builtins and external predicates in a very extensible manner. Finally, we report on our implementation of these techniques in a practical partial evaluator, embedded in a state of the art compiler which uses global analysis extensively (the Ciao compiler and, specifically, its preprocessor CiaoPP). The performance analysis of the resulting system shows that our techniques, in addition to dealing with practical programs, are also significantly more efficient in time and somewhat more efficient in memory than traditional treebased implementations. 1
NonLeftmost Unfolding in Partial Evaluation of Logic Programs with Impure Predicates
 In 15th International Symposium on Logicbased Program Synthesis and Transformation (LOPSTR’05), number 3901 in LNCS
, 2006
"... Abstract. Partial evaluation of logic programs which contain impure predicates poses nontrivial challenges. Impure predicates include those which produce sideeffects, raise errors (or exceptions), and those whose truth value varies according to the degree of instantiation of arguments4. In particu ..."
Abstract

Cited by 16 (12 self)
 Add to MetaCart
(Show Context)
Abstract. Partial evaluation of logic programs which contain impure predicates poses nontrivial challenges. Impure predicates include those which produce sideeffects, raise errors (or exceptions), and those whose truth value varies according to the degree of instantiation of arguments4. In particular, nonleftmost unfolding steps can produce incorrect results since the independence of the computation rule no longer holds in the presence of impure predicates. Existing proposals allow nonleftmost unfolding steps, but at the cost of accuracy: bindings and failure are not propagated backwards to predicates which are potentially impure. In this work we propose a partial evaluation scheme which substantially reduces the situations in which such backpropagation has to be avoided. With this aim, our partial evaluator takes into account the information about purity of predicates expressed in terms of assertions. This allows achieving some optimizations which are not feasible using existing partial evaluation techniques. We argue that our proposal goes beyond existing ones in that it is a) accurate, since the classification of pure vs impure is done at the level of atoms instead of predicates, b) extensible, as the information about purity can be added to programs using assertions without having to modify the partial evaluator itself, and c) automatic, since (backwards) analysis can be used to automatically infer the required assertions. Our approach has been implemented in the context of CiaoPP, the abstract interpretationbased preprocessor of the Ciao logic programming system. 1
Rules + Strategies for Transforming Lazy Functional Logic Programs
 Theoretical Computer Science
, 2004
"... This work introduces a transformation methodology for functional logic programs based on needed narrowing, the optimal and complete operational principle for modern declarative languages which integrate the best features of functional and logic programming. We provide correctness results for the tra ..."
Abstract

Cited by 9 (4 self)
 Add to MetaCart
This work introduces a transformation methodology for functional logic programs based on needed narrowing, the optimal and complete operational principle for modern declarative languages which integrate the best features of functional and logic programming. We provide correctness results for the transformation system w.r.t. the set of computed values and answer substitutions and show that the prominent properties of needed narrowing—namely, the optimality w.r.t. the length of derivations and the number of computed solutions—carry over to the transformation process and the transformed programs. We illustrate the power of the system by taking on in our setting two wellknown transformation strategies (composition and tupling). We also provide an implementation of the transformation system which, by means of some experimental results, highlights the potentiality of our approach.
Forward Slicing of MultiParadigm Declarative Programs Based on Partial Evaluation
, 2002
"... Program slicing has been mainly studied in the context of imperative languages, where it has been applied to many software engineering tasks, like program understanding, maintenance, debugging, testing, code reuse, etc. This paper introduces the first forward slicing technique for multiparadigm ..."
Abstract

Cited by 8 (5 self)
 Add to MetaCart
(Show Context)
Program slicing has been mainly studied in the context of imperative languages, where it has been applied to many software engineering tasks, like program understanding, maintenance, debugging, testing, code reuse, etc. This paper introduces the first forward slicing technique for multiparadigm declarative programs. In particular, we show how program slicing can be defined in terms of online partial evaluation. Our approach
A Residualizing Semantics for the Partial Evaluation of Functional Logic Programs
 Information Processing Letters
, 2002
"... Recent proposals for multiparadigm declarative programming combine the most important features of functional, logic and concurrent programming into a single framework. The operational semantics of these languages is usually based on a combination of narrowing and residuation. In this note, we intro ..."
Abstract

Cited by 6 (4 self)
 Add to MetaCart
(Show Context)
Recent proposals for multiparadigm declarative programming combine the most important features of functional, logic and concurrent programming into a single framework. The operational semantics of these languages is usually based on a combination of narrowing and residuation. In this note, we introduce a nonstandard, residualizing semantics for multiparadigm declarative programs and prove its equivalence with a standard operational semantics. Our residualizing semantics is particularly relevant within the area of program transformation where it is useful, e.g., to perform computations during partial evaluation. Thus, the proof of equivalence is a crucial result to demonstrate the correctness of (existing) partial evaluation schemes. Key words: Programming languages, formal semantics, program transformation 1
Offline narrowingdriven partial evaluation
, 2005
"... Narrowingdriven partial evaluation (NPE) is a powerful technique for the specialization of rewrite systems. Although it gives good results on small programs, it does not scale up well to realistic problems (e.g., interpreter specialization). In this work, we introduce a faster partial evaluation sc ..."
Abstract

Cited by 6 (5 self)
 Add to MetaCart
Narrowingdriven partial evaluation (NPE) is a powerful technique for the specialization of rewrite systems. Although it gives good results on small programs, it does not scale up well to realistic problems (e.g., interpreter specialization). In this work, we introduce a faster partial evaluation scheme by ensuring the termination of the process offline. For this purpose, we first characterize a class of rewrite systems which are quasiterminating, i.e., the computations performed with needed narrowing (the symbolic computation mechanism of NPE) only contain finitely many different terms (and, thus, partial evaluation terminates). Since this class is quite restrictive, we introduce an annotation algorithm for a broader class of systems so that they behave like quasiterminating rewrite systems w.r.t. a proposed extension of needed narrowing.
A Simple Supercompiler Formally Verified in Coq
 SECOND INTERNATIONAL WORKSHOP ON METACOMPUTATION IN RUSSIA (META 2010)
, 2010
"... We study an approach for verifying the correctness of a simplified supercompiler in Coq. While existing supercompilers are not very big in size, they combine many different program transformations in intricate ways, so checking the correctness of their implementation poses challenges. The presented ..."
Abstract

Cited by 6 (0 self)
 Add to MetaCart
We study an approach for verifying the correctness of a simplified supercompiler in Coq. While existing supercompilers are not very big in size, they combine many different program transformations in intricate ways, so checking the correctness of their implementation poses challenges. The presented method relies on two important technical features to achieve a compact and modular formalization: first, a very limited object language; second, decomposing the supercompilation process into many subtransformations, whose correctness can be checked independently. In particular, we give separate correctness proofs for two key parts of driving – normalization and positive information propagation – in the context of a nonTuringcomplete expression sublanguage. Though our supercompiler is currently limited, its formal correctness proof can give guidance for verifying more realistic implementations.
TypeBased Homeomorphic Embedding and Its Applications to Online Partial Evaluation
"... Abstract. Homeomorphic Embedding (HEm) hasproventobevery powerful for supervising termination of computations, provided that such computations are performed over a finite signature, i.e., the number of constants and function symbols involved is finite. However, there are situations, for example nume ..."
Abstract

Cited by 4 (4 self)
 Add to MetaCart
(Show Context)
Abstract. Homeomorphic Embedding (HEm) hasproventobevery powerful for supervising termination of computations, provided that such computations are performed over a finite signature, i.e., the number of constants and function symbols involved is finite. However, there are situations, for example numeric computations, which involve an infinite (or too large) signature, in which HEm does not guarantee termination. Some extensions to HEm for the case of infinite signatures have been proposed which guarantee termination, but they either do not provide systematic means for generating such extensions or the extensions are too simplistic and do not produce the expected results in practice. We introduce Typebased Homeomorphic Embedding (TbHEm) asanextension of the standard, untyped HEm to deal with infinite signatures. In the paper, we show how TbHEm can be used to improve the accuracy of online partial evaluation. For this purpose, we propose an approach to constructing suitable types for partial evaluation automatically based on existing analysis tools for constraint logic programs. We also present useful properties of types which allow us to take full advantage of TbHEm in practice. Experimental results are reported which show that our work improves the state of the practice of online partial evaluation. 1