Upload
tran-gia-loc
View
220
Download
1
Embed Size (px)
Citation preview
8/3/2019 02 Propositional
1/77
Computational Applied LogicCSC 503 Fall 2005
Jon Doyle
Department of Computer ScienceNorth Carolina State University
Propositional logic
NC State University 1 / 77 CSC 503 Fall 2005c 2005 by Jon Doyle
http://find/http://goback/8/3/2019 02 Propositional
2/77
Propositional logic Statements and their uses
What things can one express?
Sounds/exclamations/marks
Words
Statements
Sets of statements = theories Partial statements
Sets of partial statements
Sequences of statements or sets of statements
NC State University 2 / 77 CSC 503 Fall 2005c 2005 by Jon Doyle
http://find/http://goback/8/3/2019 02 Propositional
3/77
Propositional logic Statements and their uses
How to do things with sentences
Declarative: facts and descriptions
Interrogative: questions
Imperative: commands and pleas
NC State University 3 / 77 CSC 503 Fall 2005c 2005 by Jon Doyle
http://find/http://goback/8/3/2019 02 Propositional
4/77
Propositional logic Statements and their uses
What can I express with statements?
Knowledge/facts/opinions/conditions
Ignorance/uncertainty
Goals/desires/intentions
Procedures/methods Propositional attitudes
NC State University 4 / 77 CSC 503 Fall 2005c 2005 by Jon Doyle
http://find/http://goback/8/3/2019 02 Propositional
5/77
Propositional logic Language
Statements
Complete statements = propositions Snow is white
Letters snow-is-white
Four-score-and-seven-years-ago-
our-fathers-brought-forth-
on-this-continent-a-new-nation-
conceived-in-Liberty-
and-dedicated-to-the-proposition-that-all-men-are-created-equal
Ignore spelling, just enumerate A1, A2, . . .
NC State University 5 / 77 CSC 503 Fall 2005c 2005 by Jon Doyle
P i i l l i L
http://find/http://goback/8/3/2019 02 Propositional
6/77
Propositional logic Language
Propositional connectives
Disjunction or Conjunction and Negation not
Conditional implies Biconditional iff = if and only if+ Exclusive or xor| Sheffer stroke nand
n
at least n
And more besides, when we visit description logics
NC State University 6 / 77 CSC 503 Fall 2005c 2005 by Jon Doyle
P iti l l i L
http://find/http://goback/8/3/2019 02 Propositional
7/77
Propositional logic Language
Complex propositions
All combinators use parentheses to provideunique parse tree.
We omit parentheses when parse is clear.
p = A B C p = (((A) B) C)
Depth= depth of parse tree (root has depth 0) Depth(p) = 3
Support= set of letters appearing in tree Support(p) = {A, B, C}
NC State University 7 / 77 CSC 503 Fall 2005c 2005 by Jon Doyle
Propositional logic Meaning
http://find/http://goback/8/3/2019 02 Propositional
8/77
Propositional logic Meaning
Meaning of propositions
We only consider standard meanings at this time. Standard meanings
True/False (= T/F, 1/0, /)
Multivalued logics Elements of boolean lattices Belnap 4-valued logic {TT, TF, FT, FF}
Probabilistic logics Probability values in [0, 1]
Fuzzy logics Possibility values in [0, 1]
NC State University 8 / 77 CSC 503 Fall 2005c 2005 by Jon Doyle
Propositional logic Meaning
http://find/http://goback/8/3/2019 02 Propositional
9/77
Propositional logic Meaning
Logicians are weird
Logical meaning = English (etc.) meaning If 1=2, then Im the Man in the Moon. She is either a lawyer or a professor. Ive won every World Cup game Ive played.
Logical meaning is atemporal 10:00AM Assert 10:01AM Assert Simple inconsistency, or change?
NC State University 9 / 77 CSC 503 Fall 2005c 2005 by Jon Doyle
Propositional logic Meaning
http://find/http://goback/8/3/2019 02 Propositional
10/77
Propositional logic Meaning
Truth functionality
Basic connectives are truth functional
Truth of compound statement determined bytruth of the connected substatements
Truth of compound a function of truth ofconstituents
Truth tablesrepresent these functions
NC State University 10 / 77 CSC 503 Fall 2005c 2005 by Jon Doyle
Propositional logic Meaning
http://find/http://goback/8/3/2019 02 Propositional
11/77
Propositional logic Meaning
Connective truth tables
( )
T T TT F T
F T T
F F F
( )
T T TT F F
F T F
F F F
()
T FF T
NC State University 11 / 77 CSC 503 Fall 2005c 2005 by Jon Doyle
Propositional logic Meaning
http://find/http://goback/8/3/2019 02 Propositional
12/77
Propositional logic Meaning
Connective truth tables
( )
T T TT F F
F T T
F F T
( )
T T TT F F
F T F
F F T
NC State University 12 / 77 CSC 503 Fall 2005c 2005 by Jon Doyle
Propositional logic Meaning
http://find/http://goback/8/3/2019 02 Propositional
13/77
p g g
Connective truth tables
( + )
T T FT F T
F T T
F F F
( | )
T T FT F T
F T T
F F T
NC State University 13 / 77 CSC 503 Fall 2005c 2005 by Jon Doyle
Propositional logic Meaning
http://find/http://goback/8/3/2019 02 Propositional
14/77
p g g
Truth tables
Complete truth tables One column for each proposition in formation tree
Abbreviated truth tables
Omit one or more intermediate propositions
NC State University 14 / 77 CSC 503 Fall 2005c 2005 by Jon Doyle
Propositional logic Meaning
http://find/http://goback/8/3/2019 02 Propositional
15/77
Non-truth-functional connectives
Truth values of component propositions do notdetermine truth value of compound proposition.
because
causes necessarily implies
preceded
is a shorter statement than
expresses more information than
is more likely than
Alice believes but Bob claims
NC State University 15 / 77 CSC 503 Fall 2005c 2005 by Jon Doyle
Propositional logic Meaning
http://find/http://goback/8/3/2019 02 Propositional
16/77
Truth valuations
Truth assignment A : L {T, F} Truth valuation V : L(L) {T, F}
Required to respect truth tables in every connective
Valuations must agree on a propositionwhenever they agree on the propositionssupport
NC State University 16 / 77 CSC 503 Fall 2005c 2005 by Jon Doyle
Propositional logic Meaning
http://find/http://goback/8/3/2019 02 Propositional
17/77
Logical equivalence
Means and are logically equivalent
Logical equivalence = agreement w.r.t. every
valuation
True just in case the truth table column for contains only Ts
Each row corresponds to a class of valuations Truth table summarizes all valuations restricted to
support of a proposition
NC State University 17 / 77 CSC 503 Fall 2005c 2005 by Jon Doyle
Propositional logic Meaning
http://find/http://goback/8/3/2019 02 Propositional
18/77
Lattice of meanings
Propositional equivalence classes [] = { | }
2n distinct truth tables over n letters
Thus 2n equivalence classes over n letters
Form a Boolean lattice with respect to , ,
Define lattice order iff [ ] = []
NC State University 18 / 77 CSC 503 Fall 2005c 2005 by Jon Doyle
Propositional logic Meaning
http://find/http://goback/8/3/2019 02 Propositional
19/77
Metalanguage vs. object language
is part of the logical metalanguage Part of the language we use to talk about logical
statements
Not part of the logical object language in whichpropositions are expressed.
Other metalinguistic notions:
Entailment Satisfiability
Provability
NC State University 19 / 77 CSC 503 Fall 2005c 2005 by Jon Doyle
Propositional logic Meaning
http://find/http://goback/8/3/2019 02 Propositional
20/77
Adequacy
What can one say with a specific set of connectives?
S is adequate iff every proposition is equivalentto some proposition constructed using onlyconnectives in S
For every truth-functional , there is some over S such that
Claim: {, , } is adequate. Why?
Claim: {, } is adequate. Why?
NC State University 20 / 77 CSC 503 Fall 2005c 2005 by Jon Doyle
Propositional logic Meaning
http://find/http://goback/8/3/2019 02 Propositional
21/77
Normal forms
Literal = letter or negation of a letter: A, A Clause = disjunction of literals: A1 . . . An Conjunct = conjunction of literals: A1 . . . An
CNF = Conjunctive normal form Conjunction of clauses (A1 . . . An) . . . (B1 . . . Bm)
DNF = Disjunctive normal form Disjunction of conjuncts (A1 . . . An) . . . (B1 . . . Bm)
NC State University 21 / 77 CSC 503 Fall 2005c 2005 by Jon Doyle
Propositional logic Meaning
http://find/http://goback/8/3/2019 02 Propositional
22/77
Linguistic expressiveness
Choose or change the basis connectives to improve Consision of expression
Cardinality of expression
Complexity of expression Clarity/comprehensibility/convenience of
expression
NC State University 22 / 77 CSC 503 Fall 2005c 2005 by Jon Doyle
Propositional logic Meaning
http://find/http://goback/8/3/2019 02 Propositional
23/77
Validity
is valid iff every valuation makes it true is a tautology
Taut = set of all tautologies
is nontrivialif neither nor are valid
NC State University 23 / 77 CSC 503 Fall 2005c 2005 by Jon Doyle
Propositional logic Meaning
http://find/http://goback/8/3/2019 02 Propositional
24/77
Satisfiability
is satisfiable iff some valuation makes it true is possibly true
is unsatisfiable iff no valuation makes it true
is a contradiction
is a tautology
NC State University 24 / 77 CSC 503 Fall 2005c 2005 by Jon Doyle
Propositional logic Meaning
http://find/http://goback/8/3/2019 02 Propositional
25/77
Consistency
is consistent just in case some valuationmakes every statement in true
For finite , just in case
is satisfiable
is inconsistent if no valuation makes allstatements true
and
are (in)consistent iff{, } is (in)consistent
NC State University 25 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Meaning
http://find/http://goback/8/3/2019 02 Propositional
26/77
Logical consequence
|= means V() = T whenever V() = T entails
|= means V() = T whenever V() = T for each entails
Cn() is the set of consequencesof Cn() = { | |= }
Taut = Cn()
NC State University 26 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Meaning
http://find/http://goback/8/3/2019 02 Propositional
27/77
Properties of consequences
Monotonic: implies Cn() Cn() Supra-tautologous: Taut Cn()
Idempotent: Cn(Cn()) = Cn()
Additive: Cn()
NC State University 27 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Meaning
http://find/http://goback/8/3/2019 02 Propositional
28/77
Completeness
A complete theory determines truth values for allpropositions
is complete iff for each p either p Cn(), or
p Cn()
Is {p, p} complete?
NC State University 28 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Meaning
http://find/http://goback/8/3/2019 02 Propositional
29/77
Models
Models = interpretations that make true V a model of iff V() = T for each
M() = {V | .V() = T} is the set of allmodels of .
implies M() M()
NC State University 29 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Formalizing theories
http://find/http://goback/8/3/2019 02 Propositional
30/77
So what good is logic?
Precise concepts for expressing theories Precise concepts for critiquing theories
NC State University 30 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Formalizing theories
Th f l i l f li i
http://find/http://goback/8/3/2019 02 Propositional
31/77
The process of logical formalization
Commence with initial formulation Common sense Expertise Informed speculation Wild guesses
Critique the formulation with respect to thedesired qualities
Correct the visible flaws as seems fit
Continue this process until convergence
NC State University 31 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Formalizing theories
Th NC S K l d Di
http://find/http://goback/8/3/2019 02 Propositional
32/77
The NC State Knowledge Discovery
Method
Commence to continuously correct the contentvia the critique categories until convergence
Truth
Correctness**Consistency**CompletenessCategoricity
**ContingencyChanceCoverageCourageousness
Goodness
Computability**Complexity**CardinalityCompromises
ConvenienceCharityCompactness
Beauty
ClarityComprehensibilityCleavageCogency
CommonsensicalityContinuity
Perfection
ClosenessCumulativityConvergenceConstancy
NC State University 32 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Formalizing theories
L i l f li ti h
http://find/http://goback/8/3/2019 02 Propositional
33/77
Logical formalization as search
Different critiques might suggest incompatiblecorrections; what to desire?
Applied corrections might not work
Confusion or contradiction can suggest retreatto prior formulation; divergence
View this process as a search for the rightformulation
Process state as position in a space of assessment
dimensions Assessment criteria as elements of heuristic
evaluation function Correction methods as possible actions
NC State University 33 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Inference
T bl f
http://find/http://goback/8/3/2019 02 Propositional
34/77
Tableau proofs
Tableaux = tables Labeled trees, built up from atomic tableaux
Various nice computational properties
We will consider other proof formalisms later
NC State University 34 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Inference
At i iti l t bl
http://find/http://goback/8/3/2019 02 Propositional
35/77
Atomic propositional tableaux
TA FA
T()
F
F()
T
NC State University 35 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Inference
Atomic propositional tablea
http://find/http://goback/8/3/2019 02 Propositional
36/77
Atomic propositional tableaux
T( )
T
T
F( )
T
dd
T
T( )
T
dd
T
F( )
F
F
NC State University 36 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Inference
Atomic propositional tableaux
http://find/http://goback/8/3/2019 02 Propositional
37/77
Atomic propositional tableaux
T( )
F
dd
T
F( )
T
F
T( )
T
dd
F
T F
F( )
T
dd
F
F T
NC State University 37 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Inference
Tableaux construction rules
http://find/http://goback/8/3/2019 02 Propositional
38/77
Tableaux construction rules
Root is proposition under consideration Apply atomic tableau to some proposition in tree
Append atomic tableau at end of branch beneath Head of appended tableau duplicates proposition
being reduced
NC State University 38 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Inference
Tableau properties
http://find/http://goback/8/3/2019 02 Propositional
39/77
Tableau properties
Tableau , path P on , and E an entry on P
E is reduced iff all entries on the atomic tableauwith root E appear on P
P is contradictory iff both T and F appear onP
P is finished iff it is contradictory or every entry
on P is reduced on P is finished iff every path is finished
is contradictory iff every path is contradictory
NC State University 39 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Inference
Tableau proof
http://find/http://goback/8/3/2019 02 Propositional
40/77
Tableau proof
Proof by refutation Tableau proofof = a contradictory tableau with
root F
means is tableau provable
Tableau refutationof = a contradictory tableauwith root T
is tableau refutable iff it has a tableaurefutation
NC State University 40 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Inference
Complete systematic tableaux
http://find/http://goback/8/3/2019 02 Propositional
41/77
Complete systematic tableaux
Construct increasing sequence of tableaux Find highest level with unreduced noncontradictory
entry E Find leftmost path containing such an entry Adjoin atomic tableau with root E to each such path Adjunction means m m+1
Limit (union) of this sequence is the CST
NC State University 41 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Inference
Properties of CST
http://find/http://goback/8/3/2019 02 Propositional
42/77
Properties of CST
Every CST is finished
If a CST is contradictory, it contains a finitecontradictory tableau m
Thus if a CST is a proof, it is a finite tableau.
Every CST is finite
NC State University 42 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Inference
Soundness and completeness
http://find/http://goback/8/3/2019 02 Propositional
43/77
Soundness and completeness
What is the relationship between truth and proof?Between entailment and provability?
Soundnessmeans truth preserving
A logic is sound if p implies |= p
Completenessmeans proof preserving A logic is complete if |= p implies p
Logicians often will use completeness proof tomean a proof of both soundness and completeness
NC State University 43 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Inference
Soundness of tableau proof
http://find/http://goback/8/3/2019 02 Propositional
44/77
Soundness of tableau proof
Each satisfying valuation of a formula mustagree with the labels on some path through thetableau
No valuation can agree with a contradictory path
In a proof, all paths are contradictory
NC State University 44 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Inference
Completeness of tableau proof
http://find/http://goback/8/3/2019 02 Propositional
45/77
Completeness of tableau proof
Each finished but noncontradictory pathprovides a counterexample
Assign T to A if TA appears on the path Assign F to A otherwise
NC State University 45 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Inference
Tableau proof from premises
http://find/http://goback/8/3/2019 02 Propositional
46/77
Tableau proof from premises
Allow a set of premises for use in proofs Add a new atomic tableau Tp for each premise p
Tp can be added to any path that does notcontradict it
NC State University 46 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Inference
Complete systematic tableaux from
http://find/http://goback/8/3/2019 02 Propositional
47/77
Complete systematic tableaux from
premises
Assume an enumeration of the premises
Add premises sequentially to each
noncontradictory finished path
NC State University 47 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Inference
Soundness and completeness
http://find/http://goback/8/3/2019 02 Propositional
48/77
Soundness and completeness
Sound: p implies |= p
Complete: |= p implies p
NC State University 48 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Inference
Compactness
http://find/http://goback/8/3/2019 02 Propositional
49/77
Compactness
Propositional logic is a compact logic |= p iff |= p for some finite subset
One only needs finitely many premises to get
any particular consequence
An infinite set is satisfiable iff every finitesubset of is satisfiable
NC State University 49 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Inference
Deductive closure
http://find/http://goback/8/3/2019 02 Propositional
50/77
Deductive closure
The deductive closureof a set of propositionscontains all the statements deducible from the set
Th() = {p | p}
Soundness and completeness mean Th() = Cn()
NC State University 50 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Inference
Deduction theorem
http://find/http://goback/8/3/2019 02 Propositional
51/77
Deduction theorem
If is finite and
is the conjunction of thesestatements, the following conditions are equivalent:
|=
|=
This shows the desired matching of truth and proof
NC State University 51 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Inference
Alternative proof systems
http://find/http://goback/8/3/2019 02 Propositional
52/77
Alternative proof systems
Proof by intimidation Shut up, he explained. Five-finger argument
Axiomatic proofs
Natural Deduction proofs
NC State University 52 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Inference
Axiomatic logics
http://find/http://goback/8/3/2019 02 Propositional
53/77
g
Axioms Maybe lots Axiom schemata
( ( )) (( ( )) (( ) ( )))
(( ) (( ) ))
Inference rules Usually a small set Modus ponens
p, p q q
NC State University 53 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Inference
Axiomatic proofs
http://find/http://goback/8/3/2019 02 Propositional
54/77
p
Proof = sequence of statements Each statement either An axiom, or A conclusion of an inference rule applied to preceding
statements
Final statement is the theorem
NC State University 54 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Inference
Natural deduction proofs
http://find/http://goback/8/3/2019 02 Propositional
55/77
p
No axioms Lots of inference rules
Rules p correspond to axioms
Introduction and discharge of assumptions
Dependency tracking
NC State University 55 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Inference
A sample proof
http://find/http://goback/8/3/2019 02 Propositional
56/77
p p
In the style of Kalish and Montague
Line Statement Justification Deps.
1. A B Premise {1}
2. B C Premise {2}3. A Hypothesis {3}4. B MP 1,3 {1,3}5. C MP 2,4 {1,2,3}6. A C Discharge 3,5 {1,2}7. A B B C -introduction {1,2}8. (A B B C) (A C) Discharge 7,6 {}
NC State University 56 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Resolution
Resolution
http://find/http://goback/8/3/2019 02 Propositional
57/77
Language
Inference method
Proof automation
Logic programming
NC State University 57 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Resolution
Language
http://find/http://goback/8/3/2019 02 Propositional
58/77
g g
CNF language: Literals Clauses Formulas
Set notation: Clauses as finite sets of literals
Empty clause is always false
Formulae as finite sets of clauses Empty formula {} is always true
Sets mean syntactic irredundance
NC State University 58 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Resolution
Linguistic models
http://find/http://goback/8/3/2019 02 Propositional
59/77
Partial truth assignment = consistent set ofliterals Does not contain both A and A Literals in set = what is assigned T
Complete truth assignment contains each letteror its negation
A |= S Means assignment A satisifies formula (set) S
For each C S, C A = S (un)satisfiable iff there is an (no) assignment
that satisfies S
NC State University 59 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Resolution
Prolog
http://find/http://goback/8/3/2019 02 Propositional
60/77
Divide clauses into positive and negative literals Interpret each clause as implication
A1 . . . An B1 . . . Bm B1 . . . Bm A1 . . . An
Hornclause: at most one positive literal Programclause: exactly one positive literal
Prolog program = set of program clauses
NC State University 60 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Resolution
Prolog notation
http://find/http://goback/8/3/2019 02 Propositional
61/77
Rule: some negative literals Fact or unit clause: no negative literals Goalclause: no positive literals
Rule A B1, . . . , Bm A : B1, . . . , BmFact A A :Goal B1, . . . , Bm : B1, . . . , Bm
Nomenclature for clause parts:
head : bodygoal : subgoals
NC State University 61 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Resolution
Modus Ponens in Clausal Form
http://find/http://goback/8/3/2019 02 Propositional
62/77
Modus Ponens:
From and infer
From and infer
Cut rule generalizes Modus Ponens: From and infer
From and infer
NC State University 62 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Resolution
Resolution rule
http://find/http://goback/8/3/2019 02 Propositional
63/77
Resolving on literal A:
Clause {A} C1 Clause {A} C2
Infer C1 C2
NC State University 63 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Resolution
Resolution deduction
http://find/http://goback/8/3/2019 02 Propositional
64/77
A resolution deductionof C from S consists of
A finite sequence C1, . . . , Cn with Cn = C Each Ci is either
A clause in S or
The resolvent of two preceding clauses in thesequence
NC State University 64 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Resolution
Resolution refutations
http://find/http://goback/8/3/2019 02 Propositional
65/77
A resolution refutationof S is a resolution proof of from S
Resolution preserves satisfiability Clauses {A} C1, {A} C2 Resolvent C1 C2
Hence refutation is sound
NC State University 65 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Resolution
Resolution trees
http://find/http://goback/8/3/2019 02 Propositional
66/77
A resolution treededuction of C from S:
A labeled binary tree such that
The root is labeled with clause C
The leaves are labeled with the clauses of S
Each nonleaf node is labeled with resolvents ofits children
NC State University 66 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Resolution
Resolution closure
http://find/http://goback/8/3/2019 02 Propositional
67/77
The resolution closureR(S) of a set of clauses S isthe closure of S under the operation of takingresolutions
S R(S)
If C1, C2 R(S) and C is a resolvent of C1 andC2, then C R(S)
There is a resolution refutation of S iff R(S)
NC State University 67 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Resolution
Semantic analysis
http://find/http://goback/8/3/2019 02 Propositional
68/77
Formula S, literal Literal reductions:
S() = {C R(S) | , / C} If S is unsatisfiable, then so is S()
S = {C {} | C S / C} Formula reduced by assuming is true If S is unsatisfiable, both S and S must be
unsatisifable
NC State University 68 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Resolution
Soundness and completeness
http://find/http://goback/8/3/2019 02 Propositional
69/77
S is satisfiable iff either S
or S
is satisfiable The unsatisifiable sentences U are generatedby
If S, then S U If S U and S U, then S U
If S is unsatisfiable, then R(S)
NC State University 69 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Resolution
Computational complexity
http://find/http://goback/8/3/2019 02 Propositional
70/77
SAT = set of all satisfiable formulae
Is S satisfiable?
Resolution answer
2-SAT is linear time
SAT is NP-complete
3-SAT is NP-complete
This is good news too, not just bad;more on this later
NC State University 70 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Resolution
Restricted resolution
http://find/http://goback/8/3/2019 02 Propositional
71/77
T-resolution: never resolve a tautology
Semanticresolution: one parent is falsified byassignment A
Orderedresolution: order letters, always resolve
on highest-index letter possible Supportrestriction: never resolve two clauses
outside support clauses
These are sound and complete, but others are not
NC State University 71 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Resolution
Linear resolution
http://find/http://goback/8/3/2019 02 Propositional
72/77
A linearresolution deduction of C from S is asequence of pairs C0, B0, . . . , Cn, Bn such that
C = Cn C0 S
Each Bi is either in S or is some preceding Cj Each Ci+1 is a resolvent of Ci and Bi.
C is linearly deducible (refutable) from S if there is alinear deduction (refutation) of C from S
NC State University 72 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Resolution
Nomenclature
http://find/http://goback/8/3/2019 02 Propositional
73/77
S = inputclauses
C0 = startingclauses
Ci = centerclauses
Bi = sideclauses
NC State University 73 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Resolution
Soundness and completeness
http://find/http://goback/8/3/2019 02 Propositional
74/77
Linear resolution is sound (by restriction) Linear resolution is complete
NC State University 74 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Resolution
Linear input resolution
http://find/http://goback/8/3/2019 02 Propositional
75/77
Starts with goal clause All side clauses are input clauses
Incomplete in general
Consider all clauses of two literals Complete when all inputs are program clauses
NC State University 75 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Resolution
Refinements
http://find/http://goback/8/3/2019 02 Propositional
76/77
LD-resolution = linear definite resolution Ordered literals = definiteclauses Resolutions maintain ordering within insertions
SLD-resolution = selected linear definite
resolution Resolutions follow syntactic ordering of literals Prolog: always resolve on first goal literal
Both are sound and complete
NC State University 76 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
Propositional logic Resolution
Search and backtracking
http://find/http://goback/8/3/2019 02 Propositional
77/77
Success and failure on resolution paths Success = find on path Failure = end path with no
Search all paths until success or exhaustion
Depth-first search, breadth-first search, etc.
Pure backtracking DFS can fail!
Intelligent backtracking schemes
NC State University 77 / 77CSC 503 Fall 2005
c 2005 by Jon Doyle
http://find/http://goback/