cs 1502 formal methods in computer science

29
1 CS 1502 Formal Methods CS 1502 Formal Methods in Computer Science in Computer Science Lecture Notes 13 Lecture Notes 13 Equivalences, Equivalences, Arguments, and Proofs Arguments, and Proofs involving Quantifiers involving Quantifiers

Upload: margaret-emerson

Post on 31-Dec-2015

27 views

Category:

Documents


3 download

DESCRIPTION

CS 1502 Formal Methods in Computer Science. Lecture Notes 13 Equivalences, Arguments, and Proofs involving Quantifiers. Propositional Logic. Tautology Tautological Consequence Tautological Equivalence. Based on the truth-functional Connectives. First-Order Logic. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: CS 1502 Formal Methods in Computer Science

11

CS 1502 Formal Methods in CS 1502 Formal Methods in Computer ScienceComputer Science

Lecture Notes 13Lecture Notes 13Equivalences, Arguments, and Equivalences, Arguments, and

Proofs involving QuantifiersProofs involving Quantifiers

Page 2: CS 1502 Formal Methods in Computer Science

22

Propositional LogicPropositional Logic

TautologyTautology

Tautological ConsequenceTautological Consequence

Tautological EquivalenceTautological Equivalence

Based on thetruth-functional

Connectives

Page 3: CS 1502 Formal Methods in Computer Science

33

First-Order LogicFirst-Order Logic

Takes into consideration all of the truth-Takes into consideration all of the truth-functional connectives functional connectives (( ), ), the identity symbolthe identity symbol (=) (=), and the quantifiers , and the quantifiers ((x x y).y).

Page 4: CS 1502 Formal Methods in Computer Science

44

First-Order LogicFirst-Order Logic

FO ValidityFO Validity: a sentence that can’t be false: a sentence that can’t be falseFO Consequence:FO Consequence: applies to an argument applies to an argument whose conclusion can’t be made false whose conclusion can’t be made false when all of its premises are true.when all of its premises are true.FO EquivalenceFO Equivalence applies to a pair of applies to a pair of sentences that, in all possible sentences that, in all possible circumstances, have the same truth valuescircumstances, have the same truth values

Page 5: CS 1502 Formal Methods in Computer Science

55

FactsFacts

All All tautological consequencestautological consequences are are FO FO ConsequencesConsequences..

All All tautological equivalenciestautological equivalencies are are FO FO EquivalenciesEquivalencies..

Page 6: CS 1502 Formal Methods in Computer Science

66

FO ConsequenceFO Consequence

x [P(x) Q(x)] Q(b)

P(b)

QP

b

x [Tet(x) Large(x)] Large(b)

Tet(b)

A B

C

C is not a tautological consequence of A and B

Page 7: CS 1502 Formal Methods in Computer Science

77

Replacement MethodReplacement Method

This method is used to determine if a This method is used to determine if a sentence is an FO Validity and if an sentence is an FO Validity and if an argument is an FO Consequence.argument is an FO Consequence.

Page 8: CS 1502 Formal Methods in Computer Science

88

Replacement MethodReplacement Method

Replace all predicates in the sentence or in the Replace all predicates in the sentence or in the argument with symbolic ones making sure that if a argument with symbolic ones making sure that if a predicate appears more than once it is replaced with the predicate appears more than once it is replaced with the same symbolic name.same symbolic name.

See if you can describe a circumstance where the See if you can describe a circumstance where the sentence is false, if this is impossible then the sentence sentence is false, if this is impossible then the sentence is a FO Validity.is a FO Validity.

See if you can describe a circumstance where the See if you can describe a circumstance where the conclusion is false and the premises are all true. If this is conclusion is false and the premises are all true. If this is impossible, then the conclusion is an FO Consequence impossible, then the conclusion is an FO Consequence of its premises.of its premises.

Page 9: CS 1502 Formal Methods in Computer Science

99

DeMorgan’s Laws for QuantifiersDeMorgan’s Laws for Quantifiers

x P(x) x P(x) x [x [P(x)]P(x)]Nobody is P.Nobody is P.Everyone is not P.Everyone is not P.

x P(x) x P(x) x [x [P(x)]P(x)]It is not the case that everyone is P.It is not the case that everyone is P.Somebody is not P.Somebody is not P.

P

P

Page 10: CS 1502 Formal Methods in Computer Science

1010

Aristotelian Forms RevisitedAristotelian Forms Revisited

Negate: Negate: All P’s are Q’sAll P’s are Q’s..

~all x (P(x) ~all x (P(x) Q(x)) Q(x)) ~all x (~P(x) v Q(x)) ~all x (~P(x) v Q(x)) exist x (~(~P(x) v Q(x))) exist x (~(~P(x) v Q(x)))

exist x (P(x) ^ ~Q(x)) exist x (P(x) ^ ~Q(x))

Some P’s are not Q’sSome P’s are not Q’s

Page 11: CS 1502 Formal Methods in Computer Science

1111

A Special Form and its EquivalentA Special Form and its Equivalent

Only Q’s are P’sOnly Q’s are P’s

All P’s are Q’sAll P’s are Q’s

P

Q

Page 12: CS 1502 Formal Methods in Computer Science

1212

Page 13: CS 1502 Formal Methods in Computer Science

1313

Other Other EquivalencesEquivalences and and Non-Non-EquivalencesEquivalences (which are which?)(which are which?)

x [P(x) x [P(x) Q(x)] Q(x)] x P(x) x P(x) x Q(x)x Q(x)

x [P(x) x [P(x) Q(x)] Q(x)] x P(x) x P(x) x Q(x)x Q(x)

x [P(x) x [P(x) Q(x)] Q(x)] x P(x) x P(x) x Q(x)x Q(x)

x [P(x) x [P(x) Q(x)] Q(x)] x P(x) x P(x) x Q(x)x Q(x)

Page 14: CS 1502 Formal Methods in Computer Science

1414

Other EquivalencesOther Equivalences

x P x P P, where x is not free in P P, where x is not free in P

x P x P P, where x is not free in P P, where x is not free in P

x [P x [P Q(x)] Q(x)] P P x Q(x)x Q(x)

x [P x [P Q(x)] Q(x)] P P x Q(x)x Q(x)

x P(x) x P(x) y P(y) y P(y)

x P(x) x P(x) y P(y) y P(y)

Page 15: CS 1502 Formal Methods in Computer Science

1515

Proofs Involving QuantifiersProofs Involving Quantifiers

Universal EliminationUniversal Elimination

x S(x)x S(x) … …

S(c) S(c) Elim Elim

Page 16: CS 1502 Formal Methods in Computer Science

1616

ExampleExample

ProveProve

x Cube(x)x Cube(x) x Large(x)x Large(x)

Large(d) Large(d) Cube(d)] Cube(d)]

Page 17: CS 1502 Formal Methods in Computer Science

1717

Page 18: CS 1502 Formal Methods in Computer Science

1818

Proofs Involving Quantifiers

Universal Introduction c

S(c)

x S(x) Intro

Assume c is anarbitrary elementin the domain ofdiscourse.

Page 19: CS 1502 Formal Methods in Computer Science

1919

Example

Prove

x Cube(x) x Large(x)

x [Large(x) Cube(x)]

Page 20: CS 1502 Formal Methods in Computer Science

2020

Page 21: CS 1502 Formal Methods in Computer Science

2121

Proofs Involving Quantifiers

Existential Introduction

S(c) …

x S(x) Intro

Page 22: CS 1502 Formal Methods in Computer Science

2222

Example

Prove

Cube(e) Large(e) LeftOf(e,a) x [Cube(x) LeftOf(x,a)]

Page 23: CS 1502 Formal Methods in Computer Science

2323

Page 24: CS 1502 Formal Methods in Computer Science

2424

Proofs Involving Quantifiers

Existential Elimination x S(x)

c S(c)

Q

Q Elim

Since there exists an x such that S(x),

let c designate this object.

Symbol c cannot appear outside this

subproof!

Page 25: CS 1502 Formal Methods in Computer Science

2525

Example

Prove

x Large(x) x Cube(x)

x [Large(x) Cube(x)]

Page 26: CS 1502 Formal Methods in Computer Science

2626

Page 27: CS 1502 Formal Methods in Computer Science

2727

General Conditional Proof

Universal Introduction c P(c)

Q(c)

x [P(x) Q(x)] Intro

Assume c is anarbitrary elementin the domain ofDiscourse and assume P(c)

Page 28: CS 1502 Formal Methods in Computer Science

2828

Example

Prove

x [P(x) Q(x)] z [Q(z) R(z)]

x [P(x) R(x)]

Page 29: CS 1502 Formal Methods in Computer Science

2929