Propositional and predicate logic - PowerPoint PPT Presentation

1 / 52
About This Presentation
Title:

Propositional and predicate logic

Description:

the set of all the breeds of cat in the world. A = {s, d, f, h, k } B = {a, b, c, d, e, f} ... (x) this would mean: There is one and only one cat that is green. ... – PowerPoint PPT presentation

Number of Views:277
Avg rating:3.0/5.0
Slides: 53
Provided by: aaron63
Category:

less

Transcript and Presenter's Notes

Title: Propositional and predicate logic


1
Propositional and predicate logic
2
Propositional and predicate logic
At the end of this lecture you should be able to
  • distinguish between propositions and predicates
  • utilize and construct truth tables for a number
    of logical connectives
  • determine whether two expressions are logically
    equivalent
  • explain the difference between bound and unbound
    variables
  • bind variables by substitution and by
    quantification.

3
Propositions
In classical logic, propositions are statements
that are either TRUE or FALSE..
4
There are seven days in a week
5
2 4 6
6
London is the capital of France.
7
The food at UEL tastes nice.
8
Put 10 into X
9
Using Symbols..
10
In mathematics we often represent a proposition
symbolically by a variable name such as P or Q.
P I go shopping on Wednesdays Q 102.001 gt
101.31
11
Logical connectives..
12
Negation
Negation is represented by the symbol if P is a
proposition, then not P is represented by P
13
I like dogs
P
14
I do not like dogs
P
15
Connectives can be defined by truth tables.
16



P
P
T
F
T
F
17
The and operator
And is represented by the symbol ?
18
I like shopping
P
19
The sun is shining
Q
20
I like shopping and the sun is shining
P ? Q
21
The truth table for 'and'





P
Q
P ? Q
T
T
T
T
F
F
T
F
F
F
F
F
22
The or operator
The or operator is represented by the symbol ?
23
It is raining
P
24
Today is Tuesday
Q
25
It is raining or today is Tuesday
P ? Q
26
The truth table for or'





P
Q
P ? Q
T
T
T
T
F
T
T
F
T
F
F
F
27
The implication operator
Implication is represented by the symbol ?
28
It is Wednesday
P
29
I do the ironing
Q
30
If it is Wednesday I do the ironing
P ? Q
31
The truth table for implication





P
Q
P ? Q
T
T
T
T
F
F
T
F
T
F
F
T
32
The equivalence operator
Equivalence is represented by the symbol ?.
33
Ive passed my exam
P
34
Ive passed my coursework
Q
35
Ive passed my module
M
36
I will pass my module if and only if I pass my
exam and my coursework.
?
M
(P ? Q)
37
The truth table for equivalence





P
Q
P ? Q
T
T
T
T
F
F
T
F
F
F
F
T
38
Compound statements
P Physics is easy Q Chemistry is interesting
P ? Q
Physics is not easy and chemistry is
interesting
39
Compound statements
P Physics is easy Q Chemistry is interesting
(P ? Q)
It is not true both that physics is easy and
that chemistry is interesting.
40
Logical equivalence
Two compound propositions are said to be
logically equivalent if identical results are
obtained from constructing their truth
tables This is denoted by the symbol ?. For
example P ? P



P
P
P
T
T
F
F
T
F
41
Logical equivalence a demonstration
?(P ? Q) ? ?P ? ?Q





P
Q
P ? Q
?(P ? Q)
?P
?Q
?P ? ?Q
T
F
F
F
F
T
F
T
T
F
T
F
T
T
F
T
F
T
T
T
42
Tautologies
A statement which is always true (that is, all
the rows of the truth table evaluate to true) is
called a tautology. For example, the following
statement is a tautology P ? ?P This can be
seen from the truth table



P
P
P ? ?P
T
F
T
T
43
Contradictions
A statement which is always false (i.e. all rows
of the truth table evaluate to false) is called a
contradiction. For example, the following
statement is a contradiction P ? ?P Again,
this can be seen from the truth table



P
P
P ? ?P
F
F
T
F
44
Sets
A set is any well-defined, unordered, collection
of objects For example we could refer to
the set containing all the people who work in a
particular office the set of whole numbers from
1 to 10 the set of the days of the week the
set of all the breeds of cat in the world.
45
Representing sets
A s, d, f, h, k B a, b, c, d, e,
f the symbol ? means "is an element of". the
statement "d is an element of A" is written d ?
A the statement "p is not an element of A" is
written p ? A Predicate logic is a powerful way
for us to reason about sets.
46
Predicates
A predicate is a truth valued expression
containing free variables These allow the
expression to be evaluated by giving different
values to the variables Once the variables are
evaluated they are said to be bound.
Examples C(x) x is a cat Studies(x,y) x
studies y Prime(n) n is a prime number
47
Binding Variables
There are two ways in which variables in
predicates can be given values.
  1. By substitution (giving a particular value to the
    variable)
  2. By Quantification

48
Substitution
C( x ) Studies( x , y ) Prime( x )
Simba ) Simba is a cat
Olawale, physics ) Olawale studies physics
3 ) 3 is a prime number
49
Quantification
A quantifier is a mechanism for specifying an
expression about a set of values There are
three quantifiers that we can use, each with its
own symbol The Universal Quantifier, ? The
Existential Quantifier ? The Unique
Existential Quantifier ?!
50
The Universal Quantifier, ?
This quantifier enables a predicate to make a
statement about all the elements in a particular
set. For example If M(x) is the predicate x
chases mice, we could write ?x ? Cats ?
M(x) this reads For all the xs which are
members of the set Cats, x chases mice Or All
cats chase mice.
51
The Existential Quantifier ?
In this case, a statement is made about whether
or not at least one element of a set meets a
particular criterion. For example if, P(n) is
the predicate n is a prime number, we could
write ?n ? ? ? P(n) this reads There exists
an n in the set of natural numbers such that n is
a prime number or There exists at least one prime
number in the set of natural numbers.
52
The Unique Existential Quantifier ?!
This quantifier modifies a predicate to make a
statement about whether or not precisely one
element of a set meets a particular
criterion. For example If G(x) is the predicate
x is green, we could write ?!x ? Cats ? G(x)
this would mean There is one and only one cat
that is green.
Write a Comment
User Comments (0)
About PowerShow.com