Advertisement

Classical By-Need

  • Pierre-Marie PédrotEmail author
  • Alexis Saurin
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9632)

Abstract

Call-by-need calculi are complex to design and reason with. When adding control effects, the very notion of canonicity is irremediably lost, the resulting calculi being necessarily ad hoc. This calls for a design of call-by-need guided by logical rather than operational considerations. Ariola et al. proposed such an extension of call-by-need with control making use of Curien and Herbelin’s duality of computation framework.

In this paper, Classical by-need is developed as an alternative extension of call-by-need with control, better-suited for a programming-oriented reader.This method is proof-theoretically oriented by relying on linear head reduction (LHR) – an evaluation strategy coming from linear logic – and on the \(\lambda \mu \)-calculus – a classical extension of the \({\lambda }\)-calculus.

More precisely, the paper contains three main contributions:
  • LHR is first reformulated by introducing closure contexts and extended to the \({\lambda }{\mu }\)-calculus;

  • it is then shown how to derive a call-by-need calculus from LHR. The result is compared with standard call-by-need calculi, namely those of Ariola–Felleisen and Chang–Felleisen;

  • it is finally shown how to lift the previous item to classical logic, that is from the \({\lambda }\)-calculus to the \({\lambda }{\mu }\)-calculus, providing a classical by-need calculus, that is a lazy \({\lambda }{\mu }\)-calculus. The result is compared with the call-by-need with control of Ariola et al.

Keywords

Call-by-need Classical logic Control operators Lambda-calculus Lambda-mu-calculus Lazy evaluation Linear head reduction Linear logic Krivine abstract machine Sigma equivalence 

Notes

Acknowledgements

The authors would like to thank Beniamino Accattoli, Thibaut Balabonski, Olivier Danvy and Delia Kesner for discussions regarding this work as well as anonymous reviewers.

References

  1. 1.
    Abadi, M., Cardelli, L., Curien, P.-L., Lévy, J.-J.: Explicit substitutions. J. Funct. Program. 1(4), 375–416 (1991)MathSciNetzbMATHCrossRefGoogle Scholar
  2. 2.
    Accattoli, B., Barenbaum, P., Mazza, D.: Distilling abstract machines. In: Jeuring, Chakravarty (eds.) ICFP 2014, pp. 363–376. ACM (2014)Google Scholar
  3. 3.
    Accattoli, B., Bonelli, E., Kesner, D., Lombardi, C.: A nonstandard standardization theorem. In: POPL 2014, San Diego, CA, USA, pp. 659–670 (2014)Google Scholar
  4. 4.
    Accattoli, B., Kesner, D.: The structural \(\lambda \)-calculus. In: Dawar, A., Veith, H. (eds.) CSL 2010. LNCS, vol. 6247, pp. 381–395. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  5. 5.
    Accattoli, B., Kesner, D.: The permutative \(\lambda \)-calculus. In: Bjørner, N., Voronkov, A. (eds.) LPAR-18 2012. LNCS, vol. 7180, pp. 23–36. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  6. 6.
    Accattoli, B., Lago, U.D.: Beta reduction is invariant, indeed. In: CSL-LICS 2014, Vienna, Austria, July 2014Google Scholar
  7. 7.
    Ariola, Z.M., Downen, P., Herbelin, H., Nakata, K., Saurin, A.: Classical call-by-need sequent calculi: the unity of semantic artifacts. In: Schrijvers, T., Thiemann, P. (eds.) FLOPS 2012. LNCS, vol. 7294, pp. 32–46. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  8. 8.
    Ariola, Z.M., Felleisen, M.: The call-by-need lambda calculus. J. Funct. Program. 7(3), 265–301 (1997)MathSciNetzbMATHCrossRefGoogle Scholar
  9. 9.
    Ariola, Z.M., Felleisen, M., Maraist, J., Odersky, M., Wadler, P.: The call-by-need lambda calculus. In: POPL 1995, pp. 233–246. ACM Press (1995)Google Scholar
  10. 10.
    Ariola, Z.M., Herbelin, H., Saurin, A.: Classical call-by-need and duality. In: Ong, L. (ed.) Typed Lambda Calculi and Applications. LNCS, vol. 6690, pp. 27–44. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  11. 11.
    Barendregt, H.: The Lambda Calculus, its Syntax and Semantics. Studies in Logic and the Foundations of Mathematics. Elsevier, Amsterdam (1984)zbMATHGoogle Scholar
  12. 12.
    Chang, S., Felleisen, M.: The call-by-need lambda calculus, revisited. In: Seidl, H. (ed.) Programming Languages and Systems. LNCS, vol. 7211, pp. 128–147. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  13. 13.
    Curien, P.-L., Herbelin, H.: The duality of computation. In: Odersky, M., Wadler, P. (eds.) ICFP 2000, pp. 233–243. ACM Press (2000)Google Scholar
  14. 14.
    Danos, V., Herbelin, H., Regnier, L.: Game semantics & abstract machines. In: LICS 1996, pp. 394–405. IEEE Press (1996)Google Scholar
  15. 15.
    Danos, V., Regnier, L.: Head linear reduction (2004) (unpublished)Google Scholar
  16. 16.
    Danvy, O., Millikin, K., Munk, J., Zerny, I.: Defunctionalized interpreters for call-by-need evaluation. In: Blume, M., Kobayashi, N., Vidal, G. (eds.) FLOPS 2010. LNCS, vol. 6009, pp. 240–256. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  17. 17.
    Girard, J.-Y.: Une extension de l’interprtation de Gdel l’analyse, et sonapplication a l’élimination des coupures dans l’analyse et la thorie destypes. In: Fenstad (ed.) Proceedings of the Second Scandinavian Logic Symposium. Studies in Logic and the Foundations of Mathematics, vol. 63, pp. 63–92. Elsevier (1971)Google Scholar
  18. 18.
    Girard, J.-Y.: Linear logic. Theoret. Comput. Sci. 50, 1–102 (1987)MathSciNetzbMATHCrossRefGoogle Scholar
  19. 19.
    Hyland, M., Ong, L.: On full abstraction for PCF. Inf. Comput. 163(2), 285–408 (2000)MathSciNetzbMATHCrossRefGoogle Scholar
  20. 20.
    Krivine, J.-L.: A call-by-name lambda-calculus machine. Higher-Order Symb. Comput. 20(3), 199–207 (2007)MathSciNetzbMATHCrossRefGoogle Scholar
  21. 21.
    Laurent, O.: A study of polarization in logic. Ph.D. Thesis, Université de la Méditerranée - Aix-Marseille II, March 2002Google Scholar
  22. 22.
    Maraist, J., Odersky, M., Wadler, P.: The call-by-need lambda-calculus. J. Funct. Program. 8(3), 275–317 (1998)MathSciNetzbMATHCrossRefGoogle Scholar
  23. 23.
    Miquel, A.: Forcing as a program transformation. In: LICS, pp. 197–206. IEEE Computer Society (2011)Google Scholar
  24. 24.
    Parigot, M.: Lambda-mu-calculus: an algorithmic interpretation of classical natural deduction. In: Voronkov, A. (ed.) LPAR 1992. LNCS, vol. 624, pp. 190–201. Springer, Heidelberg (1992)CrossRefGoogle Scholar
  25. 25.
    Regnier, L.: Lambda-calcul et réseaux. Ph.D. Thesis, Univ. Paris VII (1992)Google Scholar
  26. 26.
    Regnier, L.: Une équivalence sur les \(\lambda \)-termes. Theoret. Comput. Sci. 126, 281–292 (1994)MathSciNetCrossRefGoogle Scholar
  27. 27.
    Reynolds, J.C.: Towards a theory of type structure. In: Robinet, B. (ed.) Programming Symposium. LNCS, vol. 19, pp. 408–423. Springer, Heidelberg (1974)CrossRefGoogle Scholar
  28. 28.
    Reynolds, J.C.: The discoveries of continuations. Lisp Symb. Comput. 6(3–4), 233–248 (1993)CrossRefGoogle Scholar
  29. 29.
    Streicher, T., Reus, B.: Classical logic, continuation semantics and abstract machines. J. Funct. Program. 8(6), 543–572 (1998)MathSciNetzbMATHCrossRefGoogle Scholar
  30. 30.
    Wadsworth, C.P.: Semantics and pragmatics of the lambda-calculus. Ph.D. Thesis, Programming Research Group, Oxford University (1971)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2016

Authors and Affiliations

  1. 1.Laboratoire PPS, CNRS, UMR 7126, Univ Paris Diderot, Sorbonne Paris Cité, PiR2, INRIA Paris RocquencourtParisFrance

Personalised recommendations