660 likes | 702 Vues
Explore the concepts of generating proofs and interpolants from structured formulas using linear inequalities (LI) and equality/uninterpreted functions (EUF). Learn about an interpolating prover and its applications in theorem proving.
                
                E N D
An Interpolating Theorem Prover K.L. McMillan Cadence Berkley Labs
Agenda • Concepts • Inerpolants from Proofs • Linear Inequalities (LI) • Equality and Uninterpreted Functions (EUF) • Combining LI and EUF • An Interpolating Prover • Generating Proofs • Interpolants for Structured Formulas • Applications
Agenda • Concepts • Inerpolants from Proofs • Linear Inequalities (LI) • Equality and Uninterpreted Functions (EUF) • Combining LI and EUF • An Interpolating Prover • Generating Proofs • Interpolants for Structured Formulas • Applications
Concepts • term - linear combination: c0+c1v1+…+cnvn • v1…vn : distinct individual variables • c0…cn : rational constants, c1…cn≠0 • x,y terms: • x is 1+a, y is b-2a => 2x+y is term 2+b • atomic predicate • 0 ≤ x (x is term) • propositional variable
Concepts Cont. • literal - atomic predicate or its negation • clause - (l1 v …v ln) : l1..n: literals •  - set of literals • <>- clause from literal of  • <> - empty clause = False • sequent - ├ : ,set of clauses • conjunctions of entails disjunction of . • lower case letters - formulas • upper case letters - sets of formulas • Example:,├,A U {}├{} UA
Concepts cont. • ┴ - 0≤-1 (False) • : is “interpolant“ (deduction of )
Agenda • Concepts • Inerpolants from Proofs • Linear Inequalities (LI) • Equality and Uninterpreted Functions (EUF) • Combining LI and EUF • An Interpolating Prover • Generating Proofs • Interpolants for Structured Formulas • Applications
Proof Example • Yael’s example: This is a refutation proof
Motivation for interpolant definition • A - 0 ≤ w-x, 0 ≤ x-y • B - 0 ≤ y-z • F = A+B = 0 ≤ w-y • Contribution from A: FA = 0 ≤ w-y • A |= FA • FA,B |= F • Coefficient of w is the same in A and FA • When F= 0 ≤ -1 then FA B
Inequality Interpolation • Definition 1: (A,B) |- 0 ≤ x [x’, , ] • A, B: clause sets • x, x’ : terms • , :formulas such that • A, |= 0 ≤ x’  • B |= and B, |= 0 ≤ x - x’ • ,  B x’, ρ,  A (x-x’) B • For the current system, the formulas  and  are always T.
Soundness • Comb: • Comb: • Condition 3 is trivial
Example • We want to derive an interpolant for (A,B) where: • A - (0≤y-x),(0≤z-y) • B - (0≤x-z-1) • In example:
Solution • A - (0≤y-x),(0≤z-y) • B - (0≤x-z-1) • Step 1,2: • Step 3: • Step 4: • Step 5:
Interpolation syntax for clauses • Definition 2: (A,B) |- <> [] • A, B : clause sets • : literal set • : formula • A |= φ v <\B> • B, φ |= <↓B> •  B and  A • If is empty,  is an interpolant for (A,B).
Resolution(A) Soundness • Condition 1,2:
Resolution(B) Soundness • Condition 1,2:
Soundness • Condition 1: • Definition 1: • DeMorgan:
Soundness • Condition 2: • Definition 1 (condition 2): • Previous + DeMorgan: • Condition 3: • Third condition of definition 1 guaranties that. Because coefficient of every must be 0.
Example • We want to derive an interpolant for (A,B) where: • Step 1: • Step 2:
Example (Cont.) • Step 3: • Step 4: • Result:
Agenda • Concepts • Inerpolants from Proofs • Linear Inequalities (LI) • Equality and Uninterpreted Functions (EUF) • Combining LI and EUF • An Interpolating Prover • Generating Proofs • Interpolants for Structured Formulas • Applications
Proof rules for EUF • terms are: x1…xn fn(x1…xn)
Proof rules for EUF • CONTRA and RES rules the same as in previous system.
Motivation for interpolant definition • =>(x=t1)(t1=t2)…(tn=y) • All equalities (A,B) • At least one global term in  • ‘ - leftmost global term in  (A,B) • ’ - right most global term in  (A,B) • A |= x=‘ and y=’ (everything from the left and right are from A) • There are (tk=…=tm) only from A can be summarized by a single (tk=tm) such that ‘≤tk and tm≤ ’ by location. • tk, tm=are common between A,B
Motivation for interpolant definition •  - will present conjunction of such subchains • A |=  • B,  |= ‘=’ •  consists only from common variables from (A,B) •  is interpolant for x=y • If  not contains global terms  degenerate case  ‘=x and ’=y   = T
Equality Interpulation • Definition 3: (A,B) |- x=y [x’, y’, , ] • A,B : clause sets • x, y, x’, y’: terms • , : formulas • A, |= x=x’ y=y’  • B |= and • x’y andy’x (the degenerate case), or • x‘,y’ Band B,  |=x’=y’ • , B and , B, and if x B then x’ x else x’ A (similarity for y,y’)
More Concepts • ‘(x,y) or : if x B then x else y • (x,y)’ or : if y B then y else x • : if then else T • : if then T else x=y • x(y/z) : if then y else x • :syntactic equality, equality pass contains global variable
Transitivity Rule - Motivation • Solid lines = equalities from A • Dotted lines = equalities from B, • Not degenerate case • x‘= z’  x = z • If y is local then y’,y’’ A else y’ y’’
Transitivity Sound Prove • Condition 1:
Transitivity Sound Prove (cont.) • Condition 2: Suppose B, , ’, y’=y’’
Transitivity Sound Prove (cont.) • Condition 3: Trivial
Transitivity degenerate • Now y’’=z’ is solution for x=z • B, |= y’’=z’
Transitivity Rule (degenerate) - Sound • Condition 1: Suppose A, , ’ • Same for z=z’(y’/y)
Transitivity Rule (degenerate) - Sound • Condition 2: Suppose B, , ’
Transitivity Rule (degenerate) - Sound • Condition 3:
Cong-Rule Soundness • Condition 1:
Cong-Rule Soundness • Condition 2:
Cong-Rule Soundness • Condition 3:
Example • We want to derive an interpolant for f(x)=f(y) A : x=y B : y=z Step 1,2: Two hypotheses Step 3: Step 4: