inference rules

Upload: kalgi-patel

Post on 03-Apr-2018

237 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/28/2019 Inference Rules

    1/19

    Inference Rules

    CS160/CS122

    Rosen: 1.5

  • 7/28/2019 Inference Rules

    2/19

    Whatislogic?

    Logic is a truth-preserving system of inference

    Inference: the process ofderiving (inferring) new

    statements from old

    statements

    System: a set ofmechanistic

    transformations, based

    on syntax alone

    Truth-preserving:If the initial

    statements are

    true, the inferred

    statements will

    be true

  • 7/28/2019 Inference Rules

    3/19

    Proposi0onalLogic

    Anargumentisasequenceofproposi0ons:Premises(Axioms)arethefirstnproposi0ons

    Conclusionisthen+1th(final)proposi0on.

    Anargumentisvalidifisatautology,giventhatsarethepremises

    (axioms)andistheconclusion

    p1" p

    2" ..." p

    n( )# q

    piq

  • 7/28/2019 Inference Rules

    4/19

    Hello

    World

    Proof By Truth Table

    n If the conclusion is true in the truth tablewhenever the premises are true, it isprovedn Warning: when the premises are false, the

    conclusion my be true orfalse

    n Problem: given n propositions, the truthtable has 2

    n

    rowsn Proof by truth table quickly becomes

    infeasible

  • 7/28/2019 Inference Rules

    5/19

    RulesofInference

    n Aruleofinferenceisapre-provedrela0on:any0metheleHhandside(LS)istrue,the

    righthandside(RS)isalsotrue.

    n Therefore,ifwecanmatchapremisetotheLS(bysubs0tu0ngproposi0ons),wecan

    assertthe(subs0tuted)RS

  • 7/28/2019 Inference Rules

    6/19

    ExampleRuleofInference

    ModusPonensp" p# q( )( )# q

    p

    "

    p# q

    q

    0 0 1 0 1

    0 1 1 0 11 0 0 0 1

    1 1 1 1 1

    p

    q

    p" q

    p" p# q( )

    p" p# q( )( )# q

  • 7/28/2019 Inference Rules

    7/19

    Example

    Given(p)Ifitisraining,then(q)thegrassiswet.(p)Itisraining.

    Therefore,bymodusponens,(q)Thegrassiswet.

  • 7/28/2019 Inference Rules

    8/19

    Applyingrulesofinference

    n Examplerule:A,ABBn ReadasAandAB,thereforeBn Thisrulehasaname:modusponens

    n IfyouhavepremisesC,CDn Subs0tuteCforA,DforBnApplymodusponens

    n ConcludeD

  • 7/28/2019 Inference Rules

    9/19

    RulesofInference

  • 7/28/2019 Inference Rules

    10/19

    LogicalEquivalences

  • 7/28/2019 Inference Rules

    11/19

    ASimpleProofn Given:X,XY,YZ,(Z)Wn Prove:W

    Step Reason

    1. Given (Premise)

    2. Given (Premise)

    3. Hypothetical Syllogism (1) & (2)

    4. Given (Premise)

    5. Modus Ponens (3) & (4)

    6. Given (Premise)

    7. Disjunctive Syllogism (5) & (6)

    x! y

    y! z

    x! z

    x

    z

    z!w

    w

  • 7/28/2019 Inference Rules

    12/19

    ASimpleProofFromWords

    InordertotakeCS161,ImustfirsttakeCS16andeitherM155orM16.IhavenottakenM155butIhavetakenCS161.ProvethatIhavetakenM16.

    Firststep:assignproposi0onsn A:takeCS161n B:takeCS16n C:TakeM155n D:TakeM16

  • 7/28/2019 Inference Rules

    13/19

    Nowsetuptheproof

    n Axioms:n AB(CD)n An C

    n Conclusion:n D

  • 7/28/2019 Inference Rules

    14/19

    NowdotheProof

    Step Reason

    1. Given (Premise)

    2. Given (Premise)

    3. Modus Ponens (1) & (2)

    4. Simplification

    5. Given (Premise)

    6. Disjunctive Syllogism (4) & (5)

    A! B"(C#D)

    A

    B!(C"D)

    C!D

    D

    C

  • 7/28/2019 Inference Rules

    15/19

    Example

    Given: Conclude:p"q

    r# p

    r# s

    s#

    t

    t

  • 7/28/2019 Inference Rules

    16/19

    ProofofExample

    Step Reason

    1. Premise

    2. Simplification using (1)

    3. Premise

    4. Modus Tollens (2) & (3)

    5. Premise

    6. Modus Ponens (4) & (5)

    7. Premise

    8. Modus Ponens (6) & (7)

    r" p

    p"q

    p

    r

    t

    r" s

    s

    s" t

  • 7/28/2019 Inference Rules

    17/19

    AnotherExample

    Given: Conclude:p" q

    p" r

    r" s

    q" s

  • 7/28/2019 Inference Rules

    18/19

    ProofofAnotherExample

    Step Reason

    1. Premise

    2. Implication law (1)

    3. Premise

    4. Hypothetical syllogism of(2) & (3)

    5. Premise

    6. Hypothetical syllogism of

    (4) & (5)

    p" r

    p" q

    q"p

    q" r

    r" s

    q" s

  • 7/28/2019 Inference Rules

    19/19

    Proof by Rules of Inference (Example)

    n By 2nd DeMorgansn By 1st DeMorgansn By double negationn By 2nd distributiven By definition ofn By commutative lawn By definition of

    Prove: (p(pq)) (pq)

    (p(pq)) p (pq)

    p ((p)q)p(pq)

    (pp) (pq) F (pq) (pq) F

    (pq)