skip to main content
research-article
Open Access

Computation focusing

Published:03 August 2020Publication History
Skip Abstract Section

Abstract

Focusing is a technique from proof theory that exploits type information to prune inessential nondeterminism from proof search procedures. Viewed through the lens of the Curry-Howard correspondence, a focused typing derivation yields terms in normal form. This paper explores how to exploit focusing for reasoning about contextual equivalences and full abstraction. We present a focused polymorphic call-by-push-value calculus and prove a computational completeness result: for every well-typed term, there exists a focused term that is βη-equivalent to it. This completeness result yields a powerful way to refine the context lemmas for establishing contextual equivalences, cutting down the set that must be considered to just focused contexts. The paper demonstrates the application of focusing to establish program equivalences, including free theorems. It also uses focusing to prove full abstraction of a translation of the pure, total call-by-push-value language into a language with divergence and simple effect types, yielding a novel solution to a simple-to-state, but hitherto difficult to solve problem.

Skip Supplemental Material Section

Supplemental Material

Presentation at ICFP '20

References

  1. Andreas Abel. 2008. Weak-Normalization and Normalization by Evaluation for System F. In 15th International Conference on Logic for Programming, Artificial Intelligence, and Reasoning, LPAR 2008, 22-27 November 2008, Doha, Qatar, Proceedings (Lecture Notes in Artificial Intelligence), Illiano Cervesato, Helmut Veith, and Andrei Voronkov (Eds.), Vol. 5330. SpringerVerlag, 497-511.Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Andreas Abel and Christian Sattler. 2019. Normalization by Evaluation for Call-By-Push-Value and Polarized Lambda Calculus. In Proceedings of the 21st International Symposium on Principles and Practice of Programming Languages 2019 (PPDP '19). Association for Computing Machinery, New York, NY, USA, Article 3, 12 pages.Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Samson Abramsky. 1990. The Lazy-Calculus. In Research topics in functional programming. Addison Wesley, 65-116.Google ScholarGoogle Scholar
  4. Samson Abramsky and C-H Luke Ong. 1993. Full abstraction in the lazy lambda calculus. Information and Computation 105, 2 ( 1993 ), 159-267.Google ScholarGoogle Scholar
  5. Amal Ahmed and Matthias Blume. 2008. Typed Closure Conversion Preserves Observational Equivalence. SIGPLAN Not. 43, 9 ( 2008 ), 157-168.Google ScholarGoogle Scholar
  6. Amal Ahmed and Matthias Blume. 2011. An Equivalence-preserving CPS Translation via Multi-language Semantics. SIGPLAN Not. 46, 9 ( 2011 ), 431-444.Google ScholarGoogle Scholar
  7. Jean-Marc Andreoli. 1992. Logic programming with focusing proofs in linear logic. Journal of logic and computation 2, 3 ( 1992 ), 297-347.Google ScholarGoogle ScholarCross RefCross Ref
  8. Taus Brock-Nannestad and Carsten Schürmann. 2010. Focused Natural Deduction. In Proceedings of the 17th International Conference on Logic for Programming, Artificial Intelligence, and Reasoning (LPAR'10). Springer-Verlag, Berlin, Heidelberg, 157-171.Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Kaustuv Chaudhuri, Frank Pfenning, and Greg Price. 2018. A logical characterization of forward and backward chaining in the inverse method. Journal of Automated Reasoning 40, 2-3 ( 2018 ), 133-177.Google ScholarGoogle Scholar
  10. J. W. Debakker and Dana S. Scott. 1969. A theory of programs. ( 1969 ).Google ScholarGoogle Scholar
  11. Harley D Eades III and Aaron Stump. 2010. Hereditary Substitution for Stratified System F. International Workshop on Proof-Search in Type Theories 10 ( 2010 ).Google ScholarGoogle Scholar
  12. Jonathan Frankle, Peter-Michael Osera, David Walker, and Steve Zdancewic. 2016. Example-Directed Synthesis: A TypeTheoretic Interpretation. SIGPLAN Not. 51, 1 (Jan. 2016 ), 802-815.Google ScholarGoogle Scholar
  13. Neelakantan R. Krishnaswami. 2009. Focusing on Pattern Matching. In Proceedings of the 36th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL '09). Association for Computing Machinery, New York, NY, USA, 366-378.Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Søren B Lassen. 1999. Bisimulation in Untyped Lambda Calculus: Böhm Trees and Bisimulation up to Context. Electronic Notes in Theoretical Computer Science 20 ( 1999 ), 346-374.Google ScholarGoogle Scholar
  15. Søren B. Lassen. 2005. Eager Normal Form Bisimulation. In 20th Annual IEEE Symposium on Logic in Computer Science (LICS' 05). 345-354.Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Daniel Leivant. 1991. Finitely Stratified Polymorphism. Inf. Comput. 93, 1 ( July 1991 ), 93-113.Google ScholarGoogle Scholar
  17. Paul Blain Levy. 1999. Call-by-Push-Value : A Subsuming Paradigm. In Typed Lambda Calculi and Applications, 4th International Conference, TLCA'99, L 'Aquila, Italy, April 7-9, 1999, Proceedings (Lecture Notes in Computer Science), Jean-Yves Girard (Ed.), Vol. 1581. Springer, 228-242.Google ScholarGoogle Scholar
  18. Ian Mason and Carolyn Talcott. 1991. Equivalence in functional languages with efects. Journal of functional programming 1, 3 ( 1991 ), 287-327.Google ScholarGoogle ScholarCross RefCross Ref
  19. Jacob Matthews and Robert Bruce Findler. 2007. Operational Semantics for Multi-language Programs. SIGPLAN Not. 42, 1 ( 2007 ), 3-10.Google ScholarGoogle Scholar
  20. Robin Milner. 1977. Fully abstract models of typed-calculi. Theoretical Computer Science 4, 1 ( 1977 ), 1-22.Google ScholarGoogle Scholar
  21. J. H. Morris. 1968. Lambda Calculus Models of Programming Languages. Ph.D. Dissertation. Massachusets Institute of Technology.Google ScholarGoogle Scholar
  22. Max S. New, William J. Bowman, and Amal Ahmed. 2016. Fully Abstract Compilation via Universal Embedding. SIGPLAN Not. 51, 9 (Sept. 2016 ), 103-116.Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Peter-Michael Osera and Steve Zdancewic. 2015. Type-and-Example-Directed Program Synthesis. SIGPLAN Not. 50, 6 ( June 2015 ), 619-630.Google ScholarGoogle Scholar
  24. Marco Patrignani, Amal Ahmed, and Dave Clarke. 2019. Formal Approaches to Secure Compilation: A Survey of Fully Abstract Compilation and Related Work. ACM Comput. Surv. 51, 6, Article 125 ( 2019 ), 36 pages.Google ScholarGoogle Scholar
  25. Frank Pfenning. 1995. Structural Cut Elimination. In Proceedings of the 10th Annual IEEE Symposium on Logic in Computer Science (LICS '95). IEEE Computer Society, USA, 156.Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Andrew Pitts. 2004. Typed Operational Reasoning. In Advanced Topics in Types and Programming Languages, Benjamin C. Pierce (Ed.). The MIT Press, Chapter 7.Google ScholarGoogle Scholar
  27. Gordon D Plotkin. 1980. Lambda-definability in the full type hierarchy. To HB Curry: essays on combinatory logic, lambda calculus and formalism ( 1980 ), 363-373.Google ScholarGoogle Scholar
  28. Nadia Polikarpova and Ilya Sergey. 2019. Structuring the Synthesis of Heap-Manipulating Programs. Proc. ACM Program. Lang. 3, POPL, Article 72 ( Jan. 2019 ), 30 pages.Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Nick Rioux and Steve Zdancewic. 2020. Computation Focusing (Technical Report). Technical Report MS-CIS-20-04. Department of Computer and Information Science, University of Pennsylvania.Google ScholarGoogle Scholar
  30. Davide Sangiorgi, Naoki Kobayashi, and Eijiro Sumii. 2007. Environmental bisimulations for higher-order languages. In Logic in Computer Science, 2007. LICS 2007. 22nd Annual IEEE Symposium on. IEEE, 293-302.Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. José Espírito Santo. 2016. The Polarized-calculus. Electr. Notes Theor. Comput. Sci. 332 ( 2016 ), 149-168.Google ScholarGoogle Scholar
  32. Gabriel Scherer. 2017. Deciding Equivalence with Sums and the Empty Type. SIGPLAN Not. 52, 1 ( 2017 ), 374-386.Google ScholarGoogle Scholar
  33. Gabriel Scherer and Didier Rémy. 2015. Which Simple Types Have a Unique Inhabitant?. In Proceedings of the 20th ACM SIGPLAN International Conference on Functional Programming (ICFP 2015 ). Association for Computing Machinery, New York, NY, USA, 243-255.Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Robert J Simmons. 2014. Structural focalization. ACM Transactions on Computational Logic (TOCL) 15, 3 ( 2014 ), 21.Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Richard Statman. 1985. Logical relations and the typed-calculus. Information and Control 65, 2-3 ( 1985 ), 85-97.Google ScholarGoogle ScholarCross RefCross Ref
  36. Eijiro Sumii and Benjamin C. Pierce. 2005. A Bisimulation for Type Abstraction and Recursion. SIGPLAN Not. 40, 1 ( 2005 ), 63-74.Google ScholarGoogle Scholar
  37. William W. Tait. 1967. Intensional interpretations of functionals of finite type I. Journal of Symbolic Logic 32, 2 ( 1967 ), 198-212.Google ScholarGoogle ScholarCross RefCross Ref
  38. Philip Wadler. 1989. Theorems for Free!. In Proceedings of the 4th International Symposium on Functional Programming and Computer Architecture.Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Noam Zeilberger. 2008a. Focusing and Higher-order Abstract Syntax. SIGPLAN Not. 43, 1 ( 2008 ), 359-369.Google ScholarGoogle Scholar
  40. Noam Zeilberger. 2008b. On the unity of duality. Annals of Pure and Applied Logic 153, 1 ( 2008 ), 66-96.Google ScholarGoogle ScholarCross RefCross Ref
  41. Jianzhou Zhao, Qi Zhang, and Steve Zdancewic. 2010. Relational Parametricity for Polymorphic Linear Lambda Calculus. In Proceedings of the Eighth ASIAN Symposium on Programming Languages and Systems (APLAS).Google ScholarGoogle ScholarCross RefCross Ref

Index Terms

  1. Computation focusing

        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

        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!