90 likes | 255 Views
Propositional SAT. The search for a model of a given proposition. Propositional Logic. ATOM: set of propositional atoms P,Q,... Boolean operators: ¬, or, and etc. Most used: clauses, see Def. 2.7.1 Literal: atom or negated atom Clause, examples: c = {P, ¬Q,¬R}, d = {A}
E N D
Propositional SAT The search for a model of a given proposition
Propositional Logic • ATOM: set of propositional atoms P,Q,... • Boolean operators: ¬, or, and etc. • Most used: clauses, see Def. 2.7.1 • Literal: atom or negated atom • Clause, examples: c = {P, ¬Q,¬R}, d = {A} • Notation: c\Q = {P,¬R}, d\A = {} etc. • Clause set C
Idea: a partial interpretation can make a clause set false • Partial mapping I: ATOM - - -> {0,1} • I(¬p) = I(p) provided I(p) is defined • I({L1 ,…,Lk}) = 1 if some I(Li) = 1, = 0 if allI(Li) = 0, undefined otherwise • I(C) = 1 if I(c) = 1 for all c in C = 0 if I(c) = 0 for some c in C undefined otherwise
Extending partial interpretations • I2 extends I1 if I2(p) = I1(p) for all p in ATOM such that I1(p) is defined • Extensions preserves truth and falsity of clauses (but not undefinedness, of course!) • For all p in ATOM and clause sets C, partial interpretation I can be extended to a model of C iff either I[p:=0] or I[p:=1] can be extended to a model of C (maybe both)
Naive algorithm, example Clause set (unsatisfiable): {P1,Q1, A}, {¬P1,Q1}, {P1, ¬Q1}, {¬P1, ¬Q1}, {P2,Q2, ¬A}, {¬P2,Q2}, {P2, ¬Q2}, {¬P2, ¬Q2} Atom order (arbitrary): P1,Q1, A, P2,Q2 Development on the blackboard
Relevance analysis • If an atom is not used, you don’t have to consider an alternative truth value for it • Trivial example: clauses {P},{Q},{¬Q}, developed on the blackboard • Let C be a clause set not containing p. If I[p:=0] can’t be extended to a model of C, then neither I[p:=1] can.
Forward reasoning: one literal rule • If I(c\p) = 0 for some p occurring in c, then there is at most one extension of I which is a model of c (and we know its value for p!) • Combined with relevancy analysis: c as above is a parent clause of p wrt I • Development of the running example on the blackboard
Clause learning • It is a waste to throw away all the knowled-ge obtained by the forward reasoning. This knowledge can elegantly be recovered for future use (beware: this can also slow down the algorithm). • In the running example, {P2, ¬Q2} led to a contradiction with P2 = 0 and Q2 inferred by {P2,Q2, ¬A}: learn {P2, ¬A} by resolution!