0% found this document useful (0 votes)
49 views44 pages

DS Ch2 Predicate Logic and Proving Methods Handout

Uploaded by

Quân Bảo Cát
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views44 pages

DS Ch2 Predicate Logic and Proving Methods Handout

Uploaded by

Quân Bảo Cát
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 44

Logics (cont.

Nguyen An Khuong,
Huynh Tuong Nguyen

Chapter 2
Logics (cont.) Contents

Predicate Logic

Discrete Structures for Computer Science (CO1007) on Ngày Proof Methods

25 tháng 1 năm 2017 Some problems for


discussion

Nguyen An Khuong, Huynh Tuong Nguyen


Faculty of Computer Science and Engineering
University of Technology, VNU-HCM
2.1
Logics (cont.)
Contents
Nguyen An Khuong,
Huynh Tuong Nguyen

Contents

Predicate Logic
1 Predicate Logic Proof Methods

Some problems for


discussion

2 Proof Methods

3 Some problems for discussion

2.2
Logics (cont.)
Limitations of Propositional Logic
Nguyen An Khuong,
Huynh Tuong Nguyen

Contents

Predicate Logic

Proof Methods

Some problems for


• x > 3: not a proposition. discussion

• All square numbers are not prime numbers. 100 is a square


number. Therefore 100 is not a prime number: not able to
infer in propositional logic.

2.3
Logics (cont.)
Predicates
Nguyen An Khuong,
Definition Huynh Tuong Nguyen

• A predicate (vị từ) is a statement containing one or more


variables.
Contents
• If values are assigned to all the variables in a predicate, the Predicate Logic
resulting statement is a proposition (mệnh đề ). Proof Methods

Some problems for


discussion
Examples:
• x > 3 (predicate)
• 5 > 3 (proposition)
• 2 > 3 (proposition)
Etymology: predicate (n.)
from Latin praedicatum “that which is said of the
subject.”
Contexts: properties, relations, characteristics, features,...
Notations:
• x > 3 → P (x)
• 5 > 3 → P (5)
• 2 > 3 → P (2)
• A predicate with n variables P (x1 , x2 , ..., xn ) 2.4
Logics (cont.)
Truth value and Quantifiers
Nguyen An Khuong,
Huynh Tuong Nguyen

• x > 3 is true or false? Contents

Predicate Logic
• 5>3
Proof Methods

• For every number x, x > 3 holds Some problems for


discussion
• There is a number x such that x > 3
Quantifiers:
• ∀: Universal – Với mọi
• ∀xP (x) = P (x) is T for all x
• ∃: Existential – Tồn tại
• ∃xP (x) = There exists an element x such that P (x) is T
• We need a domain of discourse for variable: Universe

2.5
Logics (cont.)

Nguyen An Khuong,
Huynh Tuong Nguyen

Example
Let P (x) be the statement “x < 2”. What is the truth value of the
Contents
quantification ∀xP (x), where the domain consists of all real
Predicate Logic
number? Proof Methods

Some problems for


• P (3) = 3 < 2 is false discussion

• ⇒ ∀xP (x) is false

• 3 is a counterexample (phản ví dụ) of ∀xP (x)

Example
What is the truth value of the quantification ∃xP (x), where the
domain consists of all real number?

2.6
Logics (cont.)

Nguyen An Khuong,
Huynh Tuong Nguyen

Example
Express the statement “Some student in this class comes from
Central Vietnam.” Contents

Predicate Logic

Proof Methods
Solution 1
Some problems for
discussion
• M (x) = x comes from Central Vietnam
• Domain for x is the students in the class
• ∃xM (x)

Solution 2

• Domain for x is all people


• ...

2.7
Logics (cont.)
Negation of Quantifiers
Nguyen An Khuong,
Huynh Tuong Nguyen

Statement Negation Equivalent form


Contents
∀xP (x) ¬(∀xP (x)) ∃x¬P (x) Predicate Logic

∃xP (x) ¬(∃xP (x)) ∀x¬P (x) Proof Methods

Some problems for


discussion

Example

• All CSE students study Discrete Math 1


• Let C(x) denote “x is a CSE student”
• Let S(x) denote “x studies Discrete Math 1”
• ∀x : C(x) → S(x)
• ∃x : ¬(C(x) → S(x)) ≡ ∃x : C(x) ∧ ¬S(x)
• There is a CSE student who does not study Discrete Math 1.

2.8
Logics (cont.)
Another Example
Nguyen An Khuong,
Huynh Tuong Nguyen

Example
Translate these: Contents

Predicate Logic
• All lions are fierce.
Proof Methods
• Some lions do not drink coffee. Some problems for
discussion
• Some fierce creatures do not drink coffee.

Solution
Let P (x), Q(x) and R(x) be the statements “x is a lion”, “x is
fierce” and “x drinks coffee”, respectively.
• ∀x(P (x) → Q(x)).
• ∃x(P (x) ∧ ¬R(x)).
• ∃x(Q(x) ∧ ¬R(x)).

2.9
Logics (cont.)
The Order of Quantifiers
Nguyen An Khuong,
Huynh Tuong Nguyen

• The order of quantifiers is important, unless all the quantifiers


Contents
are universal quantifiers or all are existential quantifiers Predicate Logic

• Read from left to right, apply from inner to outer Proof Methods

Some problems for


discussion
Example
∀x ∀y (x + y = y + x)
T for all x, y ∈ R

Example
∀x ∃y (x + y = 0) is T, while
∃y ∀x (x + y = 0) is F

2.10
Logics (cont.)
Quantifiers plus ∧ and ∨
Nguyen An Khuong,
Huynh Tuong Nguyen

Example
Show ∀x(P (x) ∧ Q(x)) ≡ ∀xP (x) ∧ ∀xQ(x). (That is, show that
no matter what the domain is, these 2 propositions always have Contents

the same truth value). Predicate Logic

Proof Methods

Terminology: We say that ∀ distributes over ∧. Some problems for


discussion

Chứng minh.
First assume that ∀x(P (x) ∧ Q(x)) is true. So for all x, P (x) is
true and Q(x) is true. Therefore ∀xP (x) is true, and ∀xQ(x) is
true. Therefore ∀xP (x) ∧ ∀xQ(x) is true.

Now assume ∀xP (x) ∧ ∀xQ(x) is true. So ∀xP (x) is true and
∀xQ(x) is true. So for all x, P (x) is true and for all x, Q(x) is
true. Therefore, for all x, P (x) ∧ Q(x) is true. So
∀x(P (x) ∧ Q(x)) is true.

Therefore ∀x(P (x) ∧ Q(x)) ≡ ∀xP (x) ∧ ∀xQ(x).


2.11
Exercises∗ Logics (cont.)

Nguyen An Khuong,
Huynh Tuong Nguyen

1 The existential quantifier ∃ does not distribute over ∧. That


is, Contents
∃x(P (x) ∧ Q(x)) 6≡ ∃xP (x) ∧ ∃xQ(x). Predicate Logic

Proof Methods
2 The following is true though:
Some problems for
discussion
∃x(P (x) ∧ Q(x)) −→ ∃xP (x) ∧ ∃xQ(x).

3 With ∨, the situation is reversed. ∃ distributes over ∨, but ∀


does not.
a. ∃x(S(x) ∨ R(x)) ≡ ∃xS(x) ∨ ∃xR(x).
b. ∀x(S(x) ∨ R(x)) ←− ∀xS(x) ∨ ∀xR(x) is true.
b. ∀x(S(x) ∨ R(x)) 6≡ ∀xS(x) ∨ ∀xR(x)
4 ∃ does not distribute over −→. I.e.,

∃x(P (x) −→ Q(x)) 6≡ ∃xP (x) −→ ∃xQ(x).

2.12
Logics (cont.)
Translating Nested Quantifiers
Nguyen An Khuong,
Huynh Tuong Nguyen

Example Contents

Predicate Logic
∀x (C(x) ∨ ∃y (C(y) ∧ F (x, y)) ) Proof Methods
Provided that: Some problems for
discussion
• C(x): x has a computer,
• F (x, y): x and y are friends,
• x, y ∈ all students in your school.

Answer
For every student x in your school, x has a computer or there is a
student y such that y has a computer and x and y are friends.

2.13
Logics (cont.)
Translating Nested Quantifiers
Nguyen An Khuong,
Huynh Tuong Nguyen

Contents
Example
Predicate Logic
∃x∀y∀z (((F (x, y) ∧ F (x, z) ∧ (y 6= z)) → ¬F (y, z))) Proof Methods
Provided that: Some problems for
discussion
• F (x, y): x, y are friends
• x, y, z ∈ all students in your school.

Answer
There is a student x, so that for every student y, every student z
not the same as y, if x and y are friends, and x and z are friends,
then y and z are not friends.

2.14
Logics (cont.)
Translating into Logical Expressions
Nguyen An Khuong,
Huynh Tuong Nguyen

Example
Contents
1 “There is a student in the class has visited Hanoi”.
Predicate Logic
2 “Every students in the class have visited Nha Trang or Vung Proof Methods

Tau”. Some problems for


discussion

Answer
Assume:
C(x) : x has visited Hanoi
D(x) : x has visited Nha Trang
E(x) : x has visited Vung Tau
We have:
1 ∃xC(x)
2 ∀x(D(x) ∨ E(x))

2.15
Logics (cont.)
Translating into Logical Expressions
Nguyen An Khuong,
Huynh Tuong Nguyen

Contents

Predicate Logic
Example Proof Methods

Every people has one and only one best friend. Some problems for
discussion

Solution
Assume:
• B(x, y) : y is the best friend of x
We have: ∀x∃y∀z(B(x, y) ∧ ((y 6= z) → ¬B(x, z)))

2.16
Logics (cont.)
Translating into Logical Expressions
Nguyen An Khuong,
Huynh Tuong Nguyen

Example Contents

Predicate Logic
If a person is a woman and a parent, then this person is mother of Proof Methods
some one. Some problems for
discussion

Solution
We define:
• C(x) : x is woman
• D(x) : x is a parent
• E(x, y): x is mother of y
We have: ∀x((C(x) ∧ D(x)) → ∃yE(x, y))

2.17
Logics (cont.)
Inference
Nguyen An Khuong,
Huynh Tuong Nguyen

Example Contents

Predicate Logic
• If I have a girlfriend, I will take her to go shopping. Proof Methods

• Whenever I and my girlfriend go shopping and that day is a Some problems for
discussion
special day, I will surely buy her some expensive gift.
• If I buy my girlfriend expensive gifts, I will eat noodles for a
week.
• Today is March 8.
• March 8 is such a special day.
• Therefore, if I have a girlfriend,...
• I will eat noodles for a week.

2.18
Logics (cont.)
Propositional Rules of Inferences
Nguyen An Khuong,
Huynh Tuong Nguyen

Rule of Inference Name


Contents
p
Predicate Logic
p→q
Proof Methods
∴q Modus ponens Some problems for
discussion
¬q
p→q
∴ ¬p Modus tollens
p→q
q→r
Hypothetical syllogism
∴p→r
(Tam đoạn luận giả định)
p∨q
¬p
Disjunctive syllogism
∴q
(Tam đoạn luận tuyển)

2.19
Logics (cont.)
Propositional Rules of Inferences
Nguyen An Khuong,
Huynh Tuong Nguyen

Rule of Inference Name


Contents
p Predicate Logic
Addition
∴p∨q Proof Methods
(Quy tắc cộng ) Some problems for
discussion
p∧q
Simplification
∴p
(Rút gọn)
p
q
Conjunction
∴p∧q
(Kết hợp)
p∨q
¬p ∨ r
Resolution
∴q∨r
(Phân giải)

2.20
Logics (cont.)

Nguyen An Khuong,
Huynh Tuong Nguyen

Example
If it rains today, then we will not have a barbecue today. If we do
not have a barbecue today, then we will have a barbecue Contents

tomorrow. Therefore, if it rains today, then we will have a Predicate Logic

barbecue tomorrow. Proof Methods

Some problems for


discussion
Solution

• p: It is raining today
• q: We will not have a barbecue today
• r: We will have barbecue tomorrow
p→q
q→r
∴p→r
Hypothetical syllogism

2.21
Logics (cont.)

Nguyen An Khuong,
Huynh Tuong Nguyen

Example
1. ¬p ∧ q Hypothesis Contents
• It is not sunny this afternoon
Predicate Logic
(¬p) and it is colder than 2. ¬p Simplification using (1) Proof Methods
yesterday (q)
Some problems for
• We will go swimming (r) 3. r → p Hypothesis discussion

only if it is sunny
4. ¬r Modus tollens using (2) and (3)
• If we do not go swimming,
then we will take a canoe trip 5. ¬r → s Hypothesis
(s)
• If we take a canoe trip, then 6. s Modus ponens using (4) and (5)
we will be home by sunset (t)
7. s → t Hypothesis
• We will be home by sunset
(t)
8. t Modus ponens using (6) and (7)

2.22
Logics (cont.)
Fallacies
Nguyen An Khuong,
Huynh Tuong Nguyen

Contents
Definition Predicate Logic

Fallacies (ngụy biện) resemble rules of inference but are based on Proof Methods

contingencies rather than tautologies. Some problems for


discussion

Example
If you do correctly every questions in mid-term exam, you will get
10 grade. You got 10 grade.
Therefore, you did correctly every questions in mid-term exam.
Is [(p → q) ∧ q] → p a tautology?

2.23
Logics (cont.)
Rules of Inference for Quantified Statements
Nguyen An Khuong,
Huynh Tuong Nguyen

Rule of Inference Name Contents

Predicate Logic
∀xP (x) Proof Methods
Universal instantiation
∴ P (c) Some problems for
(Cụ thể hóa phổ quát) discussion

P (c)for an arbitrary c
Universal generalization
∴ ∀xP (x)
(Tổng quát hóa phổ quát)
∃xP (x)
Existential instantiation
∴ P (c)for some element c
(Cụ thể hóa tồn tại)
P (c)for some element c
Existential generalization
∴ ∃xP (x)
(Tổng quát hóa tồn tại)

2.24
Logics (cont.)

Nguyen An Khuong,
Huynh Tuong Nguyen

Example
Contents
• A student in this class has not gone to class
Predicate Logic
• Everyone in this class passed the first exam Proof Methods

• Someone who passed the first exam has not gone to class Some problems for
discussion

Hint

• C(x): x is in this class


• B(x): x has gone to class
• P (x): x passed the first exam
• Premises???

2.25
Logics (cont.)

Nguyen An Khuong,
Huynh Tuong Nguyen

1. ∃x(C(x) ∧ ¬B(x)) Premise Contents

Predicate Logic
2. C(a) ∧ ¬B(a) Existential instantiation from (1)
Proof Methods
3. C(a) Simplification from (2)
Some problems for
4. ∀x(C(x) → P (x)) Premise discussion

5. C(a) → P (a) Universal instantiation from (4)


6. P (a) Modus ponens from (3) and (5)
7. ¬B(a) Simplification from (2)
8. P (a) ∧ ¬B(a) Conjunction from (6) and (7)
9. ∃x(P (x) ∧ ¬B(x)) Existential generalization from (8)

2.26
Logics (cont.)
Introduction
Nguyen An Khuong,
Huynh Tuong Nguyen

Contents

Predicate Logic

Proof Methods

Definition Some problems for


discussion
A proof is a sequence of logical deductions from
- axioms, and
- previously proved theorems
that concludes with a new theorem.

2.27
Logics (cont.)
Terminology
Nguyen An Khuong,
Huynh Tuong Nguyen

Contents

Predicate Logic

Proof Methods

Some problems for


discussion

• Theorem (định lý ) = a statement that can be shown to be


true
• Axiom (tiên đề ) = a statement we assume to be true
• Hypothesis (giả thiết) = the premises of the theorem

2.28
Logics (cont.)

Nguyen An Khuong,
Huynh Tuong Nguyen

Contents

Predicate Logic

Proof Methods

Some problems for


discussion

• Lemma (bổ đề ) = less important theorem that is helpful in


the proofs of other results
• Corollary (hệ quả ) = a theorem that can be established
directly from a proved theorem
• Conjecture (phỏng đoán) = statement being proposed to be
true, when it is proved, it becomes theorem

2.29
Logics (cont.)
Proving a Theorem
Nguyen An Khuong,
Huynh Tuong Nguyen

Contents

Predicate Logic

Proof Methods
Many theorem has the form ∀xP (x) → Q(x) Some problems for
discussion
Goal:
• Show that P (c) → Q(c) is true with arbitrary c of the domain
• Apply universal generalization
⇒ How to show that conditional statement p → q is true.

2.30
Logics (cont.)
Methods of Proof
Nguyen An Khuong,
Huynh Tuong Nguyen

Contents

Predicate Logic

Proof Methods

• Direct proofs (chứng minh trực tiếp) Some problems for


discussion

• Proof by contraposition (chứng minh phản đảo)


• Proof by contradiction (chứng minh phản chứng )
• Mathematical induction (quy nạp toán học)

2.31
Logics (cont.)
Direct Proofs
Nguyen An Khuong,
Huynh Tuong Nguyen

Contents
Definition Predicate Logic

A direct proof shows that p → q is true by showing that if p is Proof Methods

true, then q must also be true. Some problems for


discussion

Example

Ex.: If n is an odd integer, then n2 is odd.


Pr.: Assume that n is odd. By the definition, n = 2k + 1, k ∈ Z.
n2 = (2k + 1)2 = 4k 2 + 4k + 1 = 2(2k 2 + 2k) + 1 is an odd
number.

2.32
Logics (cont.)
Proof by Contraposition
Nguyen An Khuong,
Huynh Tuong Nguyen

Definition Contents

p → q can be proved by showing (directly) that its contrapositive, Predicate Logic

¬q → ¬p, is true. Proof Methods

Some problems for


discussion
Example

Ex.: If n is an integer and 3n + 2 is odd, then n is odd.


Pr.: Assume that “If 3n + 2 is odd, then n is odd” is false; or n is
even, so n = 2k, k ∈ Z. Substituting
3n + 2 = 3(2k) + 2 = 6k + 2 = 2(3k + 1) is even. Because
the negation of the conclusion of the conditional statement
implies that the hypothesis is false, Q.E.D.

2.33
Logics (cont.)
Proofs by Contradiction
Nguyen An Khuong,
Huynh Tuong Nguyen

Definition
p is true if if can show that ¬p → (r ∧ ¬r) is true for some Contents

proposition r. Predicate Logic

Proof Methods

Some problems for


Example discussion


Ex.: Prove that 2 is irrational.

Pr.: Let p is the proposition
√ “ 2 is irrational”. Suppose
√ ¬p is true,
which means 2 is rational. If so, ∃a, b ∈ Z, 2 = a/b, a, b
have no common factors. Squared, 2 = a2 /b2 , 2b2 = a2 , so
a2 is even, and a is even, too. Because of that a = 2c, c ∈ Z.
Thus, 2b2 = 4c2 , or b2 = 2c2 , which means b2 is even and so
is b. That means 2 divides both a and b, contradict with the
assumption.

2.34
Logics (cont.)
Problem
Nguyen An Khuong,
Huynh Tuong Nguyen

Contents

Predicate Logic

Proof Methods

Some problems for


discussion

Assume that we have an infinite domino string, we want to know


whether every dominoes will fall, if we only know two things:
1 We can push the first domino to fall
2 If a domino falls, the next one will be fall
We can! Mathematical induction.

2.35
Logics (cont.)
Mathematical Induction
Nguyen An Khuong,
Huynh Tuong Nguyen

Contents
Definition (Induction)
Predicate Logic

To prove that P (n) is true for all positive integers n, where P (n) Proof Methods

is a propositional function, we complete two steps: Some problems for


discussion

• Basis Step: Verify that P (1) is true.


• Inductive Step: Show that the conditional statement
P (k) → P (k + 1) is true for all positive integers k
Logic form:
[P (1) ∧ ∀kP (k) → P (k + 1))] → ∀nP (n)

What is P (n) in domino string case?

2.36
Logics (cont.)
Example on Induction
Nguyen An Khuong,
Example Huynh Tuong Nguyen

Show that if n is a positive integer, then

n(n + 1) Contents
1 + 2 + ... + n = .
2 Predicate Logic

Proof Methods

Some problems for


Solution discussion

Let P (n) be the proposition that sum of first n is n(n + 1)/2


1(1+1)
• Basis Step: P (1) is true, because 1 = 2
• Inductive Step:
k(k+1)
Assume that 1 + 2 + . . . + k = 2
.
Then:
k(k + 1)
1 + 2 + . . . + k + (k + 1) = + (k + 1)
2
k(k + 1) + 2(k + 1)
=
2
(k + 1)(k + 2)
=
2

shows that P (k + 1) is true under the assumption that P (k) is true.


2.37
Logics (cont.)
Example on Induction
Nguyen An Khuong,
Huynh Tuong Nguyen

Example
Prove that n < 2n for all positive integers n. Contents

Predicate Logic

Proof Methods
Solution
Some problems for
Let P (n) be the proposition that n > 2n . discussion

• Basis Step: P (1) is true, because 1 > 21 = 2


• Inductive Step:
Assume that P (k) is true for the positive k, that is, k < 2k .
Add 1 to both side of k < 2k , note that 1 ≤ 2k .

k + 1 < 2k + 1 ≤ 2k + 2k = 2 · 2k = 2k+1 .

shows that P (k + 1) is true, namely, that k + 1 < 2k+1 ,


based on the assumption that P (k) is true.

2.38
Logics (cont.)
On drinking in pubs
Nguyen An Khuong,
Huynh Tuong Nguyen

The drinker’s paradox


Contents
In every non-empty pub there is somebody such that if he (or she)
Predicate Logic
drinks then everybody drinks. Proof Methods

Some problems for


discussion

• Is this true?
• Or more precisely: Is this a tautology in classical predicate
logic?
• I.e. is it true independent of the domain (here pubs, people)
and the meanings of pub and to drink?
• Predicate formula:
∃x ∈ P, [D(x) −→ ∀y ∈ P, D(y)].
• Law of excluded middle (LEM): p ∨ ¬p is a tautology.

2.39
Logics (cont.)
Some MCQs
Nguyen An Khuong,
Huynh Tuong Nguyen

Contents

Predicate Logic

MCQ1 Proof Methods

Some problems for


Which of the following has truth value T ? discussion

A. ∀x ∈ R, (x > 1 −→ x2 − 3x + 2 > 0).


B. ∃x ∈ Q, (x2 = 2015).
C. ∃x ∈ R, (x > 2 −→ x2 − 3x + 2 < 0).
D. ∃x ∈ R, (x2 − x = −1).

2.40
Logics (cont.)
Some MCQs (cont’d)
Nguyen An Khuong,
Huynh Tuong Nguyen

MCQ2
Giả sử D(x, y) là một vị từ với ý nghĩa “số nguyên y là một ước Contents
của số nguyên x.” Phát biểu nào dưới đây tương đương diễn đạt ý Predicate Logic
nghĩa của công thức Proof Methods

Some problems for


∀x, y(D(x, y) −→ ∃z(D(x, z) ∧ D(y, z)))? discussion

A. Mọi cặp số tự nhiên (x, y) đều có ít nhất một ước chung.


B. Nếu y là một ước của x và z là một ước của y thì z cũng là
ước của x.
C. Nếu y không phải là ước của x thì chúng không có ước
chung.
D. Nếu x và y không có ước chung thì y không phải là một ước
của x.

2.41
Logics (cont.)
Some MCQs (cont’d)
Nguyen An Khuong,
Huynh Tuong Nguyen

Contents

Predicate Logic
MCQ3
Proof Methods

Which of the following are semantically and syntactically correct Some problems for
discussion
translations of “No dog bites a child of its owner”?
A. ∀xDog(x) −→ ¬Bites(x, Child(Owner(x))).
B. ¬∃x, yDog(x) ∧ Child(y, Owner(x)) ∧ Bites(x, y).
C. ∀xDog(x) −→ (∀yChild(y, Owner(x)) −→ ¬Bites(x, y)).
D. ¬∃xDog(x) −→ (∃yChild(y, Owner(x)) ∧ Bites(x, y)).

2.42
Logics (cont.)
Convert Codes to English and Predicate Formula
Nguyen An Khuong,
Huynh Tuong Nguyen

Example
Contents

for (i=0; i<numObjects; i++) Predicate Logic

Proof Methods
{
Some problems for
Object x = Objects(i); discussion

if isMushroom(i)
if isPoisonous(x) && isPurple(x)
return false;
}
return true;

• There are no mushrooms that are poisonous and purple.


• ∀xM ushroom(x) −→ ¬(P oisonous(x) ∧ P urple(x)).

2.43
Logics (cont.)
Convert Codes to English and Predicate Formula (cont’d)
Nguyen An Khuong,
Huynh Tuong Nguyen

Contents

Example Predicate Logic

Proof Methods

Some problems for


for (i=0; i<numObjects; i++) discussion
{
Object x = Objects(i);
if isMushroom(i) && isPoisonous(x) && isPurple(x)
return true;
}
return false;

2.44

You might also like