Skip to main content
Springer Nature - PMC COVID-19 Collection logoLink to Springer Nature - PMC COVID-19 Collection
. 2020 Apr 18;12075:515–543. doi: 10.1007/978-3-030-44914-8_19

A First-Order Logic with Frames

Adithya Murali 9, Lucas Peña 9,, Christof Löding 10, P Madhusudan 9
Editor: Peter Müller1
PMCID: PMC7702254

Abstract

We propose a novel logic, called Frame Logic (FL), that extends first-order logic (with recursive definitions) using a construct Sp(·) that captures the implicit supports of formulas— the precise subset of the universe upon which their meaning depends. Using such supports, we formulate proof rules that facilitate frame reasoning elegantly when the underlying model undergoes change. We show that the logic is expressive by capturing several data-structures and also exhibit a translation from a precise fragment of separation logic to frame logic. Finally, we design a program logic based on frame logic for reasoning with programs that dynamically update heaps that facilitates local specifications and frame reasoning. This program logic consists of both localized proof rules as well as rules that derive the weakest tightest preconditions in FL.

Keywords: Program Verification, Program Logics, Heap Verification, First-Order Logic, First-Order Logic with Recursive Definitions

Author Contributions

Adithya Murali, Lucas Peña: Equal contribution

Contributor Information

Peter Müller, Email: peter.mueller@inf.ethz.ch.

Adithya Murali, Email: adithya5@illinois.edu.

Lucas Peña, Email: lpena7@illinois.edu.

Christof Löding, Email: loeding@automata.rwth-aachen.de.

P. Madhusudan, Email: madhu@illinois.edu

References

  • 1.Banerjee, A., Naumann, D.: Local reasoning for global invariants, Part II: Dynamic boundaries. Journal of the ACM (JACM) 60 (06 2013)
  • 2.Banerjee, A., Naumann, D.A., Rosenberg, S.: Regional logic for local reasoning about global invariants. In: Vitek, J. (ed.) ECOOP 2008 – Object-Oriented Programming. pp. 387–411. Springer Berlin Heidelberg, Berlin, Heidelberg (2008)
  • 3.Banerjee, A., Naumann, D.A., Rosenberg, S.: Local reasoning for global invariants, Part I: Region logic. J. ACM 60(3), 18:1–18:56 (Jun 2013), 10.1145/2485982
  • 4.Berdine, J., Calcagno, C., O’Hearn, P.W.: A decidable fragment of separation logic. In: Proceedings of the 24th International Conference on Foundations of Software Technology and Theoretical Computer Science. pp. 97–109. FSTTCS’04 (2004)
  • 5.Berdine, J., Calcagno, C., O’Hearn, P.W.: Symbolic execution with separation logic. In: Proceedings of the Third Asian Conference on Programming Languages and Systems. pp. 52–68. APLAS’05 (2005)
  • 6.Berdine, J., Calcagno, C., O’Hearn, P.W.: Smallfoot: Modular automatic assertion checking with separation logic. In: Proceedings of the 4th International Conference on Formal Methods for Components and Objects. pp. 115–137. FMCO’05, Springer-Verlag, Berlin, Heidelberg (2006). 10.1007/11804192_6
  • 7.Brinck, K., Foo, N.Y.: Analysis of algorithms on threaded trees. The Computer Journal 24(2), 148–155 (01 1981). 10.1093/comjnl/24.2.148
  • 8.Brookes, S.: A semantics for concurrent separation logic. Theor. Comput. Sci. 375(1-3), 227–270 (Apr 2007). 10.1016/j.tcs.2006.12.034
  • 9.Brotherston, J., Distefano, D., Petersen, R.L.: Automated cyclic entailment proofs in separation logic. In: Proceedings of the 23rd International Conference on Automated Deduction. pp. 131–146. CADE’11, Springer-Verlag, Berlin, Heidelberg (2011), http://dl.acm.org/citation.cfm?id=2032266.2032278
  • 10.Chin, W.N., David, C., Nguyen, H.H., Qin, S.: Automated verification of shape, size and bag properties. In: 12th IEEE International Conference on Engineering Complex Computer Systems (ICECCS 2007). pp. 307–320 (2007)
  • 11.Cook, B., Haase, C., Ouaknine, J., Parkinson, M., Worrell, J.: Tractable reasoning in a fragment of separation logic. In: Proceedings of the 22nd International Conference on Concurrency Theory. pp. 235–249. CONCUR’11 (2011)
  • 12.Demri, S., Deters, M.: Separation logics and modalities: a survey. Journal of Applied Non-Classical Logics 25, 50–99 (2015)
  • 13.Hayes, P.J.: The frame problem and related problems in artificial intelligence. In: Webber, B.L., Nilsson, N.J. (eds.) Readings in Artificial Intelligence, pp. 223 – 230. Morgan Kaufmann (1981). 10.1016/B978-0-934613-03-3.50020-9
  • 14.Itzhaky, S., Banerjee, A., Immerman, N., Lahav, O., Nanevski, A., Sagiv, M.: Modular reasoning about heap paths via effectively propositional formulas. In: Proceedings of the 41st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. pp. 385–396. POPL ’14, ACM, New York, NY, USA (2014). 10.1145/2535838.2535854
  • 15.Itzhaky, S., Banerjee, A., Immerman, N., Nanevski, A., Sagiv, M.: Effectively-propositional reasoning about reachability in linked data structures. In: Proceedings of the 25th International Conference on Computer Aided Verification. pp. 756–772. CAV’13, Springer-Verlag, Berlin, Heidelberg (2013). 10.1007/978-3-642-39799-8_53
  • 16.Itzhaky, S., Bjørner, N., Reps, T., Sagiv, M., Thakur, A.: Property-directed shape analysis. In: Proceedings of the 16th International Conference on Computer Aided Verification. pp. 35–51. CAV’14, Springer-Verlag, Berlin, Heidelberg (2014). 10.1007/978-3-319-08867-9_3
  • 17.Kassios, I.T.: The dynamic frames theory. Form. Asp. Comput. 23(3), 267–288 (May 2011). 10.1007/s00165-010-0152-5
  • 18.Kassios, I.T.: Dynamic frames: Support for framing, dependencies and sharing without restrictions. In: Misra, J., Nipkow, T., Sekerinski, E. (eds.) FM 2006: Formal Methods. pp. 268–283. Springer-Verlag, Berlin, Heidelberg (2006)
  • 19.Kovács, L., Robillard, S., Voronkov, A.: Coming to terms with quantified reasoning. In: Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages. pp. 260–270. POPL ’17, ACM, New York, NY, USA (2017). 10.1145/3009837.3009887
  • 20.Kovács, L., Voronkov, A.: First-order theorem proving and Vampire. In: CAV ’13. pp. 1–35 (2013). 10.1007/978-3-642-39799-8_1
  • 21.Leino, K.R.M.: Dafny: An automatic program verifier for functional correctness. In: Proceedings of the 16th International Conference on Logic for Programming, Artificial Intelligence, and Reasoning. p. 348–370. LPAR’10, Springer-Verlag, Berlin, Heidelberg (2010). 10.5555/1939141.1939161
  • 22.Leino, K.R.M., Müller, P.: A basis for verifying multi-threaded programs. In: Castagna, G. (ed.) Programming Languages and Systems. pp. 378–393. Springer Berlin Heidelberg, Berlin, Heidelberg (2009). 10.1007/978-3-642-00590-9_27
  • 23.Löding, C., Madhusudan, P., Peña, L.: Foundations for natural proofs and quantifier instantiation. PACMPL 2(POPL), 10:1–10:30 (2018). 10.1145/3158098
  • 24.Madhusudan, P., Qiu, X., Ştefănescu, A.: Recursive proofs for inductive tree data-structures. In: Proceedings of the 39th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. pp. 123–136. POPL ’12, ACM, New York, NY, USA (2012). 10.1145/2103656.2103673
  • 25.Murali, A., Peña, L., Löding, C., Madhusudan, P.: A first order logic with frames. CoRR (2019), http://arxiv.org/abs/1901.09089
  • 26.Navarro Pérez, J.A., Rybalchenko, A.: Separation logic + superposition calculus = heap theorem prover. In: Proceedings of the 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation. pp. 556–566. PLDI ’11, ACM, New York, NY, USA (2011)
  • 27.O’Hearn, P.W.: A primer on separation logic (and automatic program verification and analysis). In: Software Safety and Security (2012)
  • 28.O’Hearn, P.W., Reynolds, J.C., Yang, H.: Local reasoning about programs that alter data structures. In: Proceedings of the 15th International Workshop on Computer Science Logic. pp. 1–19. CSL ’01, Springer-Verlag, London, UK, UK (2001), http://dl.acm.org/citation.cfm?id=647851.737404
  • 29.O’Hearn, P.W., Yang, H., Reynolds, J.C.: Separation and information hiding. In: Proceedings of the 31st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. pp. 268–280. POPL ’04, ACM, New York, NY, USA (2004). 10.1145/964001.964024
  • 30.Parkinson, M., Bierman, G.: Separation logic and abstraction. In: Proceedings of the 32nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. pp. 247–258. POPL ’05, ACM, New York, NY, USA (2005). 10.1145/1040305.1040326
  • 31.Parkinson, M.J., Summers, A.J.: The relationship between separation logic and implicit dynamic frames. In: Barthe, G. (ed.) Programming Languages and Systems. pp. 439–458. Springer Berlin Heidelberg, Berlin, Heidelberg (2011). 10.1007/978-3-642-19718-5_23
  • 32.Pek, E., Qiu, X., Madhusudan, P.: Natural proofs for data structure manipulation in C using separation logic. In: Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation. pp. 440–451. PLDI ’14, ACM, New York, NY, USA (2014). 10.1145/2594291.2594325
  • 33.Pérez, J.A.N., Rybalchenko, A.: Separation logic modulo theories. In: Programming Languages and Systems (APLAS). pp. 90–106. Springer International Publishing, Cham (2013)
  • 34.Piskac, R., Wies, T., Zufferey, D.: Automating separation logic using SMT. In: Proceedings of the 25th International Conference on Computer Aided Verification. pp. 773–789. CAV’13, Springer-Verlag, Berlin, Heidelberg (2013). 10.1007/978-3-642-39799-8_54
  • 35.Piskac, R., Wies, T., Zufferey, D.: Automating separation logic with trees and data. In: Proceedings of the 16th International Conference on Computer Aided Verification. pp. 711–728. CAV’14, Springer-Verlag, Berlin, Heidelberg (2014)
  • 36.Piskac, R., Wies, T., Zufferey, D.: Grasshopper. In: Ábrahám, E., Havelund, K. (eds.) Tools and Algorithms for the Construction and Analysis of Systems. pp. 124–139. Springer Berlin Heidelberg, Berlin, Heidelberg (2014)
  • 37.Qiu, X., Garg, P., Ştefănescu, A., Madhusudan, P.: Natural proofs for structure, data, and separation. In: Proceedings of the 34th ACM SIGPLAN Conference on Programming Language Design and Implementation. pp. 231–242. PLDI ’13, ACM, New York, NY, USA (2013). 10.1145/2491956.2462169
  • 38.Reynolds, J.C.: Separation logic: A logic for shared mutable data structures. In: Proceedings of the 17th Annual IEEE Symposium on Logic in Computer Science. pp. 55–74. LICS ’02 (2002)
  • 39.Smans, J., Jacobs, B., Piessens, F.: Implicit dynamic frames: Combining dynamic frames and separation logic. In: Drossopoulou, S. (ed.) ECOOP 2009 – Object-Oriented Programming. pp. 148–172. Springer Berlin Heidelberg, Berlin, Heidelberg (2009). 10.1007/978-3-642-03013-0_8
  • 40.Smans, J., Jacobs, B., Piessens, F.: Implicit dynamic frames. ACM Trans. Program. Lang. Syst. 34(1), 2:1–2:58 (May 2012). 10.1145/2160910.2160911
  • 41.Suter, P., Dotta, M., Kunćak, V.: Decision procedures for algebraic data types with abstractions. In: Proceedings of the 37th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. pp. 199–210. POPL ’10, ACM, New York, NY, USA (2010). 10.1145/1706299.1706325
  • 42.Ta, Q.T., Le, T.C., Khoo, S.C., Chin, W.N.: Automated mutual explicit induction proof in separation logic. In: Fitzgerald, J., Heitmeyer, C., Gnesi, S., Philippou, A. (eds.) FM 2016: Formal Methods. pp. 659–676. Springer International Publishing, Cham (2016). 10.1007/978-3-319-48989-6_40

Articles from Programming Languages and Systems are provided here courtesy of Nature Publishing Group

RESOURCES