Skip to main content
QUICK REVIEW

[Paper Review] Trace Logic for Inductive Loop Reasoning

Pamina Georgiou, Bernhard Gleiss|arXiv (Cornell University)|Aug 4, 2020
Formal Methods in VerificationComputer Science28 references5 citations
TL;DR

This paper introduces trace logic, a many-sorted first-order logic framework that models program variables as functions of timepoints and loop iterations, enabling automated inductive loop reasoning for safety verification. By encoding program semantics in trace logic and using sound trace lemmas to guide superposition-based theorem proving, the authors achieve fully automated verification of complex first-order properties with quantifier alternations in arrays and integers—successfully proving 100+ benchmarks from SV-COMP that were previously intractable for SMT-based tools.

ABSTRACT

We propose trace logic, an instance of many-sorted first-order logic, to automate the partial correctness verification of programs containing loops. Trace logic generalizes semantics of program locations and captures loop semantics by encoding properties at arbitrary timepoints and loop iterations. We guide and automate inductive loop reasoning in trace logic by using generic trace lemmas capturing inductive loop invariants. Our work is implemented in the RAPID framework, by extending and integrating superposition-based first-order reasoning within RAPID. We successfully used RAPID to prove correctness of many programs whose functional behavior are best summarized in the first-order theories of linear integer arithmetic, arrays and inductive data types.

Motivation & Objective

  • To address the challenge of automating inductive reasoning over loops with unbounded data structures like arrays and inductive types.
  • To generalize program semantics by modeling variable values as functions of timepoints and loop iterations, enabling arbitrary quantification over iterations.
  • To automate loop invariant discovery and safety verification using trace lemmas grounded in bounded induction.
  • To integrate first-order superposition-based reasoning into formal verification, complementing SMT solvers for quantified, complex properties.
  • To implement and evaluate the approach on real-world benchmarks, demonstrating superiority over existing SMT-based and transformation-based methods.

Proposed method

  • Propose trace logic, a many-sorted first-order logic that treats program locations as functions of execution timepoints and loop iterations.
  • Define a non-recursive, complete axiomatization of program semantics in trace logic, proven sound and complete with respect to Hoare logic.
  • Introduce three generic trace lemmas that capture inductive loop invariants through bounded induction, ensuring soundness of derived invariants.
  • Extend the Vampire first-order theorem prover with support for trace logic properties and integrate it into the Rapid framework.
  • Use superposition-based reasoning over trace logic to automatically derive loop invariants as logical consequences of trace lemmas and program axioms.
  • Encode programs and assertions in trace logic, including alternations of existential and universal quantifiers over arrays and integers, to express complex safety properties.

Experimental results

Research questions

  • RQ1Can first-order theorem proving be effectively used to automate inductive loop reasoning for safety verification?
  • RQ2Can trace logic support arbitrary quantification over loop iterations and timepoints to express complex array and integer properties?
  • RQ3Can trace lemmas based on bounded induction reliably guide the discovery of inductive invariants for programs with unbounded data structures?
  • RQ4Can superposition-based reasoning in trace logic verify properties that are undecidable or intractable for SMT solvers?
  • RQ5Can the integration of trace logic into Rapid enable automated verification of benchmarks with complex quantified assertions that existing tools fail on?

Key findings

  • The authors successfully verified over 100 benchmarks from the SV-COMP repository, including complex safety properties with quantifier alternations in arrays and integers.
  • The approach proved correctness of a program copying positive elements from one array to another, a property that could not be proven in prior work using similar frameworks.
  • Trace logic's non-recursive axiomatization is both sound and complete with respect to Hoare logic, providing a solid foundation for formal verification.
  • The three trace lemmas are sound and enable automated discovery of invariants needed for proving safety assertions through superposition reasoning.
  • The integration of trace logic with the Vampire theorem prover in the Rapid framework enables fully automated verification of properties that are out of reach for current SMT solvers and transformation-based tools.
  • The method demonstrates scalability and expressiveness beyond existing approaches, particularly in handling existential and universally quantified properties over unbounded data structures.

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.