3 research outputs found
Inferring Non-Failure Conditions for Declarative Programs
Unintended failures during a computation are painful but frequent during
software development. Failures due to external reasons (e.g., missing files, no
permissions) can be caught by exception handlers. Programming failures, such as
calling a partially defined operation with unintended arguments, are often not
caught due to the assumption that the software is correct. This paper presents
an approach to verify such assumptions. For this purpose, non-failure
conditions for operations are inferred and then checked in all uses of
partially defined operations. In the positive case, the absence of such
failures is ensured. In the negative case, the programmer could adapt the
program to handle possibly failing situations and check the program again. Our
method is fully automatic and can be applied to larger declarative programs.
The results of an implementation for functional logic Curry programs are
presented.Comment: Extended version of a paper presented at the 17th International
Symposium on Functional and Logic Programming (FLOPS 2024
Implementing a Functional Logic Programming Language via the Fair Scheme
This document presents a new compiler for the Functional Logic programming language Curry based on a novel pull-tabbing evaluation strategy called the Fair Scheme. A simple version of the Fair Scheme is proven sound, complete, and optimal. An elaborated version is also developed, which supports narrowing computations and other features of Curry, such as constraint programming, equational constraints, and set functions.
The Fair Scheme is used to develop a new Curry system called Sprite, a high-quality, performant implementation whose aims are to promote practical uses of Curry and to serve as a laboratory for further research. An important aspect of Sprite is its integration with the popular imperative language Python. This combination allows one to write hybrid programs in which the programmer may move between declarative and non-declarative styles with relative ease. Benchmarking data show Sprite to be more complete than other Curry systems and competitive in terms of execution time, particularly for non-deterministic programs