CS 228: Logic in Computer Science: Krishna. S
CS 228: Logic in Computer Science: Krishna. S
Krishna. S
1/16
Recap
2/16
Recap
2/16
Recap
2/16
Recap
2/16
Recap
2/16
Recap
2/16
Recap
3/16
Recap
3/16
Recap
3/16
Recap
3/16
Recap
3/16
Satisfiability in PL and FO
4/16
Free and Bound Variables
5/16
Free and Bound Variables
5/16
Free and Bound Variables
5/16
Free and Bound Variables
5/16
P(x, y) → ∀x((∀yR(x, y)) → Q(x, y))
→
P(x, y) → ∀x((∀yR(x, y)) → Q(x, y))
P ∀x
P(x, y) → ∀x((∀yR(x, y)) → Q(x, y))
P ∀x
x y
→
P(x, y) → ∀x((∀yR(x, y)) → Q(x, y))
P ∀x
x y
→
∀y Q
P(x, y) → ∀x((∀yR(x, y)) → Q(x, y))
P ∀x
x y
→
∀y Q
x y
R
P(x, y) → ∀x((∀yR(x, y)) → Q(x, y))
P ∀x
x y
→
∀y Q
x y
R
x y
6/16
P(x, y) → ∀x((∀yR(x, y)) → Q(x, y))
P ∀x
s t
→
∀y Q
x t
R
x y
7/16
∀x(R(x, y) → ∀yP(y))
∀x
∀x(R(x, y) → ∀yP(y))
∀x
→
∀x(R(x, y) → ∀yP(y))
∀x
R ∀y
∀x(R(x, y) → ∀yP(y))
∀x
R ∀y
x y P
∀x(R(x, y) → ∀yP(y))
∀x
R ∀y
x y P
y
∀x(R(x, y) → ∀yP(y))
∀x
R ∀y
x y P
8/16
∀x(R(x, y) → ∀yP(y))
∀x
R ∀y
x t P
9/16
Assignments on τ -structures
Assignments
For a τ -structure A, an assignment over A is a function α : V → u(A)
that assigns every variable x ∈ V a value α(x ) ∈ u(A). If t is a
constant symbol c, then α(t) is c A
10/16
Assignments on τ -structures
Assignments
For a τ -structure A, an assignment over A is a function α : V → u(A)
that assigns every variable x ∈ V a value α(x ) ∈ u(A). If t is a
constant symbol c, then α(t) is c A
Binding on a Variable
α over A, α[x 7→ a] is the assignment
For an assignment
α(y ), y 6= x ,
α[x 7→ a](y ) =
a, y = x
10/16
Satisfaction
11/16
Satisfaction
11/16
Satisfaction
11/16
Satisfaction
11/16
Satisfaction
11/16
Satisfaction
11/16
Satisfaction
11/16
Example of Satisfaction
◮ G = ({1, 2, 3}, E G = {(1, 2), (2, 1), (2, 3), (3, 2)})
◮ For any assignment α, G |=α ∀x∀y (E(x, y ) → E(y , x)) iff for every
a, b ∈ {1, 2, 3}, G |=α[x 7→a,y 7→b] (E(x, y ) → E(y , x))
12/16
Example of Satisfaction
◮ G = ({1, 2, 3}, E G = {(1, 2), (2, 1), (2, 3), (3, 2)})
◮ For any assignment α, G |=α ∀x∀y (E(x, y ) → E(y , x)) iff for every
a, b ∈ {1, 2, 3}, G |=α[x 7→a,y 7→b] (E(x, y ) → E(y , x))
◮ There is an assignment α which satisfies
G |=α ∃x(E(x, y ) ∧ E(x, z) ∧ y 6= z)
12/16
Example of Satisfaction
◮ G = ({1, 2, 3}, E G = {(1, 2), (2, 1), (2, 3), (3, 2)})
◮ For any assignment α, G |=α ∀x∀y (E(x, y ) → E(y , x)) iff for every
a, b ∈ {1, 2, 3}, G |=α[x 7→a,y 7→b] (E(x, y ) → E(y , x))
◮ There is an assignment α which satisfies
G |=α ∃x(E(x, y ) ∧ E(x, z) ∧ y 6= z)
◮ G 2 ∃x∀yE(x, y ), G |= ∀x∃yE(x, y )
◮ W = abaaa
12/16
Example of Satisfaction
◮ G = ({1, 2, 3}, E G = {(1, 2), (2, 1), (2, 3), (3, 2)})
◮ For any assignment α, G |=α ∀x∀y (E(x, y ) → E(y , x)) iff for every
a, b ∈ {1, 2, 3}, G |=α[x 7→a,y 7→b] (E(x, y ) → E(y , x))
◮ There is an assignment α which satisfies
G |=α ∃x(E(x, y ) ∧ E(x, z) ∧ y 6= z)
◮ G 2 ∃x∀yE(x, y ), G |= ∀x∃yE(x, y )
◮ W = abaaa
◮ There is an assignment α for which
W |=α (Qa (x) ∧ Qa (y ) ∧ S(x, y ))
12/16
Example of Satisfaction
◮ G = ({1, 2, 3}, E G = {(1, 2), (2, 1), (2, 3), (3, 2)})
◮ For any assignment α, G |=α ∀x∀y (E(x, y ) → E(y , x)) iff for every
a, b ∈ {1, 2, 3}, G |=α[x 7→a,y 7→b] (E(x, y ) → E(y , x))
◮ There is an assignment α which satisfies
G |=α ∃x(E(x, y ) ∧ E(x, z) ∧ y 6= z)
◮ G 2 ∃x∀yE(x, y ), G |= ∀x∃yE(x, y )
◮ W = abaaa
◮ There is an assignment α for which
W |=α (Qa (x) ∧ Qa (y ) ∧ S(x, y ))
◮ There is no assignment α which satisfies
∃x∃y (Qb (x) ∧ Qb (y ) ∧ x 6= y )
12/16
Example of Satisfaction
◮ G = ({1, 2, 3}, E G = {(1, 2), (2, 1), (2, 3), (3, 2)})
◮ For any assignment α, G |=α ∀x∀y (E(x, y ) → E(y , x)) iff for every
a, b ∈ {1, 2, 3}, G |=α[x 7→a,y 7→b] (E(x, y ) → E(y , x))
◮ There is an assignment α which satisfies
G |=α ∃x(E(x, y ) ∧ E(x, z) ∧ y 6= z)
◮ G 2 ∃x∀yE(x, y ), G |= ∀x∃yE(x, y )
◮ W = abaaa
◮ There is an assignment α for which
W |=α (Qa (x) ∧ Qa (y ) ∧ S(x, y ))
◮ There is no assignment α which satisfies
∃x∃y (Qb (x) ∧ Qb (y ) ∧ x 6= y )
◮ Prove or disprove : W |= ∃x∀y [Qb (x) ∧ x < y ∧ Qa (y )]
◮ Prove or disprove : W |= ∃x∀y [Qb (x) ∧ x < y ⇒ Qa (y )]
12/16
Satisfiability, Validity and
Equivalence
13/16
Satisfiability, Validity and
Equivalence
13/16
Satisfiability, Validity and
Equivalence
13/16
Satisfiability, Validity and
Equivalence
13/16
True or False?
14/16
True or False?
14/16
True or False?
14/16
True or False?
14/16
True or False?
14/16
True or False?
15/16
True or False?
No free variables!
15/16
Check SAT
16/16
Check SAT
16/16