0% found this document useful (0 votes)
14 views51 pages

FM-Lect07-Fall2024-Satisfiability Modulo Theory (SMT) and First Order Logic

The document discusses First-Order Logic (FOL) and its components, including objects, properties, relations, and functions, along with examples of translating statements into FOL. It also covers quantifiers, the significance of constant and predicate symbols, and provides examples related to healthcare and academic systems. Additionally, it touches on theories such as the Theory of Equality and Peano Arithmetic, along with concepts of satisfiability and validity in FOL.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views51 pages

FM-Lect07-Fall2024-Satisfiability Modulo Theory (SMT) and First Order Logic

The document discusses First-Order Logic (FOL) and its components, including objects, properties, relations, and functions, along with examples of translating statements into FOL. It also covers quantifiers, the significance of constant and predicate symbols, and provides examples related to healthcare and academic systems. Additionally, it touches on theories such as the Theory of Equality and Peano Arithmetic, along with concepts of satisfiability and validity in FOL.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 51

Satisfiability

Modulo Theory
Nigar Azhar Butt
Give examples
of problems
that we
cannot easily
encode in SAT?
Dreadbury Mansion Mystery
Dreadbury Mansion Mystery
(in FOL)
Dog, Cat, Mouse
Puzzle
Dog, Cat, Mouse
Puzzle
More Math
Challanges
Second
Language
First order Logic
First-order logic
• First-order logic (FOL) models the world in terms of
• Objects, which are things with individual identities
• Properties of objects that distinguish them from other
objects
• Relations that hold among sets of objects
• Functions, which are a subset of relations where there is
only one “value” for any given “input”
• Examples:
• Objects: Students, lectures, companies, cars ...
• Relations: Brother-of, bigger-than, outside, part-of, has-
color, occurs-after, owns, visits, precedes, ...
• Properties: blue, oval, even, large, ...
• Functions: father-of, best-friend, second-half, one-more-
than ...
User provides
• Constant symbols, which represent individuals in the
world
• Mary
• 3
• Green
• Function symbols, which map individuals to
individuals
• father-of(Mary) = John
• color-of(Sky) = Blue
• Predicate symbols, which map individuals to truth
values
• greater(5,3)
• green(Grass)
• color(Grass, Green)
FOL Provides
• Variable symbols
• E.g., x, y, foo
• Connectives
• Same as in PL: not (), and (), or (), implies
(), if and only if (biconditional )
• Quantifiers
• Universal x or (Ax)
• Existential x or (Ex)
Components of FOL
Quantifiers
•Universal Quantifier (∀): "For all"
• Introduce this by asking students to express general statements (e.g., “All
humans are mortal” becomes ∀ x (Human(x) → Mortal(x))).
•Existential Quantifier (∃): "There exists"
• Explain this through specific statements (e.g., "There exists a person who
is a doctor" becomes ∃ x (Person(x) ∧ Doctor(x))).
•Important Tips:
• Emphasize the difference between universal and existential quantifiers,
and how negation affects them (e.g., ¬∀x P(x) is equivalent to ∃x ¬P(x)).
• Teach common misconceptions like confusing "for all" with "there exists."
Examples
Example 1: "All humans are mortal."
•Translate to FOL: ∀ x (Human(x) → Mortal(x))

Example 2: "There exists a person who is a doctor."


•Translate to FOL: ∃ x (Person(x) ∧ Doctor(x))

Example 3: "All humans love someone."


•Translate to FOL: ∀ x (Human(x) → ∃ y Loves(x, y))

Example 4: "Every person loves their parent."


•Translate to FOL: ∀ x (Person(x) → Loves(x, Parent(x)))
Examples

Healthcare System Statement:


Every doctor who works in the cardiology
department and has more than five years of
experience is eligible to perform heart surgeries
on patients with a valid health insurance policy.
Examples

Constants:
•CardiologyDepartment: Refers to the specific department.
•FiveYears: Represents the value of five years of experience.
•HeartSurgery: Represents the heart surgery operation.
Variables:
•d: Represents a doctor.
•p: Represents a patient.
•exp: Represents years of experience.
Examples

Predicates:
•Doctor(d): Represents that d is a doctor.
•WorksIn(d, CardiologyDepartment): Represents that d works in the
cardiology department.
•Experience(d, exp): Represents that d has exp years of experience.
•Eligible(d): Represents that d is eligible to perform heart surgeries.
•ValidInsurance(p): Represents that p has a valid health insurance
policy.
Examples

Functions:
•Perform(d, HeartSurgery, p): Represents that doctor d performs a
heart surgery on patient p.
Quantifiers:
•Universal Quantifier (∀): For every doctor, if they work in the
cardiology department and have more than five years of
experience, they are eligible.
•Existential Quantifier (∃): There exists a valid insurance policy
for the patient.
Examples

FOL expression:
∀ d ∀ p ((Doctor(d) ∧ WorksIn(d, CardiologyDepartment) ∧
Experience(d, exp) ∧ exp > FiveYears ∧ ValidInsurance(p)) →
Eligible(d) ∧ Perform(d, HeartSurgery, p))
Example: Academic System

Statement: All students who have completed at least


120 credit hours and have a GPA above 3.5 are eligible to
graduate with honors, provided they submit a final
project approved by their academic advisor.
Dreadbury Mansion Mystery
Dreadbury Mansion Mystery
Dog, Cat, Mouse
Puzzle
Language: Signatures
Select all meaningful arities
a) the number 12 has arity 0
b) the number 1 has arity 1
c) The addition function (+) has arity 2
d) The negation function (!) has arity 2
e) The relation that one person is richer than another person
has arity 2
Language: Quantifier free
formulas
Language: Formulas
Free variables in
a) x
b) y
c) z
Free variables in
a) x
b) y
c) z
Models (Semantics) of FOL
Models (Semantics) of FOL
Models (Semantics) of FOL
Example: Propositional Logic
Translating English to
FOL
Every gardener likes the sun.
x gardener(x)  likes(x,Sun)
You can fool some of the people all of the time.
x t person(x) time(t)  can-fool(x,t)
You can fool all of the people some of the time.
x t (person(x)  time(t) can-fool(x,t)) Equivalent
x (person(x)  t (time(t) can-fool(x,t)))
All purple mushrooms are poisonous.
x (mushroom(x)  purple(x))  poisonous(x)
No purple mushroom is poisonous.
x purple(x)  mushroom(x)  poisonous(x) Equivalent
x (mushroom(x)  purple(x))  poisonous(x)
There are exactly two purple mushrooms.
x y mushroom(x)  purple(x)  mushroom(y)  purple(y) ^ (x=y)  z
(mushroom(z)  purple(z))  ((x=z)  (y=z))
Clinton is not tall.
tall(Clinton)
X is above Y iff X is on directly on top of Y or there is a pile of one
or more other objects directly on top of one another starting with
X and ending with Y.
Dreadbury Mansion Mystery
Dreadbury Mansion Mystery
(in FOL)
Dreadbury Mansion Mystery:
theories
Theory of Equality T E
Theory of Equality T E
Select all true statements for T E
a) x=x
b) f(x,y) = f(y,x)
c) f(x,x) = f(x,x)
d) f(x,y) = g(x,y)
e) P(x) = P (y) for x=y
Theory of Peano Arithmetic
(Natural Numbers)
Select all true statements for
peano arithmetic
a) x + 1 = y + 1 -> x=y
b) x+1 = y -> y != 0
c) (x+1) * 0 = 0
d) x * (y+ 1 + 1) = x * y + x + x
Select all true statements for
peano arithmetic
a) x + 1 = y + 1 -> x=y
b) x+1 = y -> y != 0
c) (x+1) * 0 = 0
d) x * (y+ 1 + 1) = x * y + x + x
T-Satisfiability
T-Validity
Select all staisfiable formulas in
FOL for T E
a) x=true
Undecidability (intuition)
Fragement of a Theory
Decidable Fragement of a
Theory
Thank you

You might also like