Sie sind auf Seite 1von 81

CSI2101

DISCRETE STRUCTURES

WonSook Lee
wslee@uottawa.ca
EECS, Univ. of Ottawa
The lecture note is collaborative work, and
large contribution is from Prof. Nejib Zaguia
1/16/2018 1
Predicate logic (§1.4-1.5)
• Motivation
• Predicates
• Quantifiers
– universal quantifier, existential quantifier, other quantifiers
– domain of a quantifier
– binding variable by a quantifier
• Quantified expressions
– equivalence of quantified expressions
– negating quantified expressions
– translating into/from English
– nested quantifiers
– order of quantifiers
2
Predicate?
• Every complete sentence contains two
parts: a subject and a predicate.
– The subject is what (or whom) the
sentence is about, while the
predicate tells something about the
subject.

3
Subject and Predicate

• Ref: Proposition - A sentence expressing


something true or false.
– “Mr. Smith took a walk”
» Atomic proposition
– “Mr. Smoth took a walk and the dentist pulled out
a tooth” 4
» Molecular/complex proposition
WonSook came
WonSook saw
WonSook conquered

5
Topic #3 – Predicate Logic

Motivation
• Predicate logic is an extension of
propositional logic that permits concisely
reasoning about whole classes of entities.
• Propositional logic treats simple propositions
(sentences) as atomic entities.

• In contrast, predicate logic distinguishes


the subject of a sentence from its
predicate.
6
Topic #3 – Predicate Logic

Applications of Predicate
Logic
It is the formal notation for writing
• perfectly clear, concise, and unambiguous
• mathematical definitions, axioms, and theorems
(more on subsequent lectures)
• for any branch of mathematics.

Predicate logic with function symbols, operators and a


few proof-building rules is sufficient for
• defining any conceivable mathematical system, and
for
• proving anything that can be proved within that 7
system!
Topic #3 – Predicate Logic

Other Applications
• Predicate logic is the foundation of the
field of mathematical logic, which
culminated in Gödel’s incompleteness
theorem, which revealed the ultimate
limits of mathematical thought:
Kurt Gödel
1906-1978
– Given any finitely describable, consistent
proof procedure, there will always remain
some true statements that will never be
proven by that procedure.
• i.e., we can’t discover all mathematical truths,
unless we sometimes resort to making guesses.
8
Practical Applications of
Predicate Logic
• It is the basis for
– clearly expressed formal specifications for any
complex system.
– automatic theorem provers and many
other Artificial Intelligence systems.
• E.g. automatic program verification systems.
• Predicate-logic like statements are
supported by some of the more
sophisticated database query engines and
container class libraries
– these are types of programming tools.
9
Topic #3 – Predicate Logic

Subjects and Predicates


• In the sentence “The dog is sleeping”:
– The phrase “the dog” denotes the subject -
the object or entity that the sentence is about.
– The phrase “is sleeping” denotes the predicate-
a property that is true of the subject.
• In predicate logic, a predicate is modeled as a
function P(·) from objects to propositions.
– P(x) = “x is sleeping” (where x is any object).
• We decompose the sentence into two parts:
– subject « variable » X
– predicate P “is sleeping” (a property true or false
depending of the subject)
10
Topic #3 – Predicate Logic

More About Predicates


• Convention: Lowercase variables x, y, z... denote
objects/entities; uppercase variables P, Q, R…
denote propositional functions (predicates).
• Keep in mind that the result of applying a predicate P
to an object x is the proposition P(x). But the
predicate P itself (e.g. P=“is sleeping”) is not a
proposition (not a complete sentence).

If P(x) = “x is a prime number”,


P(3) is the proposition “3 is a prime number.”
TRUE
P(6) is the proposition “6 is a prime number.”
FALSE 11
Topic #3 – Predicate Logic

Propositional Functions
Predicate logic generalizes the grammatical notion of
a predicate to also include propositional functions of
any number of arguments (Arity), each of which may
take any grammatical role that a noun can take.

FATHER(X,Y),
arity n=2 ; X is the father of Y.
MEN(X),
arity n=1
PARENT(X,Y,Z),
arity n=3, X is a child of Y and Z.
If x=“Mike”, y=“Mary”, z=“Paul”, then
PARENT(X,Y,Z)= PARENT(Mike, Mary, Paul)
“Mike is a child of Mary and Paul”
12
Predicates
Other examples: The predicate can have several variables:
• Friends(X,Y): X and Y are friends
• SumsTo7(x, y): x+y=7
• P(x,y,z): x > y2+z3-5
So, what are the truth values?
• SumsTo7(4,5)
• SumsTo7(4,3)
• P(27, 2, 3)
• P(45, 1, 4)

13
Predicates in computing
The predicates are very useful in capturing the properties the variable
values must satisfy before/during/after executing a code segment
Consider the code segment
temp = x;
x = y;
y = temp;
Precondition – what holds before the code segment:
• Q(x, y): x = a, y = b for some values a and b
Postcondition – what holds after the code segment:
• R(x,y): x = b, y = a
• also can be expressed as Q(y, x)
To verify that the postcondition holds, we must start from the assumption
that the precondition holds and go over every stop of the code and
examine what it does to see whether the postcondition is really true. 14
Predicates in computing
Other examples:
Consider the code segment
if P(x, y) {
temp = x;
x = y;
y = temp;
}
where P(x, y) is “x>y”
Precondition – what holds before the code segment:
• Q(x, y): x = a, y = b for some values a and b
Postcondition – what holds after the code segment:
???

15
WonSook came
WonSook saw
X came
WonSook conquered
X saw
Everyone came
X conquered
Everyone sawcame
Somebody
Everyone conquered
Somebody saw
Somebody conquered
16
Topic #3 – Predicate Logic

Universes of Discourse
(U.D.s)
• The power of distinguishing objects from
predicates is that it lets you state things
about many objects at once.
– E.g., let P(x)=“x+1>x”. We can then say,
“For any non negative integer x, P(x) is true”
instead of (0+1>0)  (1+1>1)  (2+1>2)  ...

• The collection of values that a variable x


can take is called x’s universe of discourse.

17
Topic #3 – Predicate Logic

Quantifier Expressions
• Quantifiers provide a notation that allows us
to quantify (count) how many objects in the
universe of discourse satisfy a given
predicate.

• “” is the FOR LL or universal quantifier.


x P(x) means for all x in the u.d., P holds.

• “” is the XISTS or existential quantifier.


x P(x) means there exists an x in the u.d.
(that is, 1 or more) such that P(x) is true.
18
The Universal Quantifier 
e.g. Let the u.d. (universe of discourse)
of x be parking spaces at UO.
Let P(x) be the predicate “x is full.”

Then the universal quantification of


P(x), x P(x), is the proposition:
– “All parking spaces at UO are full.”
– i.e. “Every parking space at UO is full.”
– i.e., “For each parking space at UF, that space is
19
full.”
The Existential Quantifier 
e.g. Let the u.d. (universe of discourse)
of x be parking spaces at UO.
Let P(x) be the predicate “x is full.”

Then the existential quantification of


P(x), x P(x), is the proposition:
– “Some parking space at UO is full.”
– i.e. “There is a parking space at UO that is full.”
– i.e. “At least one parking space at UO is full.”
20
Topic #3 – Predicate Logic

Free and Bound Variables


An expression like P(x) is said to have a
free variable x (meaning, x is
undefined).
A quantifier (either  or ) operates
on an expression having one or more
free variables, and binds one or more
of those variables, to produce an
expression having one or more bound
variables. 21
Topic #3 – Predicate Logic

Example of Binding
• P(x,y) has 2 free variables, x and y.
• x P(x,y) has 1 free variable, and one
bound variable. [Which is which?]
• “P(x), where x=3” is another way to bind x.
• An expression with zero free variables?
– It is actually a proposition.
• An expression with one or more free
variables is still only a predicate:
– e.g. let Q(y) = x P(x,y)
22
Topic #3 – Predicate Logic

Nesting of Quantifiers
Example: Let the u.d. of x & y be people.
Let L(x,y)=“x likes y”

How many free variables?

• (a predicate w. 2 f.v.’s)

23
Topic #3 – Predicate Logic

Nesting of Quantifiers
Example: Let the u.d. of x & y be people.
y L(x,y) = “There is someone whom x likes.”

How many free variables?

(A predicate w. 1 free variable, x)

24
Topic #3 – Predicate Logic

Nesting of Quantifiers
Example: Let the u.d. of x & y be people.
x (y L(x,y)) =
“Everyone has someone whom they like.”

How many free variables?

(A __________ with ___ free variables.)

25
Review: Predicate Logic
• Objects x, y, z, …
• Predicates P, Q, R, … are functions mapping
objects x to propositions P(x).
• Multi-argument predicates P(x, y).
• Quantifiers: [x P(x)] :≡ “For all x’s, P(x).”
[x P(x)] :≡ “There is an x such that P(x).”
• Universes of discourse, bound & free vars.

26
Topic #3 – Predicate Logic

Quantifier Exercise
If R(x,y)=“x relies upon y,” express the
following in unambiguous English:
x(y R(x,y))= Everyone has someone to rely on.
There’s a poor overburdened soul whom
y(x R(x,y))= everyone relies upon (including himself)!
x(y R(x,y))= There’s some needy person who relies
upon everybody (including himself).
y(x R(x,y))= Everyone has someone who relies upon them
x(y R(x,y))= Everyone relies upon everybody,
(including themselves)!
27
Topic #3 – Predicate Logic

Natural language is
ambiguous!
• “Everybody likes somebody.”
– For everybody, there is somebody they like,
• x y Likes(x,y) [Probably more likely.]
– or, there is somebody (a popular person) whom
everyone likes?
• y x Likes(x,y)
• “Somebody likes everybody.”
– Same problem: Depends on context, emphasis.

28
Still More Conventions
• Sometimes the universe of discourse
is restricted within the
quantification, e.g.,
– x>0 P(x) is shorthand for “For all x
that are greater than zero, P(x).”
=x (x>0  P(x))
– x>0 P(x) is shorthand for “There is an x
greater than zero such that P(x).”
=x (x>0  P(x))
29
Topic #3 – Predicate Logic

More to Know About Binding

• x x P(x)
– x is not a free variable in x P(x), therefore the
x binding isn’t used.

• (x P(x))  Q(x)


– The variable x is outside of the scope of the x
quantifier, and is therefore free. Not a
complete proposition!

• (x P(x))  (x Q(x))


– This is legal, because there are 2 different x’s!
30
Topic #3 – Predicate Logic

Quantifier Equivalence Laws


• Definitions of quantifiers:
– If u.d.=a,b,c,…
x P(x)  P(a)  P(b)  P(c)  …
x P(x)  P(a)  P(b)  P(c)  …
• From those, we can prove the laws:
x P(x)  x P(x)
x P(x)  x P(x)

31
32
33
Topic #3 – Predicate Logic

More Equivalence Laws


• x y P(x,y)  y x P(x,y)
x y P(x,y)  y x P(x,y)
• x (P(x)  Q(x))  (x P(x))  (x Q(x))
x (P(x)  Q(x))  (x P(x))  (x Q(x))
• Exercise: See if you can prove these.
– What propositional equivalences did you
use?

34
Be careful!
• x (P(x)  Q(x)) logically equivalent
to (x P(x))  (x Q(x))?

• x (P(x)  Q(x)) logically equivalent


to (x P(x))  (x Q(x))?

35
36
37
Once more
• x (P(x)  Q(x)) logically equivalent
to (x P(x))  (x Q(x))

• x (P(x)  Q(x)) is NOT logically


equivalent to (x P(x))  (x Q(x))

38
Question
• x (P(x)  Q(x))  (x P(x))  (x
Q(x)) ??????
YES

• x (P(x)  Q(x))  (x P(x))  (x


Q(x)) ??????
NO
39
Every politician is dishonest
Some American does not eat cheeseburgers

De Morgan’s law for universal quantifiers and pq  (p  q)

• Solutions in the textbook’s page 47


40
Examples from Lewis Carroll
• Consider the statements (two
premises followed by a conclusion)
– “All lions are fierce”
– “Some lions do not drink coffee”
– “Some fierce creatures do not drink
coffee” x (P(x) Q(x))
P(x) = “x is a lion” x (P(x)   R(x))?
Q(x) = “x is fierce” When x is not a lion?
R(x) = “x drinks coffee” True if a cat drinks coffee.
It must be x (P(x)   R(x))
x (Q(x)   R(x))
Nested Quantifiers

42
the order of quantifiers
matters
• Let’s expand out the definitions of FORALL
and EXISTS in terms of AND and OR.
– e.g. suppose the universe of discourse just
consists of two objects a and b. Then,
FORALL x EXISTS y P(x,y)
 (EXISTS y P(a,y)) /\ (EXISTS y P(b,y))
 (P(a,a) \/ P(a,b)) /\ (P(b,a) \/ P(b,b)).
EXISTS y FORALL x P(x,y)
 (FORALL x P(x,a)) \/ (FORALL x P(x,b))
 (P(a,a) /\ P(b,a)) \/ (P(a,b) /\ P(b,b)). 43
Be careful with Universe of
discourse
• Domain = Domain of discourse =
universe of discourse
• P(x) = “x is an odd number”
• x P(x) is false
– for the domain of integer numbers
• x P(x) is true
– for the domain of prime numbers
greater than 2
44
Universal quantifiers:
example
• Let P(x) be “x2 >10”. What is the truth
value of x P(x) for each of the
following domains:
• The set of real numbers
False. 3 is a counter example.
• The set of positive integers not exceeding 4
False. 3 is a counter example.
• The set of real numbersin the interval [10, 39.5]
True.
45
Existencial quantifiers:
example

True. 10 is a witness.

True. 4 is a witness. c

False.
46
Topic #3 – Predicate Logic

Review: Predicate Logic

• Objects x, y, z, …
• Predicates P, Q, R, … are functions
mapping objects x to propositions P(x).
• Multi-argument predicates P(x, y).
• Quantifiers:
(x P(x)) =“For all x’s, P(x).”
(x P(x))=“There is an x such that P(x).”

47
Topic #3 – Predicate Logic

More Notational Conventions


• Quantifiers bind as loosely as needed:

•  and  have higher precedence than


logical operators.
• Example:
– x P(x)  Q(x) means
• (x P(x))  Q(x) ? YES
• x (P(x)  Q(x) )?
NO
• Parenthesize x (P(x)  Q(x)) to make things
clear
48
Topic #3 – Predicate Logic

More Notational Conventions


• Consecutive quantifiers of the same type
can be combined:(x y z)P(x,y,z) 
x,y,z P(x,y,z) or even xyz P(x,y,z)
• All quantified expressions can be reduced
to the canonical alternating form
x1x2x3x4… P(x1, x2, x3, x4, …)

49
Summary of quantification
of two variables

50
Summary of quantification
of two variables
R(x,y)=“x relies upon y,”

Everyone relies upon everybody,


(including themselves)!

Everyone has someone to rely on.


There’s some needy person who
relies upon everybody (including
himself).
There’s someone who has someone
to reply on.

51
Topic #3 – Predicate Logic

Defining New Quantifiers


As per their name, quantifiers can be used to
express that a predicate is true of any
given quantity (number) of objects.

Define !x P(x) to mean “P(x) is true of exactly


one x in the universe of discourse.”
!x P(x)  x (P(x)  y (P(y)  y x))
“There is an x such that P(x), where there is no y
such that P(y) and y is other than x.”
52
Topic #3 – Predicate Logic

Some Number Theory


Examples
• Let u.d. = the natural numbers 0, 1, 2, …
• “A number x is even, E(x), if and only if it is
equal to 2 times some other number.”
– x (E(x)  (y x=2y))
• “A number is prime, P(x), iff it’s greater
than 1 and it isn’t the product of any two
non-unity numbers.”
– x (P(x)  (x>1  yz x=yz  y1  z1))

53
E.g. Goldbach's conjecture
“Every even integer greater than 2 can be
expressed as the sum of two primes”
On June 1742, the German mathematician Christian
Goldbach wrote a letter to Leonhard Euler

The conjecture has been shown to hold


up through 4 × 1018, but remains
unproven despite considerable effort.

54
Goldbach's conjecture

55
“Every even integer greater than 2 can be expressed
as the sum of two primes”

Goldbach’s Conjecture
• Using E(x) and P(x)

E(x>2): P(p),P(q): p+q = x

or, with more explicit notation:

x [x>2  E(x)] → p q [P(p)  P(q)  p+q = x].

56
Translating Math
Statements into Nested
quantifiers
• Translate the following statements:
– “The sum of two positive integers is
always positive."

x y((x > 0) (y > 0) → (x +y > 0))


where the domain for both variables
consists of all integers

57
Translating Math
Statements into Nested
quantifiers
• Translate the following statements:
– “Every real number except zero has a
multiplicative inverse."(a multiplicative
inverse of x is y such that xy = 1).
 “For every real number x except zero, x has a multiplicative
inverse.”
 “For every real number x, if x ≠ 0, then there exists a real number y
such that xy = 1.”
 ∀x((x ≠ 0) → ∃y(xy = 1)).
58
Translating Math
Statements into Nested
quantifiers
• Translate the following statements:
– “Every positive integer is the sum of the
squares of four integers.“

59
Topic #3 – Predicate Logic

e.g. Calculus
• One way of precisely defining the
calculus concept of a limit, using
quantifiers:

lim f ( x)  L 
xa

   0 :   0 : x : 
 
 | x  a |    | f ( x)  L |   60
Translating from Nested
Quantifiers
• Translate the statement into English
x(C(x) y(C(y) F(x, y)))
where C(x) is “x has a computer,” F(x, y) is “x and y
are friends,” and the domain for both x and y
consists of all students in your school.
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.

In other words, every student in your school has a computer or has a


friend who has a computer.
61
Translating from Nested
Quantifiers
• Translate the statement into English
x y z((F (x, y) F(x, z) (y≠z))→¬F(y,z))
where F(x, y) is “x and y are friends,” and the domain
for both x and y consists of all students in your
school.
(F (x, y) ∧ F(x, z) ∧ (y ≠ z))→¬F(y, z) says that if students x and y
are friends, and students x and z are friends, and
furthermore, if y and z are not the same student, then y and z are not
friends.
 there is a student none of whose friends are also friends
62
with each other.
Translating from English into
Nested Quantifiers
• “If a person is female and is a parent,
then this person is someone's
mother."
“For every person x, if person x is female and person x is a
parent, then there exists a person y such that person x is the
mother of person y.”
 F(x) to represent “x is female,”
P(x) to represent “x is a parent,” and
M(x, y) to represent “x is the mother of y.”
 ∀x((F (x) ∧ P(x)) → ∃yM(x, y)).
 ∀x∃y((F (x) ∧ P(x)) → M(x, y)). 63
Translating from English into
Nested Quantifiers
• “Everyone has exactly one best
friend."
 “For every person x, person x has exactly one best friend.”
 “∀x(person x has exactly one best friend),” where the domain
consists of all people.
 Exactly one best friend
 B(x, y) to represent “y is the best friend of x,”
 ∃y(B(x, y) ∧ ∀z((z ≠ y)→¬B(x, z))).
 ∀x∃y(B(x, y) ∧ ∀z((z ≠ y)→¬B(x, z))).

[Note that we can write this statement as ∀x∃!yB(x, y), 64


Translating from English into
Nested Quantifiers
• “There is a woman who has taken a
flight on every airline of the world."
Solution 1
 P(w, f ) to represent “w has taken f ”
Q(f, a) to represent “f is a flight on a.”
 ∃w∀a∃f (P(w, f ) ∧ Q(f, a)),
where the domains of discourse for w, f , and a consist of all the
women in the world, all airplane flights, and all airlines, respectively.

Solution 2
 R(w, f, a) is “w has taken f on a.”
65
 ∃w∀a∃fR(w, f, a)
Negating Nested
Quantifiers
• Express the negation of the following
statements, so that no negation
precedes a quantifier (apply
DeMorgan successively):
• x y(xy = 1)
¬ x y(xy = 1)
 x¬ y(xy = 1)
 x y¬(xy = 1). 66
 x y(xy ≠ 1).
Negating Nested
Quantifiers
• Use Quantifiers to express “There
does not exist a woman who has taken
a flight on every airline in the world.”
¬∃w∀a∃f (P(w, f ) ∧ Q(f, a)), where P(w, f ) is “w has taken f ”
and Q(f, a) is “f is a flight on a.”
 ∀w¬∀a∃f (P(w, f ) ∧ Q(f, a))
 ∀w∃a¬∃f (P(w, f ) ∧ Q(f, a))
 ∀w∃a∀f¬(P (w, f ) ∧ Q(f, a))
 ∀w∃a∀f (¬P(w, f )∨¬Q(f, a)).
“For every woman there is an airline such that for all flights, this
woman has not taken that flight or that flight is not on this airline.”
67
Predicate calculus in
Mathematical Reasoning
• Using predicates to express definitions.
• D(x) =“x is a prime number“ (defined term)
• P(x) =“x ≥ 2 and the only divisors of x are 1
and x"(defining property about x)
• Definition of prime number:
x(D(x)↔P(x))

68
Predicate calculus in
Mathematical Reasoning
Let P(n, x, y, z) be the predicate xn + yn = zn.
1.Write the following statements in predicate logic,
using the domain of positive integers:
“For every integer n > 2, there does not exist positive integers
x, y and z such that xn + yn = zn "
2.Negate the previous statement, and simplify it so
that no negation precedes a quantifier.
3.What needs to be found in order to give a counter
example to 1 ?
4.Which famous theorem is expressed in 1, who
proved and when? 69
Predicate calculus in
Program Verication
• a toy example
The following program is designed to exchange the
value of x and y:
temp := x
x := y
y := temp
Find preconditions, postconditions and verify its
correctness.
• Precondition: P(x; y) is “x = a and y = b", where a
and b are the values of x and y before we execute
these 3 statements. 70
Predicate calculus in
Program Verication
temp := x
x := y
y := temp
• Precondition: P(x; y) is “x = a and y = b",
• Postconditon: Q(x; y) is “x = b and y = a".
• Assume P(x; y) holds before and show that Q(x; y) holds after.
• Originally x = a and y = b, by P(x; y).
• After step 1, x = a, temp = a and y = b.
• After step 2, x = b, temp = a and y = b.
• After step 3, x = b, temp = a and y = a.
• Therefore, after the program we know Q(x, y)
71
holds.
Predicate calculus in System
Specification
• Use predicates and quantifiers to
express system specifications:
“Every mail message larger than one
megabyte will be compressed."
– S(m; y):”mail message m is larger than y
megabytes“
– C(m): “mail message m will be compressed“
– m(S(m; 1)  C(m))
72
Predicate calculus in System
Specification
• Use predicates and quantifiers to
express system specifications:
“If a user is active, at least one network link
will be available.“
– A(u): “User u is active.“
– S(n; x): “Network n is in state x".
– uA(u)  nS(n, available)

73
Predicate calculus in Logic
Programming
• Prolog is a declarative language based
in predicate logic. The program is
expressed as Prolog facts and Prolog
rules.
• Execution is triggered by running
queries over these relations.

74
Predicate calculus in Logic
Programming
mother_child(trude, sally).

father_child(tom, sally).
father_child(tom, erica).
father_child(mike, tom).

sibling(X, Y) :- parent_child(Z, X), parent_child(Z, Y).

parent_child(X, Y) :- father_child(X, Y).


parent_child(X, Y) :- mother_child(X, Y).

The result of the following query is given:


?- sibling(sally, erica).
Yes 75
Topic #3 – Predicate Logic

e.g. Deduction
• Definitions: Socrates
469-399 B.C.
s :≡ Socrates (ancient Greek philosopher
who taught Plato, who taught Aristotle));
H(x) :≡ “x is human”;
M(x) :≡ “x is mortal”.
• Premises:
H(s) Socrates is human.
x H(x)M(x) All humans are mortal.
76
Topic #3 – Predicate Logic

Deduction Example
Continued
Some valid conclusions you can draw:
H(s)M(s) [Instantiate universal.]
If Socrates is human then he is mortal.
H(s)  M(s) Socrates is inhuman or mortal.
H(s)  (H(s)  M(s))
Socrates is human, and also either inhuman or mortal.
(H(s)  H(s))  (H(s)  M(s)) [Apply distributive Law.]
F  (H(s)  M(s)) [Trivial contradiction.]
H(s)  M(s) [Use identity law.]
M(s) Socrates is mortal.
All men are mortal Socrates is a man. 77
Therefore Socrates is mortal.
Topic #3 – Predicate Logic

Another Example
• Definitions:
• H(x) :≡ “x is human”; M(x) :≡ “x is mortal”;
G(x) :≡ “x is a god”
• Premises:
– x H(x)  M(x) (“Humans are mortal”)
and
– x G(x)  M(x) (“Gods are immortal”).
• Show that x (H(x)  G(x))
(“No human is a god.”) 78
Topic #3 – Predicate Logic

The Derivation
• x H(x)M(x) and x G(x)M(x).
• x M(x)H(x) [Contrapositive.]
• x [G(x)M(x)]  [M(x)H(x)]
• x G(x)H(x) [Transitivity of .]
• x G(x)  H(x) [Definition of .]
• x (G(x)  H(x)) [DeMorgan’s law.]
• x G(x)  H(x) [An equivalence law.]

79
Topic #3 – Predicate Logic

End of §1.4-1.5, Predicate


Logic
• From these sections you should have
learned:
– Predicate logic notation & conventions
– Conversions: predicate logic  clear
English
– Meaning of quantifiers, equivalences
– Simple reasoning with quantifiers

80
1/16/2018 81

Das könnte Ihnen auch gefallen