Formalizing Predicate Logic
Predicate
A predicate is a symbol denoting an T/F attribute (property) of a value or the relationship between multiple values
We call a predicate that takes a single value a unary predicate, two values a binary predicate and
- Billy is a child
- "Billy" is a value
- "child" is a attribute of Billy
- Billy likes ice cream
- "Billy" is a value
- "likes" is a relation (predicate)
- "ice cream" is the value Billy likes
- 10 is greater than 5
- "10" and "5" are values
is an "infix predicate"
- Barbara plays the piano
- "Barbara" is a value, "plays" is a binary predicate, "piano" is a value
- plays(x, y) means x plays y
- plays(Barbara, Piano)
Quantifiers
- Something is rotten in the state of Denmark
& \exists x \cdot \op{rotten}(x) \land \op{inDenmark}(x) \
& \exists x \cdot \op{rotten}(x) \land \op{in}(x, \text{Denmark}) \
& \exists x \cdot \op{rotten}(x, \text{Denmark}) && \text{where } \op{rotten} (a, b) \text{ means} \
&&& a \text{ is rotten in } b
\end
- Someone is happy or hungry
$$\exists x \cdot \op{happy}(x) \lor \op{hungry}(x)$$ - Every child likes Mickey Mouse
Remember to give meanings to each predicate
All bicycles are in the garage
Some bicycles are in the garage
All things are bicycles in the garage
Everything is a bicycle or is in the garage
Something is a bicycle or is in the garage
Be careful,
Nested Quantifiers
- Everything doesn't like something
- Nothing likes everything
Are equivalent.
Binding of variables:
where
The meaning is not the same.
Functions
How would we formalize "Mary's age is less than 20"?
where
But this means Mary could have multiple ages.
We can use functions to establish that there is only 1 value.
- Eunsuk was born north of Toronto
- For all
, if "input" has the value , then "output" has the value squared.
Formalizing English Sentences
Reasonable order to formalize:
- Connectives
- Quantifiers
- Constants
- Functions
- Predicates
For SE212 (and in general), remember to give the predicates and functions meaning on assignments and exams. For brevity, meanings have been omitted since they are self-evident.
Formalize:
All students who like software engineering also like logic
solution
You could formalize this as:
Which is logically equivalent.
Where:
means is a student means likes
Formalize:
All rich actors collect some valuables
solution
Typed predicate logic:
Formalize:
Not everyone who lives in Louisiana speaks French, but everyone who lives in Louisiana knows someone who lives in Louisiana who speaks French
solution
- Not everyone who lives in Louisiana speaks French
- But
- Everyone who lives in Louisiana knows someone who lives in Louisiana who speaks French
Formalize:
Every house has at least one child under the age of 10 living in it has at least two different sizes of pumpkins
in typed predicate logic.
solution
where:
means lives in means the age of means has means the size of
Selective Formalization
If asked to formalize sentences for an argument, and then to prove that the argument is valid, we can choose what we want to formalize based on what we wish to prove.
- For all sentences (premises and conclusion):
- Pick the smallest phrases without connectives that you can answer "is it true or false" to
- Identify all possible logical connectives
- Identify what might be quantified, implicit quantifiers, and constants
- Identify possible predicates and functions. The quantified variables must be arguments to the predicates
- Look for similar phrases and determine how much detail needs to be provided (how much information can one predicate/function capture)
- Think of an outline for the proof