More on Composite of Existential and Universal Quantifiers - PowerPoint PPT Presentation

1 / 12
About This Presentation
Title:

More on Composite of Existential and Universal Quantifiers

Description:

More on Composite of Existential and Universal Quantifiers (x) (y) = (y) (x) ... of a variable, x, we may differentiate the post-condition by using an apostrophe, ... – PowerPoint PPT presentation

Number of Views:59
Avg rating:3.0/5.0
Slides: 13
Provided by: fts2
Category:

less

Transcript and Presenter's Notes

Title: More on Composite of Existential and Universal Quantifiers


1
More on Composite of Existential and Universal
Quantifiers
  • (x) (y) ltgt (y) (x) ?
  • Lets look at this with an example
  • Let x be father and y be children
  • (x) (y) There exists a father for all
    children
  • (y) (x) For all the children there is a
    father
  • These are clearly different sentences in that
  • There is one father for all the children --- very
    unlikely
  • For all the children, there is a father. (Every
    child has a father. ---- much more reasonable! )

2
View the two cases in tabular form
Let F( x, y ) be the predicate that states x is
the father of y.
Note x is the bound variable and y is free as
you change y, the expression still holds true.
X1
X2
X3
(x) F( x, y)
T
T
y1
F
F
T
F
T
y2
F
V (y) ? (x) F( x, y)
F
T
y3
T
F
Yes
F
T
F
T
y4
V (y) F(x,y)
F
F
F
? (x) V (y) F(x,y)
No
y is the bound and x is free as you Iterate
through the xs, the expression Is never true
3
Existential and Universal Quantifiers Basics
  • Note that (x) P(x) is the equivalent to
    saying
  • P(a1), P(a2), - - - - , P(an) is true for all
    the n instances of as.
  • or
  • (x) P(x) ? P(a1) /\ P(a2)/\ - - - - /\
    P(an)
  • Note that (x) P(x) is the same as saying
  • at least one of the following P(a1) P(a2) - -
    - - P(an) is true
  • or
  • (x) P(x) ? P(a1) \/ P(a2) \/ - - - -
    \/ P(an)

4
Relationships Between Existential and Universal
Quantifiers
  • From previous slide, we can have
  • (x) P(x) ( P(a1) /\ P(a2) /\ - - -
    /\ P(an) )
  • P(a1) \/ P(a2) \/
    - - - \/ P(an)
  • (x) P(x)
  • Thus we have the following
  • (x) P(x) ?
    (x)P(x)

Your try the (x) P(x) ? (x) P(x)
5
More Than One Predicate
  • Consider the following
  • (x) ( P(x) /\ Q(x) ) (P(a1)/\Q(a1)) \/
    (P(a2)/\Q(a2)) \/ - - -
  • (x)(P(x) /\ Q(x)) (P(a1)/\Q(a1)) \/
    (P(a2)/\Q(a2)) \/ - - -
  • (P(a1)/\Q(a1))
    /\ (P(a2)/\Q(a2)) /\ - - - -
  • (x) (
    P(x) /\ Q(x) )
  • (x) (P(x)
    \/ Q(x) )

So we have (x) (P(x)/\Q(x)) ?
(x) (P(x) \/ Q(x) )
6
Relationship Between Existential and Universal
Quantifiers
  • (x) p(x) ltgt (x) p(x)
  • (x) p(x) ltgt (x) p(x)
  • (x) (p(x) /\ q(x)) ltgt (x) (p(x) \/
    q(x) )

7
More Relationships in Predicate Calculus
  • (x) P(x) -gt (x) P(x)
  • (x) P(x) lt-gt (x) P(x)
  • (x) P(x) lt-gt (x) P(x)
  • (x) (y) P(x,y) lt-gt (y) (x)
    P(x,y)
  • (x) (y) P(x,y) lt-gt (y) (x)
    P(x,y)
  • (x) (y) P(x,y) -gt (y) (x)
    P(x,y)

Note the one way arrow versus the two way arrow

8
Sample Proof
  • V(x) P(x) -gt ? (x) P(x)
  • P(x1) ------ P(xn) -gt P(x1) V ------ V
    P(xn)
  • P(x1) ----- P(xn) V P(x1) V ------ V
    P(xn)
  • P(x1) V ------V P(xn) V P(x1) V ----- VP(xn)
  • P(x1) V P(x1) V ---------------------V P(xn) V
    P(xn)
  • T V -------------------V
    T
  • True
  • A tautology

9
Does Spot have a tail?
  • Now that we have gone through the fundamentals of
    predicate calculus, lets try the earlier
    reasoning process
  • Let p(x) indicate that x is a dog
  • Let q(y) indicate that y has a tail
  • Let spot be the specific dog in question.
  • (x) (p(x) -gt q(x)) every dog has a
    tail (premise 1)
  • p(spot) spot is a dog
    (premise 2)
  • p(spot) -gt q(spot) universal
    instantiation with spot premise 1
  • p(spot), p(spot) -gt q(spot) gt q(spot) using
    modus ponens rule
  • therefore q(spot) spot has a tail !

10
Additional Concepts
  • Singular existential quantifier
  • There exists only one object that has the desired
    characteristic
  • We represent that by placing a 1 subscript to the
    existential quantifier (x) P(x)
  • Counting quantifiers
  • Represents the number of objects in a group that
    has the specific characteristic
  • We will use O to represent counting quantifiers.
  • Example 1 O(x) 1,2, - - - ,10 xgt6
    will yield 4
  • Example 2 O(x) programs has_bug(x)
    stands for the number of programs that are
    defective

1
11
Additional Concepts
  • Pre-condition and Post-condition
  • These were used when we covered code correctness
  • How should we articulate and what should we use
    to articulate the pre-condition and
    post-conditions of computing systems.
  • Variables
  • Global
  • Local
  • In the case of a variable, x, we may
    differentiate the post-condition by using an
    apostrophe,,
  • X for the variable for pre-condition
  • X for the same variable for post-condition

12
Converting English Phrases to Pre/Post Conditions
in Predicate Calculus
  • Example from page 86 of your text
  • The procedure SunUpPost has two
    parameters. The first parameter is an integer
    array, Vals, which has a range of 1, - - -,10.
    The second parameter is a boolean variable,
    Outrange. This is set to true if any value of the
    Vals is less than or greater than 2000.
  • Let the counting quantifier, omega, be
    represented by O,
  • Pre-conditions
  • O par variables param_of(par,
    SunUpPost) 2
  • param_of(Vals, SunUpPost) /\ param_of(
    OutRange, SunupPost)
  • i 1, - - -,10 Integer( Vals(i) )
  • boolean(Outrange)
  • Post-conditions
  • i 1, - - - , 10 Vals(i)
    Vals(i)
  • ( i 1, - - -, 10 Vals(i) 2000
    ) -gt ( Outrange True )
Write a Comment
User Comments (0)
About PowerShow.com