#4 formal methods – predicate logic

50
Prepared by: Sharif Omar Salem – [email protected] Prepared by: Sharif Omar Salem – [email protected] Formal Methods: Predicate Logic 1

Upload: sharif-omar-salem

Post on 15-Feb-2017

1.293 views

Category:

Education


3 download

TRANSCRIPT

Page 1: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

1

Prepared by: Sharif Omar Salem – [email protected]

Formal Methods:Predicate Logic

Page 2: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

2

Proposition are not enough

In general Propositional Logic is not enough to describe properties and its related specs.

Page 3: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

3

Syntax of Predicate Logic

Page 4: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

4

VariablesA variable is a symbol that stands for an individual in a collection or set.

For example, the variable x may stand for one of the days. We may let x = Monday or x = Tuesday, etc.

A collection of objects is called the domain of a variable.For the above example, the days in the week is the domain of variable x.

Months have 30 days.Domain or Set is Months of the year x≔ Individuals or objects are Jan, Feb, …… Dec.Property or Predicate is “ has 30 days” P≔Predicate Formula P(x)

Variables and Statements

Page 5: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

5

Quantifiers: Quantifiers are phrases that refer to given quantities.Two kinds of quantifiers: Universal and ExistentialUniversal Quantifier: represented by The symbol is translated as and means “for all”, “given any”, “for each,” or “for

every,” and is known as the universal quantifier. All Days have 24 hours.

Predicate Formula (x)P(x)

Existential Quantifier: represented by The symbol is translated as and means variously “for some,” “there exists,”

“there is a,” or “for at least one”.Some months has 30 days.

Predicate Formula (x)P(x)

Quantifiers and Predicates

Page 6: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

6

PredicateIt is the verbal statement that describes the property of a variable. Usually represented by the letter P, the notation P(x) is used to represent

some unspecified property or predicate that x may havee.g. P(x) = x has 30 days. P(April) = April has 30 days.

The collection of objects that satisfy the property P(x) is called the domain of interpretation.

Truth value of expressions formed using quantifiers and predicatesWhat is the truth value of (x)P(x) x is all the months P(x) = x has less than 32 days.The above formula is true since no month has 32 days.

Quantifiers and Predicates

Page 7: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

7

Truth of expression (x)P(x)1. P(x) is the property that x is yellow, and the domain of interpretation is the

collection of all flowers:

2. P(x) is the property that x is a plant, and the domain of interpretation is the collection of all flowers:

3. P(x) is the property that x is positive, and the domain of interpretation consists of integers:

Can you find one interpretation in which both (x)P(x) is true and (x)P(x) is false?

Can you find one interpretation in which both (x)P(x) is true and (x)P(x) is false?

Truth value of the following expressions

not true

not true

true

Case 1 as mentioned above

Not possible

Page 8: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

8

A predicate Formula for a single variable is known as unary predicate All days has 24 hours (≔ x)P(x)

A predicate Formula for two variables is known as Binary predicate For every University there exists a talent students .

≔ (x) (y) Q(x,y)

A predicate Formula for N variables is known as N-ary predicate.

Unary, Binary, Ternary, … N-ary Predicate

Page 9: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

9

Formal definition: An interpretation for an expression involving predicates consists of the following:

1. A collection of objects, called the domain of interpretation, which must include at least one object.

2. An assignment of a property of the objects in the domain to each predicate in the expression.

3. An assignment of a particular object in the domain to each constant symbol in the expression.

Interpretation

Page 10: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

10

Predicate wffs can be built similar to propositional wffs using logical connectives with predicates and quantifiers.

Examples of predicate wffs

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

(x) ((y)[P(x,y) V Q(x,y)] R(x))

S(x,y) Λ R(x,y)

WFF

Page 11: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

11

“Every person is nice” can be rephrased as “For any thing, if it is a person, then it is nice.”

P(x) “≔ x is a person” Q(x) “≔ x is nice” the statement can be symbolized

as For any thing, if it is a person, then it is nice

(x) [ P(x) Q(x) ]“All persons are nice” or “Each person is nice” will also have the

same symbolic formula. always related with (implication)

Translation: Verbal statements to symbolic form

Page 12: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

12

“There is a nice person” can be rewritten as “There exists something that is both a person and nice.”In symbolic form, (x)[P(x) Λ Q(x)].Variations: “Some persons are nice” or “There are nice persons.” always related with Λ (conjunction)

What would the following form mean for the example above?(x)[P(x) Q(x)] ???????

Translation: Verbal statements to symbolic form

Page 13: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

13

Example for forming symbolic forms from predicate symbols

All dogs chase all rabbits ≔For anything, if it is a dog, Then for any other thing, if it is a rabbit, then the dog chases it ≔

(x)[ D(x) (y)( R(y) C(x,y) ) ]

Translation

D(x) ≔ “x is a dog”R(y) ≔ “y is a rabbit”C(x,y) ≔ “x chases y”

Page 14: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

14

Some dogs chase all rabbits ≔There is something that is a dog and for any other thing, if that thing is a rabbit, then the dog chases it ≔ (x)[D(x) Λ (y)(R(y) C(x,y) ) ]

Only dogs chase rabbits ≔For any things, If it chase rabbits, then it is a dog.

≔ For any things and for any other things if the other things is rabbits and chases by the first thing, then that first thing is a dog

≔ For any two things, if one is a rabbit and the other chases it, then the other is a dog ≔ (y) (x)[R(y) Λ C(x,y) D(x)]

Translation

D(x) ≔ “x is a dog”R(y) ≔ “y is a rabbit”C(x,y) ≔ “x chases y”

Page 15: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

15

Everything is fun (≔ x)A(x)Negation will be “it is false that everything is fun,” [(≔ x)A(x)] i.e. “something is non-fun.” (≔ x)[A(x)] In symbolic form, [(x)A(x)] ↔ (x)[A(x)]

Similarly negation of “Something is fun” (≔ x)A(x)Negation will be “it is false that Something is fun,”

“Nothing is fun” [(≔ x)A(x)] i.e. “Everything is boring.” (≔ x)[A(x)] Hence, [(x)A(x)] ↔ (x)[A(x)]

Negation of statements

Page 16: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

16

What is the negation of the following statements?Some pictures are old and faded.

All people are tall and thin.

Negation of statements

Every picture is neither old nor faded.

Someone is short or fat.

Page 17: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

17

Write wffs that express the following statements:All players are good.

Some good players, score goals.

Class exercise

For anything, if it is a player, then it is good ≔ (x)[S(x) I (x)]

There is something that is good and it is a player and it score goals ≔ (x)[I(x) Λ S(x) Λ M(x)]

S(x)≔ x is a player I(x)≔ x is good M(x)≔ x scores goals

Page 18: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

18

Everyone who scores goals is a bad player.

Only good player, scores goals.

Class exercise

For anything, if that thing scores goals, then it is a player and it is not good ≔ (x)[ M(x) S(x) Λ (I (x)) ]

For any thing, if it scores goals , then it is a player and it is good ≔ (x)(M(x) S(x) Λ I(x))

S(x)≔ x is a player I(x)≔ x is good M(x)≔ x scores goals

Page 19: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

19

Similar to a tautology of propositional logic.Truth of a predicate wff depends on the interpretation.A predicate wff is valid if it is true in all possible interpretations just like a

propositional wff is true if it is true for all rows of the truth table.A valid predicate wff is intrinsically true

Validity

Propositional Wffs Predicate Wffs

Truth valuesTrue or false – depends on the truth value of statement letters

True, false or neither (if the wff has a free variable)

Intrinsic truth Tautology – true for all truth values of its statements

Valid wff – true for all interpretations

Methodology(Validity Porve)

Truth Table/Proof sequence using rules

Proof sequence using rules/others

Free Variable (x)[P(x,y) (y) Q(x,y)]variable y is not defined for P(x,y) hence y is called a free variable.

Such expressions might not have a truth value at all.

Page 20: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

20

Bound and Free variable

Page 21: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

21

(x)P(x) (x)P(x)This is valid because if every object of the domain has a certain property, then

there exists an object of the domain that has the same property.

(x)P(x) P(a)Valid – quite obvious since “a” is a member (object) of the domain of x.

(x)P(x) (x)P(x)Not valid since the property cannot be valid for all objects in the domain if it is

valid for some objects of than domain. Can use a mathematical context to check as well.

Say P(x) = “x is even,” then there exists an integer that is even but not every integer is even.

Validity examples

Page 22: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

22

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

Invalid, can prove by mathematical context by taking P(x) = x is even and Q(x) = x is odd.

In that case, the hypothesis is true but not the conclusion is false because it is not the case that every integer is even or that every integer is odd.

Validity examples

Page 23: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

23

Exercise Translation

P(x) ≔ x is a painterL(x,y) ≔ x loves ya ≔ Aliceb ≔ Bob

Alice is a painter. ≔ P(a)Bob loves Alice ≔ L(b,a)Alice loves Bob ≔ L(a,b)Bob is not a painter ≔ ¬P(b) or

[P(b)]˜If Bob is a painter then Alice loves Bob

≔ P(b)L(a,b)

Bob is a painter only if Alice is not a painter

≔ P(b) ¬P(a)

Page 24: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

24

Exercise Translation

P(x) ≔ x is a painterL(x,y) ≔ x loves ya ≔ Aliceb ≔ Bob

Everyone is a painter ≔ (x)P(x)

Someone is a painter ≔ (x)P(x)Not everyone is a painter

≔ ¬(x)P(x)

No one is a painter ≔ (x) ¬P(x)

Everyone loves Bob ≔ (x)L(x,b)

Alice loves someone ≔ (x)L(a,x)

Page 25: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

25

Exercise Translation

W(x) ≔ x is a workerP(x) ≔ x is a painterL(x,y) ≔ x loves ya ≔ Aliceb ≔ Bob

Every painter loves Bob ≔ (x)[P(x) L(xb)]Some worker is a painter ≔ (x)[W(x) ∧ P(x)]Alice loves every worker ≔ (x)[W(x) L(ax)]Some painters are not workers ≔ (x)[P(x) ∧ ¬W(x)]

No painters are workers ≔ (x)[P(x) ¬W(x)]Not every painter loves Alice

≔ ¬(x)[P(x) L(x,a)]

Page 26: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

26

Translation

W(x) ≔ x is a workerP(x) ≔ x is a painterL(x,y) ≔ x loves ya ≔ Aliceb ≔ Bob

Every worker loves some painter

≔ (x){W(x) (y)[P(y) ∧ L(x,y)]}

Some painter loves some worker

≔ (x){P(x) ∧ (y)[W(y) ∧ L(x,y)]}

No worker loves every worker ≔ (x){W(x) ¬(y)[W(y)L(x,y)]}

Every worker who is also a painter loves Bob ≔ (x){[W(x) ∧ P(x)] L(x,b)}Some worker loves both Bob and Alice

≔ (x){W(x) ∧ [L(x,b) ∧ L(x,a)]}

Every worker who loves Bob also loves Alice ≔ (x){[T(x) ∧ L(x,b)]L(x,a)}

Page 27: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

27

Class Exercise

What is the truth of the following wffs where the domain consists of integers:(x)[L(x) O(x)] where O(x) is “x is odd” and L(x) is “x < 10”?

Page 28: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

28

What is the truth of the following wffs where the domain consists of integers:

(x)[L(x) O(x)] where O(x) is “x is odd” and L(x) is “x < 10”?

Using predicate symbols and appropriate quantifiers, write the symbolic form of the following English statement:D(x) is “x is a day” M is “Monday” T is “Tuesday”S(x) is “x is sunny” R(x) is “x is rainy”

Some days are sunny and rainy.It is always a sunny day only if it is a rainy day.It rained both Monday and Tuesday.Every day that is rainy is not sunny.

Class Exercise

Page 29: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

29

A valid argument for predicate logic need to be a tautology.The meaning and the structure of the quantifiers and predicates

determines the interpretation and the validity of the argumentsBasic approach to prove arguments:

The same proof sequence methodology we use in propositional logic. We use the same rules beside another four inference rules.

Four new inference rules

Inference Rules

Two rules to strip the qualifiers

Two rules to reinsert the qualifiers

Page 30: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

30

Inference Rules

From To Name/Appr. Conditions

(x)P(x) ⊢ P(t) ui ≔ Universal Instantiation

- If t is a variable, it must not fall within the scope of a quantifier for t

(x)P(x) ⊢ P(t) ei ≔ Existential Instantiation

- Where t is not previously used in a proof sequence.

- Must be the first rule used that introduces t.

P(x) ⊢ (x)P(x) ug ≔ Universal Generalization

P(x) has not been - deduced from any hypotheses in which

x is a free variable - or deduced by ei from any wff in which

x is a free variableP(x) ⊢ (x)P(x)

P(a) ⊢ (x)P(x)

eg ≔ Existential Generalization

- To go from P(a) to (x)P(x), x must not appear in P(a)

- Where t is a sub-variable or constant symbol (object).

Page 31: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

31

Proof Rules

From Name/Appr.(x)P(x) ⊢ P(t) ui ≔ Universal Instantiation(x)P(x) ⊢ P(t) ei ≔ Existential Instantiation

P(x) ⊢ (x)P(x) ug ≔ Universal Generalization

P(x) ⊢ (x)P(x) eg ≔ Existential GeneralizationP(a) ⊢ (x)P(x)

R, R S ⊢ S mp ≔ Modus PonensR S, S ⊢ R’ mt ≔ Modus TollensR, S ⊢ R Λ S con ≔ ConjunctionR Λ S ⊢ R, S sim ≔ SimplificationR ⊢ R V S add ≔ AdditionP Q, Q R ⊢ P R hs ≔ Hypothetical syllogismP V Q, P ⊢ Q ds ≔ Disjunctive syllogism(P Λ Q) R ⊢ P (Q R) exp ≔ Exportation P, P ⊢ Q inc ≔ InconsistencyP Λ (Q V R) ⊢ (P Λ Q) V (P Λ R)

dist ≔ Distributive

P V (Q Λ R) ⊢ (P V Q) Λ (P V R)

dist ≔ Distributive

Page 32: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

32

Proof Rules

From Name/Appr.R V S ↔ S V R comm ≔ CommutativeR Λ S ↔ S Λ R comm ≔ Commutative(R V S) V Q ↔ R Λ (S Λ Q) ass ≔ Associative (R Λ S) Λ Q ↔ R V (S V Q) ass ≔ Associative(R V S) ↔ R Λ S (De-Morgan) ≔ De-Morgan’s Laws

(R Λ S) ↔ R V S (De-Morgan) ≔ De-Morgan’s Laws

R S ↔ R V S imp ≔ ImplicationR ↔ (R) dn ≔ Double Negation PQ ↔ (P Q) Λ (Q P) equ ≔ Equivalence Q P ↔ P Q cont≔ ContrapositionP ↔ P Λ P self ≔ Self-referenceP V P ↔ P self≔ Self-referenceDeduction Method

{P1 Λ P2 Λ ... Λ Pn R Q} ⊢ {P1 Λ P2 Λ ... Λ Pn Λ R Q}

Page 33: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

33

Prove the following argument: All flowers are plants. Sunflower is a flower. Therefore, sunflower is

a plant. P(x) is “ x is a flower” a is a constant symbol (Sunflower) Q(x) is “x is a plant”

The argument is (x)[P(x) Q(x)] Λ P(a) Q(a) The proof sequence is as follows:

Examples: Proofs using Predicate Logic

Page 34: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

34

Prove the argument (x)[P(x) Q(x)] Λ [Q(y)] [P(y)] Proof sequence:

Prove the argument (x)P(x) (x)P(x) Proof sequence:

Examples: Proofs using Predicate Logic

Page 35: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

35

Prove the argument (x)[P(x) Q(x)] Λ (x)P(x) (x)Q(x) Proof sequence:

Examples: Proofs using Predicate Logic

Page 36: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

36

Prove the argument (x)[P(x) Λ Q(x)] (x)P(x) Λ (x)Q(x)

Proof sequence:

Examples: Proofs using Predicate Logic

Page 37: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

37

Prove the argument (y)[P(x) Q(x,y)] [P(x) (y)Q(x,y)]

Proof sequence:

Examples: Proofs using Predicate Logic

Page 38: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

38

A temporary hypothesis can be inserted into a proof sequence. If T is inserted as a temporary hypothesis and eventually W is deduced from T and other hypotheses, then the wff T W has been deduced from other hypotheses and must be reinserted into the proof sequence

P1,P2,….. Original hypothesis. T Temporary hypothesis. W the result of Implementing rules with T,P1,P2,….. Then the formula T W must be reinserted into the proof

sequence

Temporary hypotheses

Page 39: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

39

Prove the argument [P(x) (y)Q(x,y)] (y)[P(x) Q(x,y)]

Proof sequence:

Temporary hypotheses

Page 40: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

40

Prove the Formula [(x)A(x)] ↔ (x)[A(x)]

To prove equivalence, implication in each direction should be proved

{[(x)A(x)] → (x)[A(x)]} Λ {[(x)A(x)] → (x)[A(x)]}

Proof sequence for [(x)A(x)] (x)[A(x)] 1. [(x)A(x)] hyp2. A(x) temp. hyp3. (x)A(x) 2, eg4. A(x) (x)A(x) temp. hyp discharged5. [A(x)] 1, 4, mt6. (x)[A(x)] 5, ug

More Examples

Page 41: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

41

Proof sequence for (x)[A(x)] [(x)A(x)] 1. (x)[A(x)] hyp2. (x)A(x) temp. hyp3. A(a) 2, ei4. [A(a)] 1, ui5. [(x)[A(x)]] 3, 4, inc6. (x)A(x) [(x)[A(x)]] temp.

discharged7. [((x)[A(x)])] 1, dn8. [(x)A(x)] 6, 7, mt

More Examples

Page 42: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

42

Every ambassador speaks only to diplomats, and some ambassadors speak to someone. Therefore, there is a diplomat.

Q: Prove the upper argument using Predicate Logic?

Step 1: Determine Key statements and present by predicate logic

A(x) ≔ x is an ambassador; D(y) ≔ y is a diplomatS(x,y) ≔ x speaks to y;

Proving Verbal arguments

Page 43: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

43

A(x) ≔ x is an ambassadorD(y) ≔ y is a diplomatS(x,y) ≔ x speaks to y

Step 2: Convert verbal argument to predicate logic (hypothesis, conclusion and form)

Every ambassador speaks only to diplomats ≔ For everyone and every others if this one is an ambassador

and he speaks to the other one, then that other one is a diplomat. ≔ (x) (y)[(A(x) Λ S(x,y)) D(y)]

Proving Verbal arguments

Page 44: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

44

A(x) ≔ x is an ambassador D(y) ≔ y is a diplomat S(x,y) ≔ x speaks to y

Some ambassadors speak to someone ≔ There exist someone and some others that this one is an

ambassador and he speaks to others. ≔ (x)(y)(A(x) Λ S(x,y))

there is a diplomat ≔ (x)D(x)

Argument formula (x) (y)[(A(x) Λ S(x,y)) D(y)] Λ (x)(y)(A(x) Λ S(x,y)) (x)D(x)

Proving Verbal arguments

Page 45: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

45

Proving Verbal arguments

Step 3: Prove the Predicate form using the prove sequence rules (equivalence, inference and deduction)

Page 46: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

46

Exercises

Every cat is bigger than every mouse. Tom is a cat. Jerry is either a cat or a mouse. Tom is bigger than jerry . Therefore, Jerry is a mouse.

Q: Prove the upper argument using Predicate Logic?

“A student who is registered for this course is not eligible. Every student registered for this course has pass the prerequisite. Therefore a student who has pass the prerequisite is not eligible.”

Q: Prove the upper argument using Predicate Logic?

“All good players play to some famous team. Messi is a good player and he plays to FC Barcelona. Therefore, FC Barcelona is a famous team.”

Q: Prove the upper argument using Predicate Logic?

Page 47: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

47

Conclusion

Propositional Logic is not enough to describe properties and its related specs.Predicate Logic Syntax are variables, quantifiers, predicate and connectives.A collection of objects is called the domain of a variable.Two kinds of quantifiers: Universal and Existential.The collection of objects that satisfy the property P(x) is called the domain of

interpretation.• always related with (implication)• always related with Λ (conjunction)• Negation of statements represented by the formula

[(x)A(x)] ↔ (x)[A(x)] [(x)A(x)] ↔ (x)[A(x)]

Bound variable is the variable within the scope of the quantifier. Free variable is the one out of the scope.

A predicate wff is valid if it is true in all possible interpretations

Page 48: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

48

- Prove a predicate formula means that it is tautology.- Proof sequence Methodology is one of the methods used for proving predicate

formula.- Proof rules from prepositional Logic used in predicate logic prove sequence in

addition to another four rules.- A temporary Hyp. can be inserted as T then must be discharged as T implies W.- Proving a verbal argument pass a three systematic steps

- Find the atomic predicates , translate argument to a predicate formula , then use proof rules to prove the translated predicate formula.

Conclusion

Page 49: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

49

Prepared by: Sharif Omar Salem – [email protected]

End of Lecture

Page 50: #4 formal methods – predicate logic

Prep

ared

by:

Sha

rif

Om

ar S

alem

– s

sale

mg@

gmai

l.com

50

Prepared by: Sharif Omar Salem – [email protected]

Next Lecture:Hoare Logic