skip to main content
research-article
Open Access

Higher-Order MSL Horn Constraints

Published:11 January 2023Publication History
Skip Abstract Section

Abstract

The monadic shallow linear (MSL) class is a decidable fragment of first-order Horn clauses that was discovered and rediscovered around the turn of the century, with applications in static analysis and verification. We propose a new class of higher-order Horn constraints which extend MSL to higher-order logic and develop a resolution-based decision procedure. Higher-order MSL Horn constraints can quite naturally capture the complex patterns of call and return that are possible in higher-order programs, which make them well suited to higher-order program verification. In fact, we show that the higher-order MSL satisfiability problem and the HORS model checking problem are interreducible, so that higher-order MSL can be seen as a constraint-based approach to higher-order model checking. Finally, we describe an implementation of our decision procedure and its application to verified socket programming.

References

  1. Alexander Aiken. 1999. Introduction to set constraint-based program analysis. Science of Computer Programming, 35, 2 (1999), 79–111. issn:0167-6423 https://doi.org/10.1016/S0167-6423(99)00007-6 Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Leo Bachmair, Harald Ganzinger, and Uwe Waldmann. 1993. Set Constraints are the Monadic Class. In Eighth Annual IEEE Symposium on Logic in Computer Science. IEEE, Montreal, Canada. 75–83. https://doi.org/10.1109/LICS.1993.287598 Google ScholarGoogle ScholarCross RefCross Ref
  3. Christopher Broadbent and Naoki Kobayashi. 2013. Saturation-based model checking of higher-order recursion schemes. In Computer Science Logic 2013 (CSL 2013). https://doi.org/10.4230/LIPIcs.CSL.2013.129 Google ScholarGoogle ScholarCross RefCross Ref
  4. Florian Bruse, Martin Lange, and Étienne Lozes. 2021. The Complexity of Model-Checking Tail-Recursive Higher-Order Fixpoint Logic. Fundam. Informaticae, 178, 1-2 (2021), 1–30. https://doi.org/10.3233/FI-2021-1996 Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Toby Cathcart Burn, C.-H. Luke Ong, and Steven J. Ramsay. 2017. Higher-Order Constrained Horn Clauses for Verification. Proc. ACM Program. Lang., 2, POPL (2017), Article 11, Dec, 28 pages. https://doi.org/10.1145/3158099 Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Toby Cathcart Burn, C.-H. Luke Ong, Steven J. Ramsay, and Dominik Wagner. 2021. Initial Limit Datalog: a New Extensible Class of Decidable Constrained Horn Clauses. In 2021 36th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS). 1–13. https://doi.org/10.1109/LICS52264.2021.9470527 Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Angelos Charalambidis, Christos Nomikos, and Panos Rondogiannis. 2019. The Expressive Power of Higher-Order Datalog. Theory and Practice of Logic Programming, 19, 5-6 (2019), 925–940. https://doi.org/10.1017/S1471068419000279 Google ScholarGoogle ScholarCross RefCross Ref
  8. Pierre Clairambault, Charles Grellois, and Andrzej S. Murawski. 2018. Linearity in Higher-Order Recursion Schemes. Proc. ACM Program. Lang., 2, POPL (2018), Article 39, Dec, 29 pages. https://doi.org/10.1145/3158127 Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Byron Cook, Alexey Gotsman, Andreas Podelski, Andrey Rybalchenko, and Moshe Y Vardi. 2007. Proving that programs eventually do something good. ACM SIGPLAN Notices, 42, 1 (2007), 265–276. https://doi.org/10.1145/1190216.1190257 Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. František Farka. 2020. Proof-Relevant Resolution: the Foundations of Constructive Proof Automation. Ph. D. Dissertation. Heriot-Watt University, UK. Google ScholarGoogle Scholar
  11. Thom Frühwirth, Moshe Vardi, and Eyal Yardeni. 1997. Logic Programs as Types for Logic Programs. Proceedings – Symposium on Logic in Computer Science, 12, https://doi.org/10.1109/LICS.1991.151654 Google ScholarGoogle ScholarCross RefCross Ref
  12. Peng Fu and Ekaterina Komendantskaya. 2015. A Type-Theoretic Approach to Resolution. In Logic-Based Program Synthesis and Transformation, Moreno Falaschi (Ed.). Springer International Publishing, Cham. 91–106. isbn:978-3-319-27436-2 https://doi.org/10.1007/978-3-319-27436-2_6 Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Peng Fu and Ekaterina Komendantskaya. 2017. Operational Semantics of Resolution and Productivity in Horn Clause Logic. Form. Asp. Comput., 29, 3 (2017), may, 453–474. issn:0934-5043 https://doi.org/10.1007/s00165-016-0403-1 Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Peng Fu, Ekaterina Komendantskaya, Tom Schrijvers, and Andrew Pond. 2016. Proof Relevant Corecursive Resolution. In Functional and Logic Programming, Oleg Kiselyov and Andy King (Eds.). Springer International Publishing, Cham. 126–143. isbn:978-3-319-29604-3 https://doi.org/10.1007/978-3-319-29604-3_9 Google ScholarGoogle ScholarCross RefCross Ref
  15. Jean Goubault-Larrecq. 2002. Higher-Order Positive Set Constraints. In Computer Science Logic, Julian Bradfield (Ed.). Springer Berlin Heidelberg, Berlin, Heidelberg. 473–489. isbn:978-3-540-45793-0 https://doi.org/10.1007/3-540-45793-3_32 Google ScholarGoogle ScholarCross RefCross Ref
  16. Jean Goubault-Larrecq. 2005. Deciding H1 by resolution. Inform. Process. Lett., 95, 3 (2005), 401–408. issn:0020-0190 https://doi.org/10.1016/j.ipl.2005.04.007 Google ScholarGoogle ScholarCross RefCross Ref
  17. Sergey Grebenshchikov, Nuno P. Lopes, Corneliu Popeea, and Andrey Rybalchenko. 2012. Synthesizing Software Verifiers from Proof Rules. In Proceedings of the 33rd ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’12). Association for Computing Machinery, New York, NY, USA. 405–416. isbn:9781450312059 https://doi.org/10.1145/2254064.2254112 Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Matthew Hague, Andrzej S. Murawski, C.-H. Luke Ong, and Olivier Serre. 2008. Collapsible Pushdown Automata and Recursion Schemes. In Logic in Computer Science, LICS’08. IEEE Computer Society, 452–461. Google ScholarGoogle Scholar
  19. Haskell.org. 2013. Iteratee I/O: The problem with lazy IO. https://wiki.haskell.org/Iteratee_I/O#The_problem_with_lazy_I.2FO Google ScholarGoogle Scholar
  20. Youkichi Hosoi, Naoki Kobayashi, and Takeshi Tsukada. 2019. A type-based HFL model checking algorithm. In Asian Symposium on Programming Languages and Systems. 136–155. https://doi.org/10.1007/978-3-030-34175-6_8 Google ScholarGoogle ScholarCross RefCross Ref
  21. William Howard. 1980. The formulae-as-types notion of construction. In To H. B. Curry: Essays on Combinatory Logic, Lambda Calculus and Formalism, J. Seldin and R. J. Hindley (Eds.). Academic Press. Google ScholarGoogle Scholar
  22. Ranjit Jhala, Rupak Majumdar, and Andrey Rybalchenko. 2011. HMC: Verifying Functional Programs Using Abstract Interpreters. In Computer Aided Verification, Ganesh Gopalakrishnan and Shaz Qadeer (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg. 470–485. isbn:978-3-642-22110-1 https://doi.org/10.1007/978-3-642-22110-1_38 Google ScholarGoogle ScholarCross RefCross Ref
  23. Jerome. Jochems. 2020. Higher-order constrained Horn clauses for higher-order program verification. Ph. D. Dissertation. Oxford University, UK. Google ScholarGoogle Scholar
  24. Jerome Jochems, Eddie Jones, and Steven Ramsay. 2022. Higher-Order MSL Horn Constraints. https://doi.org/10.48550/ARXIV.2210.14649 Google ScholarGoogle Scholar
  25. Naoki Kobayashi. 2009. Types and Higher-Order Recursion Schemes for Verification of Higher-Order Programs. SIGPLAN Not., 44, 1 (2009), Jan, 416–428. issn:0362-1340 https://doi.org/10.1145/1594834.1480933 Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Naoki Kobayashi. 2013. Model checking higher-order programs. Journal of the ACM (JACM), 60, 3 (2013), 1–62. https://doi.org/10.1145/2487241.2487246 Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Naoki Kobayashi. 2021. An Overview of the HFL Model Checking Project. arXiv preprint arXiv:2109.04629, https://doi.org/10.4204/EPTCS.344.1 Google ScholarGoogle ScholarCross RefCross Ref
  28. Naoki Kobayashi and C.-H. Luke Ong. 2009. A Type System Equivalent to the Modal Mu-Calculus Model Checking of Higher-Order Recursion Schemes. In Logic in Computer Science, LICS 2009. IEEE Computer Society, 179–188. https://doi.org/10.1109/LICS.2009.29 Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Dale Miller and Gopalan Nadathur. 2012. Programming with Higher-Order Logic. Cambridge University Press. https://doi.org/10.1017/CBO9781139021326 Google ScholarGoogle ScholarCross RefCross Ref
  30. Dale Miller, Gopalan Nadathur, Frank Pfenning, and Andre Scedrov. 1991. Uniform proofs as a foundation for logic programming. Annals of Pure and Applied Logic, 51, 1 (1991), 125–157. issn:0168-0072 https://doi.org/10.1016/0168-0072(91)90068-W Google ScholarGoogle ScholarCross RefCross Ref
  31. Andrey Mokhov, Georgy Lukyanov, Simon Marlow, and Jeremie Dimino. 2019. Selective applicative functors. Proceedings of the ACM on Programming Languages, 3, ICFP (2019), 1–29. https://doi.org/10.1145/3341694 Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. David E. Muller and Paul E. Schupp. 1987. Alternating automata on infinite trees. Theoretical Computer Science, 54, 2 (1987), 267–276. issn:0304-3975 https://doi.org/10.1016/0304-3975(87)90133-2 Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Takashi Nagaya and Yoshihito Toyama. 2002. Decidability for Left-Linear Growing Term Rewriting Systems. Information and Computation, 178, 2 (2002), 499–514. issn:0890-5401 https://doi.org/10.1006/inco.2002.3157 Google ScholarGoogle ScholarCross RefCross Ref
  34. Robin P. Neatherway, Steven J. Ramsay, and C.-H. Luke Ong. 2012. A Traversal-Based Algorithm for Higher-Order Model Checking. SIGPLAN Not., 47, 9 (2012), Sep, 353–364. issn:0362-1340 https://doi.org/10.1145/2398856.2364578 Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Flemming Nielson, Hanne Riis Nielson, and Helmut Seidl. 2002. Normalizable Horn clauses, strongly recognizable relations, and Spi. In International Static Analysis Symposium. 20–35. https://doi.org/10.1007/3-540-45789-5_5 Google ScholarGoogle ScholarCross RefCross Ref
  36. C.-H. Luke Ong. 2006. On Model-Checking Trees Generated by Higher-Order Recursion Schemes. In 21th IEEE Symposium on Logic in Computer Science (LICS 2006), 12-15 August 2006, Seattle, WA, USA, Proceedings. 81–90. https://doi.org/10.1109/LICS.2006.38 Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. C.-H. Luke Ong and Dominik Wagner. 2019. HoCHC: A Refutationally Complete and Semantically Invariant System of Higher-order Logic Modulo Theories. In 2019 34th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS). 1–14. https://doi.org/10.1109/LICS.2019.8785784 Google ScholarGoogle ScholarCross RefCross Ref
  38. Steven J. Ramsay, Robin P. Neatherway, and C.-H. Luke Ong. 2014. A Type-Directed Abstraction Refinement Approach to Higher-Order Model Checking. In Principles of Programming Languages, POPL’14. ACM, 61–72. https://doi.org/10.1145/2535838.2535873 Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Jakob Rehof and Paweł Urzyczyn. 2011. Finite Combinatory Logic with Intersection Types. In Typed Lambda Calculi and Applications, C.-H. Luke Ong (Ed.). Springer Berlin Heidelberg, Berlin, Heidelberg. 169–183. isbn:978-3-642-21691-6 https://doi.org/10.1007/978-3-642-21691-6_15 Google ScholarGoogle ScholarCross RefCross Ref
  40. Patrick Maxim Rondon, Ming Kawaguchi, and Ranjit Jhala. 2008. Liquid types. In Proceedings of the ACM SIGPLAN 2008 Conference on Programming Language Design and Implementation, Tucson, AZ, USA, June 7-13, 2008. 159–169. https://doi.org/10.1145/1375581.1375602 Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Sylvain Salvati and Igor Walukiewicz. 2016. Simply typed fixpoint calculus and collapsible pushdown automata. Math. Struct. Comput. Sci., 26, 7 (2016), 1304–1350. https://doi.org/10.1017/S0960129514000590 Google ScholarGoogle ScholarCross RefCross Ref
  42. Taku Terao and Naoki Kobayashi. 2014. A ZDD-based efficient higher-order model checking algorithm. In Asian Symposium on Programming Languages and Systems. 354–371. https://doi.org/10.1007/978-3-319-12736-1_19 Google ScholarGoogle ScholarCross RefCross Ref
  43. Tachio Terauchi. 2010. Dependent types from counterexamples. In Proceedings of the 37th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2010, Madrid, Spain, January 17-23, 2010. 119–130. https://doi.org/10.1145/1706299.1706315 Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Andreas Teucke and Christoph Weidenbach. 2017. Decidability of the Monadic Shallow Linear First-Order Fragment with Straight Dismatching Constraints. In Automated Deduction – CADE 26, Leonardo de Moura (Ed.). Springer International Publishing, Cham. 202–219. isbn:978-3-319-63046-5 https://doi.org/10.1007/978-3-319-63046-5_13 Google ScholarGoogle ScholarCross RefCross Ref
  45. Hiroshi Unno and Naoki Kobayashi. 2009. Dependent type inference with interpolants. In Proceedings of the 11th International ACM SIGPLAN Conference on Principles and Practice of Declarative Programming, September 7-9, 2009, Coimbra, Portugal. 277–288. https://doi.org/10.1145/1599410.1599445 Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. Niki Vazou, Alexander Bakst, and Ranjit Jhala. 2015. Bounded refinement types. In Proceedings of the 20th ACM SIGPLAN International Conference on Functional Programming, ICFP 2015, Vancouver, BC, Canada, September 1-3, 2015. 48–61. https://doi.org/10.1145/2784731.2784745 Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. Niki Vazou, Patrick Maxim Rondon, and Ranjit Jhala. 2013. Abstract Refinement Types. In Programming Languages and Systems - 22nd European Symposium on Programming, ESOP 2013, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2013, Rome, Italy, March 16-24, 2013. Proceedings. 209–228. https://doi.org/10.1007/978-3-642-37036-6_13 Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. Mahesh Viswanathan and Ramesh Viswanathan. 2004. A Higher Order Modal Fixed Point Logic. In CONCUR 2004 - Concurrency Theory, Philippa Gardner and Nobuko Yoshida (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg. 512–528. isbn:978-3-540-28644-8 https://doi.org/10.1007/978-3-540-28644-8_33 Google ScholarGoogle ScholarCross RefCross Ref
  49. Christoph Weidenbach. 1999. Towards an Automatic Analysis of Security Protocols in First-Order Logic. In Automated Deduction — CADE-16. Springer Berlin Heidelberg, Berlin, Heidelberg. 314–328. isbn:978-3-540-48660-2 https://doi.org/10.1007/3-540-48660-7_29 Google ScholarGoogle ScholarCross RefCross Ref
  50. He Zhu and Suresh Jagannathan. 2013. Compositional and Lightweight Dependent Type Inference for ML. In Verification, Model Checking, and Abstract Interpretation, 14th International Conference, VMCAI 2013, Rome, Italy, January 20-22, 2013. Proceedings. 295–314. https://doi.org/10.1007/978-3-642-35873-9_19 Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Higher-Order MSL Horn Constraints

        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)90
          • Downloads (Last 6 weeks)9

          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!