[Paper Review] An Expressive Trace Logic for Recursive Programs
This paper introduces an expressive trace logic based on binary state predicates, chop, and least fixed points for specifying and verifying recursive imperative programs. It establishes a fully compositional denotational semantics for programs and trace formulas, proves soundness and relative completeness of a compositional proof calculus, and formalizes a Galois connection between programs and formulas via strongest trace formulas and canonical programs, revealing deep correspondences between programming constructs and logical connectives.
We present an expressive logic over trace formulas, based on binary state predicates, chop, and least fixed-points, for precise specification of programs with recursive procedures. Both, programs and trace formulas, are equipped with a direct-style, fully compositional, denotational semantics that on programs coincides with the standard SOS of recursive programs. We design a compositional proof calculus for proving finite-trace program properties, and prove soundness as well as (relative) completeness. We show that each program can be mapped to a semantics-preserving trace formula and, vice versa, each trace formula can be mapped to a canonical program over slightly extended programs, resulting in a Galois connection between programs and formulas. Our results shed light on the correspondence between programming constructs and logical connectives.
Motivation & Objective
- To develop a trace logic as expressive as the programs it specifies, enabling precise, modular verification of recursive procedures.
- To provide a fully compositional denotational semantics for both programs and trace formulas that matches standard small-step operational semantics.
- To design a compositional proof calculus for finite-trace program properties that is sound and relatively complete.
- To formalize a Galois connection between programs and trace formulas via strongest trace formulas and canonical programs, revealing structural correspondences.
- To demonstrate that procedure-modular verification is possible without explicit contracts by using symbolic continuations via statement variables.
Proposed method
- Define a programming language Rec with recursive procedures and non-deterministic guards, equipped with a standard small-step operational semantics.
- Introduce a fully compositional denotational semantics for Rec that is proven equivalent to the SOS semantics.
- Construct a trace logic using binary state predicates, chop (concatenation), and least fixed points to express sets of finite program traces.
- Define the strongest trace formula (stf) of a program as a trace formula that precisely characterizes all its finite traces.
- Design a compositional proof calculus for judgments of the form S : ϕ, with inference rules that decompose judgments and algebraic rules that transform formulas.
- Define a canonical program construction that maps any trace formula back to a program in an extended language Rec∗, establishing a Galois connection between Rec∗ and trace formulas via stf and canonical program mappings.
Experimental results
Research questions
- RQ1Can a trace logic be constructed that is as expressive as recursive imperative programs, with full compositional semantics?
- RQ2Is it possible to design a compositional proof calculus for finite-trace program properties that is both sound and relatively complete?
- RQ3How can a precise correspondence between programming constructs and logical connectives be formalized and proven?
- RQ4Can a Galois connection be established between programs and trace formulas through strongest trace formulas and canonical programs?
- RQ5Does the absence of explicit procedure contracts in the verification framework still allow for modular, procedure-level verification?
Key findings
- The denotational semantics of Rec is proven fully equivalent to its small-step operational semantics, ensuring correctness of the compositional model.
- The strongest trace formula of any program fully preserves its semantics, meaning stf(S) characterizes exactly the set of finite traces of S.
- The proof calculus for judgments S : ϕ is sound and relatively complete, enabling verification of finite-trace properties through compositional reasoning.
- A Galois connection is formally established between the language Rec∗ and the set of trace formulas, with stf and canonical program mappings as the adjoint pair.
- Procedure-modular verification is achieved without explicit contracts by using symbolic continuations via statement variables, leading to a novel, modular 'Call' rule.
- The framework naturally supports complex inter-procedural properties such as call sequences, absence of callbacks, and event occurrences, which are hard to express in Hoare logic or standard temporal logic.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.