Download Verification Architecture Lecture 15: Error Conditions and Satisfiability Checking and more Study notes Computer Graphics in PDF only on Docsity! Satisfying Error Conditions 3 Lecture 15 24 Feb 2004 290G - Lecture 15 1 Overview of Verification Architecture 24 Feb 2004 290G - Lecture 15 2 Program Specification Error Condition Verification Condition SAT solver Davis-Putnam negate conjunction of literals checkSatLitsArith EC satisfiability checker checkSatLits checkSatLitsEquality Nelson-Oppen cooperating decision procedures checkSatLitsArrays checkSatLitsArith: Difference Constraints 24 Feb 2004 290G - Lecture 15 5 • A special case of linear arithmetic • All constraints of the form: x + c <= y • c is a constant • Special variable z representing 0 • Example – x <= y – y+4 <= w – w-2 <= x – w+1 < =z x y w 0 4-2 z 1 checkSatLitsEquality 24 Feb 2004 290G - Lecture 15 6 • Consider: g(g(g(x)) = x . g(g(g(g(g(x))))) = x . g(x) ≠ x x g g g g g g g x g g g g g x g g g g g g x g g Contra- diction Overview of Verification Architecture 24 Feb 2004 290G - Lecture 15 7 Program Specification Error Condition Verification Condition SAT solver Davis-Putnam negate conjunction of literals checkSatLitsArith EC satisfiability checker checkSatLits checkSatLitsEquality Nelson-Oppen cooperating decision procedures checkSatLitsArrays Overview of Verification Architecture 24 Feb 2004 290G - Lecture 15 10 Program Specification Error Condition Verification Condition SAT solver Davis-Putnam negate conjunction of literals checkSatLitsArith EC satisfiability checker checkSatLits checkSatLitsEquality Nelson-Oppen cooperating decision procedures checkSatLitsArrays Theory of Arrays 24 Feb 2004 290G - Lecture 15 11 • Syntax and informal semantics: – If E denotes an address and µ a heap state then: – sel(µ,E) denotes the contents of memory cell – upd(µ,E,V) denotes a new heap state obtained from µ by writing V at address E • Decision procedure implements following rule – what if x = y is unknown? x = y ⇒ sel(upd(µ, x, v), y) = v x ≠ y ⇒ sel(upd(µ, x, v), y) = sel(µ, y) Theory of Arrays 24 Feb 2004 290G - Lecture 15 12 • Syntax and informal semantics: – If E denotes an address and µ a heap state then: – sel(µ,E) denotes the contents of memory cell – upd(µ,E,V) denotes a new heap state obtained from µ by writing V at address E • Decision procedure implements following rule – what if x = y is unknown? – non-convex theory: input facts entail disjunction of equalities, but do not entail any individual equality – can add SAT literal {x=y} x ≠ y - sel(upd(µ, x, v), y) = v x = y - sel(upd(µ, x, v), y) = sel(µ, y)