220 likes | 393 Views
Interpolant Generation without Constructing Resolution Graph. Speaker : Guo-Jhu Huang Advisor : Chun-Yao Wang 200 9 .10.09. Outline. Introduction Preliminary Previous work Algorithm. Introduction – What is Interpolant. Craig Interpolation theorem
E N D
Interpolant Generation without Constructing Resolution Graph Speaker : Guo-Jhu Huang Advisor : Chun-Yao Wang 200 9 .10.09
Outline • Introduction • Preliminary • Previous work • Algorithm
Introduction – What is Interpolant • Craig Interpolation theorem Given two boolean formulas A and B with A ∩ B unsatisfiable, there exist an interpolant I such that • A → I • I ∩ B is unsatisfiable • I refers to only common variables of A and B I B A
Introduction - Application • Interpolation is an important technique on synthesis and verification • Application example – Resubstitution • f is target signal in circuit • A:f-ODC • B:f’-ODC f’ f’ ODC f f f
Preliminary – Resolvent • Resolvent Given two clauses, C1=pAand C2=-pB, where A=l1l2….ln and B=k1k2….km • the resolvent(Cr) of C1 and C2 is the clause AB, and p is called pivot variable • the meaning is C1C2Cr • Example C1=ab, C2=-ac • Cr=bc
Preliminary – Circuit to CNF • = g1(g1g2+c)(g2a*b) = g1(g1(g2+c))’(g2(a*b))’ = g1(g1+g2’)(g1+c’)(g1’+g2+c)(g2+a’+b’)(g2’+a)(g2’+b) a g2 b g1 c
Preliminary – Conflict Driven SAT Solving Assumption Setting Boolean Constraint Propagation • Boolean Constraint Propagation • BCP is repeat implication until there is no clause could be implied • (x+y) , if x is false, then y is implied true • Conflict Analysis • Find the “reason” occurs conflict • Add the reason as the learn clause • Non-chronlogical Backtracking • Backtrack to the decision until the learn clause is not conflict SAT Conflict? All Assign? Conflict Analysis Decision Non-chronlogical Backtracking Assumption Conflict ? UNSAT Conflict Driven SAT Solving
SAT target: A B 1 1 g4 g1 B A g5 g6 g2 g3 x y z Preliminary – Conflict Driven SAT Solving • A case • A=(g1)(g1+g2’)(g1+g3’)(g1’+g2+g3)(g2+x+z’)(g2’+x’)(g2’+z)(g3+x’+y+z)(g3’+x)(g3’+y’)(g3’+z’) • B=(g4)(g4+g5’)(g4+g6’)(g4’+g5+g6)(g5+x’+y’)(g5’+x)(g5’+y)(g6+x+z)(g6’+x’)(g6’+z’)
Preliminary – Conflict Driven SAT Solving Assumption Setting partial clauses A B Boolean Constraint Propagation SAT (g1) (g3’+x) (g1’+g2+g3) (g2’+z) (g2’+x’) (g3’+y’) (g4) (g5’+x) (g4’+g5+g6) (g6’+z’) (g6’+x’) (g5’+y) Conflict? All Assign? x * g1 * g4 → conflict ≡ non-conflict → x’+g1’+g4’ Conflict Analysis Decision (x’+g1’+g4’) g3 y’ g1 Non-chronlogical Backtracking Assumption Conflict ? g2’ conflict x UNSAT g6’ g4 y g5 Conflict Driven SAT Solving
Preliminary – Conflict driven SAT Solving Assumption Setting partial clauses A B Boolean Constraint Propagation SAT (g1) (g3’+x) (g1’+g2+g3) (g2’+z) (g2’+x’) (g3’+y’) (g4) (g5’+x) (g4’+g5+g6) (g6’+z’) (g6’+x’) (g5’+y) Conflict? All Assign? Conflict Analysis Decision (x’+g1’+g4’) g2 z g1 Non-chronlogical Backtracking Assumption Conflict ? g3’ conflict x’ UNSAT g5’ g4 z’ g6 Conflict Driven SAT Solving ( )
Preliminary – Conflict Analysis 1. Imp Graph G 2. Conflict varx A B (g1) (g3’+x) (g1’+g2+g3) (g2’+z) (g2’+x’) (g3’+y’) (g4) (g5’+x) (g4’+g5+g6) (g6’+z’) (g6’+x’) (g5’+y) X = { x , -x } L ={} Present in X Present in L Is X singleton? (x’+g1’+g4’) g 3 y = pop last Implied literal in X c = clause imply y C = literal on c- y Learn clause l = -L + -X y’ g1 g2’ Return l R += c conflict x g6’ Z = { z C | z implied at last level} X+= Z L += C/Z g4 y g5 Conflict Analysis
Preliminary – Conflict Analysis 1. Imp Graph G 2. Conflict varx A B g3 g1 y’ (g1) (g3’+x) (g1’+g2+g3) (g2’+z) (g2’+x’) (g3’+y’) (g4) (g5’+x) (g4’+g5+g6) (g6’+z’) (g6’+x’) (g5’+y) X = { x , -x } L ={} g2’ x g6’ Is X singleton? g4 y g 5 y = pop last Implied literal in X c = clause imply y C = literal on c Learn clause l = -L + -X • (g3y) (g5y) (g4 g6g5) (g3g5) Return l R += c Record l and R (g4g6g3) (g1g2g3) Z = { z C | z implied at last level} X+= Z L += C/Z (xg6) (g1g2g4g6) Resolution Graph (xg1g4g6) (xg2) (xg1g4) Conflict Analysis
SAT target: A B 1 1 g1 g4 B A g3 g2 g6 g5 x y z Preliminary – Resolution Graph • (g3y) (g5y) (g4 g6g5) (g3g5) (g4g6g3) (g1g2g3) (xg1g4) (g4) (g1) (xg1) (xg4) (xg6) (g1g2g4g6) (xg5) (x) (x) (xg3) (xg1g4g6) (g5) (g4g6g5) (xg2) (g3) (g1g2g3) (g6g5) (g2g3) (xg1g4) (g6z) (g6) (g2z) (g2) (z) (z) ( )
Previous work SAT solver Resolution Graph Interpolant Memory overhead Belong to this method: Pudlak’s algorithm and McMillan’s algorithm
Previous work – Pudlak’salgo. • Pudlak’s Algorithm • Leaf Node • Local to A to be const 0 • Local to B to be const 1 • Internal Node • If pivot variable is Local to A • IPT(c1)IPT(c2) • If pivot variable is Local to B • IPT(c1)IPT(c2) • If p is global with p in c1 and –p in c2 • (-p IPT(c1)) (p ITP(c2))
x z -y Previous work – Pudlak’salgo. 1 0 • (g3y) (g5y) (g4 g6g5) (g3g5) (g4g6g3) (g1g2g3) (xg1g4) (g4) (g1) (xg1) (xg4) (g1g2g4g6) (xg2) (y0)(-y1) => -y (xg5) (x) (x) (xg3) (xg6) (xg1g4g6) (g5) (g4g6g5) (g3) (g1g2g3) (g6g5) (g2g3) (xg1g4) (g6z) (g6) (g2z) (g2) (z) (z) ( ) (z(-x(x-y)))(-z (x-y)) ITP(c1) = -x(x-y) ITP(c2) = x-y
Algorithm Assumption Setting Boolean Constraint Propagation SAT SAT solver Conflict? All Assign? Interpolant Conflict Analysis + Sub-interpolant construction Decision Embedded interpolant construction in SAT solving Non-chronlogical Backtracking Assumption Conflict ? UNSAT
Algorithm Main idea Ix x=1 B A x x=0 Ix’
Algorithm • Boundary process, conflict at • Local A, I = constant 0 • Local B, I = constant 1 • Update sub-Interpolant by by ( y , c , I) • IL is Interpolant relate to clause c if c is learn • y is global and cA I = y I • y is global and cB I = y I • y is Local A and cLearn I = I IL • y is Local B and cLearn I = I IL • y is global and cLearn I = ( y I) ( y IL) X = { x , -x } L ={} 1. Imp Graph G 2. Conflict varx I =boundary process Is X singleton? y = pop last Implied literal in X c = clause imply y C = literal on c Learn clause l = -L + -X I = update Sub-Interpolantby ( y , c , I) Return l Record l and I Z = { z C | z implied at last level} X+= Z L += C/Z
Algorithm Apply rule X = { x , -x } L ={} 1. Imp Graph G 2. Conflict varx • 2. y is global and cB I = y I • 1. y is global and cA I = y I No rule I =boundary process I = -y-y = -y I = -y0 = -y Sub-interpolant Is X singleton? 0 -y -y y = pop last Implied literal in X c = clause imply y C = literal on c Learn clause l = -L + -X g3 y’ g1 y= y , c= (g5 ’y) y= y’ , c= (g3 y’) y= g5 , c= (g4 g6’g5) g2’ I = update Sub-Interpolantby ( y , c , I) conflict Return l x Record l and I g6’ Z = { z C | z implied at last level} X+= Z L += C/Z g4 y g5 Record < (-g1-g4 -x) , -y >
Algorithm Record < (-g1-g4 -x) , -y > Apply rule X = { x , -x } L ={} 1. Imp Graph G 2. Conflict varx • 5. y is global and cLearn I = ( y I) ( y IL) • 1. y is global and cA I = y I • 2. y is global and cB I = y I I =boundary process I = (-xz)(x-y) I = zz = z I = z0= z Sub-interpolant Is X singleton? z 0 z (-xz)(x-y) y = pop last Implied literal in X c = clause imply y C = literal on c Learn clause l = -L + -X g2 z g1 y= z , c= (g2z) y= x’ , c= (-g1-g4 -x) y= z’ , c= (g6’z’) g3’ I = update Sub-Interpolantby ( y , c , I) conflict x’ Return l Record l and I g5’ Z = { z C | z implied at last level} X+= Z L += C/Z g4 z’ g6
z x y Algorithm Interpolant : (-xz)(x-y)