skip to main content
research-article
Open Access

Fully abstract models for effectful λ-calculi via category-theoretic logical relations

Published:12 January 2022Publication History
Skip Abstract Section

Abstract

We present a construction which, under suitable assumptions, takes a model of Moggi’s computational λ-calculus with sum types, effect operations and primitives, and yields a model that is adequate and fully abstract. The construction, which uses the theory of fibrations, categorical glueing, ⊤⊤-lifting, and ⊤⊤-closure, takes inspiration from O’Hearn & Riecke’s fully abstract model for PCF. Our construction can be applied in the category of sets and functions, as well as the category of diffeological spaces and smooth maps and the category of quasi-Borel spaces, which have been studied as semantics for differentiable and probabilistic programming.

Skip Supplemental Material Section

Supplemental Material

Auxiliary Presentation Video

This is a 5-minute introduction to our paper, setting out the context, some applications, and a broad idea of how the main construction works. We present a construction which, under suitable assumptions, takes a model of Moggi’s computational λ-calculus with sum types, effect operations and primitives, and yields a model that is adequate and fully abstract. The construction, which uses the theory of fibrations, categorical glueing, ⊤⊤-lifting, and ⊤⊤-closure, takes inspiration from O’Hearn & Riecke’s fully abstract model for PCF. Our construction can be applied in the category of sets and functions, as well as the category of diffeological spaces and smooth maps and the category of quasi-Borel spaces, which have been studied as semantics for differentiable and probabilistic programming.

References

  1. S. Abramsky, K. Honda, and G. McCusker. 1998. A fully abstract game semantics for general references. In Proceedings of the Thirteenth Annual IEEE Symposium on Logic in Computer Science (Cat. No.98CB36226). IEEE Comput. Soc. https://doi.org/10.1109/lics.1998.705669 Google ScholarGoogle ScholarCross RefCross Ref
  2. S. Abramsky and R. Jagadeesan. 1994. Games and full completeness for multiplicative linear logic. Journal of Symbolic Logic, 59, 2 (1994), June, 543–574. https://doi.org/10.2307/2275407 Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. S. Abramsky, R. Jagadeesan, and P. Malacaria. 2000. Full Abstraction for PCF. Information and Computation, 163, 2 (2000), Dec., 409–470. https://doi.org/10.1006/inco.2000.2930 Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. J. Adamek, H. Herrlich, and G.E. Strecker. 2009. Abstract and Concrete Categories: The Joy of Cats. Dover Publications. isbn:9780486469348 lccn:2009010561 https://books.google.co.jp/books?id=rqT4PgAACAAJGoogle ScholarGoogle Scholar
  5. M. Alimohamed. 1995. A Characterization of Lambda Definability in Categorical Models of Implicit Polymorphism. Theor. Comput. Sci., 146, 1-2 (1995), July, 5–23. issn:0304-3975 https://doi.org/10.1016/0304-3975(94)00283-O Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. F. Borceux. 1994. Handbook of Categorical Algebra, volume 1. Cambridge University Press. https://doi.org/10.1017/cbo9780511525858 Google ScholarGoogle ScholarCross RefCross Ref
  7. R. Cartwright, P.L. Curien, and M. Felleisen. 1994. Fully Abstract Semantics for Observably Sequential Languages. 111, 2 (1994), jun, 297–401. https://doi.org/10.1006/inco.1994.1047 Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. P. Clairambault and M. de Visme. 2020. Full abstraction for the quantum lambda-calculus. Proceedings of the ACM on Programming Languages, 4, POPL (2020), jan, 1–28. https://doi.org/10.1145/3371131 Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. P.-L. Curien. 2007. Definability and Full Abstraction. Electronic Notes in Theoretical Computer Science, 172 (2007), April, 301–310. https://doi.org/10.1016/j.entcs.2007.02.011 Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. U. de’ Liguoro. 1996. PCF Definability via Kripke Logical Relations (after O’Hearn and Riecke). Laboratoire d’Informatique de l’Ecole Normale Supérieure.Google ScholarGoogle Scholar
  11. T. Ehrhard, C. Tasson, and M. Pagani. 2014. Probabilistic coherence spaces are fully abstract for probabilistic PCF. In Proceedings of the 41st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. ACM. https://doi.org/10.1145/2535838.2535865 Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. M. Fiore, A. Jung, E. Moggi, P. O’Hearn, Riecke J., G. Rosolini, and I. Stark. 1996. Domains and denotational semantics: History, accomplishments and open problems. Bulletin of EATCS, 59 (1996), 227–256. Edited by A. Jung.Google ScholarGoogle Scholar
  13. M. Fiore, G. Plotkin, and D. Turi. 1999. Abstract Syntax and Variable Binding. In Proceedings of the 14th Annual IEEE Symposium on Logic in Computer Science (LICS ’99). IEEE Computer Society, Washington, DC, USA. 193–. isbn:0-7695-0158-3 http://dl.acm.org/citation.cfm?id=788021.788948Google ScholarGoogle Scholar
  14. M. Fiore and A. Simpson. 1999. Lambda Definability with Sums via Grothendieck Logical Relations. In Typed Lambda Calculi and Applications, J.-Y. Girard (Ed.). Springer Berlin Heidelberg, Berlin, Heidelberg. 147–161. isbn:978-3-540-48959-7Google ScholarGoogle Scholar
  15. P. Freyd. 1972. Aspects of topoi. Bulletin of the Australian Mathematical Society, 7, 1 (1972), aug, 1–76. https://doi.org/10.1017/s0004972700044828 Google ScholarGoogle ScholarCross RefCross Ref
  16. J. Y. Girard. 1989. Proofs and types. Cambridge University Press, Cambridge. isbn:9780521371810Google ScholarGoogle Scholar
  17. M. Giry. 1982. A categorical approach to probability theory. In Lecture Notes in Mathematics. Springer Berlin Heidelberg, 68–85. https://doi.org/10.1007/bfb0092872 Google ScholarGoogle ScholarCross RefCross Ref
  18. J. Goubault-Larrecq, S. Lasota, and D. Nowak. 2008. Logical relations for monadic types. Mathematical Structures in Computer Science, 18, 06 (2008), Oct., 1169. https://doi.org/10.1017/s0960129508007172 Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. J. Goubault-Larrecq, S. Lasota, D. Nowak, and Y. Zhang. 2004. Complete Lax Logical Relations for Cryptographic Lambda-Calculi. In Computer Science Logic. Springer Berlin Heidelberg, 400–414. https://doi.org/10.1007/978-3-540-30124-0_31 Google ScholarGoogle ScholarCross RefCross Ref
  20. C. A. Hermida. 1993. Fibrations, Logical Predicates and Indeterminates. Ph.D. Dissertation. University of Edinburgh.Google ScholarGoogle Scholar
  21. C. Heunen, O. Kammar, S. Staton, and H. Yang. 2017. A Convenient Category for Higher-Order Probability Theory. In Proceedings of the 32nd Annual ACM/IEEE Symposium on Logic in Computer Science (LICS ’17). IEEE Press, Article 77, 12 pages. isbn:9781509030187Google ScholarGoogle Scholar
  22. M. Huot, S. Staton, and M. Vákár. 2020. Correctness of Automatic Differentiation via Diffeologies and Categorical Gluing. In Lecture Notes in Computer Science. Springer International Publishing, 319–338. https://doi.org/10.1007/978-3-030-45231-5_17 Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. J.M.E. Hyland and C.-H.L. Ong. 2000. On Full Abstraction for PCF: I, II, and III. Information and Computation, 163, 2 (2000), Dec., 285–408. https://doi.org/10.1006/inco.2000.2917 Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. P. Iglesias-Zemmour. 2013. Diffeology. American Mathematical Society, Providence, Rhode Island. isbn:9780821891315Google ScholarGoogle Scholar
  25. B. Jacobs. 1993. Comprehension categories and the semantics of type dependency. Theoretical Computer Science, 107, 2 (1993), Jan., 169–207. https://doi.org/10.1016/0304-3975(93)90169-t Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. B. Jacobs. 1999. Categorical Logic and Type Theory (Studies in Logic and the Foundations of Mathematics). North Holland, Amsterdam.Google ScholarGoogle Scholar
  27. P. T. Johnstone. 2002. Sketches of an elephant : a topos theory compendium. Oxford University Press, Oxford New York. isbn:9780198534259Google ScholarGoogle Scholar
  28. A. Jung and J. Tiuryn. 1993. A new characterization of lambda definability. In Typed Lambda Calculi and Applications, Marc Bezem and Jan Friso Groote (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg. 245–257. isbn:978-3-540-47586-6Google ScholarGoogle Scholar
  29. O. Kammar. 2014. An Algebraic Theory of Type-and-Effect Systems. Ph.D. Dissertation. University of Edinburgh.Google ScholarGoogle Scholar
  30. O. Kammar and D. McDermott. 2018. Factorisation Systems for Logical Relations and Monadic Lifting in Type-and-effect System Semantics. Electronic Notes in Theoretical Computer Science, 341 (2018), 239 – 260. issn:1571-0661 https://doi.org/10.1016/j.entcs.2018.11.012 Proceedings of the Thirty-Fourth Conference on the Mathematical Foundations of Programming Semantics (MFPS XXXIV). Google ScholarGoogle ScholarCross RefCross Ref
  31. O. Kammar and G. D. Plotkin. 2012. Algebraic foundations for effect-dependent optimisations. In Proceedings of the 39th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages - POPL ' 12. ACM Press. https://doi.org/10.1145/2103656.2103698 Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. S. Katsumata. 2005. A Semantic Formulation of ⊤ ⊤ -Lifting and Logical Predicates for Computational Metalanguage. In Computer Science Logic. Springer Berlin Heidelberg, 87–102. https://doi.org/10.1007/11538363_8 Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. S. Katsumata. 2008. A Characterisation of Lambda Definability with Sums Via ⊤ ⊤ -Closure Operators. In Computer Science Logic, Michael Kaminski and Simone Martini (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg. 278–292. isbn:978-3-540-87531-4Google ScholarGoogle Scholar
  34. S. Katsumata. 2013. Relating computational effects by ⊤ ⊤ -lifting. Information and Computation, 222 (2013), 228 – 246. issn:0890-5401 https://doi.org/10.1016/j.ic.2012.10.014 38th International Colloquium on Automata, Languages and Programming (ICALP 2011). Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. A. Kock. 1972. Strong functors and monoidal monads. Archiv der Mathematik, 23, 1 (1972), dec, 113–120. https://doi.org/10.1007/bf01304852 Google ScholarGoogle ScholarCross RefCross Ref
  36. S. Lasota, D. Nowak, and Y. Zhang. 2007. On Completeness of Logical Relations for Monadic Types. In Advances in Computer Science - ASIAN 2006. Secure Software and Related Issues. Springer Berlin Heidelberg, 223–230. https://doi.org/10.1007/978-3-540-77505-8_17 Google ScholarGoogle ScholarCross RefCross Ref
  37. F. W. Lawvere. 2006. Diagonal Arguments and Cartesian Closed Categories. Reprints in Theory and Applications of Categories, 1–13. http://www.tac.mta.ca/tac/reprints/articles/15/tr15.pdfGoogle ScholarGoogle Scholar
  38. F. Loregian and E. Riehl. 2020. Categorical notions of fibration. Expositiones Mathematicae, 38, 4 (2020), Dec., 496–514. https://doi.org/10.1016/j.exmath.2019.02.004 Google ScholarGoogle ScholarCross RefCross Ref
  39. Q. M. Ma and John C. Reynolds. 1992. Types, abstraction, and parametric polymorphism, part 2. In Lecture Notes in Computer Science. Springer Berlin Heidelberg, 1–40. https://doi.org/10.1007/3-540-55511-0_1 Google ScholarGoogle ScholarCross RefCross Ref
  40. M. Marz. 2000. A fully abstract model for sequential computation. Electronic Notes in Theoretical Computer Science, 35 (2000), 133–152. https://doi.org/10.1016/s1571-0661(05)80735-2 Google ScholarGoogle ScholarCross RefCross Ref
  41. C. Matache, S. Moss, and S. Staton. 2021. Recursion and Sequentiality in Categories of Sheaves. To appear in Proceedings of 6th International Conference on Formal Structures for Computation and Deduction (FSCD 2021), https://doi.org/10.4230/LIPIcs.FSCD.2021.25 Google ScholarGoogle ScholarCross RefCross Ref
  42. R. Milner. 1977. Fully abstract models of typed λ -calculi. Theoretical Computer Science, 4, 1 (1977), Feb., 1–22. https://doi.org/10.1016/0304-3975(77)90053-6 Google ScholarGoogle ScholarCross RefCross Ref
  43. J. C. Mitchell and A. Scedrov. 1993. Notes on sconing and relators. In Computer Science Logic. Springer Berlin Heidelberg, 352–378. https://doi.org/10.1007/3-540-56992-8_21 Google ScholarGoogle ScholarCross RefCross Ref
  44. E. Moggi. 1989. Computational Lambda-Calculus and Monads. In Proceedings of the Fourth Annual Symposium on Logic in Computer Science. IEEE Press, 14–23. isbn:0818619546Google ScholarGoogle ScholarCross RefCross Ref
  45. E. Moggi. 1991. Notions of computation and monads. Inf. Comput., 93, 1 (1991), 55–92.Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. A. S. Murawski and N. Tzevelekos. 2012. Algorithmic Games for Full Ground References. In Automata, Languages, and Programming. Springer Berlin Heidelberg, 312–324. https://doi.org/10.1007/978-3-642-31585-5_30 Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. P. W. O’Hearn and J. G. Riecke. 1995. Kripke Logical Relations and PCF. Information and Computation, 120, 1 (1995), 107 – 116. issn:0890-5401 https://doi.org/10.1006/inco.1995.1103 Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. B. Pareigis. 1977. Non-additive ring and module theory II: C-categories, C-functors and C-morphisms. Publicationes mathematicae, 24, 3 (1977), January.Google ScholarGoogle Scholar
  49. G. D. Plotkin. 1973. Lambda-definability and logical relations. University of Edinburgh.Google ScholarGoogle Scholar
  50. G. D. Plotkin. 1977. LCF considered as a programming language. Theoretical Computer Science, 5, 3 (1977), Dec., 223–255. https://doi.org/10.1016/0304-3975(77)90044-5 Google ScholarGoogle ScholarCross RefCross Ref
  51. G. D. Plotkin. 1980. Lambda-Definability in the Full Type Hierarchy. In To H. B. Curry: Essays on Combinatory Logic, Lambda Calculus and Formalism, Jonathan P. Seldin and J. Roger Hindley (Eds.). Academic Press.Google ScholarGoogle Scholar
  52. G. D. Plotkin and J. Power. 2003. Algebraic Operations and Generic Effects. Applied Categorical Structures, 11, 1 (2003), 69–94. https://doi.org/10.1023/a:1023064908962 Google ScholarGoogle ScholarCross RefCross Ref
  53. J. Power and E. Robinson. 2000. Logical Relations and Data Abstraction. In Computer Science Logic. Springer Berlin Heidelberg, 497–511. https://doi.org/10.1007/3-540-44622-2_34 Google ScholarGoogle ScholarCross RefCross Ref
  54. J. G. Riecke and A. Sandholm. 2002. A Relational Account of Call-by-Value Sequentiality. Information and Computation, 179, 2 (2002), Dec., 296–331. https://doi.org/10.1006/inco.2002.2957 Google ScholarGoogle ScholarDigital LibraryDigital Library
  55. G. Scherer. 2017. Deciding Equivalence with Sums and the Empty Type. In Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages (POPL 2017). Association for Computing Machinery, New York, NY, USA. 374–386. isbn:9781450346603 https://doi.org/10.1145/3009837.3009901 Google ScholarGoogle ScholarDigital LibraryDigital Library
  56. A. Ścibior, O. Kammar, V. Vákár, S. Staton, H. Yang, Y. Cai, K. Ostermann, S. K. Moss, C. Heunen, and Z. Ghahramani. 2018. Denotational validation of higher-order Bayesian inference. Proceedings of the ACM on Programming Languages, 2, POPL (2018), Jan., 1–29. https://doi.org/10.1145/3158148 Google ScholarGoogle ScholarDigital LibraryDigital Library
  57. J. M. Souriau. 1980. Groupes differentiels. In Differential Geometrical Methods in Mathematical Physics, P. L. García, A. Pérez-Rendón, and J. M. Souriau (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg. 91–128. isbn:978-3-540-38405-2Google ScholarGoogle Scholar
  58. S. Staton. 2017. Commutative Semantics for Probabilistic Programming. In Programming Languages and Systems. Springer Berlin Heidelberg, 855–879. https://doi.org/10.1007/978-3-662-54434-1_32 Google ScholarGoogle ScholarDigital LibraryDigital Library
  59. S. Staton, H. Yang, F. Wood, C. Heunen, and O. Kammar. 2016. Semantics for probabilistic programming. In Proceedings of the 31st Annual ACM/IEEE Symposium on Logic in Computer Science. ACM. https://doi.org/10.1145/2933575.2935313 Google ScholarGoogle ScholarDigital LibraryDigital Library
  60. R. Street. 1972. The formal theory of monads. Journal of Pure and Applied Algebra, 2, 2 (1972), 149 –168. issn:0022-4049 https://doi.org/10.1016/0022-4049(72)90019-9 Google ScholarGoogle ScholarCross RefCross Ref

Index Terms

  1. Fully abstract models for effectful λ-calculi via category-theoretic logical relations

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      • Article Metrics

        • Downloads (Last 12 months)174
        • Downloads (Last 6 weeks)27

        Other Metrics

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!