View stunning SlideShares in full-screen with the new iOS app!Introducing SlideShare for AndroidExplore all your favorite topics in the SlideShare appGet the SlideShare app to Save for Later — even offline
View stunning SlideShares in full-screen with the new Android app!View stunning SlideShares in full-screen with the new iOS app!
1.
CS1502 Formal Methods in Computer Science Lecture Notes 10 Resolution and Horn Sentences
2.
Resolution Theorem ProvingMethod for searching for proofs automaticallySentences are translated into CNF, and then tosets of clausesAt each step, a new clause is derived from twoclauses you already haveProof steps all use the same ruleIf reach (_|_), sentences were not satisfiableStart: premises + negation of goalEnd: if reach , premises |= goal
3.
Resolution Theorem ProvingMethod for searching for proofs automaticallySentences are translated into CNF, and then tosets of clausesAt each step, a new clause is derived from twoclauses you already haveProof steps all use the same ruleIf reach (_|_), sentences were not satisfiableStart: premises + negation of goalEnd: if reach , premises |= goal
4.
Conversion to Clausal FormUse P Q equiv ~P v Q to remove Use P Q equiv ((~P v Q) ^ (~Q v P)) to remove New 1st Step! We hadn’t done conditionals yetUse DeMorgan’s laws and ~Elim to move ~ as far inwardas possible (gives NNF)Use the distributive laws until the sentence is in CNF
5.
Clausal FormGiven a sentence S written in CNF S = ( ) ∧( ) ∧ . . . ∧ ( )Convert each ( ) into a clause - a setconsisting of each of the literals in ( ).Example: S= (A) ∧ (¬B ∨ C ∨ D) ∧ (¬A∨ D)Clauses are: {A}, {¬ B, C, D}, {¬ A, D}
6.
Resolution Theorem ProvingMethod for searching for proofs automaticallySentences are translated into CNF, and then to sets ofclausesAt each step, a new clause is derived from two clausesyou already haveProof steps all use the same ruleIf reach (_|_), sentences were notsatisfiableStart: premises + negation of goalEnd: if reach , premises |= goal
7.
Satisfying a Set of ClausesAssigning truth-values to the atomicsentences so the CNF sentence the setcorresponds to is true.{{A, ¬C, D}, {C},{¬A},{A, D}} is satisfied by A = False C = True D = True
8.
Empty Clause{} denoted by .The empty clause is not satisfiableWe want {{A}, {¬ A}} to lead to {} ()The basic resolution step involves “canceling”pos and neg matching literals from two clausesSo, we derive {} () from {{A}, {¬ A}}
10.
Resolution Theorem ProvingMethod for searching for proofs automaticallySentences are translated into CNF, and then tosets of clausesAt each step, a new clause is derived from twoclauses you already haveProof steps all use the same ruleIf reach (_|_), sentences were not satisfiableStart: premises + negation of goalEnd: if reach , premises |= goal
13.
ResolventClause R is a resolvent of clauses C 1 andC2 if there is a literal in C1 whose negationis in C2 and R consists of all the remainingliterals in either clause.Example: {A, C , ¬D} and {B, ¬C} haveresolvent {A, B, ¬D}
14.
Resolution Theorem ProvingMethod for searching for proofs automaticallySentences are translated into CNF, and then tosets of clausesAt each step, a new clause is derived from twoclauses you already haveProof steps all use the same ruleIf reach (_|_), sentences were notsatisfiableStart: premises + negation of goalEnd: if reach , premises |= goal
15.
Resolution TheoremFor any set of clauses that are notsatisfiable, it is possible to arrive at theempty clause by using successiveresolutions.
16.
Resolution Theorem ProvingMethod for searching for proofs automaticallySentences are translated into CNF, and then to sets ofclausesAt each step, a new clause is derived from two clausesyou already haveProof steps all use the same ruleIf reach (_|_), sentences were not satisfiableStart: premises + negation of goalEnd: if reach , premises |= goal
17.
Using Resolution to Determine Validity of ArgumentsQ is a logical consequence of P1, P2, …,Pn iff P1 ^ P2 ^ … ^ Pn ^ ~Q is notsatisfiableFor sentences in clausal form:Q is a logical consequence of a set ofclauses S iff S ∪ {¬Q} is not satisfiable.So, convert premises + negation of goal toclausal form, and do resolution steps, trying toreach {} ()
20.
ExampleModus PonesP→Q ¬P∨Q or {¬P,Q}P {P}Q negate to get {¬Q}Apply resolution: {¬P,Q} { P} { Q} { ¬Q}
21.
What is a Horn sentence?A positive literal is any literal that is notpreceded with a ¬. For example, Cube(b)and P are positive literals.A sentence S is a Horn sentence if andonly if it is in CNF and every conjunct hasat most one positive literal.
22.
Examples(A ∨ ¬B ∨ ¬C) ∧ (¬A ∨ ¬B) Horn sentence(A ∨ ¬B ∨ C) ∧ (D) Not Horn sentence(A ∧ B) ∨ (¬C ∧ ¬D) Horn sentence (A ∨ ¬C) ∧ (B ∨ ¬C) ∧ (A ∨ ¬D) ∧ (B ∨ ¬D)
23.
Alternate Form of Horn Conjunct¬A1∨ ¬A2∨...∨ ¬An∨ B ¬(A1 ∧ A2 ∧... ∧ An) ∨ B (A1 ∧ A2 ∧... ∧ An) → B B :- A1, A2, …, An. Conditional Form In Prolog: of HornRule sentence B if A1, A2, …, An
24.
Special CasesNo positive literal¬A1∨ ¬A2∨...∨ ¬An In Prolog, this is a query!(A1 ∧ A2 ∧... ∧ An) → FalseNo negative literalsB In Prolog, this True → B is a fact!
25.
Why are Horn sentences important?Very efficient algorithms exist for determining if aset of Horn sentences is satisfiable
26.
CNF to PROLOG¬A ∨ B ∨ ¬C is ¬(A∧C) ∨ B is (A ∧ C)→BB :- A, C.A.C.Query: :- B.Answer: Yes.
27.
Example Prolog Programgrandfather(X,Y) :- father(X,Z), father(Z,Y).grandfather(X,Y) :- father(X,Z), mother(Z,Y).mother(ann,bill).father(carl,ed).father(nick,ann).father(ed,sam).
Views
Actions
Embeds 0
Report content