Skip to main content

Semantics of a Relational \(\lambda \)-Calculus

  • Conference paper
  • First Online:
Theoretical Aspects of Computing – ICTAC 2020 (ICTAC 2020)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 12545))

Included in the following conference series:

Abstract

We extend the \(\lambda \)-calculus with constructs suitable for relational and functional–logic programming: non-deterministic choice, fresh variable introduction, and unification of expressions. In order to be able to unify \(\lambda \)-expressions and still obtain a confluent theory, we depart from related approaches, such as \(\lambda \)Prolog, in that we do not attempt to solve higher-order unification. Instead, abstractions are decorated with a location, which intuitively may be understood as its memory address, and we impose a simple coherence invariant: abstractions in the same location must be equal. This allows us to formulate a confluent small-step operational semantics which only performs first-order unification and does not require strong evaluation (below lambdas). We study a simply typed version of the system. Moreover, a denotational semantics for the calculus is proposed and reduction is shown to be sound with respect to the denotational semantics.

Work partially supported by project grants ECOS Sud A17C01, PUNQ 1346/17, and UBACyT 20020170100086BA.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

Notes

  1. 1.

    https://arxiv.org/abs/2009.10929.

  2. 2.

    Key in our proof of confluence is the fact that if \(\sigma \) and \(\sigma '\) are most general unifiers for unification problems \(\mathsf {G}\) and \(\mathsf {G}'\) respectively, then the most general unifier for \((\mathsf {G}\cup \mathsf {G}')\) is an instance of both \(\sigma \) and \(\sigma '\). See Example 4.5.

  3. 3.

    E.g. \(\lambda ^{\ell } x.\,x \overset{\bullet }{=}\lambda ^{\ell } x.\,x\) succeeds but \(\lambda ^{\ell } x.\,x \overset{\bullet }{=}\lambda ^{\ell '} x.\,x\) fails.

  4. 4.

    We expect that a less naive semantics should be stateful, involving a memory, in such a way that abstractions (\(\lambda x.\,P\)) allocate a memory cell and store a closure, whereas allocated abstractions (\(\lambda ^{\ell } x.\,P\)) denote a memory location in which a closure is already stored.

  5. 5.

    Precisely, \(\underline{\mathbf {t}}(n) = \{f_n\}\) with \(f_n(m) = \{(n,m)\}\).

References

  1. Albert, E., Hanus, M., Huch, F., Oliver, J., Vidal, G.: Operational semantics for functional logic languages. Electronic Notes Theor. Comput. Sci. 76, 1–19 (2002)

    Article  Google Scholar 

  2. Arbiser, A., Miquel, A., Ríos, A.: A lambda-calculus with constructors. In: Pfenning, F. (ed.) RTA 2006. LNCS, vol. 4098, pp. 181–196. Springer, Heidelberg (2006). https://doi.org/10.1007/11805618_14

    Chapter  Google Scholar 

  3. Ayala-Rincón, M., Bonelli, E., Edi, J., Viso, A.: Typed path polymorphism. Theoretical Comput. Sci. 781, 111–130 (2019)

    Article  MathSciNet  Google Scholar 

  4. Barendregt, H.: The Lambda Calculus: Its Syntax and Semantics, vol. 103. Elsevier (1984)

    Google Scholar 

  5. Byrd, W.E.: Relational programming in miniKanren: techniques, applications, and implementations. [Bloomington, Ind.]: Indiana University (2010)

    Google Scholar 

  6. Chakravarty, M.M., Guo, Y., Köhler, M., Lock, H.C.: Goffin: higher-order functions meet concurrent constraints. Sci. Comput. Program. 30(1–2), 157–199 (1998)

    Article  MathSciNet  Google Scholar 

  7. Faggian, C., Rocca, S.R.D.: Lambda calculus and probabilistic computation. In: 34th Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2019, Vancouver, BC, Canada, June 24–27, 2019. pp. 1–13. IEEE (2019)

    Google Scholar 

  8. Friedman, D.P., Byrd, W.E., Kiselyov, O.: The Reasoned Schemer. The MIT Press, Cambridge (2005)

    Book  Google Scholar 

  9. Gould, W.E.: A Matching Procedure for Omega-Order Logic. Ph.D. thesis, Princeton University (1966)

    Google Scholar 

  10. Hanus, M.: Functional logic programming: from theory to curry. In: Voronkov, A., Weidenbach, C. (eds.) Programming Logics. LNCS, vol. 7797, pp. 123–168. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-37651-1_6

    Chapter  MATH  Google Scholar 

  11. Hanus, M.: A unified computation model for functional and logic programming. In: Lee, P., Henglein, F., Jones, N.D. (eds.) Conference Record of POPL 1997: The 24th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, Papers Presented at the Symposium, Paris, France, 15–17 January 1997. pp. 80–93. ACM Press (1997)

    Google Scholar 

  12. Huet, G.P.: The undecidability of unification in third order logic. Inf. Control 22(3), 257–267 (1973)

    Article  MathSciNet  Google Scholar 

  13. Huet, G.P.: A unification algorithm for typed \(\lambda \)-calculus. Theoretical Comput. Science 1(1), 27–57 (1975)

    Article  MathSciNet  Google Scholar 

  14. Jay, B., Kesner, D.: Pure Pattern Calculus. In: Sestoft, P. (ed.) ESOP 2006. LNCS, vol. 3924, pp. 100–114. Springer, Heidelberg (2006). https://doi.org/10.1007/11693024_8

    Chapter  Google Scholar 

  15. Klop, J.W., Van Oostrom, V., De Vrijer, R.: Lambda calculus with patterns. Theoretical Comput. Sci. 398(1–3), 16–31 (2008)

    Article  MathSciNet  Google Scholar 

  16. Levy, J., Veanes, M.: On the undecidability of second-order unification. Inf. Comput. 159(1–2), 125–150 (2000)

    Article  MathSciNet  Google Scholar 

  17. Martelli, A., Montanari, U.: An efficient unification algorithm. ACM Trans. Program. Lang. Syst. (TOPLAS) 4(2), 258–282 (1982)

    Article  Google Scholar 

  18. Miller, D.: A logic programming language with lambda-abstraction, function variables, and simple unification. J. Logic Comput. 1(4), 497–536 (1991)

    Article  MathSciNet  Google Scholar 

  19. Miller, D.: Unification of simply typed lambda-terms as logic programming. Technical Report MS-CIS-91-24, University of Pennsylvania (1991)

    Google Scholar 

  20. Miller, D., Nadathur, G.: Programming with Higher-Order Logic. Cambridge University Press, Cambridge (2012)

    Book  Google Scholar 

  21. Milner, R.: A theory of type polymorphism in programming. J. Comput. Syst. Sci. 17(3), 348–375 (1978)

    Article  MathSciNet  Google Scholar 

  22. Nadathur, G., Miller, D.: Higher-order logic programming. In: Proceedings of the Third International Logic Programming Conference, pp. 448–462 (1984)

    Google Scholar 

  23. Petit, B.: Semantics of typed lambda-calculus with constructors. Log. Methods Comput. Sci. 7(1), 536 (2011)

    Article  MathSciNet  Google Scholar 

  24. Ramsey, N., Pfeffer, A.: Stochastic lambda calculus and monads of probability distributions. In: Proceedings of the 29th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 154–165 (2002)

    Google Scholar 

  25. Rozplokhas, D., Vyatkin, A., Boulytchev, D.: Certified semantics for minikanren. In: Proceedings of the 2019 MiniKanren and Relational Programming Workshop, pp. 80–98 (2019)

    Google Scholar 

  26. Schmidt-Schauß, M., Huber, M.: A lambda-calculus with letrec, case, constructors and non-determinism. arXiv preprint cs/0011008 (2000)

    Google Scholar 

  27. Smolka, G.: A foundation for higher-order concurrent constraint programming. In: Mathematical Methods in Program Development, pp. 433–458. Springer, Heidelberg (1997). https://doi.org/10.1007/978-3-642-60858-2_24

  28. Somogyi, Z., Henderson, F., Conway, T.: The execution algorithm of mercury, an efficient purely declarative logic programming language. J. Logic Program. 29(1–3), 17–64 (1996)

    Article  Google Scholar 

  29. The Coq Development Team: The Coq proof assistant reference manual. LogiCal Project (2004). http://coq.inria.fr, version 8.0

  30. Urban, C., Pitts, A.M., Gabbay, M.J.: Nominal unification. Theor. Comput. Sci. 323(1–3), 473–497 (2004)

    Article  MathSciNet  Google Scholar 

  31. Van Roy, P. (ed.): MOZ 2004. LNCS, vol. 3389. Springer, Heidelberg (2005). https://doi.org/10.1007/b106627

    Book  Google Scholar 

Download references

Acknowledgements

To Alejandro Díaz-Caro for supporting our interactions. To Eduardo Bonelli, Delia Kesner, and the anonymous reviewers for their feedback and suggestions.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Pablo Barenbaum .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2020 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Barenbaum, P., Lochbaum, F., Milicich, M. (2020). Semantics of a Relational \(\lambda \)-Calculus. In: Pun, V.K.I., Stolz, V., Simao, A. (eds) Theoretical Aspects of Computing – ICTAC 2020. ICTAC 2020. Lecture Notes in Computer Science(), vol 12545. Springer, Cham. https://doi.org/10.1007/978-3-030-64276-1_13

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-64276-1_13

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-64275-4

  • Online ISBN: 978-3-030-64276-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics