0% found this document useful (0 votes)
31 views4 pages

Predicate Logic (Rosen, Sections 1.4, 1.5)

Predicate logic can express statements that propositional logic cannot, such as "All men are mortal" and "Some trees have needles." Predicate logic uses predicates and variables to make statements about relations and properties. Statements in predicate logic contain a predicate and variables that can take on values from a domain. Universal and existential quantifiers are used to express the extent to which a predicate is true over a set. Universal quantifiers indicate a statement is true for all values, while existential quantifiers indicate a statement is true for at least one value. Predicate logic can evaluate statements and determine their truth values.

Uploaded by

Laura Rossi
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)
31 views4 pages

Predicate Logic (Rosen, Sections 1.4, 1.5)

Predicate logic can express statements that propositional logic cannot, such as "All men are mortal" and "Some trees have needles." Predicate logic uses predicates and variables to make statements about relations and properties. Statements in predicate logic contain a predicate and variables that can take on values from a domain. Universal and existential quantifiers are used to express the extent to which a predicate is true over a set. Universal quantifiers indicate a statement is true for all values, while existential quantifiers indicate a statement is true for at least one value. Predicate logic can evaluate statements and determine their truth values.

Uploaded by

Laura Rossi
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/ 4

Predicate Logic

■ Some statements cannot be expressed in


propositional logic, such as:
Predicate Logic
■ All men are mortal.
(Rosen, Sections 1.4, 1.5)
TOPICS
■ Some trees have needles.
■ X > 3.
• Universal Quantifiers
• Existential Quantifiers ■ Predicate logic can express these
• Predicate Equivalences statements and make inferences on them.

CS160 - Summer Semester 2016 2

Statements in Predicate Logic Example


P(x,y) ■ Let Q(x,y) denote “x=y+3”.
■ What are truth values of:
■ Two parts: ■Q(1,2)
false
■ A predicate P describes a relation or property. ■Q(3,0)
true
■ Variables (x,y) can take arbitrary values from ■ Let R(x,y) denote x beats y in Rock/Paper/Scissors with
some domain. 2 players with following rules:
Rock smashes scissors, Scissors cuts paper, Paper covers
■ Still have two truth values for statements ■

rock.
(T and F) ■ What are the truth values of:
R(rock, paper)
■ When we assign values to x and y, then P ■

■ R(scissors, paper)
has a truth value. false

true

CS160 - Summer Semester 2016 3 CS160 - Summer Semester 2016 4


Quantifiers Universal Quantifier
■ Quantification expresses the extent to ■ P(x) is true for all values in the domain
which a predicate is true over a set of ∀x∈D, P(x)
elements. ■ For every x in D, P(x) is true.
■ Two forms: ■ An element x for which P(x) is false is
■ Universal ∀ (All) called a counterexample.
■ Existential ∃ (One) ■ Given P(x) as “x+1>x” and the domain of
R, what is the truth value of:
∀x P(x)
true
CS160 - Summer Semester 2016 5 CS160 - Summer Semester 2016 6

Example Existential Quantifier


■ Let P(x) be that x>0 and x is in domain ■ P(x) is true for at least one value in the domain.
of R. ∃x∈D, P(x)
■ For some x in D, P(x) is true.
■ Give a counterexample for:
∀x P ■ Let the domain of x be “animals”,
(x) x = -5 M(x) be “x is a mammal” and
E(x) be “x lays eggs”, true
what is the truth value of: Platypuses
echidnas
∃x (M(x) ∧ E(x))

CS160 - Summer Semester 2016 7 CS160 - Summer Semester 2016 8


English to Logic English to Logic
■ Some person in this class has visited the ■ For every one there is someone to love.
Grand Canyon. ■ Domain of x and y is the set of all persons
■ Domain of x is the set of all persons ■ L(x, y): x loves y
■ C(x): x is a person in this class ■ ∀x∃y L(x,y)
■ V(x): x has visited the Grand Canyon ■ Is it necessary to explicitly include that x
■ ∃x(C(x)∧V(x)) and y must be different people (i.e. x≠y)?
■ Just because x and y are different variable
names doesn’t mean that they can’t take the
same values
CS160 - Summer Semester 2016 9 CS160 - Summer Semester 2016 10

Evaluating Expressions:
English to Logic Precedence and Variable Bindings
■ No one in this class is wearing shorts and a ski ■ Precedence:
parka. ■ Quantifiers and negation are evaluated
■ Domain of x is persons in this class before operators
■ S(x): x is wearing shorts ■ Otherwise left to right
■ P(x): x is wearing a ski parka ■ Bound:
■ ¬∃x(S(x)∧P(x)) ■ Variables can be given specific values or
■ Domain of x is all persons ■ Can be constrained by quantifiers
■ C(x): x belongs to the class

■ ¬∃x(C(x)∧S(x)∧P(x))

CS160 - Summer Semester 2016 11 CS160 - Summer Semester 2016 12


Predicate Logic Equivalences Other Equivalences
Statements are logically equivalent iff they have the • Someone likes skiing (P) or likes swimming (Q); hence,
same truth value under all possible bindings. there exists someone who likes skiing or there exists
someone who likes skiing.
For example:
• Not everyone likes to go to the dentist; hence there is
someone who does not like to go to the dentist.
In English: “Given the domain of students in CS160, all
students have passed M124 course (P) and are
registered at CSU (Q); hence, all students have passed • There does not exist someone who likes to go to the
M124 and all students are registered at CSU. dentist; hence everyone does not like to go to the dentist.

CS160 - Summer Semester 2016 13 CS160 - Summer Semester 2016 14

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy