# SMELS: Sat Modulo Equality with Lazy Superposition Christopher Lynch – Clarkson Duc-Khanh Tran - MPI.

## Presentation on theme: "SMELS: Sat Modulo Equality with Lazy Superposition Christopher Lynch – Clarkson Duc-Khanh Tran - MPI."— Presentation transcript:

SMELS: Sat Modulo Equality with Lazy Superposition Christopher Lynch – Clarkson Duc-Khanh Tran - MPI

Interest Verification problems often reduce to formulas containing mostly ground equations and quantified equations representing properties or theories

Goal Efficient inference system for deciding satisfiability of sets of equational clauses, mostly ground

Assumptions DPLL(cc) most efficient way of solving ground equational clauses Superposition most efficient way of solving nonground equational clauses Develop complete implementable combination of the two methods –DPLL(cc(Sup))

Contents of Talk DPLL(cc) Superposition SMELS: DPLL(cc) with Lazy Superposition Completeness Implementation plans

DPLL(cc) DPLL: Given set of clauses S, tries to build model of S by adding literals one by one DPLL(cc): Given set of equational clauses, tries to build model by adding literals one by one, and checking consistency in background theory (Cong. Closure)

Responsibility of cc Receives set M of (dis)equations Notifies DPLL procedure if M inconsistent –Returns J µ M, justification of inconsistency Clause : J (or alternative) can be added as lemma

Using cc for implication Given M find L where M ² L –And find small J µ M where J ² L DPLL adds : J Ç L (or alternative) as lemma

Example f(a)=b Ç d!=e a=c Ç i!=j d=e Ç g!=h i=j DPLL generates {i=j, a=c, g=h, d=e, f(a)=b} g=h is justification for f(c)=b (not only one) Then g!=h Ç f(c)=b added as lemma

Definition of Justification Let S be set of clauses, M (partial) model Model is set of (dis)equations Let L 2 M j is a function where –j(L) µ M and –S [ j(L) ² L

Summary so far DPLL sends partial model M to cc cc determines consistency of M If M ² L, there 9 just. j(L) It is sound to add : j(L) Ç L Note: We can always have j(L) = {L} –Self-justification

Superposition ¡ Ç u[s] = v ¢ Ç s=t -------------------------------- ( ¡ Ç ¢ Ç u[t] = v) ¾ ¾ = mgu(s,s) and s not variable s ! · t, u[s] ! · v, s=t max, u[s] = v max Also for u[s] != v

Orderings are crucial Without orderings, no hope of termination Example: – : gt(x,0) Ç gt(s(x),0) – gt(c,0) With orderings it immediately halts

SMELS Let S be set of clauses, g(S): ground clauses in S, v(S): nonground clauses in S DPLL receives g(S) and passes M to cc cc passes reduced implied (dis)equations T to Sup Sup performs inferences between T and v(S), justified ground clauses sent to DPLL

Superposition in DPLL(cc(Sup) There are two kinds of Superposition –Superposition among nonground clauses –Superposition among nonground clause and implied (dis)equation from cc (Justified Sup) No Superposition between ground clauses

Nonground Superposition We modify Superposition so that inferences involve maximal literals of nonground part of clause (as opposed to max of entire clause) Equational Factoring and Equation Resolution also involve maximal nonground literal

Example of Nonground Sup Premises –f(g(a))=b Ç g(x)=x Ç f(g(x))=x – f(f(a))=c Ç g(a)=c Ç g(y)=y Conclusion –f(g(a))=b Ç f(f(a))=c Ç g(a)=c Ç g(x)=x Ç f(x)=x

Justified Superposition Between nonground clause and literal L from cc, After Superposition, we add negation of justification Equivalently, a Superposition inference between nonground clause and : j(L) Ç L

Examples of Justified Sup Suppose j(f(a)=b) = {d=e, f(b)=e} Let g(f(c))=c Ç f(x)=x Ç f(x)=g(x) 2 v(S) Then Justified Superposition gives d!=e Ç f(b)!=e Ç g(f(c))=c Ç f(a)=a Ç b=g(a) This is ground, so passed back to DPLL

Example of DPLL(cc(Sup)) p(a,b) = p1 p(c,d) = p2 p(e,f) = p3 p1 = p2 Ç p1 = p3 a != c a != e p(x1,y1) != p(x2,y2) Ç x1= x2

DPLL Input: g(S) = {p(a,b)=p1, p(c,d)=p2, p(e,f)= p3, p1=p2 Ç p1=p3, a != c, a != e} Output: M = {p(a,b)=p1, p(c,d)=p2, p(e,f)= p3, p1=p2, a!=c, a!=e} j(p1=p2) = {p1=p2} For all other L 2 M, j(L) = ;

cc Input: M = {p(a,b)=p1, p(c,d)=p2, p(e,f)= p3, p1=p2, a!=c, a!=e} Output: T = {p(a,b)=p2, p(c,d)=p2, p(e,f)= p3, p1=p2, a!=c, a!=e} j(p(a,b)=p2) = {p1=p2}

Sup Input: T = {p(a,b)=p2, p(c,d)=p2, p(e,f)= p3, p1=p2, a!=c, a!=e} v(S) = {p(x1,y1) != p(x2,y2) Ç x1= x2} Justified Superposition gives {p1!=p2 Ç p2!=p(x2,y2) Ç a=x2, p2!=p(x2,y2) Ç c=x2, p3!=p(x2,y2) Ç e=x2} Also: p1!=p2 Ç a=c

DPLL Input: g(S) = {p(a,b)=p1, p(c,d)=p2, p(e,f)= p3, p1=p2 Ç p1=p3, a != c, a != e, p1!=p2 Ç a=c} Output: M = {p(a,b)=p1, p(c,d)=p2, p(e,f)= p3, p1=p3, a!=c, a!=e} j(p1=p3) = ;

cc Input: M = {p(a,b)=p1, p(c,d)=p2, p(e,f)= p3, p1=p3, a!=c, a!=e} Output: T = {p(a,b)=p3, p(c,d)=p2, p(e,f)= p3, p1=p3, a!=c, a!=e} j(p(a,b)=p3) = ;

Sup Input: T = {p(a,b)=p3, p(c,d)=p2, p(e,f)= p3, p1=p3, a!=c, a!=e} v(S) = {p(x1,y1) != p(x2,y2) Ç x1= x2} Justified Superposition gives a=e

DPLL Input: g(S) = {p(a,b)=p1, p(c,d)=p2, p(e,f)= p3, p1=p2 Ç p1=p3, a != c, a != e, p1!=p2 Ç a=c, a=e} Output: UNSAT

Example 2 Repeat example, suppose that original set did not contain a!=e Then everything is the same up until the last DPLL step

DPLL Input: g(S) = {p(a,b)=p1, p(c,d)=p2, p(e,f)= p3, p1=p2 Ç p1=p3, a != c, p1!=p2 Ç a=c, a=e} Output: M = {p(a,b)=p1, p(c,d)=p2, p(e,f)= p3, p1=p3, a!=c, a=e}

cc Input: M = {p(a,b)=p1, p(c,d)=p2, p(e,f)= p3, p1=p3, a!=c, a=e} Output: T = {p(e,b)=p3, p(c,d)=p2, p(e,f)= p3, p1=p3, c!=e, a=e} All justifications empty

Sup Input: T = {p(e,b)=p3, p(c,d)=p2, p(e,f)= p3, p1=p3, c!=e, a=e} v(S) = {p(x1,y1) != p(x2,y2) Ç x1= x2} Justified Superposition gives nothing new Therefore T is a model modulo v(S)

Schematic Saturation Example theory v(S) is decidable We could use Schematic Saturation to prove the decidability We could also use Schematic Saturation to compile nonground theory and efficiently perform Justified Superposition

Instantiation Resolution + self-justification =Instantiation j(p(a)) = {p(a)} Nonground clause q(x) Ç ~p(x) Justified Resolution gives q(a) Ç ~p(a) As far as we know, first combination of instantiation with ordered resolution

Completeness Suppose S is saturated by SMELS Let M be model of g(S) Then M is v(S) model of g(S)

Completeness Proof Modifed version of BG model generation May have implications for selection rules and goal-directed Superposition Justifications are key

Completeness implies S is SAT implies –Ground model M (modulo v(S)) is generated in finite time, or –M (modulo v(S)) is generated in infinite time S is UNSAT implies –Unsatisfiable ground g(S) is found

Comparisons BE: Uses Eager Superposition (works for some theories) SPASS+T: FOL theorem prover is driver, which calls SMT, not complete InstGen: Instantiates clauses but no orderings Simplify: Instantiates terms but is not complete

Conclusions SMELS = DPLL(cc(Sup)) DPLL sends partial model to cc cc passes reduced implications to Sup Sup handles nonground part using powerful orderings

Future Work Implement using compilation of Justification Superposition using Schematic Saturation Combine with other theories like Linear Arithmetic

Similar presentations