{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,7,17]],"date-time":"2026-07-17T02:29:16Z","timestamp":1784255356898,"version":"3.55.0"},"reference-count":32,"publisher":"Association for Computing Machinery (ACM)","issue":"ICFP","license":[{"start":{"date-parts":[[2020,8,2]],"date-time":"2020-08-02T00:00:00Z","timestamp":1596326400000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/"}],"content-domain":{"domain":["dl.acm.org"],"crossmark-restriction":true},"short-container-title":["Proc. ACM Program. Lang."],"published-print":{"date-parts":[[2020,8,2]]},"abstract":"<jats:p>Functional programming languages are particularly well-suited for building automated reasoning systems, since (among other reasons) a logical term is well modeled by an inductive type, traversing a term can be implemented generically as a higher-order combinator, and backtracking search is dramatically simplified by persistent datastructures. However, existing pure functional programming languages all suffer a major limitation in these domains: traversing a term requires time proportional to the tree size of the term as opposed to its graph size. This limitation would be particularly devastating when building automation for interactive theorem provers such as Lean and Coq, for which the exponential blowup of term-tree sizes has proved to be both common and difficult to prevent. All that is needed to recover the optimal scaling is the ability to perform simple operations on the memory addresses of terms, and yet allowing these operations to be used freely would clearly violate the basic premise of referential transparency. We show how to use dependent types to seal the necessary pointer-address manipulations behind pure functional interfaces while requiring only a negligible amount of additional trust. We have implemented our approach for the upcoming version (v4) of Lean, and our approach could be adopted by other languages based on dependent type theory as well.<\/jats:p>","DOI":"10.1145\/3408997","type":"journal-article","created":{"date-parts":[[2020,8,3]],"date-time":"2020-08-03T13:48:02Z","timestamp":1596462482000},"page":"1-20","update-policy":"https:\/\/doi.org\/10.1145\/crossmark-policy","source":"Crossref","is-referenced-by-count":3,"title":["Sealing pointer-based optimizations behind pure functions"],"prefix":"10.1145","volume":"4","author":[{"given":"Daniel","family":"Selsam","sequence":"first","affiliation":[{"name":"Microsoft Research, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Simon","family":"Hudon","sequence":"additional","affiliation":[{"name":"Carnegie Mellon University, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Leonardo","family":"de Moura","sequence":"additional","affiliation":[{"name":"Microsoft Research, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"320","published-online":{"date-parts":[[2020,8,3]]},"reference":[{"key":"e_1_2_2_1_1","doi-asserted-by":"crossref","unstructured":"Thorsten Altenkirch and Ambrus Kaposi. 2016. Type theory in type theory using quotient inductive types. ACM SIGPLAN Notices 51 1 ( 2016 ) 18-29.  Thorsten Altenkirch and Ambrus Kaposi. 2016. Type theory in type theory using quotient inductive types. ACM SIGPLAN Notices 51 1 ( 2016 ) 18-29.","DOI":"10.1145\/2914770.2837638"},{"key":"e_1_2_2_3_1","volume-title":"Structured Formal Development with Quotient Types in Isabelle\/HOL","author":"Bortin Maksym","unstructured":"Maksym Bortin and Christoph L\u00fcth . 2010. Structured Formal Development with Quotient Types in Isabelle\/HOL . In Intelligent Computer Mathematics, Serge Autexier, Jacques Calmet, David Delahaye, Patrick D. F. Ion, Laurence Rideau, Renaud Rioboo, and Alan P. Sexton (Eds.). Springer Berlin Heidelberg , Berlin, Heidelberg , 34-48. Maksym Bortin and Christoph L\u00fcth. 2010. Structured Formal Development with Quotient Types in Isabelle\/HOL. In Intelligent Computer Mathematics, Serge Autexier, Jacques Calmet, David Delahaye, Patrick D. F. Ion, Laurence Rideau, Renaud Rioboo, and Alan P. Sexton (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg, 34-48."},{"key":"e_1_2_2_4_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-642-03359-9_6"},{"key":"e_1_2_2_5_1","doi-asserted-by":"publisher","DOI":"10.1145\/1217975.1217992"},{"key":"e_1_2_2_6_1","doi-asserted-by":"publisher","DOI":"10.1017\/S095679681300018X"},{"key":"e_1_2_2_7_1","doi-asserted-by":"publisher","DOI":"10.1007\/s10817-014-9306-0"},{"key":"e_1_2_2_8_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-642-39634-2_17"},{"key":"e_1_2_2_9_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-319-21401-6_26"},{"key":"e_1_2_2_10_1","volume-title":"The annotated C++ reference manual","author":"Ellis Margaret A","unstructured":"Margaret A Ellis and Bjarne Stroustrup . 1990. The annotated C++ reference manual . Addison-Wesley . Margaret A Ellis and Bjarne Stroustrup. 1990. The annotated C++ reference manual. Addison-Wesley."},{"key":"e_1_2_2_11_1","unstructured":"Phil Freeman. 2015. PureScript.  Phil Freeman. 2015. PureScript."},{"key":"e_1_2_2_13_1","unstructured":"Jean Goubault. 1994. Implementing functional languages with fast equality sets and maps: an exercise in hash consing. Journ\u00e9es Francophones des Langages Applicatifs (JFLA'93) ( 1994 ) 222-238.  Jean Goubault. 1994. Implementing functional languages with fast equality sets and maps: an exercise in hash consing. Journ\u00e9es Francophones des Langages Applicatifs (JFLA'93) ( 1994 ) 222-238."},{"key":"e_1_2_2_14_1","doi-asserted-by":"publisher","DOI":"10.1145\/1408681.1408682"},{"key":"e_1_2_2_15_1","unstructured":"Martin Hofmann. 1995. Extensional concepts in intensional type theory. ( 1995 ).  Martin Hofmann. 1995. Extensional concepts in intensional type theory. ( 1995 )."},{"key":"e_1_2_2_16_1","doi-asserted-by":"publisher","DOI":"10.1007\/3-540-56287-7_108"},{"key":"e_1_2_2_17_1","volume-title":"Haskell 98 language and libraries: the revised report","author":"Jones Simon Peyton","unstructured":"Simon Peyton Jones . 2003. Haskell 98 language and libraries: the revised report . Cambridge University Press . Simon Peyton Jones. 2003. Haskell 98 language and libraries: the revised report. Cambridge University Press."},{"key":"e_1_2_2_18_1","volume-title":"Symposium on Implementation and Application of Functional Languages. Springer, 37-58","author":"Jones Simon Peyton","year":"1999","unstructured":"Simon Peyton Jones , Simon Marlow , and Conal Elliott . 1999 . Stretching the storage manager: weak pointers and stable names in Haskell . In Symposium on Implementation and Application of Functional Languages. Springer, 37-58 . Simon Peyton Jones, Simon Marlow, and Conal Elliott. 1999. Stretching the storage manager: weak pointers and stable names in Haskell. In Symposium on Implementation and Application of Functional Languages. Springer, 37-58."},{"key":"e_1_2_2_19_1","doi-asserted-by":"publisher","DOI":"10.1109\/32.588534"},{"key":"e_1_2_2_20_1","unstructured":"Xavier Leroy Damien Doligez Alain Frisch Jacques Garrigue Didier R\u00e9my and J\u00e9r\u00f4me Vouillon. 2018. The OCaml system release 4.07: Documentation and user's manual. ( 2018 ).  Xavier Leroy Damien Doligez Alain Frisch Jacques Garrigue Didier R\u00e9my and J\u00e9r\u00f4me Vouillon. 2018. The OCaml system release 4.07: Documentation and user's manual. ( 2018 )."},{"key":"e_1_2_2_21_1","doi-asserted-by":"publisher","DOI":"10.1145\/3372885.3373824"},{"key":"e_1_2_2_22_1","doi-asserted-by":"crossref","unstructured":"David CJ Matthews. 1985. Poly manual. ACM SIGPLAN Notices 20 9 ( 1985 ) 52-76.  David CJ Matthews. 1985. Poly manual. ACM SIGPLAN Notices 20 9 ( 1985 ) 52-76.","DOI":"10.1145\/988364.988371"},{"key":"e_1_2_2_24_1","volume-title":"a proof assistant for higher-order logic","author":"Nipkow Tobias","unstructured":"Tobias Nipkow , Lawrence C Paulson , and Markus Wenzel . 2002. Isabelle\/HOL : a proof assistant for higher-order logic . Vol. 2283 . Springer Science & Business Media . Tobias Nipkow, Lawrence C Paulson, and Markus Wenzel. 2002. Isabelle\/HOL: a proof assistant for higher-order logic. Vol. 2283. Springer Science & Business Media."},{"key":"e_1_2_2_25_1","doi-asserted-by":"publisher","DOI":"10.1007\/3-540-45685-6_18"},{"key":"e_1_2_2_27_1","doi-asserted-by":"publisher","DOI":"10.1007\/3-540-55602-8_217"},{"key":"e_1_2_2_28_1","volume-title":"John Glauert (Ed.) : Proceedings of the 6th International Workshop on the Implementation of Functional Languages","author":"Scholz Sven-Bodo","unstructured":"Sven-Bodo Scholz . 1994. Single Assignment C-Functional Programming Using Imperative Style . In In John Glauert (Ed.) : Proceedings of the 6th International Workshop on the Implementation of Functional Languages . University of East Anglia . Sven-Bodo Scholz. 1994. Single Assignment C-Functional Programming Using Imperative Style. In In John Glauert (Ed.) : Proceedings of the 6th International Workshop on the Implementation of Functional Languages. University of East Anglia."},{"key":"e_1_2_2_29_1","volume-title":"Tabled Typeclass Resolution. arXiv preprint arXiv","author":"Selsam Daniel","year":"2001","unstructured":"Daniel Selsam , Sebastian Ullrich , and Leonardo de Moura . 2020. Tabled Typeclass Resolution. arXiv preprint arXiv : 2001 . 04301 ( 2020 ). Daniel Selsam, Sebastian Ullrich, and Leonardo de Moura. 2020. Tabled Typeclass Resolution. arXiv preprint arXiv: 2001. 04301 ( 2020 )."},{"key":"e_1_2_2_30_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-540-71067-7_23"},{"key":"e_1_2_2_31_1","volume-title":"Common LISP: the language","author":"Steele Guy","unstructured":"Guy Steele . 1990. Common LISP: the language . Elsevier . Guy Steele. 1990. Common LISP: the language. Elsevier."},{"key":"e_1_2_2_32_1","doi-asserted-by":"crossref","unstructured":"David Turner. 1986. An overview of Miranda. ACM Sigplan Notices 21 12 ( 1986 ) 158-166.  David Turner. 1986. An overview of Miranda. ACM Sigplan Notices 21 12 ( 1986 ) 158-166.","DOI":"10.1145\/15042.15053"},{"key":"e_1_2_2_33_1","volume-title":"Counting Immutable Beans: Reference Counting Optimized for Purely Functional Programming. arXiv preprint arXiv","author":"Ullrich Sebastian","year":"1908","unstructured":"Sebastian Ullrich and Leonardo de Moura . 2019. Counting Immutable Beans: Reference Counting Optimized for Purely Functional Programming. arXiv preprint arXiv : 1908 . 05647 ( 2019 ). Sebastian Ullrich and Leonardo de Moura. 2019. Counting Immutable Beans: Reference Counting Optimized for Purely Functional Programming. arXiv preprint arXiv: 1908. 05647 ( 2019 )."},{"key":"e_1_2_2_34_1","volume-title":"Homotopy Type Theory: Univalent Foundations of Mathematics. https: \/\/homotopytypetheory.org\/book","author":"Foundations Program The Univalent","unstructured":"The Univalent Foundations Program . 2013. Homotopy Type Theory: Univalent Foundations of Mathematics. https: \/\/homotopytypetheory.org\/book , Institute for Advanced Study . The Univalent Foundations Program. 2013. Homotopy Type Theory: Univalent Foundations of Mathematics. https: \/\/homotopytypetheory.org\/book, Institute for Advanced Study."},{"key":"e_1_2_2_35_1","doi-asserted-by":"publisher","DOI":"10.1145\/91556.91592"},{"key":"e_1_2_2_36_1","doi-asserted-by":"publisher","DOI":"10.1145\/75277.75283"}],"container-title":["Proceedings of the ACM on Programming Languages"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3408997","content-type":"unspecified","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3408997","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,6,17]],"date-time":"2025-06-17T20:47:59Z","timestamp":1750193279000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3408997"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2020,8,2]]},"references-count":32,"journal-issue":{"issue":"ICFP","published-print":{"date-parts":[[2020,8,2]]}},"alternative-id":["10.1145\/3408997"],"URL":"https:\/\/doi.org\/10.1145\/3408997","relation":{},"ISSN":["2475-1421"],"issn-type":[{"value":"2475-1421","type":"electronic"}],"subject":[],"published":{"date-parts":[[2020,8,2]]},"assertion":[{"value":"2020-08-03","order":2,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}]}}