Abstract
We illustrate the use of a declarative programming paradigm based upon three kinds of program clauses: equational, subset, and general relational clauses. The implemented language is called SuRE, which is an acronym for Subsets, Relations, and Equations. (To wit, SuRE is the affirmative answer to the question: Can programming be declarative and practical?) Subset clauses have many uses in the logic programming context: They serve as a declarative alternative to Prolog's mode declarations as well as those uses of assert and retract that correspond to implementations of memo-tables or collection of results from alternative search paths, as in the setof construct. By re-formulating a relation as a set-valued function, one not only specifies mode information declaratively,but also gains the flexibility of operating on the resulting set incrementally (by a membership goal) or collectively (by an equational goal). In the latter case, one further has the flexibility of working lazily or eagerly. We show that lazy enumeration of solutions is the key to declaratively pruning the search space in generate-and-test problems. Subset clauses and, more generally, partial-order clauses are also useful in the deductive database context, especially for defining setof operations, transitive closures and monotonic aggregation—the concepts of subset, aggregation and monotonicity are more naturally expressed in terms of functions than predicates. A central feature in the implementation of SuRE programs is that of a monotonic memo-table, i.e., a memo-table whose entries can monotonically grow or shrink in an appropriate partial order. The implementation of SuRE was developed as an extensionof the well-known Warren Abstract Machine (WAM) for Prolog. Even though SuRE differs substantially from Prolog, few additional instructions, registers, and storage structures are needed and these blend in well with the overall design of the WAM.
This research was supported by a grant from the National Science Foundation.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1995 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Jayaraman, B., Moon, K. (1995). The SuRE programming framework. In: Alagar, V.S., Nivat, M. (eds) Algebraic Methodology and Software Technology. AMAST 1995. Lecture Notes in Computer Science, vol 936. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-60043-4_82
Download citation
DOI: https://doi.org/10.1007/3-540-60043-4_82
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-60043-5
Online ISBN: 978-3-540-49410-2
eBook Packages: Springer Book Archive