Back to Program Verification Index | Previous: (y-15) Correctness via Assert Statements | Next: (y-17) Infeasibility Proofs and CEGAR

Mental Model for Abstractions

  • The State Space Explosion: Programs have too many states to check individually. Abstraction allows us to group many concrete states into one “abstract” state.
  • Predicates as Buckets: We use a finite set of formulas (Predicates) to categorize states. For example, if , we only care if is positive or not.
    • Finite Approximation: This analogy helps understand how we map an infinite number of concrete states (all possible values of ) into a finite set of “buckets” defined by our predicates.
  • Abstract Reachability Graph (ARG): A graph where each node is an Abstract Configuration . It represents “at location , the program state satisfies .”
  • Safety Proof: If we can build an ARG where no node has a satisfiable , we have proven the program safe.

Abstract Strongest Post ()

The standard can produce complex formulas. The Abstract Strongest Post forces the result to be a conjunction of formulas from our set .

  • Intuition: We take the real strongest postcondition and “round it up” to the nearest combination of predicates we already know.
  • This ensures the number of possible abstract states remains finite.

Abstract Reachability Graphs (ARG)

An ARG is a way to systematically explore the abstract state space of a program.

Formal Definition

An ARG is a pair where:

  • : A set of abstract configurations , where is a program location and is a set of states (represented by a formula).
  • : A set of abstract transitions .

Construction Algorithm

  1. Start at the initial location with the precondition: .
  2. Explore: For each outgoing edge in the CFG, compute the new abstract state using .
  3. Worklist: Continue until no new abstract configurations are discovered.

Safety in the ARG

An ARG is a Safety Proof if:

  • For every location (an error location), the corresponding formula in is false.
  • This means that within our abstraction , it is impossible to reach the error state.

💡 Intuition: Precision vs. Scalability

  • If is too small (e.g., ), the ARG will be small but might say the program is “unsafe” even if it’s actually safe (a False Positive).
  • If is too large, the ARG might be too big for a computer to handle, but it will be more precise.

Summary

  1. Abstraction simplifies the program by focusing on a few key properties (Predicates).
  2. keeps the reasoning within the bounds of our chosen predicates.
  3. ARG is the graph of all reachable abstract states.
  4. A program is Safe if its ARG never reaches an error state with a satisfiable formula.
  5. The Guesswork: The main challenge in verification is finding a “good” set that is precise enough to prove safety but small enough to be efficient.

Self-Check

  1. What role does the predicate set play in abstract interpretation, and why must it be finite?
  1. Define and explain what “rounding up” means.
  1. What are the two components of an ARG node, and what does the node mean?
  1. Under what condition does an ARG constitute a safety proof?
  1. Describe the trade-off involved in choosing the predicate set .

Back to Program Verification Index | Previous: (y-15) Correctness via Assert Statements | Next: (y-17) Infeasibility Proofs and CEGAR | (y) Return to Notes | (y) Return to Home