What Is a Pure Functional?

  • Martin Hofmann
  • Aleksandr Karbyshev
  • Helmut Seidl
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6199)

Abstract

Given an ML function f : (int->int)->int how can we rigorously specify that f is pure, i.e., produces no side-effects other than those arising from calling its functional argument? We show that existing methods based on preservation of invariants and relational parametricity are insufficient for this purpose and thus define a new notion that captures purity in the sense that for any functional F that is pure in this sense there exists a corresponding question-answer strategy. This research is motivated by an attempt to prove algorithms correct that take such supposedly pure functionals as input and apply them to stateful arguments in order to inspect intensional aspects of their behaviour.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Abramsky, S., Jagadeesan, R., Malacaria, P.: Full abstraction for PCF (extended abstract). In: Hagiya, M., Mitchell, J.C. (eds.) TACS 1994. LNCS, vol. 789, pp. 1–15. Springer, Heidelberg (1994)Google Scholar
  2. 2.
    Abramsky, S., McCusker, G.: Linearity, sharing and state: a fully abstract game semantics for idealized algol with active expressions. Electr. Notes Theor. Comput. Sci. 3 (1996)Google Scholar
  3. 3.
    Le Charlier, B., Van Hentenryck, P.: A Universal Top-Down Fixpoint Algorithm. Technical Report CS-92-25, Brown University, Providence, RI 02912 (1992)Google Scholar
  4. 4.
    Berry, G., Curien, P.-L.: Sequential algorithms on concrete data structures. Theor. Comput. Sci. 20, 265–321 (1982)MATHCrossRefMathSciNetGoogle Scholar
  5. 5.
    Fecht, C.: GENA - A Tool for Generating Prolog Analyzers from Specifications. In: Mycroft, A. (ed.) SAS 1995. LNCS, vol. 983, pp. 418–419. Springer, Heidelberg (1995)Google Scholar
  6. 6.
    Fecht, C., Seidl, H.: A faster solver for general systems of equations. Sci. Comput. Program. 35(2), 137–161 (1999)MATHCrossRefMathSciNetGoogle Scholar
  7. 7.
    Hermenegildo, M.V., Puebla, G., Marriott, K., Stuckey, P.J.: Incremental analysis of constraint logic programs. ACM Trans. Program. Lang. Syst. 22(2), 187–223 (2000)CrossRefGoogle Scholar
  8. 8.
    Hyland, J.M.E., Luke Ong, C.-H.: On full abstraction for pcf: I, ii, and iii. Inf. Comput. 163(2), 285–408 (2000)MATHCrossRefGoogle Scholar
  9. 9.
    Jorgensen, N.: Finding Fixpoints in Finite Function Spaces Using Neededness Analysis and Chaotic Iteration. In: LeCharlier, B. (ed.) SAS 1994. LNCS, vol. 864, pp. 329–345. Springer, Heidelberg (1994)Google Scholar
  10. 10.
    Longley, J.: When is a functional program not a functional program? In: ICFP, pp. 1–7 (1999)Google Scholar
  11. 11.
    Nielson, H.R., Nielson, F.: Flow logics for constraint based analysis. In: Koskimies, K. (ed.) CC 1998. LNCS, vol. 1383, pp. 109–127. Springer, Heidelberg (1998)CrossRefGoogle Scholar
  12. 12.
    O’Hearn, P.W., Reynolds, J.C.: From algol to polymorphic linear lambda-calculus. J. ACM 47(1), 167–223 (2000)MATHCrossRefMathSciNetGoogle Scholar
  13. 13.
    Reynolds, J.: Types, abstraction and parametric polymorphism. In: Information Processing, IFIP. North-Holland, Amsterdam (1983)Google Scholar
  14. 14.
    Reynolds, J.C., Plotkin, G.D.: On functors expressible in the polymorphic typed lambda calculus. Technical Report ECS-LFCS-88-53, University of Edinburgh (May 1988)Google Scholar
  15. 15.
    Rudich, A., Darvas, Á., Müller, P.: Checking well-formedness of pure-method specifications. In: Cuellar, J., Maibaum, T., Sere, K. (eds.) FM 2008. LNCS, vol. 5014, pp. 68–83. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  16. 16.
    Seidl, H., Vojdani, V.: Region analysis for race detection. In: Palsberg, J., Su, Z. (eds.) Static Analysis. LNCS, vol. 5673, pp. 171–187. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  17. 17.
    Simpson, A.K.: Lazy functional algorithms for exact real functionals. In: Brim, L., Gruska, J., Zlatuška, J. (eds.) MFCS 1998. LNCS, vol. 1450, pp. 456–464. Springer, Heidelberg (1998)CrossRefGoogle Scholar
  18. 18.
    Wadler, P.: Theorems for free! In: FPCA, pp. 347–359 (1989)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2010

Authors and Affiliations

  • Martin Hofmann
    • 1
  • Aleksandr Karbyshev
    • 2
  • Helmut Seidl
    • 2
  1. 1.Institut für InformatikUniversität MünchenMünchenGermany
  2. 2.Fakultät für InformatikTechnische Universität München 

Personalised recommendations