nested loop
DESCRIPTION
Presentation on Predicate Logic as Symbolic Logic & the Concept of Nested Loops in Predicate LogicTRANSCRIPT
Nepal College ofInformaiton TechnologyBalkumari, Lalitpur
May 18, 2010 1
ॐ
_ __ __ _
_ __ __ _
2001
make statements about individual subjects predicate P(x) has two parts:
variable ‘x’ is the subject of statement propositional function P is the property that the subject
can have property of an inference
May 18, 2010 2
property of description of subject in “domain or universe of discourse”
P(x) predicate
two condition: all values of ‘x’ true some values of ‘x’ true
May 18, 2010 3
‘n’ objects
‘x’ values
dynamic in nature logic operator are used so called predicate logic quantifiers & variables are used & variables bound the
quantifier (universal or existential or both) i.e. symbolic logic
May 18, 2010 4
P(x) : “x is man” For all values of ‘x’, if P(x) is true then x P(x) exists For some values of ‘x’, if P(x) is true then x P(x) exists
“All students in this class love discrete structure.” x love(x, discrete structure)
“All student love some subject.” x y love(x, y)
May 18, 2010 5
Two quantifiers are nested if one is within the scope of
the other, such as
∀x y (x + y = 0) ∃ Everything within the scope of a quantifier can be
thought of as a propositional function. Define the
propositional functions
Q(x) : y P(x, y)∃
P(x, y) : x + y = 0
Then, we have
∀x y (x + y = 0) ≡ x y P(x, y) ≡ x Q(x) .∃ ∀ ∃ ∀
May 18, 2010 6
Translation of nested quantifiers can be done by: write out what the quantifiers and predicates in the expression means convert this meaning into a simpler sentence without using any of the
variables
Statements involving nested quantifiers can be negated by applying the rules for negating statements involving a single quantifier
Table : Negating Quantifiers
May 18, 2010 7
Negation Equivalent Statement
When Is Negation True? When False?
x P(x)
x P(x)
x P(x)
x P(x)
For every x, P(x) is false.
There is an x for which P(x) is false.
There is an x for which P(x) is true.P(x) is true for every x.
For example, to evaluate x y P(x, y) we loop through all the values of x, and for each x we loop through all the values of y.
Table : Quantifications of Two Variables
May 18, 2010 8
Statement When True? When False?
x y P(x, y)y x P(x, y)
P(x, y) is true for every pair x, y.
There is a pair x, y for which P(x, y) is false.
x y P(x, y) For every x there is a y for which P(x, y) is true.
There is an x such that P(x, y) is false for all y.
x y P(x, y) There is an x for which P(x, y) is true for all y.
For every x there is a y for which P(x, y) is false.
x y P(x, y)y x P(x, y)
There is a pair x, y for which P(x, y) is true.
P(x, y) is false for every pair x, y.
Example: Translate the statement “The sum of two positive integers is always positive” into a logical expression.
Solution:
May 18, 2010 9
K. Rosen, “Discrete Mathematical Structures with Applications to Computer Science, WCB/ Mcgraw Hill”, edition 6 2006
http://www.slideshare.net/../predicate-logic www.cs.odu.edu/~toida/nerzic/conten.. www.earlham.edu/../terms3.htm
May 18, 2010 10
If you have any suggestion then let me know.
May 18, 2010 11