53
Deductive Systems Lecture - 3

Deductive Systemssaroj/LFP/LFP_2013/L3.pdf · 2013. 8. 2. · Prof Saroj Kaushik, CSE, IITD Axiomatic System (AS) for PL AS is based on the set of only three axioms and one rule of

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

  • Deductive Systems

    Lecture - 3

  • Axiomatic System

  • Prof Saroj Kaushik, CSE, IITD

    Axiomatic System (AS) for PL

    ● AS is based on the set of only three axioms and

    one rule of deduction.

    − It is minimal in structure but as powerful as the truth table

    and natural deduction approaches.

    − The proofs of the theorems are often difficult and require a

    guess in selection of appropriate axiom(s) and rules.

    − These methods basically require forward chaining strategy

    where we start with the given hypotheses and prove the

    goal.

  • Prof Saroj Kaushik, CSE, IITD

    Axiomatic System for PL -Cont

    ● Three axioms and one rule of deduction.

    Axiom1 (A1): α → (β → α)

    Axiom2 (A2): (α →(β→γ)) →((α → β) → (α → γ))

    Axiom3 (A3): (~ α → ~ β) → ( β → α)

    Modus Ponen (MP) defined as follows:

    Hypotheses: α → β and α Consequent: β

  • Prof Saroj Kaushik, CSE, IITD

    Cont…

    Definition: A deduction of a formula in Axiomatic

    System for Propositional Logic is a sequence of well-

    formed formulae α1, α2, ..., αn such that for each i, (1≤ i ≤ n), either

    – Either αi is an axiom or αi is a hypothesis (given to be true)

    – Or αi is derived from αj and αk where j, k < i using modus ponen inference rule.

    � We call αi to be a deductive consequence of {α1, ...,αi-1 }.

    � It is denoted by {αααα1, .. , ααααi-1 } |- ααααi. More formally, deductive consequence is defined on next slide.

  • Prof Saroj Kaushik, CSE, IITD

    Cont…

    Definition: If ∑ is a set of hypotheses involved in the deduction of α as defined above, then α is called to be a deductive consequence of ∑ or α is deducible from ∑ . It is written as ∑ |-α.

    Definition: If ∑ is an empty set and α is deduced, then we write |- α. In this case α is deduced from axioms only and no hypotheses are used. In such

    case we call α to be a theorem.

    � Instances of the axioms are the simplest forms of

    theorems in Axiomatic Theory.

  • Prof Saroj Kaushik, CSE, IITD

    Cont…

    � It should be noted that proofs need not be unique.

    � We have to carefully select axioms, which can lead to the proof.

    � The proof of a theorem can be tricky and hard.

    � The proofs require mixture of bottom up and top

    down reasoning.

    � Start reasoning bottom up seeing what we can do

    with axioms and top down reasoning seeing what

    might possibly lead to answer.

  • Prof Saroj Kaushik, CSE, IITD

    Examples

    Establish the following:

    Ex1:{Q} |- (P→Q) i.e.,P→Q is a deductive consequence of {Q}.

    {Hypothesis} Q (1)

    {Axiom A1} Q → (P → Q) (2){MP, (1,2)} P →→→→ Q proved

  • Prof Saroj Kaushik, CSE, IITD

    Examples – Cont…

    Ex2:

    { P → Q, Q → R } |- ( P → R ) i.e., P → R is a

    deductive consequence of { P → Q, Q → R }.

    {Hypothesis} P → Q (1)

    {Hypothesis} Q → R (2)

    {Axiom A1} (Q→ R) → (P → (Q → R)) (3)

    {MP, (2, 3)} P → (Q → R) (4)

    {Axiom A2} (P → (Q → R)) →

    ((P → Q) → (P → R)) (5)

    {MP , (4, 5)} (P → Q) → (P → R) (6)

    {MP, (1, 6)} P →→→→ R proved

  • Prof Saroj Kaushik, CSE, IITD

    Deduction Theorems in AS

    Deduction Theorem:

    If ∑ is a set of hypotheses and α and β are

    well-formed formulae , then {∑ ∪ α } |- βimplies ∑ |- (α → β ).

    Converse of deduction theorem:

    Given ∑ |- (α → β ),

    we can prove { ∑ ∪ α } |- β.

  • Prof Saroj Kaushik, CSE, IITD

    Useful Tips

    1. Given α, we can easily prove β → α for any well-formed formulae α and β.

    2. If α → β is to be proved, then include α in the set of hypotheses ∑ and derive β from the set {∑ ∪ α}. Then using deduction theorem, we conclude α → β.

  • Prof Saroj Kaushik, CSE, IITD

    Examples

    Example1:

    Prove |- ~P →→→→ (P →→→→ Q) using deduction theorem of Axiomatic System.

    Proof: Prove {~ P} |- (P → Q) and |- ~ P→(P→Q) follows from deduction theorem.

  • Prof Saroj Kaushik, CSE, IITD

    Proof

    {Prove} {~ P} |- (P →→→→ Q)

    {Hypothesis} ~ P (1)

    {Axiom A1} ~ P → (~ Q → ~ P) (2)

    {MP, (1, 2)} ~ Q → ~ P (3)

    {Axiom A3} (~ Q → ~ P) → ( P → Q) (4)

    {MP, (3,4)} P →→→→ Q proved

    Hence by using deduction theorem, we conclude

    |- ~ P → (P → Q)

  • Prof Saroj Kaushik, CSE, IITD

    Cont…

    Example2:Prove that |- (~ ~ P → ~ ~P) is a theorem.

    Proof:{Theorem} |- (~ ~P →→→→ ~ ~P){Axiom A1} ~ ~ P → (( Q → ~ ~P)

    → ~ ~P) (1){Axiom A2} (~ ~P → (( Q → ~ ~P) → ~ ~P))

    → ((~ ~P → ( Q → ~ ~ P)) → (~ ~P → ~ ~P)) (2)

    { MP, (1, 2)} ((~ ~P → ( Q → ~ ~ P)) → (~ ~P → ~ ~P)) (3)

    {Axiom A1} ~ ~P → ( Q → ~ ~ P) (4){ MP, (3, 4) } ~ ~P →→→→ ~ ~ P proved

  • Prof Saroj Kaushik, CSE, IITD

    Cont…

    Definition: A truth valuation is a function ν from a set of well-formed formulae to the set {T, F} such

    that for any well-formed formulae α and β

    – ν(~ α ) ≠ ν (α )

    – ν (α → β ) = F iff ν (α ) = T and ν (β ) = F

    � The truth assignment to the atoms uniquely

    determines the truth valuation of all formulae.

    Definition: A formula α is said to be valid (denoted by |= α) if and only if for all valuation ν, ν(α) = T.

    Lemma 1: If α and β are well-formed formulae, then |= α and |= (α → β) implies |= β.

  • Prof Saroj Kaushik, CSE, IITD

    Cont…

    Definition: A formula α is said to be inconsistent if and only if for all valuation ν, ν(α) = F.

    Definition: If α is a formula and ∃ a valuation ν such that ν(α) = T, then α is said to be consistent.

    Definition: A set of formulae is said to be mutually

    consistent if and only if they are all true

    simultaneously for some valuation.

    Definition: A set of formulae is said to be mutually inconsistent if and only if there exists no valuation

    under which conjunction of formulae is true.

  • Prof Saroj Kaushik, CSE, IITD

    Soundness and Completeness in AS

    Theorem : If α is a formula in AS, then α is a theorem if and only if α is valid.

    � (Soundness): Every theorem is valid i.e.,

    |- αααα →→→→ |= αααα.

    � (Completeness): if α is valid then α is a theorem i.e., |= αααα →→→→ |- αααα.

    � (Consistency): Axiomatic System for propositional

    logic is consistent if it is not possible to prove both αand ~ α for any well-formed formula α i.e., not both |- α and |- ~ α.

  • Semantic Tableaux Method

  • Prof Saroj Kaushik, CSE, IITD

    Semantic Tableaux System in PL

    ● Earlier approaches require

    − construction of proof of a formula from given set of

    formulae and are called direct methods.

    ● In semantic tableaux,

    − the set of rules are applied systematically on a formula or

    set of formulae to establish its consistency or

    inconsistency.

    ● Semantic tableau

    − binary tree constructed by using semantic rules with a

    formula as a root

    ● Assume α and β be any two formulae.

  • Prof Saroj Kaushik, CSE, IITD

    Semantic Tableaux Rules

    • Let α and β be any two formulae. Rule 1: A tableau for a formula (α Λ β) is constructed by

    adding both α and β to the same path (branch). This can be represented as follows:

    α Λ βαβ

    Interpretation: α Λ β is true if both α and β are true

  • Prof Saroj Kaushik, CSE, IITD

    Rules - Cont…

    Rule 2: A tableau for a formula ~ (α Λ β) is constructed by adding two alternative paths one containing ~ α and other containing ~ β

    ~ (α Λ β)

    ~ α ~ β

    Interpretation: ~ (α Λ β ) is true if either ~ αor ~ β is true

  • Prof Saroj Kaushik, CSE, IITD

    Cont…

    Rule 3: A tableau for a formula (α V β) is constructed by adding two new paths one containing α and other containing β.

    α V β

    α β

    Interpretation: α V β is true if either αor β is true

  • Prof Saroj Kaushik, CSE, IITD

    Cont…

    Rule 4: A tableau for a formula ~ (α V β) is constructed by adding both ~ α and ~ β to the same path. This can be expressed as follows:

    ~ ( α V β)

    ~ α

    ~ β

    Rule 5: Semantic tableau for ~~ α~~ α

    α

  • Prof Saroj Kaushik, CSE, IITD

    Rule 6: Semantic tableau for α → β

    α → β

    ~ α β

    Rule 7: Semantic tableau for ~ ( α → β)

    ~ (α → β)

    α

    ~ β

  • Prof Saroj Kaushik, CSE, IITD

    Rule 8: Semantic tableau for α ↔ β α↔ β ≅ (α Λ β) V (~ α Λ ~ β)

    α ↔ β

    α Λ β ~ α Λ ~ β

    Rule 9: Semantic tableau for ~ (α ↔ β)~ (α ↔ β) ≅ (α Λ ~ β) V (~ α Λ β)

    ~ (α ↔ β)

    α Λ ~ β ~ α Λ β

  • Prof Saroj Kaushik, CSE, IITD

    Consistency and Inconsistency

    � If an atom P and ~ P appear on a same

    path of a semantic tableau, – then inconsistency is indicated and such path is

    said to be contradictory or closed (finished) path.

    − Even if one path remains non contradictory or

    unclosed (open), then the formula α at the root of a tableau is consistent.

  • Prof Saroj Kaushik, CSE, IITD

    Valuation

    � A valuation ν is said to be a model of α (or νsatisfies α) iff ν (α) = T.

    � In tableaux approach, model for a consistent

    formula α is constructed as follows:

    – On an open path, assign truth values to atoms

    (positive or negative) of α which is at the root of a tableau such that α is made to be true.

    – It is achieved by assigning truth value T to each

    atomic formula (positive or negative) on that path.

  • Prof Saroj Kaushik, CSE, IITD

    Contradictory Tableau

    • Contradictory tableau (or finished tableau) is defined to be a tableau in which all the paths are contradictory or closed

    (finished).

    • If a tableau for a formula α at the root is a contradictory tableau, then a formula α is said to be inconsistent.

    • A formula α is consistent if there is at least on open path in a tableau with root α

  • Prof Saroj Kaushik, CSE, IITD

    Example – Inconsistent

    Example: Show that

    α : (P Λ Q → R) Λ (~P → S) Λ Q Λ ~ R Λ ~ S is inconsistent using tableaux method.

    {T-root} (P Λ Q → R) Λ ( ~P → S) Λ Q Λ ~ R Λ ~ S (1){Apply rule 1 to 1} P Λ Q → R (2)

    ~P → S (3)

    Q

    ~ R

    ~ S

    {Apply rule 6 to 3} P S

    Closed: {S, ~ S} on the path

    {Apply rule 6 to 2)} ~ (P Λ Q) R

    Closed { R, ~ R}

    ~P ~ Q

    Closed {P, ~ P} Closed{~ Q, Q}

  • Prof Saroj Kaushik, CSE, IITD

    Example - Consistent

    Problem: Show that α: ( Q Λ~R) Λ (R → P) is consistent and find its model.

    Solution:{T-root} ( Q Λ ~ R) Λ ( R → P) (1)

    {Apply rule 1 to 1} (Q Λ ~ R) (2)

    ( R → P) (3)

    {Apply rule 1 to 2} Q

    {Apply rule 6 to 3} ~R

    ~ R P

    open open

  • Prof Saroj Kaushik, CSE, IITD

    Example -Cont…

    � Since tableau for α has open paths, we conclude that α is consistent.

    � The models are constructed by assigning T to all

    atomic formulae appearing on open paths.

    – Assign Q = T and ~ R = T i.e., R = F.

    • So { Q = T, R = F } is a model of αααα.

    – Assign Q = T and ~ R = T and P = T.

    • So { P = T , Q = T, R = F } is another model.

    � Useful Tip:

    – Thumb rule for constructing a tableau is to

    apply non branching rules before the branching

    rules in any order

  • Prof Saroj Kaushik, CSE, IITD

    Important Definitions

    � A set of formulae {α1, α2, ….,αn } is said to be consistent if the formulae in a set are simultaneously true for some model i.e., if a tableau for α1 Λ α2 Λ ….. Λ αn has at least one open (or non contradictory) path.

    � A set of formulae {α1, α2, ….,αn } is said to be inconsistent iff all the formulae can not be true simultaneously i.e., tableau for (α1Λ α2Λ ….Λ αn )as a root is a contradictory tableau.

  • Prof Saroj Kaushik, CSE, IITD

    Definitions – Cont…

    � A formula α is tableau provable if tableau with root entry as ~ α is contradictory tableau.

    – A tableau proof of a formula α is a contradictory tableau with root entry as ~ α.

    � A formula α is valid if α is tableau provable.

  • Prof Saroj Kaushik, CSE, IITD

    Soundness and Completeness

    � Theorem: (Soundness)

    If α is tableau provable ( |- α ) , then α is

    valid ( |= α ) i.e., |- α ⇒ |= α.

    � Theorem: (Completeness)

    If α is valid, then α is tableau provable i.e.,

    |= α ⇒ |- α.

  • Prof Saroj Kaushik, CSE, IITD

    Example - Validity

    Example: Show that α : P → ( Q → P) is valid

    Solution: In order to show that α is a valid, we will try to show that α is tableau provable i.e., ~ α is inconsistent.

    {T-root} ~ (P → ( Q → P)) (1)

    {Apply rule7 to 1} P

    ~ ( Q → P) (2)

    {Apply rule 7 to 2} Q

    ~P

    Closed {P, ~ P}

    Hence P → ( Q → P) is valid.

  • Prof Saroj Kaushik, CSE, IITD

    Logical Consequence

    � A tableau proof of a formula α from a set of premises ∑ = {α1, α2 ,…,αn } is a tableau obtained from (α1 Λ α2 Λ ….. Λ αn) with ~ α as a root entry.

    � If it is a contradictory tableau, then we say that α is tableau provable from ∑.– It is denoted by ∑ |- α.

    � A formula α is said to be a logical consequence (LC) of a set of premises ∑ , if α is tableau provable from ∑.– It is denoted by ∑ |= α.

  • Prof Saroj Kaushik, CSE, IITD

    Soundness and Completeness of LC

    Theorem: (Soundness of deduction from

    premises): If there is a tableau proof of αfrom a set of premises ∑, then α is a

    logical consequence of ∑, i.e., ∑ |- α ⇒∑ |= α.

    Theorem: (Completeness of deduction from

    premises): If α is a logical consequence of a set ∑ of premises, then α is tableau provable from ∑, i.e., ∑ |= α ⇒ ∑ |- α.

  • Resolution Method in PL

  • Prof Saroj Kaushik, CSE, IITD

    Resolution Refutation in PL

    � Resolution refutation is another simple method to prove a formula by contradiction.– Here negation of goal to be proved is added to given set

    of clauses.

    – It is shown then that there is a refutation in new set using resolution principle.

    � Resolution: During this process we need to identify – two clauses, one with positive atom (P) and other with

    negative atom (~P) for the application of resolution rule.

  • Prof Saroj Kaushik, CSE, IITD

    Cont…

    � Resolution is based on modus poneninference rule.

    – This method is most favoured for developing

    computer based theorem provers.

    – Automatic theorem provers using resolution are simple and efficient systems .

    � Resolution is performed on special types of formulae called clauses.

    – Clause is propositional formula expressed using

    {V, ~ } operators.

  • Prof Saroj Kaushik, CSE, IITD

    Conjunctive and Disjunctive

    Normal Forms

    � In Disjunctive Normal Form (DNF), – a formula is represented in the form

    – (L11 Λ ….. Λ L1n ) V ..… V (Lm1 Λ ….. Λ Lmk ), where all Lij are literals. It is a disjunction

    of conjunction.

    � In Conjunctive Normal Form (CNF),– a formula is represented in the form

    – (L11 V ….. V L1n ) Λ …… Λ (Lp1 V ….. V Lpm ) , where all Lij are literals. It is a

    conjunction of disjunction.

    � A clause is a special formula expressed as disjunction of literals. If a clause contains only one literal, then it is called unit clause.

  • Prof Saroj Kaushik, CSE, IITD

    Conversion of a Formula to its CNF

    � Each formula in Propositional Logic can be easily transformed into its equivalent DNF or CNF representation using equivalence laws .

    – Eliminate → and ↔ by using the following equivalence laws.

    P → Q ≅ ~ P V Q

    P ↔ Q ≅ ( P → Q) Λ ( Q → P)

    – Eliminate double negation signs by using

    ~ ~ P ≅ P

  • Prof Saroj Kaushik, CSE, IITD

    Cont…

    � Use De Morgan’s laws to push ~ (negation)

    immediately before atomic formula.

    ~ ( P Λ Q) ≅ ~ P V ~ Q

    ~ ( P V Q) ≅ ~ P Λ ~ Q

    � Use distributive law to get CNF.

    P V (Q Λ R) ≅ (P V Q) Λ (P V R)

    � We notice that CNF representation of a formula is

    of the form

    – (C1 Λ….. ΛCn ) , where each Ck , (1≤ k ≤ n ) is a clause that is disjunction of literals.

  • Prof Saroj Kaushik, CSE, IITD

    Resolution of Clauses

    � If two clauses C1 and C2 contain a

    complementary pair of literals {L, ~L}, then

    – these clauses can be resolved together by deleting L from C1 and ~ L from C2 and constructing a new clause by the disjunction of the remaining literals in C1 and C2.

    � The new clause thus generated is called

    resolvent of C1 and C2 .

    – Here C1 and C2 are called parents of resolved clause.

    – If the resolvent contains one or more set of complementary pair of literals, then resolvent is always true.

  • Prof Saroj Kaushik, CSE, IITD

    Resolution Tree

    � Inverted binary tree is generated with the last node of the binary tree to be a resolvent.

    � This also called resolution tree.

    Example: Find resolvent of:

    C1 = P V Q V R

    C2 = ~ Q V ~ W

    C3 = ~ P V ~ W

  • Prof Saroj Kaushik, CSE, IITD

    Example- Resolution Tree

    P V Q V R ~ Q V ~W

    {Q, ~ Q}

    P V R V ~W ~ P V ~ W

    {P, ~P}

    R V ~W

    � Thus Resolvent(C1,C2, C3) = R V ~W

  • Prof Saroj Kaushik, CSE, IITD

    Definitions

    Theorem: If C is a resolvent of two clauses C1 and

    C2, then C is a logical consequence of {C1 , C2 }.

    Definition: A deduction of an empty clause from a set S of clauses is called a resolution refutation of

    S.

    Theorem: (Soundness & Completeness of resolution): There is a resolution refutation of S iffS is unsatisfiable / inconsistent.

  • Prof Saroj Kaushik, CSE, IITD

    Cont…

    Theorem: Let S be a set of clauses.

    � A clause C is a logical consequence of S iff

    the set S’= S ∪ {~ C} is unsatisfiable.

    � In other words, C is a logical consequence

    of a given set S iff an empty clause is

    deduced from the set S'.

  • Prof Saroj Kaushik, CSE, IITD

    Example

    Example: “Mary will get her degree if she registers

    as a student and pass her exam. She has registered herself as a student. She has passed

    her exam”. Show that she will get a degree.

    Solution: Symbolize above statements as follows:

    R: Mary is a registered student

    P: Mary has passed her exam

    D: Mary gets her degree

    � The formulae corresponding to above listed

    sentences are as follows:

  • Prof Saroj Kaushik, CSE, IITD

    Cont…

    � Mary will get her degree if she registers as a student and pass her exam.

    R Λ P → D ≅ (~ R V ~ P V D)

    � She has registered herself as a student. R

    � She has passed her exam.P

    � Conclude “Mary will get a degree”.D

  • Prof Saroj Kaushik, CSE, IITD

    Example – Cont…

    � Set of clauses are:

    – S = {~ R V ~ P V D , R, P }

    � Add negation of "Mary gets her degree (= D)" to S.

    � New set S' is:

    – S' = {~ R V ~ P V D , R, P, ~ D}

    � We can easily see that empty clause is

    deduced from above set.

    � Hence we can conclude that “Mary gets her degree”

  • Prof Saroj Kaushik, CSE, IITD

    Deriving Contradiction

    ~ R V ~ P V D R

    ~ P V D P

    D ~ D

  • Prof Saroj Kaushik, CSE, IITD

    Exercises

    I. Establish the following:1. { P → Q, Q → R } |- ( P → R ) 2. { P → Q} |- (R → P) → (R → Q)3. { P } |- (~ P → Q) 4. { ~Q, P → ( ~Q → R) } |- P → R5. {P → Q , ~ Q } |- ~ P. This is called Modus Tollen rule.

    II. Prove the following theorems1. |- (P → P)2. |- (~ P → P) → P3. |- (P → Q) → (~ Q → ~ P)4. |- (P → ~ Q) → ( Q → ~ P)

    III. Give tableau proof of each of the following formulae and show that formulae are valid.1. P → ( Q → P)2. (P Λ (Q V R) ↔ (( P Λ Q) V ( P Λ R))3. ~ (P V Q) ↔ (~ P Λ ~ Q)

    IV. Are the following arguments valid?1. If John lives in England then he lives in UK. John lives in England. Therefore, John lives in UK.

    2. If John lives in England then he lives in UK. John lives in UK. Therefore, John lives in England.

    3. If John lives in England then he lives in UK. John does not live in UK. Therefore, John does not live in England.

    V. Prove by resolution refutation 1. {P Λ Q , ~ P V R} |= Q V R 2. { P , Q → R , P → R} |= P Λ R 3. {P → Q Λ R , P} |= R