Expert Systems L5
Expert Systems L5
Predicate(term1, term2)
Example 2:
“Finn likes chocolate” represents as:
Likes(Finn, chocolate)
Example 3:
“Finn likes x food” represents as:
Likes(Finn, x) where x is a variable within the
domain „food‟
Are constructed (much as in propositional logic)
By combing atomic sentence with logical connectives
Conjunction (∧): AND
Disjunction (∨): OR
Negation (¬): NOT
Implication (⇒) If…THEN
Equivalence (⇔): IF AND ONLY IF
Example:
“If Alison is friends with Richard then she likes him”
friends(alison, Richard) ⇒likes(alison,Richard)
“Alison likes Richard then or chocolate”
likes(alison, Richard) ∨likes(alison, chocolate)
Predicates are symbols that represent the
attributes or connections of things. They are
used to construct assertions about things and
their properties. For instance, "human(x)" may
be a predicate indicating that "x is a human."
Variables are placeholders in logical statements
that allow us to refer to undefined objects. They
help in the creation of general statements that
may be applied to any object. In the predicate
"human(x)," for example, "x" is a variable that
represents any human.
Functions are similar to predicates but flexibly
map to terms to other terms( don‟t return truth)
Example:
Mathematics function: p(x) ⇒x2
Any value of x get‟s squared
Object: LeftLeg(John)
Interpreted as “John‟s left leg”
Rather than specifying a constant name of John‟s
left leg
"Quantifiers" are words or phrases used before
nouns to indicate the amount or quantity of
something, without necessarily specifying the
exact numbe
∃x(bird(x) ∧¬flies(x))
In universal quantifier, ∀x∀yis similar to ∀y∀x.
In Existential quantifier, ∃x∃yis similar to ∃y∃x.
∃x∀yis not similar to ∀y∃x.
Using ∧ as the main connective with ∀
intended:
Example:
“Finn eats everything that he likes”
∀x (likes(Finn,x) → eats(Finn,x)) (true)
∀x (likes(Finn,x) ∧ eats(Finn,x)) (false)
Translated to “Finn eats everything and eats
everything”
Using → as the main connectives with ∃
intended:
Example:
There exists some bird that doesn‟t fly.
∃x(bird(x) ∧¬flies(x)) (true)
∃x(bird(x) → ¬flies(x)) (false)
Translation very difficult, but this statement is
only true if there is something other than bird:
Involving properties of a single variable
∀x (house(x) → physical_object(x))
Every house is a physical object
Binary predicates:
•Involving properties of a two variable
∀x,y(Brother(x,y) → Sibling (x,y))
Brothers are siblings
Brothers are siblings
∀x,y(Brother(x,y) → Sibling(x,y))
Sibling is symmetric
∀x,y(Sibling(x,y) → Sibling(y,x))
X is bound by ∀
A formula with no free variables is called closed
formula sentence, or a proposition, and has a
truth value
Free Variable: A variable is said to be a free
variable in a formula if it occurs outside the
scope of the quantifier.
Example:
∀x ∃(y)[P (x, y, z)], where z is a free variable.
1. What is the meaning of the following FOL
formulas?
1. bought(Frank, dvd)
2. ∃x.bought(F rank, x)
3. ∀x.(bought(F rank, x) → bought(Susan, x))
4. ∀x.bought(F rank, x) → ∀x.bought(Susan, x)
5. ∀x∃y.bought(x, y)
6. ∃x∀y.bought(x, y)
Formalize the following sentences using FOL formulas.
1. All Students are smart.
2. There exists a student.
3. There exists a smart student.
4. Every student loves some student.
5. Every student loves some other student.
6. There is a student who is loved by every other student.
7. Bill is a student.
8. Bill takes either Analysis or Geometry (but not both).
9. Bill takes Analysis and Geometry.
10. Bill doesn‟t take Analysis.
11. No students love Bill