Abstract
We propose a framework to study contextual equivalence of programs written in a call-by-value functional language with local integer references. It reduces the problem of contextual equivalence to the problem of non-reachability in a transition system of memory configurations. This reduction is complete for recursion-free programs.
Restricting to programs that do not allocate references inside the body of functions, we encode this non-reachability problem as a set of constrained Horn clause that can then be checked for satisfiability automatically. Restricting furthermore to a language with finite data-types, we also get a new decidability result for contextual equivalence at any type.
Supplemental Material
- Amal Ahmed, Derek Dreyer, and Andreas Rossberg. 2009. State-dependent Representation Independence. In Proceedings of the 36th ACM Symposium on Principles of Programming Languages (POPL ’09). ACM, New York, 14.Google Scholar
Digital Library
- Anindya Banerjee and David A. Naumann. 2005. Ownership Confinement Ensures Representation Independence for Object-oriented Programs. J. ACM 52, 6 (2005), 894–960. Google Scholar
Digital Library
- Nikolaj Bjørner, Arie Gurfinkel, Ken McMillan, and Andrey Rybalchenko. 2015. Horn clause solvers for program verification. In Fields of Logic and Computation II. Springer, 24–51.Google Scholar
- Nikolaj Bjørner, Ken McMillan, and Andrey Rybalchenko. 2013. On solving universally quantified horn clauses. In International Static Analysis Symposium. Springer, 105–125.Google Scholar
Cross Ref
- James Brotherston and Alex Simpson. 2011. Sequent Calculi for Induction and Infinite Descent. J. Log. and Comput. 21, 6 (Dec. 2011), 1177–1216. Google Scholar
Digital Library
- Conrad Cotton-Barratt, David Hopkins, Andrzej S. Murawski, and C.-H. Luke Ong. 2015. Fragments of ML Decidable by Nested Data Class Memory Automata. In Proceedings of the 18th International Conference on Foundations of Software Science and Computation Structures (FoSSaCS’15). 249–263.Google Scholar
Cross Ref
- Conrad Cotton-Barratt, Andrzej S. Murawski, and C.-H. Luke Ong. 2017. ML and Extended Branching VASS. In Proceedings of the 26th European Symposium on Programming Languages and Systems (ESOP’17). 314–340.Google Scholar
Cross Ref
- Derek Dreyer, Amal Ahmed, and Lars Birkedal. 2009. Logical Step-Indexed Logical Relations. In Proceedings of the 24th IEEE Symposium on Logic In Computer Science (LICS ’09). IEEE, Washington, DC, USA, 71–80.Google Scholar
Digital Library
- Derek Dreyer, Georg Neis, and Lars Birkedal. 2010a. The Impact of Higher-order State and Control Effects on Local Relational Reasoning. In Proceedings of the 15th ACM SIGPLAN International Conference on Functional Programming (ICFP ’10). ACM, New York, 143–156.Google Scholar
Digital Library
- Derek Dreyer, Georg Neis, Andreas Rossberg, and Lars Birkedal. 2010b. A Relational Modal Logic for Higher-order Stateful ADTs. In Proceedings of the 37th ACM Symposium on Principles of Programming Languages (POPL ’10). ACM, New York, 185–198.Google Scholar
Digital Library
- Dennis Felsing, Sarah Grebing, Vladimir Klebanov, Philipp Rümmer, and Mattias Ulbrich. 2014. Automating Regression Verification. In Proceedings of the 29th ACM/IEEE International Conference on Automated Software Engineering (ASE ’14). ACM, New York, 349–360.Google Scholar
Digital Library
- Benny Godlin and Ofer Strichman. 2009. Regression Verification. In Proceedings of the 46th Design Automation Conference (DAC ’09). ACM, New York, 6.Google Scholar
- Arie Gurfinkel, Temesghen Kahsai, Anvesh Komuravelli, and Jorge A Navas. 2015. The SeaHorn verification framework. In International Conference on Computer Aided Verification. Springer, 343–361.Google Scholar
Cross Ref
- Kryštof Hoder, Nikolaj Bjørner, and Leonardo De Moura. 2011. muZ: An Efficient Engine for Fixed Points with Constraints. In Proceedings of the 23rd International Conference on Computer Aided Verification (CAV’11). Springer-Verlag, Berlin, Heidelberg, 457–462. http://dl.acm.org/citation.cfm?id=2032305.2032341Google Scholar
Cross Ref
- David Hopkins, Andrzej S. Murawski, and C.-H. Luke Ong. 2011. A Fragment of ML Decidable by Visibly Pushdown Automata. In Proceedings of the 38th International Conference on Automata, Languages and Programming - Volume Part II (ICALP’11). Springer-Verlag, Berlin, Heidelberg, 149–161.Google Scholar
Cross Ref
- David Hopkins, Andrzej S. Murawski, and C.-H. Luke Ong. 2012. HECTOR: An Equivalence Checker for a Higher-order Fragment of ML. In Proceedings of the 24th International Conference on Computer Aided Verification (CAV’12). SpringerVerlag, Berlin, Heidelberg, 774–780. Google Scholar
Digital Library
- David Hopkins and C. H. Ong. 2009. Homer: A Higher-Order Observational Equivalence Model checkER. In Proceedings of the 21st International Conference on Computer Aided Verification (CAV ’09). Springer-Verlag, Berlin, Heidelberg, 654–660. Google Scholar
Digital Library
- Chung-Kil Hur, Derek Dreyer, Georg Neis, and Viktor Vafeiadis. 2012. The Marriage of Bisimulations and Kripke Logical Relations. In Proceedings of the 39th ACM Symposium on Principles of Programming Languages (POPL ’12). ACM, New York, 59–72.Google Scholar
Digital Library
- Guilhem Jaber. 2015. Operational Nominal Game Semantics. In Proceedings of the 18th International Conference on Foundations of Software Science and Computation Structures (FOSSACS 2015). Springer Berlin Heidelberg, Berlin, Heidelberg.Google Scholar
Cross Ref
- Guilhem Jaber and Nicolas Tabareau. 2015. Kripke Open Bisimulation - A Marriage of Game Semantics and Operational Techniques. In Proceedings of the 13th Asian Symposium on Programming Languages and Systems (APLAS 2015).Google Scholar
- Guilhem Jaber and Nikos Tzevelekos. 2016. Trace Semantics for Polymorphic References. In Proceedings of the 31st ACM/IEEE Symposium on Logic in Computer Science (LICS ’16). ACM, New York, 585–594.Google Scholar
Digital Library
- Radha Jagadeesan, Corin Pitcher, and James Riely. 2009. Transactions on Aspect-Oriented Software Development V. SpringerVerlag, Berlin, Heidelberg, Chapter Open Bisimulation for Aspects, 72–132. Google Scholar
Digital Library
- Vasileios Koutavas and Mitchell Wand. 2006. Small Bisimulations for Reasoning About Higher-order Imperative Programs. In Conference Record of the 33rd ACM Symposium on Principles of Programming Languages (POPL ’06). ACM, New York, 141–152.Google Scholar
- Shuvendu K. Lahiri, Chris Hawblitzel, Ming Kawaguchi, and Henrique Rebêlo. 2012. SYMDIFF: A Language-agnostic Semantic Diff Tool for Imperative Programs. In Proceedings of the 24th International Conference on Computer Aided Verification (CAV’12). Springer-Verlag, Berlin, Heidelberg, 712–717.Google Scholar
Digital Library
- James Laird. 2007. A Fully Abstract Trace Semantics for General. In Proceedings of the 34th International Conference on Automata, Languages and Programming (ICALP’07). Springer-Verlag, Berlin, Heidelberg, 667–679.Google Scholar
Digital Library
- Soren B. Lassen and Paul Blain Levy. 2007. Typed Normal Form Bisimulation. In Proceedings of the 21st International Conference, and Proceedings of the 16th Annuall Conference on Computer Science Logic (CSL’07/EACSL’07). Springer-Verlag, Berlin, Heidelberg, 283–297. http://dl.acm.org/citation.cfm?id=2392389.2392418Google Scholar
- Andrzej S. Murawski. 2005. Functions with local state: Regularity and undecidability. Theoretical Computer Science 338, 1 (2005), 315 – 349.Google Scholar
Digital Library
- Andrzej S. Murawski, Steven J. Ramsay, and Nikos Tzevelekos. 2015. A Contextual Equivalence Checker for IMJ*. In Automated Technology for Verification and Analysis (ATVA’15). Springer International Publishing, 234–240.Google Scholar
- Andrzej S. Murawski and Nikos Tzevelekos. 2011a. Algorithmic Nominal Game Semantics. In Proceedings of the 20th European Conference on Programming Languages and Systems (ESOP’11). Springer-Verlag, Berlin, Heidelberg, 419–438.Google Scholar
- Andrzej S. Murawski and Nikos Tzevelekos. 2011b. Game Semantics for Good General References. In Proceedings of the 2011 IEEE 26th Annual Symposium on Logic in Computer Science (LICS ’11). IEEE Computer Society, Washington, DC, USA, 75–84. Google Scholar
Digital Library
- Andrzej S. Murawski and Nikos Tzevelekos. 2012. Algorithmic Games for Full Ground References. In Proceedings of the 39th International Colloquium Conference on Automata, Languages, and Programming - Volume Part II (ICALP’12). Springer-Verlag, Berlin, Heidelberg, 312–324.Google Scholar
- Andrew M. Pitts. 1996. Reasoning About Local Variables with Operationally-based Logical Relations. In Proceedings of the 11th IEEE Symposium on Logic in Computer Science (LICS ’96). IEEE, Washington, DC, USA, 152–.Google Scholar
Digital Library
- Gordon D. Plotkin and Martín Abadi. 1993. A Logic for Parametric Polymorphism. In Proceedings of the International Conference on Typed Lambda Calculi and Applications (TLCA ’93). Springer-Verlag, London, UK, UK, 361–375.Google Scholar
- Davide Sangiorgi, Naoki Kobayashi, and Eijiro Sumii. 2007. Environmental Bisimulations for Higher-Order Languages. In Proceedings of the 22Nd IEEE Symposium on Logic in Computer Science (LICS ’07). IEEE, Washington, DC, USA, 293–302.Google Scholar
Digital Library
- Eijiro Sumii. 2009. A Complete Characterization of Observational Equivalence in Polymorphic lambda-calculus with General References. In Proceedings of the 23rd CSL International Conference and 18th EACSL Conference on Computer Science Logic (CSL’09/EACSL’09). Springer-Verlag, Berlin, Heidelberg, 455–469.Google Scholar
Digital Library
- Eijiro Sumii and Benjamin C. Pierce. 2005. A Bisimulation for Type Abstraction and Recursion. In Proceedings of the 32Nd ACM Symposium on Principles of Programming Languages (POPL ’05). ACM, New York, 63–74.Google Scholar
- Nikos Tzevelekos. 2011. Fresh-register Automata. In Proceedings of the 38th ACM Symposium on Principles of Programming Languages (POPL ’11). ACM, New York, 295–306.Google Scholar
- Yuepeng Wang, Isil Dillig, Shuvendu K. Lahiri, and William R. Cook. 2018. Verifying Equivalence of Database-driven Applications. Proc. ACM Program. Lang. 2, POPL, Article 56 (2018), 29 pages. Google Scholar
Digital Library
Index Terms
SyTeCi: automating contextual equivalence for higher-order programs with references
Recommendations
Small bisimulations for reasoning about higher-order imperative programs
Proceedings of the 2006 POPL ConferenceWe introduce a new notion of bisimulation for showing contextual equivalence of expressions in an untyped lambda-calculus with an explicit store, and in which all expressed values, including higher-order values, are storable. Our notion of bisimulation ...
Program equivalence in linear contexts
Program equivalence in linear contexts, where programs are used or executed exactly once, is an important issue in programming languages. However, existing techniques like those based on bisimulations and logical relations only target at contextual ...
Small bisimulations for reasoning about higher-order imperative programs
POPL '06: Conference record of the 33rd ACM SIGPLAN-SIGACT symposium on Principles of programming languagesWe introduce a new notion of bisimulation for showing contextual equivalence of expressions in an untyped lambda-calculus with an explicit store, and in which all expressed values, including higher-order values, are storable. Our notion of bisimulation ...






Comments