ABSTRACT
This paper studies the conditions necessary to safely introduce new values as part of the results of function rules in functional-logic programs. The idea is to consider an initial functional-logic program and to produce, by means of a program transformation, a new program including states. Each rule of the new program returns pairs of values, with the first value the same as in the original program, and the second one a new value that can be defined in terms of the values returned by the function calls occurring in the rule. We prove that the transformation ensures the equivalence of the two programs with respect to the Constructor-based ReWriting Logic, a suitable semantics for functional-logic programs.
- M. Abengózar-Carneros et al. Toy: A multiparadigm declarative language. version 1.0. Technical Report SIP-119/00, Universidad Complutense de Madrid, Departamento de Sistemas Informáticos y Programación, UCM, February 2002.Google Scholar
- E. Albert, M. Hanus, and G. Vidal. A residualizing semantics for the partial evaluation of functional logic programs. Inf. Process. Lett., 85 (1): 19--25, 2003. Google ScholarDigital Library
- E. Albert, M. Hanus, F. Huch, J. Oliver, and G. Vidal. Operational semantics for declarative multi-paradigm languages. Journal of Symbolic Computation, 40: 795--829, 2005. Google ScholarDigital Library
- S. Antoy and M. Hanus. Functional logic programming. Commun. ACM, 53 (4): 74--85, 2010. Google ScholarDigital Library
- R. Caballero and F. López-Fraguas. A functional-logic perspective of parsing. In A. Middeldorp and T. Sato, editors, Functional and Logic Programming, volume 1722 of Lecture Notes in Computer Science, pages 85--99. Springer Berlin / Heidelberg, 1999. Google ScholarDigital Library
- R. Caballero and M. Rodríguez-Artalejo. A Declarative Debugging System for Lazy Functional Logic Programs. Electronic Notes in Theoretical Computer Science, 64: 113--175, 2002.Google ScholarCross Ref
- R. Caballero-Roldán. Técnicas de Diagnóstico y Depuración Declarativas para lenguajes lógico-funcionales. PhD thesis, Departamento de Sistemas Informáticos y Programación, Universidad Complutense de Madrid, 2004.Google Scholar
- J. González-Moreno, M. Hortalá-González, F. López-Fraguas, and M. Rodrıguez-Artalejo. A rewriting logic for declarative programming. In Proc. European Symposium on Programming (ESOP'96), volume 1058 of LNCS, pages 156--172. Springer, 1996. Google ScholarDigital Library
- J. González-Moreno, M. Hortalá-González, F. López-Fraguas, and M. Rodrıguez-Artalejo. An approach to declarative programming based on a rewriting logic. Journal of Logic Programming, 40 (1): 47--87, 1999.Google ScholarCross Ref
- M. Hamana. Semantics for Interactive Higher-order Functional-Logic Programming. PhD thesis, University of Tsukuba, 1998.Google Scholar
- M. Hanus. Curry: An Integrated Functional Logic Language (version 0.8.2, 2006). Available at: http://www.curry-language.org, 2006.Google Scholar
- M. Hanus. Multi-paradigm declarative languages. In ICLP'07: Proceedings of the 23rd international conference on Logic programming, pages 45--75, Berlin, Heidelberg, 2007. Springer-Verlag. Google ScholarDigital Library
- S. P. Jones, editor. Haskell 98 Language and Libraries: The Revised Report. http://haskell.org/, September 2002. URL http://haskell.org/definition/haskell98-report.pdf.Google Scholar
- R. Loogen, F. J. López-Fraguas, and M. Rodrıguez-Artalejo. A demand driven computation strategy for lazy narrowing. In PLILP '93: Proceedings of the 5th International Symposium on Programming Language Implementation and Logic Programming, pages 184--200, London, UK, 1993. Springer-Verlag. Google ScholarDigital Library
- F. López-Fraguas, J. Rodrıguez-Hortalá, and J. Sánchez-Hernández. Rewriting and call-time choice: The ho case. In J. Garrigue and M. Hermenegildo, editors, Functional and Logic Programming, volume 4989 of Lecture Notes in Computer Science, pages 147--162. Springer Berlin / Heidelberg, 2008. Google ScholarDigital Library
- E. Moggi. Notions of computation and monads. Information and Computation, 93: 55--92, 1989. Google ScholarDigital Library
- l. Naish and T. Barbour. A declarative debugger for a logical-functional language. In Eight International Conferencie on Industrial and Engineering Applications of Artificial Intelligence and Expert System - Invited and Additional Papers, volume 2, pages 91--99. DSTO General Document 51, 1995.Google Scholar
- J. Paakki. Attribute grammar paradigmsa high-level methodology in language implementation. ACM Comput. Surv., 27: 196--255, June 1995. Google ScholarDigital Library
- P. Wadler. Comprehending monads. In LFP '90: Proceedings of the 1990 ACM conference on LISP and functional programming, pages 61--78, New York, NY, USA, 1990. ACM. Google ScholarDigital Library
Index Terms
- A program transformation for returning states in functional-logic programs
Recommendations
Proving Theorems by Program Transformation
To Andrzej Skowron on His 70th BirthdayIn this paper we present an overview of the unfold/fold proof method, a method for proving theorems about programs, based on program transformation. As a metalanguage for specifying programs and program properties we adopt constraint logic programming ...
An unfold/fold transformation framework for definite logic programs
Given a logic program P, an unfold/fold program transformation system derives a sequence of programs P = P0, P1, …, Pn, such that Pi+1 is derived from Pi by application of either an unfolding or a folding step. Unfold/fold transformations have been ...
The least fixpoint transformation for disjunctive logic programs
AbstractThe paradigm of disjunctive logic programming (DLP) enhances greatly the expressive power of normal logic programming (NLP) and many (declarative) semantics have been defined for DLP to cope with various problems of knowledge representation in ...
Comments