2 research outputs found

    Compiling a Functional Logic Language: The Fair Scheme

    Full text link
    Abstract. We present a compilation scheme for a functional logic programming language. The input program to our compiler is a constructor-based graph rewrit-ing system in a non-confluent, but well-behaved class. This input is an interme-diate representation of a functional logic program in a language such as Curry or T OY. The output program from our compiler consists of three procedures that make recursive calls and execute both rewrite and pull-tab steps. This output is an intermediate representation that is easy to encode in any number of programming languages. Our design evolves the Basic Scheme of Antoy and Peters by removing the “left bias ” that prevents obtaining results of some computations—a behavior related to the order of evaluation, which is counter to declarative programming. The benefits of this evolution are not only the strong completeness of computa-tions, but also the provability of non-trivial properties of these computations. We rigorously describe the compiler design and prove some of its properties. To state and prove these properties, we introduce novel definitions of “need ” and “fail-ure. ” For non-confluent constructor-based rewriting systems these concepts are more appropriate than the classic definition of need of Huet and Levy

    CHR(Curry): Interpretation and Compilation of Constraint Handling Rules in Curry

    No full text
    Abstract. Constraint Handling Rules (CHR) is a rule-based language to specify application-oriented constraint solvers. CHR requires a host language that provides the basic constraints used in a CHR program. In this paper, we argue that an integrated functional logic language like Curry is an appropriate host language for CHR since it supports a natural formulation of constraint handling rules and a seamless integration into a typed environment. As a proof of concept, we describe CHR(Curry), an integration of CHR into Curry, together with two implementations. The first is an interpreter of CHR’s refined operational semantics imple-mented in Curry, and the second compiles CHR rules into Prolog which can be directly used in Prolog-based Curry implementations, such as PAKCS.
    corecore