Presentation is loading. Please wait.

Presentation is loading. Please wait.

3/19/2003copyright Brian Williams1 Propositional Logic and Satisfiability Brian C. Williams 16.410-13 November 22 nd, 2004.

Similar presentations


Presentation on theme: "3/19/2003copyright Brian Williams1 Propositional Logic and Satisfiability Brian C. Williams 16.410-13 November 22 nd, 2004."— Presentation transcript:

1 3/19/2003copyright Brian Williams1 Propositional Logic and Satisfiability Brian C. Williams 16.410-13 November 22 nd, 2004

2 3/19/2003copyright Brian Williams2 How Do We Reason About Complex Systems at a Commonsense Level? Helium tank Fuel tankOxidizer tank Main Engines Flow 1 = zero Pressure 1 = nominal Pressure 2 = nominal Acceleration = zero Model using propositional logic. Reason from model to operate, diagnose and repair.

3 3/19/2003copyright Brian Williams3 Propositional Satisfiability Find a truth assignment that satisfies logical sentence T: Reduce sentence T to clausal form. Perform search similar to MAC = (BT+CP) Propositional satisfiability testing: 1990: 100 variables / 200 clauses (constraints) 1998: 10,000 - 100,000 vars / 10^6 clauses Novel applications: e.g. diagnosis, planning, software / circuit testing, machine learning, and protein folding

4 3/19/2003copyright Brian Williams4 Reading Assignment: Propositional Logic & Satisfiability AIMA Ch. 6 – Propositional Logic

5 3/19/2003copyright Brian Williams5 Outline Propositional Logic Syntax Semantics Clausal Reduction Propositional Satisfiability Appendices

6 3/19/2003copyright Brian Williams6 What formal languages exist for describing constraints? Logic: Propositional logictruth of facts First order logicfacts,objects,relations Temporal logictime, …. Modal logicsknowledge, belief … Probabilitydegree of belief Algebravalues of variables

7 3/19/2003copyright Brian Williams7 Logic in General Logics formal languages for representing information such that conclusions can be drawn. Syntax defines the sentences in the language. Semantics defines the “meaning” of sentences;  truth of a sentence in a world.

8 3/19/2003copyright Brian Williams8 Propositional Logic: Syntax Propositions A statement that is true or false (valve v1) (= voltage high) Propositional Sentences (S) S ::= proposition | (NOT S) | (OR S1... Sn) | (AND S1... Sn) Some Defined Constructs (implies S1 S2) => ((not S1) OR S2) (IFF S1 S2) => (AND (IMPLIES S1 S2)(IMPLIES S2 S1))

9 3/19/2003copyright Brian Williams9 Propositional Sentences: Engine Example (mode(E1) = ok implies (thrust(E1) = on if and only if flow(V1) = on and flow(V2) = on)) and (mode(E1) = ok or mode(E1) = unknown) and not (mode(E1) = ok and mode(E1) = unknown) E1 V1V2

10 3/19/2003copyright Brian Williams10 Outline Propositional Logic Syntax Semantics Clausal Reduction Propositional Satisfiability Appendices

11 3/19/2003copyright Brian Williams11 Propositional Logic: Semantics Interpretation I of sentence S assigns true or false to every proposition P of S S = (A or B) and C I = {A=True, B=False, C=True} I = {A=False, B=True, C=False} ABC True False TrueFalseTrue False True FalseTrueFalse True False All Interpretations

12 3/19/2003copyright Brian Williams12 Propositional Logic: Semantics The truth of sentence S wrt interpretation I is defined by a composition of boolean operators applied to I: “Not S” is True iff “S” is False Not SS FalseTrue False

13 3/19/2003copyright Brian Williams13 Propositional Logic: Semantics The truth of sentence S i wrt Interpretation I: “Not S” is True iff “S” is False “S 1 and S 2” is True iff “S 1” is True and “S 2 ” is True “S 1 or S 2 ” is True iff “S 1 ” is True or “S 2 ” is True S1 and S2S1S2 True FalseTrueFalse True False S1 or S2S1S2 True False TrueFalseTrue False

14 3/19/2003copyright Brian Williams14 Propositional Logic: Semantics The truth of sentence S i wrt Interpretation I: “Not S” is True iff “S” is False “S 1 and S 2” is True iff “S 1 ” is True and “S 2 ” is True “S 1 or S 2 ” is True iff “S 1 ” is True or “S 2 ” is True “S 1 ” implies “S 2 ” is True iff “S 1 ” is False or “S 2 ” is True “S 1 ” iff S 2 is True iff “S 1 implies S 2 ” is True and “S 2 implies S 1 ” is True

15 3/19/2003copyright Brian Williams15 Example: Determining the truth of a sentence (mode(E1) = ok implies [(thrust(E1) = on if and only if (flow(V1) = on and flow(V2) = on)) and (mode(E1) = ok or mode(E1) = unknown) and not (mode(E1) = ok and mode(E1) = unknown)]) Interpretation: mode(E1) = ok is True thrust(E1) = on is False flow(V1) = on is True flow(V2) = on is False mode(E1) = unknown is False

16 3/19/2003copyright Brian Williams16 Example: Determining the truth of a sentence (True implies [(False if and only if (True and False)) and (True or False) and not (True and False)]) Interpretation: mode(E1) = ok is True thrust(E1) = on is False flow(V1) = on is True flow(V2) = on is False mode(E1) = unknown is False

17 3/19/2003copyright Brian Williams17 Example: Determining the truth of a sentence (True implies [(False if and only if (True and False)) and (True or False) and not (True and False)]) Interpretation: mode(E1) = ok is True thrust(E1) = on is False flow(V1) = on is True flow(V2) = on is False mode(E1) = unknown is False

18 3/19/2003copyright Brian Williams18 Example: Determining the truth of a sentence (True implies [(False if and only if (True and False)) and (True or False) and not False]) Interpretation: mode(E1) = ok is True thrust(E1) = on is False flow(V1) = on is True flow(V2) = on is False mode(E1) = unknown is False

19 3/19/2003copyright Brian Williams19 Example: Determining the truth of a sentence (True implies [(False if and only if (True and False)) and (True or False) and True]) Interpretation: mode(E1) = ok is True thrust(E1) = on is False flow(V1) = on is True flow(V2) = on is False mode(E1) = unknown is False

20 3/19/2003copyright Brian Williams20 Example: Determining the truth of a sentence (True implies [(False if and only if False) and True and True]) Interpretation: mode(E1) = ok is True thrust(E1) = on is False flow(V1) = on is True flow(V2) = on is False mode(E1) = unknown is False

21 3/19/2003copyright Brian Williams21 Example: Determining the truth of a sentence (True implies [(False if and only if False) and True and True]) Interpretation: mode(E1) = ok is True thrust(E1) = on is False flow(V1) = on is True flow(V2) = on is False mode(E1) = unknown is False

22 3/19/2003copyright Brian Williams22 Example: Determining the truth of a sentence (True implies [(False implies False ) and (False implies False )) and True and True]) Interpretation: mode(E1) = ok is True thrust(E1) = on is False flow(V1) = on is True flow(V2) = on is False mode(E1) = unknown is False

23 3/19/2003copyright Brian Williams23 Example: Determining the truth of a sentence (True implies [(not False or False ) and (not False or False )) and True and True]) Interpretation: mode(E1) = ok is True thrust(E1) = on is False flow(V1) = on is True flow(V2) = on is False mode(E1) = unknown is False

24 3/19/2003copyright Brian Williams24 Example: Determining the truth of a sentence (True implies [(True or False ) and (True or False )) and True and True]) Interpretation: mode(E1) = ok is True thrust(E1) = on is False flow(V1) = on is True flow(V2) = on is False mode(E1) = unknown is False

25 3/19/2003copyright Brian Williams25 Example: Determining the truth of a sentence (True implies [(True and True) and True and True]) Interpretation: mode(E1) = ok is True thrust(E1) = on is False flow(V1) = on is True flow(V2) = on is False mode(E1) = unknown is False

26 3/19/2003copyright Brian Williams26 Example: Determining the truth of a sentence (True implies [True and True and True]) Interpretation: mode(E1) = ok is True thrust(E1) = on is False flow(V1) = on is True flow(V2) = on is False mode(E1) = unknown is False

27 3/19/2003copyright Brian Williams27 Example: Determining the truth of a sentence (True implies True) Interpretation: mode(E1) = ok is True thrust(E1) = on is False flow(V1) = on is True flow(V2) = on is False mode(E1) = unknown is False

28 3/19/2003copyright Brian Williams28 Example: Determining the truth of a sentence (not True or True) Interpretation: mode(E1) = ok is True thrust(E1) = on is False flow(V1) = on is True flow(V2) = on is False mode(E1) = unknown is False

29 3/19/2003copyright Brian Williams29 Example: Determining the truth of a sentence (False or True) Interpretation: mode(E1) = ok is True thrust(E1) = on is False flow(V1) = on is True flow(V2) = on is False mode(E1) = unknown is False

30 3/19/2003copyright Brian Williams30 Example: Determining the truth of a sentence True! Interpretation: mode(E1) = ok is True thrust(E1) = on is False flow(V1) = on is True flow(V2) = on is False mode(E1) = unknown is False If a sentence S evaluates to True in interpretation I, then: I satisfies S I is a Model of S

31 3/19/2003copyright Brian Williams31 Outline Propositional Logic Syntax Semantics Clausal Reduction Propositional Satisfiability Appendices

32 3/19/2003copyright Brian Williams32 Propositional Clauses: A Simpler Form Literal: proposition or its negation B, Not A Clause: disjunction of literals (not A or B or E) Conjunctive Normal Form Phi = (A or B or C) and (not A or B or E) and (not B or C or D) Viewed as a set of clauses

33 3/19/2003copyright Brian Williams33 Reduction to Clausal Form: Engine Example (mode(E1) = ok implies (thrust(E1) = on iff (flow(V1) = on and flow(V2) = on))) and (mode(E1) = ok or mode(E1) = unknown) and not (mode(E1) = ok and mode(E1) = unknown) not (mode(E1) = ok) or not (thrust(E1) = on) or flow(V1) = on; not (mode(E1) = ok) or not (thrust(E1) = on) or flow(V2) = on; not (mode(E1) = ok) or not (flow(V1) = on) or not (flow(V2) = on) or thrust(E1) = on; mode(E1) = ok or mode(E1) = unknown; not (mode(E1) = ok) or not (mode(E1) = unknown);

34 3/19/2003copyright Brian Williams34 Reducing Propositional Formula to Clauses (CNF) See Appendix for Detailed Example: 1) Eliminate IFF and Implies E1 iff E2 => (E1 implies E2) and (E2 implies E1) E1 implies E2 => not E1 or E2 2) Move negations in towards propositions using De Morgan’s Theorem: Not (E1 and E2) => (not E1) or (not E2) Not (E1 or E2) => (not E1) and (not E2) Not (not E1) => E1 3) Move conjunctions out using Distributivity E1 or (E2 and E3) =>(E1 or E2) and (E1 or E3)

35 3/19/2003copyright Brian Williams35 Outline Propositional Logic Syntax Semantics Clausal Reduction Propositional Satisfiability Backtrack Search Unit Propagation DPLL: Unit Propagation + Backtrack Search Appendices

36 3/19/2003copyright Brian Williams36 Propositional Clauses form a Constraint Satisfaction Problem Variables:Propositions Domain:{True, False} Constraints:Clauses that must be true Clause(not A or B or E) A disjunction of Literals Literal:Proposition or its negation Positive LiteralB Negative LiteralNot A

37 3/19/2003copyright Brian Williams37 Propositional Satisfiability An interpretation (truth assignment to all propositions) such that all clauses are satisfied: A clause is satisfied if and only if at least one literal is true. A clause is violated if and only if all literals are false. C1: Not A or B C2: Not C or A C3: Not B or C

38 3/19/2003copyright Brian Williams38 Satisfiability Testing Procedures Reduce to CNF (Clausal Form) then: 1.Apply systematic, complete procedure Depth-first backtrack search (Davis, Putnam, & Loveland 1961) unit propagation, shortest clause heuristic 2.Apply stochastic, incomplete procedure GSAT (Selman et. al 1993) – see Appendix

39 3/19/2003copyright Brian Williams39 Outline Propositional Logic Propositional Satisfiability Backtrack Search Unit Propagation DPLL: Unit Propagation + Backtrack Search Appendices

40 3/19/2003copyright Brian Williams40 Propositional Satisfiability using Backtrack Search Assign true or false to an unassigned proposition. Backtrack as soon as a clause is violated. Example: C1: Not A or B C2: Not C or A C3: Not B or C A F F B C F S S S

41 3/19/2003copyright Brian Williams41 Propositional Satisfiability using Backtrack Search Assign true or false to an unassigned proposition. Backtrack as soon as a clause is violated. Example: C1: Not A or B C2: Not C or A C3: Not B or C A F F B C FT S u S

42 3/19/2003copyright Brian Williams42 Propositional Satisfiability using Backtrack Search Assign true or false to an unassigned proposition. Backtrack as soon as a clause is violated. Example: C1: Not A or B C2: Not C or A C3: Not B or C A F F B C FT T C F S S v

43 3/19/2003copyright Brian Williams43 Propositional Satisfiability using Backtrack Search Assign true or false to an unassigned proposition. Backtrack as soon as a clause is violated. Example: C1: Not A or B C2: Not C or A C3: Not B or C A F F B C FT T C TF S S v

44 3/19/2003copyright Brian Williams44 Propositional Satisfiability using Backtrack Search Assign true or false to an unassigned proposition. Backtrack as soon as a clause is violated. Example: C1: Not A or B C2: Not C or A C3: Not B or C A F F B C FT T C TF B T C F S S v

45 3/19/2003copyright Brian Williams45 Propositional Satisfiability using Backtrack Search Assign true or false to an unassigned proposition. Backtrack as soon as a clause is violated. Example: C1: Not A or B C2: Not C or A C3: Not B or C A F F B C FT T C TF B T C FT C F S S v

46 3/19/2003copyright Brian Williams46 Propositional Satisfiability using Backtrack Search Assign true or false to an unassigned proposition. Backtrack as soon as a clause is violated. Example: C1: Not A or B C2: Not C or A C3: Not B or C A F F B C FT T C TF B T C FT C TF S S S

47 3/19/2003copyright Brian Williams47 Clausal Backtrack Search: Recursive Definition BT(Phi, A) Input: A cnf theory Phi, An assignment A to propositions in Phi Output: A decision of whether Phi is satisfiable. 1. If a clause is violated, Return false; 2. Else If all propositions are assigned, Return true; 3. ElseQ = some unassigned proposition in Phi; 4.Return (BT(Phi, A[Q = True]) or 5. BT(Phi, A[Q = False])

48 3/19/2003copyright Brian Williams48 Outline Propositional Logic Propositional Satisfiability Backtrack Search Unit Propagation DPLL: Unit Propagation + Backtrack Search Appendices

49 3/19/2003copyright Brian Williams49 Unit Propagation Idea: Arc consistency (AC-3) on binary clauses (not A or B) {F} {T,F} ? {T} {T,F} ? Unit resolution rule: If all literals are false save L, then assign true to L: (not A) (not B) (A or B or C) C

50 3/19/2003copyright Brian Williams50 Unit Propagation Examples C1: Not A or B C2: Not C or A C3: Not B or C C4: A C4 A True C1 B True C3 C True Satisfied

51 3/19/2003copyright Brian Williams51 Unit Propagation Examples C1: Not A or B C2: Not C or A C3: Not B or C C4: A C4’: Not B C1C3C4 C1 C2 C4’ A True B C A False B C C4 A True Satisfied

52 3/19/2003copyright Brian Williams52 C 1 : ¬r  q  p C 2 : ¬ p  ¬ t r true q false p t procedure propagate(C)// C is a clause if all literals in C are false except L, and L is unassigned then assign true to L and record C as a support for L and for each clause C’ mentioning “not L”, propagate(C’) end propagate Unit Propagation

53 3/19/2003copyright Brian Williams53 C 1 : ¬r  q  p C 2 : ¬ p  ¬ t r true q false p t procedure propagate(C)// C is a clause if all literals in C are false except L, and L is unassigned then assign true to L and record C as a support for L and for each clause C’ mentioning “not L”, propagate(C’) end propagate Unit Propagation

54 3/19/2003copyright Brian Williams54 C 1 : ¬r  q  p rq p C 2 : ¬ p  ¬ t truefalse true t procedure propagate(C)// C is a clause if all literals in C are false except L, and L is unassigned then assign true to L and record C as a support for L and for each clause C’ mentioning “not L”, propagate(C’) end propagate Unit Propagation

55 3/19/2003copyright Brian Williams55 C 1 : ¬r  q  p rq p C 2 : ¬ p  ¬ t truefalse true t procedure propagate(C)// C is a clause if all literals in C are false except L, and L is unassigned then assign true to L and record C as a support for L and for each clause C’ mentioning “not L”, propagate(C’) end propagate Unit Propagation

56 3/19/2003copyright Brian Williams56 rq p truefalse true procedure propagate(C)// C is a clause if all literals in C are false except L, and L is unassigned then assign true to L and record C as a support for L and for each clause C’ mentioning “not L”, propagate(C’) end propagate C 2 : ¬ p  ¬ t t C 1 : ¬r  q  p Unit Propagation

57 3/19/2003copyright Brian Williams57 rq p C 2 : ¬ p  ¬ t truefalse true t false procedure propagate(C)// C is a clause if all literals in C are false except L, and L is unassigned then assign true to L and record C as a support for L and for each clause C’ mentioning “not L”, propagate(C’) end propagate C 1 : ¬r  q  p Unit Propagation

58 3/19/2003copyright Brian Williams58 Outline Propositional Logic Propositional Satisfiability Backtrack Search Unit Propagation DPLL: Unit Propagation + Backtrack Search Appendices

59 3/19/2003copyright Brian Williams59 How Do We Combine Unit Resolution and Back Track Search ? Backtrack Search Assign true or false to an unassigned proposition. Backtrack as soon as a clause is violated. Theory is satisfiable if assignment is complete. Example: C1: Not A or B C2: Not C or A C3: Not B or C A FT B FT C FT C FT B FT CC FTFT  Similar to MAC and Forward Checking:  Perform limited form of inference  apply inference rule after assigning each variable.

60 3/19/2003copyright Brian Williams60 Propositional Satisfiability by DPLL [Davis, Putnam, Logmann, Loveland, 1962] Initially: Unit propagate. Repeat: 1.Assign true or false to an unassigned proposition. 2.Unit propagate. 3.Backtrack as soon as a clause is violated. 4.Satisfiable if assignment is complete. Propagate: C = F B = F A F Example: C1: Not A or B C2: Not C or A C3: Not B or C S S S

61 3/19/2003copyright Brian Williams61 Initially: Unit propagate. Repeat: 1.Assign true or false to an unassigned proposition. 2.Unit propagate. 3.Backtrack as soon as a clause is violated. 4.Satisfiable if assignment is complete. Propagate: C = F B = F A F T Propagate: B = T C = T Example: C1: Not A or B C2: Not C or A C3: Not B or C S S S Propositional Satisfiability by DPLL [Davis, Putnam, Logmann, Loveland, 1962]

62 3/19/2003copyright Brian Williams62 DPLL Procedure [Davis, Putnam Logmann, Loveland, 1962] DPLL(Phi,A) Input: A cnf theory Phi, An assignment A to propositions in Phi Output: A decision of whether Phi is satisfiable. 1. A’ = propagate(Phi); 2. If a clause is violated given A’ return(false); 3. Else if all propositions in A’ are assigned, return(true); 4. ElseQ = some unassigned proposition in Phi; 6.Return (DPLL(Phi, A’[Q = True]) or 7. DPLL(Phi, A’[Q = False])

63 3/19/2003copyright Brian Williams63 Satisfiability Testing Procedures Reduce to CNF (Clausal Form) then: Apply systematic, complete procedure Depth-first backtrack search (Davis, Putnam, & Loveland 1961) unit propagation, shortest clause heuristic State-of-the-art implementations: ntab (Crawford & Auton 1997) itms (Nayak & Williams 1997) many others! See SATLIB 1998 / Hoos & Stutzle Apply stochastic, incomplete procedures GSAT (Selman et. al 1993) Walksat (Selman & Kautz 1993) greedy local search + noise to escape local minima

64 3/19/2003copyright Brian Williams64 Required Appendices You are responsible for reading and knowing this material: 1. Characteristics of DPLL 2. Local Search using GSAT 3. Reduction to Clausal Form

65 3/19/2003copyright Brian Williams65

66 3/19/2003copyright Brian Williams66

67 3/19/2003copyright Brian Williams67

68 3/19/2003copyright Brian Williams68 Intuition At low ratios: few clauses (constraints) many assignments easily found At high ratios: many clauses inconsistencies easily detected

69 3/19/2003copyright Brian Williams69 Fraction of Formulae Unsatisfied Phase Transitions for Different Numbers of Variables

70 3/19/2003copyright Brian Williams70 Phase transition 2-, 3-, 4-, 5-, and 6-SAT

71 3/19/2003copyright Brian Williams71 Required Appendices You are responsible for reading and knowing this material: 1. Characteristics of DPLL 2. Local Search using GSAT 3. Reduction to Clausal Form

72 3/19/2003copyright Brian Williams72 Incremental Repair (min-conflict heuristic) 1. Initialize a candidate solution using “greedy” heuristic – get solution “near” correct one. 2. Select a variable in conflict and assign it a value that minimizes the number of conflicts (break ties randomly). R,G,B GR, G Graph Coloring Initial Domains Different-color constraint V1V1 V2V2 V3V3 Spike Hubble Telescope Scheduler [Minton et al.]

73 3/19/2003copyright Brian Williams73 GSAT C1: Not A or B C2: Not C or Not A C3: or B or Not C C1, C2, C3 violated A True B False C True C3 violated False C2 violated True C1 violated False 1.Init: Pick random assignment 2.Check effect of flipping each assignment, counting violated clauses. 3.Pick assignment with fewest violations, 4.End if consistent, Else goto 2

74 3/19/2003copyright Brian Williams74 C1: Not A or B C2: Not C or Not A C3: or B or Not C C1 violated A True B False C Satisfied False Satisfied True C1,C2,C3 violated True 1.Init: Pick random assignment 2.Check effect of flipping each assignment, counting violated clauses. 3.Pick assignment with fewest violations, 4.End if consistent, Else goto 2 GSAT

75 3/19/2003copyright Brian Williams75 C1: Not A or B C2: Not C or Not A C3: or B or Not C Satisfied A True B C False 1.Init: Pick random assignment 2.Check effect of flipping each assignment, counting violated clauses. 3.Pick assignment with fewest violations, 4.End if consistent, Else goto 2 GSAT Problem: Pure hill climbers get stuck in local minima. Solution: Add random moves to get out of minima (WalkSAT)

76 3/19/2003copyright Brian Williams76 Required Appendices You are responsible for reading and knowing this material: 1. Local Search using GSAT 2. Characteristics of DPLL 3. Reduction to Clausal Form

77 3/19/2003copyright Brian Williams77 Reduction to Clausal Form: Engine Example (mode(E1) = ok implies (thrust(E1) = on iff flow(V1) = on and flow(V2) = on)) and (mode(E1) = ok or mode(E1) = unknown) and not (mode(E1) = ok and mode(E1) = unknown) not (mode(E1) = ok) or not (thrust(E1) = on) or flow(V1) = on; not (mode(E1) = ok) or not (thrust(E1) = on) or flow(V2) = on; not (mode(E1) = ok) or not (flow(V1) = on) or not (flow(V2) = on) or thrust(E1) = on; mode(E1) = ok or mode(E1) = unknown; not (mode(E1) = ok) or not (mode(E1) = unknown);

78 3/19/2003copyright Brian Williams78 Reducing Propositional Formula to Clauses (CNF) 1) Eliminate IFF and Implies E1 iff E2 => (E1 implies E2) and (E2 implies E1) E1 implies E2 => not E1 or E2

79 3/19/2003copyright Brian Williams79 Eliminate IFF: Engine Example (mode(E1) = ok implies (thrust(E1) = on iff (flow(V1) = on and flow(V2) = on))) and (mode(E1) = ok or mode(E1) = unknown) and not (mode(E1) = ok and mode(E1) = unknown) (mode(E1) = ok implies ((thrust(E1) = on implies (flow(V1) = on and flow(V2) = on)) and ((flow(V1) = on and flow(V2) = on) implies thrust(E1) = on))) and (mode(E1) = ok or mode(E1) = unknown) and not (mode(E1) = ok and mode(E1) = unknown)

80 3/19/2003copyright Brian Williams80 Eliminate Implies: Engine Example (mode(E1) = ok implies ((thrust(E1) = on implies (flow(V1) = on and flow(V2) = on)) and ((flow(V1) = on and flow(V2) = on) implies thrust(E1) = on))) and (mode(E1) = ok or mode(E1) = unknown) and not (mode(E1) = ok and mode(E1) = unknown) (not (mode(E1) = ok) or ((not (thrust(E1) = on) or (flow(V1) = on and flow(V2) = on)) and (not (flow(V1) = on and flow(V2) = on)) or thrust(E1) = on))) and (mode(E1) = ok or mode(E1) = unknown) and not (mode(E1) = ok and mode(E1) = unknown)

81 3/19/2003copyright Brian Williams81 Reducing Propositional Formula to Clauses (CNF) 2) Move negations in towards propositions using De Morgan’s Theorem: Not (E1 and E2) => (not E1) or (not E2) Not (E1 or E2) => (not E1) and (not E2) Not (not E1) => E1

82 3/19/2003copyright Brian Williams82 Move Negations In: Engine Example (not (mode(E1) = ok) or ((not (thrust(E1) = on) or (flow(V1) = on and flow(V2) = on)) and (not (flow(V1) = on and flow(V2) = on)) or thrust(E1) = on))) and (mode(E1) = ok or mode(E1) = unknown) and not (mode(E1) = ok and mode(E1) = unknown) (not (mode(E1) = ok) or ((not (thrust(E1) = on) or (flow(V1) = on and flow(V2) = on)) and (not (flow(V1) = on) or not (flow(V2) = on)) or thrust(E1) = on) ) and (mode(E1) = ok or mode(E1) = unknown) and (not (mode(E1) = ok) or not (mode(E1) = unknown)))

83 3/19/2003copyright Brian Williams83 Reducing Propositional Formula to Clauses (CNF) 3) Move conjunctions out using distributivity E1 or (E2 and E3) =>(E1 or E2) and (E1 or E3)

84 3/19/2003copyright Brian Williams84 Move Conjunctions Out: Engine Example (not (mode(E1) = ok) or ((not (thrust(E1) = on) or (flow(V1) = on and flow(V2) = on)) and (not (flow(V1) = on) or not (flow(V2) = on) or thrust(E1) = on))) and (mode(E1) = ok or mode(E1) = unknown) and (not (mode(E1) = ok) or not (mode(E1) = unknown)) (not (mode(E1) = ok) or (((not (thrust(E1) = on) or flow(V1) = on) and (not (thrust(E1) = on) or flow(V2) = on)) and (not (flow(V1) = on) or not (flow(V2) = on) or thrust(E1) = on))) and (mode(E1) = ok or mode(E1) = unknown) and (not (mode(E1) = ok) or not (mode(E1) = unknown))

85 3/19/2003copyright Brian Williams85 Move Conjunctions Out: Engine Example (not (mode(E1) = ok) or (((not (thrust(E1) = on) or flow(V1) = on) and (not (thrust(E1) = on) or flow(V2) = on)) and (not (flow(V1) = on) or not (flow(V2) = on) or thrust(E1) = on))) and (mode(E1) = ok or mode(E1) = unknown) and (not (mode(E1) = ok) or not (mode(E1) = unknown)) (not (mode(E1) = ok) or not (thrust(E1) = on) or flow(V1) = on) and (not (mode(E1) = ok) or not (thrust(E1) = on) or flow(V2) = on)) and (not (mode(E1) = ok) or not (flow(V1) = on) or not (flow(V2) = on) or thrust(E1) = on) and (mode(E1) = ok or mode(E1) = unknown) and (not (mode(E1) = ok) or not (mode(E1) = unknown))

86 3/19/2003copyright Brian Williams86 Reducing Propositional Formula to Clauses (CNF) 1) Eliminate IFF and Implies E1 iff E2 => (E1 implies E2) and (E2 implies E1) E1 implies E2 => not E1 or E2 2) Move negations in towards propositions using De Morgan’s Theorem: Not (E1 and E2) => (not E1) or (not E2) Not (E1 or E2) => (not E1) and (not E2) Not (not E1) => E1 3) Move conjunctions out using Distributivity E1 or (E2 and E3) =>(E1 or E2) and (E1 or E3)


Download ppt "3/19/2003copyright Brian Williams1 Propositional Logic and Satisfiability Brian C. Williams 16.410-13 November 22 nd, 2004."

Similar presentations


Ads by Google