Abstract
We propose a theoretical framework for adding assignments and dynamic data to functional languages without violating their semantic properties. This differs from semifunctional languages like Scheme and ML in that values of expressions remain static and side-effect-free. A new form of abstraction called observer is designed to encapsulate state-oriented computation from the remaining purely applicative computation. The type system ensures that observers are combined linearly, allowing an implementation in terms of a global store. The utility of this extension is in manipulating shared dynamic data embedded in data structures. Evaluation of well-typed programs is Church-Rosser. Thus, programs produce the same results whether an eager or lazy evaluation order is used (assuming termination). A simple, sound logic permits reasoning about well-typed programs. The benefits of this work include greater expressive power and efficiency (compared to applicative languages), while retaining simplicity of reasoning.
Supported by NASA grant NAG-1-613 (while at the University of Illinois at Urbana-Champaign).
Supported by a grant from Motorola Corporation.
Preview
Unable to display preview. Download preview PDF.
References
M. Felleisen. lambda-v-cs: An extended lambda-calculus for scheme. In ACM Symp. on LISP and Functional Programming, 1988.
M. Felleisen and D. P. Friedman. A calculus for assignments in higher-order languages. In ACM Symp. on Principles of Programming Languages, pages 314–325, 1987.
M. Felleisen and R. Hieb. The revised report on the syntactic theories of sequential control and state. Technical Report COMP TR89-100, Rice University, 1989.
J.C. Guzman and P. Hudak. Single-threaded polymorphic lambda calculus. In IEEE Symp. on Logic in Computer Science, pages 333–343, 1990.
D.K. Gifford and J.M. Lucassen. Integrating functional and imperative programming. In ACM Symp. on LISP and Functional Programming, pages 28–38, 1986.
Jean-Yves Girard, Yves Lafont, and Paul Taylor. Proofs and Types. Cambridge University Press, 1989.
P. Hudak and A. Bloss. The aggregate update problem in functional programming systems. In ACM Symp. on Principles of Programming Languages, pages 300–314, 1985.
C. A. R. Hoare, I. J. Hayes, He Jifeng, C. C. Morgan, A. W. Roscoe, J. W. Sanders, I. H. Sorensen, J. M. Spivey, and B. A. Sufrin. Laws of programming. Communications of the ACM, 30(8):672–686, August 1987.
P. Hudak and R. Sundaresh. On the expressiveness of purely functional I/O systems. Technical Report YALEU/DCS/RR665, Yale University, Dec 1988.
G. Huet. Confluent reductions: abstract properties and applications to term rewriting systems. Journal of the ACM, 27(4):797–821, October 1980. (Previous version in Proc. Symp. Foundations of Computer Science, Oct 1977).
J. Hughes. Why functional programming matters. In Research Topics in Functional Programming, Univ. of Texas at Austin Year of Programming Series, chapter 2, pages 17–42. Addison-Wesley, 1990.
P. Hudak and P. Wadler (editors). Report on the programming language Haskell, A non-strict purely functional language (Version 1.0). Technical Report YALEU/DCS/RR-777, Dep. of Computer Sc., Yale University, Apr 1990.
K. Karlsson. Nebula, A functional operating system. Tech. report, Chalmers University, 1981.
J.M. Lucassen and D.K. Gifford. Polymorphic effect systems. In ACM Symp. on Principles of Programming Languages, pages 47–57, 1988.
L. M. McLoughlin and S. Hayes. Interlanguage working from a pure functional language. Functional Programming mailing list, Nov 1988.
J. C. Mitchell. Type systems for programming languages. In J. van Leeuwen, editor, Handbook of Theoretical Computer Science. North-Holland, Amsterdam, 1990. (also Report No. STAN-CS-89-1277, Department of Computer Science, Stanford University).
I. A. Mason and C. Talcott. Axiomatizing operational equivalence in the presence of side effects. In IEEE Symp. on Logic in Computer Science, pages 284–293. IEEE, 1989.
I. A. Mason and C. Talcott. A sound and complete axiomatization of operational equivalence between programs with memory. Technical Report STAN-CS-89-1250, Stanford University, 1989. (to appear in Theoretical Computer Science).
R. Milner, M. Tofte, and R. Harper. The definition of Standard ML. The MIT Press, Cambridge, Massachusetts, 1990.
N. Perry. The Implementation of Practical Functional Programming Languages. PhD thesis, Imperial College of Science, Technology and Medicine, University of London, 1990.
D. Prawitz. Ideas and results in proof theory. In Proc. Second Scandinavian Logic Symposium, 1971.
J. Rees and W. Clinger (editors). Revised3 report on the algorithmic language scheme. ACM SIGPLAN Notices, 21(12):37–79, Dec 1986.
J. C. Reynolds. The essence of Algol. In J. W. de Bakker and J. C. van Vliet, editors, Algorithmic Languages, pages 345–372. North-Holland, 1981.
J. C. Reynolds. Idealized Algol and its specification logic. In Neel. D., editor, Tools and Notions for Program Construction, pages 121–161. Cambridge Univ. Press, 1982.
J.C. Reynolds. Preliminary design of the programming language Forsythe. Technical Report CMU-CS-88-159, Carnegie Mellon University, June 1988.
J. A. Robinson. A machine-oriented logic based on the resolution principle. Journal of the ACM, 12:23–41, 1965.
D. A. Schmidt. Detecting global variables in denotational specifications. ACM Transactions on Programming Languages and Systems, 7(2):299–310, Apr 1985.
V. Swarup and U.S. Reddy. A logical view of assignments. In Conf. on Constructivity in Computer Science, 1991. (To appear).
J. E. Stoy. Denotational Semantics: The Scott-Strachey Approach to Programming Language Theory. MIT Press, 1977.
C. Strachey and C. P. Wadsworth. Continuations — a mathematical semantics for handling full jumps. Tech. Monograph PRG-11, Programming Research Group, University of Oxford, 1974.
V. Swarup. Type theoretic properties of assignments. PhD thesis, University of Illinois at Urbana-Champaign, 1991. (To appear).
W. W. Tait. A realizability interpretation of the theory of species. In R. Parikh, itor, Proceedings of Logic Colloquium, volume 453 of Lecture Notes in Mathematics, pages 240–251. Springer, Berlin, 1975.
M. Tofte. Operational semantics and polymorphic type inference. PhD thesis, Edinburgh University, 1988. Available as Edinburgh Univ. Lab. for Foundations of Computer Science Technical Report ECS-LFCS-88-54.
P. Wadler. Comprehending monads. In ACM Symp. on LISP and Functional Programming, 1990.
P. Wadler. Linear types can change the world. In IFIP Working Conf. on Programming Concepts and Methods, Sea of Gallilee, Israel, Apr 1990.
P. Wadler. Is there a use for linear logic? In Proc. ACM SIGPLAN Conf. on Partial Evaluation and Semantics-Based Program Manipulation, New York, 1991. ACM. (SIGPLAN Notices, to appear).
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1991 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Swarup, V., Reddy, U.S., Ireland, E. (1991). Assignments for applicative languages. In: Hughes, J. (eds) Functional Programming Languages and Computer Architecture. FPCA 1991. Lecture Notes in Computer Science, vol 523. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3540543961_10
Download citation
DOI: https://doi.org/10.1007/3540543961_10
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-54396-1
Online ISBN: 978-3-540-47599-6
eBook Packages: Springer Book Archive