Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article
Open access

Computation focusing

Published: 03 August 2020 Publication History

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.

Supplementary Material

Presentation at ICFP '20 (a95-rioux-presentation.mp4)

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.
[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.
[3]
Samson Abramsky. 1990. The Lazy-Calculus. In Research topics in functional programming. Addison Wesley, 65-116.
[4]
Samson Abramsky and C-H Luke Ong. 1993. Full abstraction in the lazy lambda calculus. Information and Computation 105, 2 ( 1993 ), 159-267.
[5]
Amal Ahmed and Matthias Blume. 2008. Typed Closure Conversion Preserves Observational Equivalence. SIGPLAN Not. 43, 9 ( 2008 ), 157-168.
[6]
Amal Ahmed and Matthias Blume. 2011. An Equivalence-preserving CPS Translation via Multi-language Semantics. SIGPLAN Not. 46, 9 ( 2011 ), 431-444.
[7]
Jean-Marc Andreoli. 1992. Logic programming with focusing proofs in linear logic. Journal of logic and computation 2, 3 ( 1992 ), 297-347.
[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.
[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.
[10]
J. W. Debakker and Dana S. Scott. 1969. A theory of programs. ( 1969 ).
[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 ).
[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.
[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.
[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.
[15]
Søren B. Lassen. 2005. Eager Normal Form Bisimulation. In 20th Annual IEEE Symposium on Logic in Computer Science (LICS' 05). 345-354.
[16]
Daniel Leivant. 1991. Finitely Stratified Polymorphism. Inf. Comput. 93, 1 ( July 1991 ), 93-113.
[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.
[18]
Ian Mason and Carolyn Talcott. 1991. Equivalence in functional languages with efects. Journal of functional programming 1, 3 ( 1991 ), 287-327.
[19]
Jacob Matthews and Robert Bruce Findler. 2007. Operational Semantics for Multi-language Programs. SIGPLAN Not. 42, 1 ( 2007 ), 3-10.
[20]
Robin Milner. 1977. Fully abstract models of typed-calculi. Theoretical Computer Science 4, 1 ( 1977 ), 1-22.
[21]
J. H. Morris. 1968. Lambda Calculus Models of Programming Languages. Ph.D. Dissertation. Massachusets Institute of Technology.
[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.
[23]
Peter-Michael Osera and Steve Zdancewic. 2015. Type-and-Example-Directed Program Synthesis. SIGPLAN Not. 50, 6 ( June 2015 ), 619-630.
[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.
[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.
[26]
Andrew Pitts. 2004. Typed Operational Reasoning. In Advanced Topics in Types and Programming Languages, Benjamin C. Pierce (Ed.). The MIT Press, Chapter 7.
[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.
[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.
[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.
[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.
[31]
José Espírito Santo. 2016. The Polarized-calculus. Electr. Notes Theor. Comput. Sci. 332 ( 2016 ), 149-168.
[32]
Gabriel Scherer. 2017. Deciding Equivalence with Sums and the Empty Type. SIGPLAN Not. 52, 1 ( 2017 ), 374-386.
[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.
[34]
Robert J Simmons. 2014. Structural focalization. ACM Transactions on Computational Logic (TOCL) 15, 3 ( 2014 ), 21.
[35]
Richard Statman. 1985. Logical relations and the typed-calculus. Information and Control 65, 2-3 ( 1985 ), 85-97.
[36]
Eijiro Sumii and Benjamin C. Pierce. 2005. A Bisimulation for Type Abstraction and Recursion. SIGPLAN Not. 40, 1 ( 2005 ), 63-74.
[37]
William W. Tait. 1967. Intensional interpretations of functionals of finite type I. Journal of Symbolic Logic 32, 2 ( 1967 ), 198-212.
[38]
Philip Wadler. 1989. Theorems for Free!. In Proceedings of the 4th International Symposium on Functional Programming and Computer Architecture.
[39]
Noam Zeilberger. 2008a. Focusing and Higher-order Abstract Syntax. SIGPLAN Not. 43, 1 ( 2008 ), 359-369.
[40]
Noam Zeilberger. 2008b. On the unity of duality. Annals of Pure and Applied Logic 153, 1 ( 2008 ), 66-96.
[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).

Cited By

View all
  • (2024)Effects and Coeffects in Call-by-Push-ValueProceedings of the ACM on Programming Languages10.1145/36897508:OOPSLA2(1108-1134)Online publication date: 8-Oct-2024
  • (2023)Focusing on Refinement TypingACM Transactions on Programming Languages and Systems10.1145/361040845:4(1-62)Online publication date: 20-Dec-2023
  • (2022)Polarized SubtypingProgramming Languages and Systems10.1007/978-3-030-99336-8_16(431-461)Online publication date: 5-Apr-2022

Recommendations

Comments

Information & Contributors

Information

Published In

cover image Proceedings of the ACM on Programming Languages
Proceedings of the ACM on Programming Languages  Volume 4, Issue ICFP
August 2020
1070 pages
EISSN:2475-1421
DOI:10.1145/3415018
Issue’s Table of Contents
This work is licensed under a Creative Commons Attribution International 4.0 License.

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 03 August 2020
Published in PACMPL Volume 4, Issue ICFP

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. compiler verification
  2. focusing
  3. full abstraction
  4. program equivalence
  5. type systems

Qualifiers

  • Research-article

Funding Sources

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)145
  • Downloads (Last 6 weeks)22
Reflects downloads up to 21 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (2024)Effects and Coeffects in Call-by-Push-ValueProceedings of the ACM on Programming Languages10.1145/36897508:OOPSLA2(1108-1134)Online publication date: 8-Oct-2024
  • (2023)Focusing on Refinement TypingACM Transactions on Programming Languages and Systems10.1145/361040845:4(1-62)Online publication date: 20-Dec-2023
  • (2022)Polarized SubtypingProgramming Languages and Systems10.1007/978-3-030-99336-8_16(431-461)Online publication date: 5-Apr-2022

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media