159.302lecture 159.302 lecture propositional logic syntax 1 source: mit opencourseware
TRANSCRIPT
![Page 1: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/1.jpg)
159.302159.302 LECTURELECTURE
Propositional Logic Propositional Logic SyntaxSyntax
1
Source: MIT OpenCourseWare
![Page 2: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/2.jpg)
Propositional Logic What is a logic?
A formal language
![Page 3: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/3.jpg)
Propositional Logic What is a logic?
A formal language
• Syntax – what expressions are legal
![Page 4: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/4.jpg)
Propositional Logic What is a logic?
A formal language
• Syntax – what expressions are legal
• Semantics – what legal expressions mean
![Page 5: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/5.jpg)
Propositional Logic What is a logic?
A formal language
• Syntax – what expressions are legal
• Semantics – what legal expressions mean
• Proof System – a way of manipulating syntactic expressions to get other syntactic expressions (which will tell us something new)
![Page 6: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/6.jpg)
Propositional Logic What is a logic?
A formal language
• Syntax – what expressions are legal
• Semantics – what legal expressions mean
• Proof System – a way of manipulating syntactic expressions to get other syntactic expressions (which will tell us something new)
Why proofs?
• Two kinds of inferences an agent might want to make:
![Page 7: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/7.jpg)
Propositional Logic What is a logic?
A formal language
• Syntax – what expressions are legal
• Semantics – what legal expressions mean
• Proof System – a way of manipulating syntactic expressions to get other sytactic expressions (which will tell us something new)
Why proofs?
• Two kinds of inferences an agent might want to make:
• Multiple percepts => conclusions about the world
![Page 8: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/8.jpg)
Propositional Logic What is a logic?
A formal language
• Syntax – what expressions are legal
• Semantics – what legal expressions mean
• Proof System – a way of manipulating syntactic expressions to get other sytactic expressions (which will tell us something new)
Why proofs?
• Two kinds of inferences an agent might want to make:
• Multiple percepts => conclusions about the world
• Current state & operator => properties of next state
![Page 9: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/9.jpg)
Propositional Logic
Syntax: what you’re allowed to write
• for( thing t=fizz; t == fuzz; t++ ){…}
![Page 10: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/10.jpg)
Propositional Logic
Syntax: what you’re allowed to write
• for(thing t=fizz; t == fuzz; t++){…}
• Colorless green ideas sleep furiously.
![Page 11: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/11.jpg)
Propositional Logic
Syntax: what you’re allowed to write
• for(thing t=fizz; t == fuzz; t++){…}
• Colorless green ideas sleep furiously.
Sentences (wwfs: well-formed formulas)
![Page 12: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/12.jpg)
Propositional Logic
Syntax: what you’re allowed to write
• for(thing t=fizz; t == fuzz; t++){…}
• Colorless green ideas sleep furiously.
Sentences (wwfs: well-formed formulas)
• true and false are sentences
![Page 13: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/13.jpg)
Propositional Logic
Syntax: what you’re allowed to write
• for(thing t=fizz; t == fuzz; t++){…}
• Colorless green ideas sleep furiously.
Sentences (wwfs: well-formed formulas)
• true and false are sentences
• Propositional variables are sentences: P, Q, R, Z
![Page 14: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/14.jpg)
Propositional Logic
Syntax: what you’re allowed to write
• for(thing t=fizz; t == fuzz; t++){…}
• Colorless green ideas sleep furiously.
Sentences (wwfs: well-formed formulas)
• true and false are sentences
• Propositional variables are sentences: P, Q, R, Z
• If φ and ψ are sentences, then so are
,,,),(
![Page 15: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/15.jpg)
Propositional Logic
Syntax: what you’re allowed to write
• for(thing t=fizz; t == fuzz; t++){…}
• Colorless green ideas sleep furiously.
Sentences (wwfs: well-formed formulas)
• true and false are sentences
• Propositional variables are sentences: P, Q, R, Z
• If φ and ψ are sentences, then so are
,,,),(
• Nothing else is a sentence
![Page 16: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/16.jpg)
Precedence
![Page 17: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/17.jpg)
159.302159.302 LECTURELECTURE
Propositional Logic Propositional Logic SemanticsSemantics
2
Source: MIT OpenCourseWare
![Page 18: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/18.jpg)
Propositional Logic
Semantics
• Meaning of a sentence is truth value {t, f}
![Page 19: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/19.jpg)
Propositional Logic
Semantics
• Meaning of a sentence is truth value {t, f}
• Interpretation is an assignment of truth values to the propositional variables
holds( , i) [Sentence is t in interpretation i]
![Page 20: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/20.jpg)
Propositional Logic
Semantics
• Meaning of a sentence is truth value {t, f}
• Interpretation is an assignment of truth values to the propositional variables
holds( , i) [Sentece is t in interpretation i]
fails( , i) [Sentence is f in interpretation i]
![Page 21: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/21.jpg)
Propositional Logic
Semantic Rules
holds(true, i) for all i
![Page 22: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/22.jpg)
Propositional Logic
Semantic Rules
holds(true, i) for all i
fails(false, i) for all i
![Page 23: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/23.jpg)
Propositional Logic
Semantic Rules
holds(true, i) for all i
fails(false, i) for all i
holds( , i) if and only if fails( , i) (negation)
![Page 24: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/24.jpg)
Propositional Logic
Semantic Rules
holds(true, i) for all i
fails(false, i) for all i
holds( , i) if and only if fails( , i) (negation)
holds( , i) iff holds( ,i) and holds( , i) (conjunction)
![Page 25: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/25.jpg)
Propositional Logic
Semantic Rules
holds(true, i) for all i
fails(false, i) for all i
holds( , i) if and only if fails( , i) (negation)
holds( , i) iff holds( ,i) and holds( , i) (conjunction)
holds( , i) iff holds( ,i) or holds( , i) (disjunction)
![Page 26: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/26.jpg)
Propositional Logic
Semantic Rules
holds(true, i) for all i
fails(false, i) for all i
holds( , i) if and only if fails( , i) (negation)
holds( , i) iff holds( ,i) and holds( , i) (conjunction)
holds( , i) iff holds( ,i) or holds( , i) (disjunction)
holds( P, i) iff i(P) = t
fails( P, i) iff i(P) = f
![Page 27: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/27.jpg)
Propositional Logic
Some important shorthand
(antecedent consequent)),( nimplicatiolconditiona
![Page 28: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/28.jpg)
Propositional Logic
Some important shorthand
(antecedent consequent)),( nimplicatiolconditiona
),( )()( eequivalencnalbiconditio
![Page 29: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/29.jpg)
Propositional Logic
Some important shorthand
(antecedent consequent)),( nimplicatiolconditiona
),( )()( eequivalencnalbiconditio
f f t f f t t t
f t t f t t f f
t f f f t f t f
t t f t t t t t
P Q P QP QP QP PQ QP
![Page 30: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/30.jpg)
Propositional Logic
Some important shorthand
(antecedent consequent)),( nimplicatiolconditiona
),( )()( eequivalencnalbiconditio
f f t f f t t t
f t t f t t f f
t f f f t f t f
t t f t t t t t
P Q P QP QP QP PQ QP
Note that implication is not “causality”, if P is f then is t QP
Implication doesn't mean "is related" in any kind of real-world way
![Page 31: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/31.jpg)
Propositional Logic
Terminology
A sentence is valid iff its truth value is t in all interpretations
Pfalse, Ptrue, :sentences Valid
A sentence is satisfiable iff its truth value is t in at least one interpretation
PP, true, :sentences eSatisfiabl
A sentence is unsatisfiable iff its truth value is f in all interpretations
trueP, false, P :sentences bleUnsatisfia
All are finitely decidable.
![Page 32: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/32.jpg)
Examples
Sentence Valid? Interpretation that make sentence’s truth value = f
valid
satisfiable, not valid
satisfiable, not valid
valid
valid
smokesmoke smokesmoke
firesmoke ffiretsmoke ,
)()( fsfs tffs ,
ffstfs )(,)(
)()( sffs contrapositive
)( dbdb dbdb
![Page 33: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/33.jpg)
Examples
Sentence Valid? Interpretation that make sentence’s truth value = f
valid
satisfiable, not valid
satisfiable, not valid
valid
valid
smokesmoke smokesmoke
firesmoke ffiretsmoke ,
)()( fsfs tffs ,
ffstfs )(,)(
)()( sffs contrapositive
)( dbdb dbdb
![Page 34: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/34.jpg)
Examples
Sentence Valid? Interpretation that make sentence’s truth value = f
valid
satisfiable, not valid
satisfiable, not valid
valid
valid
smokesmoke smokesmoke
firesmoke ffiretsmoke ,
)()( fsfs tffs ,
ffstfs )(,)(
)()( sffs contrapositive
)( dbdb dbdb
![Page 35: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/35.jpg)
Examples
Sentence Valid? Interpretation that make sentence’s truth value = f
valid
satisfiable, not valid
satisfiable, not valid
valid
valid
smokesmoke smokesmoke
firesmoke ffiretsmoke ,
)()( fsfs tffs ,
ffstfs )(,)(
)()( sffs contrapositive
)( dbdb dbdb
![Page 36: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/36.jpg)
ExamplesExamples
Sentence Valid? Interpretation that make sentence’s truth value = f
valid
satisfiable, not valid
satisfiable, not valid
valid
valid
smokesmoke smokesmoke
firesmoke ffiretsmoke ,
)()( fsfs tffs ,
ffstfs )(,)(
)()( sffs contrapositive
)( dbdb dbdb
![Page 37: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/37.jpg)
Satisfiability
• Related to constraint satisfaction
• Given a sentence S, try to find an interpretation i such that holds(S,i)
• Analogous to finding an assignment of values to variables such that the constraints hold
![Page 38: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/38.jpg)
Satisfiability
• Related to constraint satisfaction
• Given a sentence S, try to find an interpretation i such that holds(S,i)
• Analogous to finding an assignment of values to variables such that the constraints hold
• Brute force method: enumerate all interpretations and check
![Page 39: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/39.jpg)
Satisfiability
• Related to constraint satisfaction
• Given a sentence S, try to find an interpretation i such that holds(S,i)
• Analogous to finding an assignment of values to variables such that the constraints hold
• Brute force method: enumerate all interpretations and check
• Better methods:
Heuristic searchConstraint propagationStochastic search
![Page 40: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/40.jpg)
Satisfiability Problems
• Scheduling nurses to work in a hospital
• propositional variables represent for example, that Pat is working on Tuesday at 2pm
• constraints on the schedule are represented using logical expressions over the variables
• Finding bugs in software
• propositional variables represent state of the program
• use logic to describe how the program works and to assert there is a bug
• if the sentence is satisfiable, you’ve found the bug!
![Page 41: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/41.jpg)
159.302159.302 LECTURELECTURE
Propositional Logic ProofPropositional Logic Proof
3
Source: MIT OpenCourseWare
![Page 42: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/42.jpg)
A Good lecture?A Good lecture?
• Imagine we knew that:
• If today is sunny, then Tomas will be happy
Should we conclude that the lecture will be good?
)( HS
• If Tomas is happy, the lecture will be good )( GH
)(S• Today is sunny
![Page 43: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/43.jpg)
Checking InterpretationsChecking Interpretations
SS HH GG S HS H H GH G SS GG
tt tt tt tt tt tt tt
tt tt ff tt ff tt ff
tt ff tt ff tt tt tt
tt ff ff ff tt tt ff
ff tt tt tt tt ff tt
ff tt ff tt ff ff ff
ff ff tt tt tt ff tt
ff ff ff tt tt ff ff
Good lecture!Good lecture!
![Page 44: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/44.jpg)
Adding a variableAdding a variable
LL SS HH GG S HS H H GH G SS GG
tt tt tt tt tt tt tt tt
tt tt tt ff tt ff tt ff
tt tt ff tt ff tt tt tt
tt tt ff ff ff tt tt ff
tt ff tt tt tt tt ff tt
tt ff tt ff tt ff ff ff
tt ff ff tt tt tt ff tt
tt ff ff ff tt tt ff ff
ff tt tt tt tt tt tt tt
ff tt tt ff tt ff tt ff
…… …… …… ……
![Page 45: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/45.jpg)
EntailmentEntailment
•A knowledge base (KBKB) entailsentails a sentence SS iff every interpretation that makes KBKB true also makes SS true
![Page 46: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/46.jpg)
Computing EntailmentComputing Entailment
• enumerate all interpretations
• select those in which all elements of KBKB are true
• check to see if SS is true in all of those interpretations
![Page 47: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/47.jpg)
Computing EntailmentComputing Entailment
• enumerate all interpretations
• select those in which all elements of KBKB are true
• check to see if SS is true in all of those interpretations
• Way too many interpretations, in general!!
![Page 48: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/48.jpg)
Entailment and ProofEntailment and Proof
• A proofproof is a way to test whether a KB entails a sentence, without enumerating all possible interpretations
![Page 49: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/49.jpg)
ProofProof
• A proofproof is a sequence of sentences
• First ones are premises (KBKB)
• Then, you can write down on the next line the result of applying an inference ruleinference rule to previous lines
• When S is on a line, you have provedproved SS from KBKB
• If inference rules are soundsound, then any SS you can prove from KBKB is entailed by KBKB
• If inference rules are completecomplete, then any SS that is entailed by KBKB can be proven from KBKB
![Page 50: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/50.jpg)
Natural DeductionNatural Deduction
• Some inference rulesinference rules:
Modus ponens
![Page 51: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/51.jpg)
Natural DeductionNatural Deduction
• Some inference rules:
Modus ponens Modus tolens
![Page 52: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/52.jpg)
Natural DeductionNatural Deduction
• Some inference rules:
Modus ponens Modus tolens
And-Introduction
![Page 53: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/53.jpg)
Natural DeductionNatural Deduction
• Some inference rules:
Modus ponens Modus tolens
And-Introduction
And-Elimination
![Page 54: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/54.jpg)
Natural Deduction ExampleNatural Deduction Example
StepStep FormulaFormula DerivationDerivation
11 GivenGiven
22 GivenGiven
33 GivenGiven
QP
RP
SRQ )(
Prove SProve S
![Page 55: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/55.jpg)
Natural Deduction ExampleNatural Deduction Example
StepStep FormulaFormula DerivationDerivation
11 GivenGiven
22 GivenGiven
33 GivenGiven
44 PP 1 And-Elim1 And-Elim
QP
RP
SRQ )(
Prove SProve S
![Page 56: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/56.jpg)
Natural Deduction ExampleNatural Deduction Example
StepStep FormulaFormula DerivationDerivation
11 GivenGiven
22 GivenGiven
33 GivenGiven
44 PP 1 And-Elim1 And-Elim
55 RR 4,2 Modus-Ponens4,2 Modus-Ponens
QP
RP
SRQ )(
Prove SProve S
![Page 57: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/57.jpg)
Natural Deduction ExampleNatural Deduction Example
StepStep FormulaFormula DerivationDerivation
11 GivenGiven
22 GivenGiven
33 GivenGiven
44 PP 1 And-Elim1 And-Elim
55 RR 4,2 Modus-Ponens4,2 Modus-Ponens
66 QQ 1 And-Elim1 And-Elim
QP
RP
SRQ )(
Prove SProve S
![Page 58: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/58.jpg)
Natural Deduction ExampleNatural Deduction Example
StepStep FormulaFormula DerivationDerivation
11 GivenGiven
22 GivenGiven
33 GivenGiven
44 PP 1 And-Elim1 And-Elim
55 RR 4,2 Modus-Ponens4,2 Modus-Ponens
66 QQ 1 And-Elim1 And-Elim
77 5,6 And-Intro5,6 And-Intro
QP
RP
SRQ )(
Prove SProve S
RQ
![Page 59: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/59.jpg)
Natural Deduction ExampleNatural Deduction Example
StepStep FormulaFormula DerivationDerivation
11 GivenGiven
22 GivenGiven
33 GivenGiven
44 PP 1 And-Elim1 And-Elim
55 RR 4,2 Modus-Ponens4,2 Modus-Ponens
66 QQ 1 And-Elim1 And-Elim
77 5,6 And-Intro5,6 And-Intro
88 SS 7,3 Modus-Ponens7,3 Modus-Ponens
QP
RP
SRQ )(
Prove SProve S
RQ
![Page 60: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/60.jpg)
Proof SystemsProof Systems
• There are many natural deduction systems; they are typically “proof checkers”, sound but not complete
![Page 61: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/61.jpg)
Proof SystemsProof Systems
• There are many natural deduction systems; they are typically “proof checkers”, sound but not complete
• Natural deductionNatural deduction uses lots of inference rules which introduces a large branching factor in the search for a proof.
![Page 62: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/62.jpg)
Proof SystemsProof Systems
• There are many natural deduction systems; they are typically “proof checkers”, sound but not complete
• Natural deductionNatural deduction uses lots of inference rules which introduces a large branching factor in the search for a proof.
• In general, you need to do “proof by casesproof by cases” which introduces even more branching.
StepStep FormulaFormula
11
22
33
QP
RQ
RP
Prove R
![Page 63: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/63.jpg)
Propositional ResolutionPropositional Resolution
Resolution rule:
• Single inference rule is a sound and complete proof system
• Requires all sentences to be converted to conjunctive normal form
![Page 64: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/64.jpg)
159.302159.302 LECTURELECTURE
Propositional Logic Propositional Logic Conjunctive Normal Form (CNF)Conjunctive Normal Form (CNF)
4
Source: MIT OpenCourseWare
![Page 65: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/65.jpg)
Conjunctive Normal Conjunctive Normal FormForm
CNF Formulas:
)()()()( CBADBCBA
![Page 66: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/66.jpg)
Conjunctive Normal Conjunctive Normal FormForm
CNF Formulas:
)()()()( CBADBCBA
clause a is )( CBA
![Page 67: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/67.jpg)
Conjunctive Normal Conjunctive Normal FormForm
CNF Formulas:
)()()()( CBADBCBA
clause a is )( CBA , which is a disjunction of literals, which is a disjunction of literals
![Page 68: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/68.jpg)
Conjunctive Normal Conjunctive Normal FormForm
CNF Formulas:
)()()()( CBADBCBA
clause a is )( CBA
literals are ) ,, CandBA
, which is a disjunction of literals, which is a disjunction of literals
![Page 69: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/69.jpg)
Conjunctive Normal Conjunctive Normal FormForm
CNF Formulas:
)()()()( CBADBCBA
clause a is )( CBA
literals are ) ,, CandBA
, which is a disjunction of literals, which is a disjunction of literals
, each of which is a variable or the negation of a variable., each of which is a variable or the negation of a variable.
![Page 70: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/70.jpg)
Conjunctive Normal Conjunctive Normal FormForm
CNF Formulas:
)()()()( CBADBCBA
clause a is )( CBA
literals are ) ,, CandBA
, which is a disjunction of literals, which is a disjunction of literals
, each of which is a variable or the negation of a variable., each of which is a variable or the negation of a variable.
• Each clause is a requirement that must be satisfied and can be Each clause is a requirement that must be satisfied and can be satisfied in multiple wayssatisfied in multiple ways
![Page 71: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/71.jpg)
Conjunctive Normal Conjunctive Normal FormForm
CNF Formulas:
)()()()( CBADBCBA
clause a is )( CBA
literals are ) ,, CandBA
, which is a disjunction of literals, which is a disjunction of literals
, each of which is a variable or the negation of a variable., each of which is a variable or the negation of a variable.
• Each clause is a requirement that must be satisfied and can be Each clause is a requirement that must be satisfied and can be satisfied in multiple wayssatisfied in multiple ways
• Every sentence in propositional logic can be written in CNFEvery sentence in propositional logic can be written in CNF
![Page 72: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/72.jpg)
Converting to CNFConverting to CNF
1. Eliminate arrows using definitions
![Page 73: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/73.jpg)
Converting to CNFConverting to CNF
1. Eliminate arrows using definitions
2. Drive in negations using De Morgan’s Laws
))(
))(
![Page 74: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/74.jpg)
Converting to CNFConverting to CNF
1. Eliminate arrows using definitions
2. Drive in negations using De Morgan’s Laws
))(
))(
3. Distribute or over and
)()()(( CABACBA
![Page 75: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/75.jpg)
Converting to CNFConverting to CNF
1. Eliminate arrows using definitions
2. Drive in negations using De Morgan’s Laws
))(
))(
3. Distribute or over and
)()()(( CABACBA
4. Every sentence can be converted to CNF, but it may grow exponentially in size
![Page 76: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/76.jpg)
CNF Conversion ExampleCNF Conversion Example
)()( DCBA
![Page 77: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/77.jpg)
CNF Conversion ExampleCNF Conversion Example
1. Eliminate arrows using definitions
)()( DCBA
)()( DCBA
![Page 78: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/78.jpg)
CNF Conversion ExampleCNF Conversion Example
1. Eliminate arrows using definitions
2. Drive in negations using De Morgan’s Laws
)()( DCBA
)()( DCBA
)()( DCBA
![Page 79: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/79.jpg)
CNF Conversion ExampleCNF Conversion Example
1. Eliminate arrows using definitions
2. Drive in negations using De Morgan’s Laws
3. Distribute or over and
)()( DCBA
)()( DCBA
)()( DCBA
)()( DCBDCA
![Page 80: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/80.jpg)
159.302159.302 LECTURELECTURE
Propositional ResolutionPropositional Resolution
5
Source: MIT OpenCourseWare
![Page 81: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/81.jpg)
Propositional ResolutionPropositional Resolution Resolution rule:
• Convert all sentences to CNF
• Negate the desired conclusion (converted to CNF)
Resolution refutation:
• Apply resolution rule until either
• Derive false (a contradiction)
• Can’t apply anymore
Resolution refutation is soundsound and completecomplete
• If we derive a contradiction, then the conclusion follows from the axioms
• If we can’t apply anymore, then the conclusion cannot be proven from the axioms
![Page 82: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/82.jpg)
Propositional ResolutionPropositional Resolution
StepStep FormulaFormula
11
22
33
QP
RP
RQ
Prove R
StepStep FormulaFormula DerivationDerivation
11 GivenGiven
22 GivenGiven
33 GivenGiven
44 Negated conclusionNegated conclusion
55 1,21,2
66 2,42,4
77 3,43,4
88 5,75,7
99 ▪▪ 4,84,8
QP
RP RQ
R
RQ
P
Q
R
![Page 83: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/83.jpg)
Propositional ResolutionPropositional Resolution
StepStep FormulaFormula
11
22
33
QP
RP
RQ
Prove R
StepStep FormulaFormula DerivationDerivation
11 GivenGiven
22 GivenGiven
33 GivenGiven
44 Negated conclusionNegated conclusion
55 1,21,2
66 2,42,4
77 3,43,4
88 5,75,7
99 ▪▪ 4,84,8
QP
RP RQ
R
RQ
P
Q
R
Rfalse falseR
falsefalse
![Page 84: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/84.jpg)
Propositional ResolutionPropositional Resolution
StepStep FormulaFormula
11
22
33
QP
RP
RQ
Prove R
StepStep FormulaFormula DerivationDerivation
11 GivenGiven
22 GivenGiven
33 GivenGiven
44 Negated conclusionNegated conclusion
55 1,21,2
66 2,42,4
77 3,43,4
88 5,75,7
99 ▪▪ 4,84,8
QP
RP RQ
R
RQ
P
Q
R
Rfalse falseR
falsefalse
unnecessaryunnecessary
![Page 85: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/85.jpg)
The Power of FalseThe Power of False
StepStep FormulaFormula
11
22
P
P
Prove Z
StepStep FormulaFormula DerivationDerivation
11 GivenGiven
22 GivenGiven
33 Negated conclusionNegated conclusion
44 ▪▪ 1,21,2
validis )( that Note ZPP
P
PZ
• Any conclusion follows from a contradiction – and so strict logic systems are very brittle.
![Page 86: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/86.jpg)
Example ProblemExample Problem
StepStep FormulaFormula
11
22
33
QQP )(
Prove R
RPP )(
)()( QSSR
Convert to CNF
![Page 87: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/87.jpg)
Example ProblemExample Problem
StepStep
11
22
33
44
55
66
77 NegNeg
Prove R
QP StepStep FormulaFormula
11
22
33
QQP )(
RPP )(
)()( QSSR
RP
RP SR
QR
QS
R
![Page 88: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/88.jpg)
Example ProblemExample Problem
StepStep
11
22
33
44
55
66
77 NegNeg
88 4,74,7
99 6,86,8
1010 1,91,9
1111 3,103,10
1212 ▪▪ 7,117,11
Prove R QP
StepStep FormulaFormula
11
22
33
QQP )(
RPP )(
)()( QSSR
RP
RP SR
QR
QS
R
Q
S
P
R
![Page 89: 159.302LECTURE 159.302 LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare](https://reader035.vdocuments.site/reader035/viewer/2022062421/56649f4e5503460f94c6f15a/html5/thumbnails/89.jpg)
Proof StrategiesProof Strategies
• Produces a shorter clause – which is good since we are trying to produce a zero-length clause, that is, a contradiction.
Unit Preference: prefer a resolution step involving a unit clause (clause with one literal).
• We’re trying to produce a contradiction that follows from the negated goal, so these are “relevant” clauses
Set of support: choose a resolution involving the negated goal or any clause derived from the negated goal.
• If a contradiction exists, one can find one using the set-of-support strategy.