Abstract
Set abstraction, originally introduced in fuctional languages by Turner, is an appealing construct because it leads to concise definitions of many interesting operations. However, existing approaches treat sets as lists for the sake of efficiency, and thereby sacrifice a simple declarative semantics. In this paper, we present a novel language based on sets and equations, where sets are treated as sets, consistent with their semantics. The language is called SEL, for Set-Equation Language. Equations are assumed to define a confluent rewriting system when oriented left to right. Sets are defined in terms of their subsets; these rules define a nonconfluent rewriting system when oriented left to right. We show examples of programs in this language, and provide an operational semantics for such programs. Programs are executed by innermost reduction, which may be nondeterministic or deterministic. Nondeterministic reduction is used when one of the elements of a set is desired. Deterministic reduction is used to simplify a term via an equation or to obtain all the elements of a set. The correctness of the operational semantics is also established.
This research is supported by grants DCR-8516243 and DCR-8603609 from the National Science Foundation.
Chapter PDF
Similar content being viewed by others
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
References
A. Bundy, “The Computer Modelling of Mathematical Reasoning,” Academic Press, New York, 1983.
L. Bachmair and N. Dershowitz, “Commutation, transformation, and temination,” In Proc. of 8th Int'l CADE, Oxford, Springer Lecture Notes in Computer Science, 230, pp. 5–20.
D. Benanav, D. Kapur, and P. Narendran, “On the complexity of matching problems,” In Rewriting Techniques and Applications, pp. 417–429, Dijon, France, May 1985.
L. Bachmair and D.A. Plaisted, “Associative Path Ordering,” J. of Symbolic Computation, 1, pp. 329–349.
K. L. Clark, “Negation as Failure,” In Logic and Data Bases, Ed. H. Gallaire and J. Minker, Plenum Press, New York, 1978, pp. 293–322.
J. S. Conery and D. F. Kibler, “Parallel Interpretation of Logic Programs,” In Conf. Functional Prog. Lang. and Comp. Arch., ACM, 1981, pp. 163–170.
W. F. Clocksin and C. S. Mellish, Programming in Prolog. Springer-Verlag, New York, 1981.
N. Dershowitz, “Orderings for term-rewriting systems,” Theoretical Computer Science, 17, pp. 279–301.
N. Dershowitz, “Termination of Rewriting,” Technical report UIUCDCS-R-85-1220, University of Illinois at Urbana-Champaign, August 1985.
N. Dershowitz and D. A. Plaisted, “Applicative Programming cum Logic Programming,” In 1985 Symp. on Logic Programming, Boston, pp. 54–66.
J. Darlington, A.J. Field, and H. Pull, “Unification of Functional and Logic Languages,” In DeGroot and Lindstrom (eds.), Logic Programming, Relations, Functions and Equations, pp. 37–70, Prentice-Hall, 1986.
D.P. Friedman and D.S. Wise, “An Indeterminate Constructor for Applicative Programming,” In 7th ACM POPL, pp. 245–250, Las Vegas, January 1980.
G. Huet, “Confluent Reductions: abstract properties and applications to term rewriting systems,” J. ACM, 27, 1980, pp. 797–821.
G. Huet and D. Oppen, “Equations and Rewrite Rules: a Survey,” In Formal Languages: Perspectives and Open Problems, R. Book (ed.), Academic Press, New York 1980.
C. M. Hoffman and M. J. O'Donnell, “Programming with Equations,” ACM TOPLAS 4, No. 1 (January 1982) pp. 83–112.
B. Jayaraman and F.S.K. Silbermann, “Equations, Sets, and Reduction Semantics for Functional and Logic Programming,” In 1986 ACM Symposium on LISP and Functional Programming, pp. 320–331, Boston, 1986.
D. E. Knuth and P. Bendix, “Simple Word Problems in Universal Algebras,” In Computational Problems in Abstract Algebra, J. Leech (ed.), Pergamon Press, New York, pp. 263–297, 1970.
R. M. Keller, “FEL (Function Equation Language) Programmer's Guide,” AMPS Technical Memo 7, Department of Computer Science, University of Utah, April 1982.
L. Naish, “All Solutions Predicates in Prolog,” In Symp. on Logic Programming, Boston, 1985, pp. 73–77.
M. J. O'Donnell, “Equational logic as a programming language,” M.I.T. Press, 1985.
D.A. Plaisted, “Semantic Confluence Tests and Completion Methods,” Information and Control, 65, pp. 182–215, 1985.
D.A. Plaisted, “Nondeterminism by Associative-Commutative Rewriting,” Internal Report, Department of Computer Science, University of North Carolina, Chapel Hill, March 1986, 30 pages.
J. A. Robinson, “New Generation Knowledge Processing: Syracuse University Parallel Expression Reduction,” First Annual Progress Report, December 1984.
U. S. Reddy, “Narrowing as the Operational Semantics of Functional Languages,” In 1985 Symp. on Logic Programming, Boston, 1985, pp. 138–151.
D. A. Turner, “The semantic elegance of applicative languages,” In ACM Symp. on Func. Prog. and Comp. Arch., New Hampshire, October, 1981, pp. 85–92.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1987 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Jayaraman, B., Plaisted, D.A. (1987). Functional programming with sets. In: Kahn, G. (eds) Functional Programming Languages and Computer Architecture. FPCA 1987. Lecture Notes in Computer Science, vol 274. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-18317-5_12
Download citation
DOI: https://doi.org/10.1007/3-540-18317-5_12
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-18317-4
Online ISBN: 978-3-540-47879-9
eBook Packages: Springer Book Archive