Skip to main content
QUICK REVIEW

[Paper Review] Compositional Symbolic Execution for Correctness and Incorrectness Reasoning

Dimovski, Aleksandar S.|arXiv (Cornell University)|Jan 1, 2024
Logic, Reasoning, and KnowledgeComputer Science6 citations
TL;DR

This paper presents a formally grounded, compositional symbolic execution (CSE) engine that unifies correctness and incorrectness reasoning via a sound axiomatic interface for 'consume' and 'produce' operations. Inspired by Gillian, the engine supports both over-approximating (correctness) and under-approximating (incorrectness) reasoning using separation logic, with a unified semantics based on satisfiability or validity, and evaluates the approach by extending Gillian-C to natively support true bug-finding via incorrectness bi-abduction.

ABSTRACT

The introduction of separation logic has led to the development of symbolic execution techniques and tools that are (functionally) compositional with function specifications that can be used in broader calling contexts. Many of the compositional symbolic execution tools developed in academia and industry have been grounded on a formal foundation, but either the function specifications are not validated with respect to the underlying separation logic of the theory, or there is a large gulf between the theory and the implementation of the tool. We introduce a formal compositional symbolic execution engine which creates and uses function specifications from an underlying separation logic and provides a sound theoretical foundation for, and indeed was partially inspired by, the Gillian symbolic execution platform. This is achieved by providing an axiomatic interface which describes the properties of the consume and produce operations used in the engine to update compositionally the symbolic state, for example when calling function specifications. This consume-produce technique is used by VeriFast, Viper, and Gillian, but has not been previously characterised independently of the tool. As part of our result, we give consume and produce operations inspired by the Gillian implementation that satisfy the properties described by our axiomatic interface. A surprising property is that our engine semantics provides a common foundation for both correctness and incorrectness reasoning, with the difference in the underlying engine only amounting to the choice to use satisfiability or validity. We use this property to extend the Gillian platform, which previously only supported correctness reasoning, with incorrectness reasoning and automatic true bug-finding using incorrectness bi-abduction. We evaluate our new Gillian platform by using the Gillian instantiation to C. This instantiation is the first tool grounded on a common formal compositional symbolic execution engine to support both correctness and incorrectness reasoning.

Motivation & Objective

  • To close the gap between formal separation logic and practical symbolic execution tools by providing a sound theoretical foundation for compositional symbolic execution.
  • To unify correctness and incorrectness reasoning under a single formal semantics, differing only in the use of satisfiability or validity.
  • To enable specification interoperability across tools by grounding function specifications in a formal separation logic.
  • To extend the Gillian platform with incorrectness reasoning and automatic true bug-finding using bi-abduction.
  • To evaluate the approach via a formal instantiation of the CSE engine to C using Gillian-C, demonstrating support for both correctness and incorrectness reasoning.

Proposed method

  • Define a compositional symbolic operational semantics using 'consume' and 'produce' operations to update symbolic states with function specifications.
  • Introduce an axiomatic interface specifying the required properties of consume and produce operations, independent of any specific tool.
  • Prove a general soundness result: if the axiomatic properties hold and function specifications are valid in separation logic, the CSE engine is sound.
  • Instantiate the axiomatic interface with operations inspired by Gillian, proving they satisfy the required properties.
  • Extend the Gillian platform to support incorrectness reasoning by switching from validity to satisfiability in the underlying logic.
  • Implement and evaluate the approach on Gillian-C, using bi-abduction to generate both correct and erroneous function specifications for C code.

Experimental results

Research questions

  • RQ1Can a formal compositional symbolic execution engine be designed that supports both correctness and incorrectness reasoning using a unified semantic foundation?
  • RQ2What axiomatic properties must 'consume' and 'produce' operations satisfy to ensure soundness in both over- and under-approximating reasoning?
  • RQ3How can function specifications be made interoperable across tools while remaining formally grounded in separation logic?
  • RQ4Can the Gillian platform be extended to support incorrectness reasoning and automatic true bug-finding without sacrificing soundness?
  • RQ5To what extent does the instantiation of the CSE engine to C (via Gillian-C) demonstrate practical viability for real-world program analysis?

Key findings

  • The CSE engine provides a unified semantic foundation for both correctness and incorrectness reasoning, with the only difference being the use of validity (for correctness) or satisfiability (for incorrectness).
  • The axiomatic interface for consume and produce operations is formally characterized and instantiated with Gillian-inspired operations that satisfy the required properties.
  • The engine enables specification interoperability, allowing function specifications from different sources to be used soundly across tools.
  • The evaluation shows that Gillian-C, extended with the CSE engine, generates 9 distinct specifications for a single C function, including 4 correct and 5 erroneous cases, demonstrating support for both reasoning modes.
  • The current implementation of Gillian-C suffers from specification explosion due to encoding limitations, but this is a practical limitation, not a flaw in the theoretical framework.
  • The approach successfully enables automatic true bug-finding via incorrectness bi-abduction, with a key example detecting a NULL dereference that would trigger a segmentation fault.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.