Satisfiability Checking
Gröbner bases
Prof. Dr. Erika Ábrahám
RWTH Aachen University
Informatik 2
LuFG Theory of Hybrid Systems
WS 14/15
Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University)
WS 14/15
1 / 15
Motivation
For simplicity, we restrict to equations.
p1 (x1 , . . . , xn ) = 0 ∧ · · · ∧ pk (x1 , . . . xn ) = 0
A solution is
Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University)
WS 14/15
2 / 15
Motivation
For simplicity, we restrict to equations.
p1 (x1 , . . . , xn ) = 0 ∧ · · · ∧ pk (x1 , . . . xn ) = 0
A solution is a common root for all pi .
Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University)
WS 14/15
2 / 15
Motivation
For simplicity, we restrict to equations.
p1 (x1 , . . . , xn ) = 0 ∧ · · · ∧ pk (x1 , . . . xn ) = 0
A solution is a common root for all pi .
This is a well-studied problem in algebra!
One approach: Gröbner bases.
Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University)
WS 14/15
2 / 15
Common roots = Varieties
Let P = {p1 , ..., pk } ⊆ R[x1 , ..., xn ] and V(P) be the set of common real
roots:
\
V(P) =
rootsR (p)
p∈P
Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University)
WS 14/15
3 / 15
Common roots = Varieties
Let P = {p1 , ..., pk } ⊆ R[x1 , ..., xn ] and V(P) be the set of common real
roots:
\
V(P) =
rootsR (p)
p∈P
Observation
Let p1 , p2 ∈ P and q ∈ R[x1 , ..., xn ].
V(P) = V(P ∪ {p1 + p2 }) = V(P ∪ {p1 · q})
Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University)
WS 14/15
3 / 15
Common roots = Varieties
Let P = {p1 , ..., pk } ⊆ R[x1 , ..., xn ] and V(P) be the set of common real
roots:
\
V(P) =
rootsR (p)
p∈P
Observation
Let p1 , p2 ∈ P and q ∈ R[x1 , ..., xn ].
V(P) = V(P ∪ {p1 + p2 }) = V(P ∪ {p1 · q})
V(P) = V(P ∪ {p1 − q · p2 }) = V(P ∪ {p1
mod p2 })
Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University)
WS 14/15
3 / 15
Common roots = Varieties
Let P = {p1 , ..., pk } ⊆ R[x1 , ..., xn ] and V(P) be the set of common real
roots:
\
V(P) =
rootsR (p)
p∈P
Observation
Let p1 , p2 ∈ P and q ∈ R[x1 , ..., xn ].
V(P) = V(P ∪ {p1 + p2 }) = V(P ∪ {p1 · q})
V(P) = V(P ∪ {p1 − q · p2 }) = V(P ∪ {p1
mod p2 })
We can simplify polynomials, maintaining V!
Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University)
WS 14/15
3 / 15
Analogon: Euclidean algorithm
R[x1 , ..., xn ] is just a ring like Z.
Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University)
WS 14/15
4 / 15
Analogon: Euclidean algorithm
R[x1 , ..., xn ] is just a ring like Z.
Euclidean algorithm
a, b ∈ Z
while b 6= 0
tmp := b
b := a mod b
a := tmp
return a
Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University)
WS 14/15
4 / 15
Analogon: Euclidean algorithm
R[x1 , ..., xn ] is just a ring like Z.
Euclidean algorithm
Generalized version
a, b ∈ Z
A⊂Z
while b 6= 0
do
tmp := b
A0 := A
b := a mod b
foreach a, b ∈ A0
a := tmp
return a
if a mod b 6= 0
A := A ∪ {a mod b}
until A = A0
return min A
Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University)
WS 14/15
4 / 15
Buchberger algorithm
Going back to polynomials:
Generalized version
A⊂Z
do
A0 := A
foreach a, b ∈ A0
if a mod b 6= 0
A := A ∪ {a mod b}
until A = A0
return min A
Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University)
WS 14/15
5 / 15
Buchberger algorithm
Going back to polynomials:
Buchberger algorithm
Generalized version
P = {p1 , ..., pk }
A⊂Z
do
do
P 0 := P
A0 := A
foreach p, q ∈ P 0
foreach a, b ∈ A0
if p mod q 6= 0
P := P ∪ {p mod q}
if a mod b 6= 0
A := A ∪ {a mod b}
until P = P 0
until A = A0
return min P
return min A
Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University)
WS 14/15
5 / 15
Buchberger algorithm
Going back to polynomials:
Buchberger algorithm
Optimizations
P = {p1 , ..., pk }
Normalize polynomials,
do
Remove polynomials if
factors have been found,
P 0 := P
foreach p, q ∈ P 0
if p mod q 6= 0
P := P ∪ {p mod q}
until P = P 0
return min P
Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University)
WS 14/15
5 / 15
Result
Euclidean algorithm yields:
Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University)
WS 14/15
6 / 15
Result
Euclidean algorithm yields: GCD, i.e. largest common factor of all numbers.
Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University)
WS 14/15
6 / 15
Result
Euclidean algorithm yields: GCD, i.e. largest common factor of all numbers.
Buchbergers algorithm yields the largest common factor of all polynomials.
Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University)
WS 14/15
6 / 15
Result
Euclidean algorithm yields: GCD, i.e. largest common factor of all numbers.
Buchbergers algorithm yields the largest common factor of all polynomials.
A root r of a polynomial p(x) corresponds to the linear factor (x − r ).
If this one has no roots, the polynomials have no common roots.
Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University)
WS 14/15
6 / 15
Result
Euclidean algorithm yields: GCD, i.e. largest common factor of all numbers.
Buchbergers algorithm yields the largest common factor of all polynomials.
A root r of a polynomial p(x) corresponds to the linear factor (x − r ).
If this one has no roots, the polynomials have no common roots.
Formally:
Theorem (Hilbert’s weak Nullstellensatz)
Let I be an ideal in K [x1 , x2 , ..., xn ], then
\
1∈I ⇔
rootsK (p) = ∅
p∈I
Buchbergers algorithm partially expands I to check if 1 ∈ I .
Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University)
WS 14/15
6 / 15
That’s it?
Unfortunately, K must be algebraically closed, i.e. K 6= R, K = C.
Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University)
WS 14/15
7 / 15
That’s it?
Unfortunately, K must be algebraically closed, i.e. K 6= R, K = C.
rootsC (P) = ∅ ⇒ rootsR (P) = V(P) = ∅
Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University)
WS 14/15
7 / 15
That’s it?
Unfortunately, K must be algebraically closed, i.e. K 6= R, K = C.
rootsC (P) = ∅ ⇒ rootsR (P) = V(P) = ∅
This method gives us no possibility to construct the actual solution!
(If V(P) is finite, we can do this.)
Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University)
WS 14/15
7 / 15
That’s it?
Unfortunately, K must be algebraically closed, i.e. K 6= R, K = C.
rootsC (P) = ∅ ⇒ rootsR (P) = V(P) = ∅
This method gives us no possibility to construct the actual solution!
(If V(P) is finite, we can do this.)
⇒ We can determine unsatisfiability, not satisfiability.
Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University)
WS 14/15
7 / 15
Example - Graphical
x2 + y2 − 1 = 0 ∧ x − y + 1 = 0
y
x
Common roots: (−1, 0), (0, 1)
Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University)
WS 14/15
8 / 15
Example - Algorithm
P ={
p1 = x 2 + y 2 − 1,
p2 = x − y + 1
}
Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University)
WS 14/15
9 / 15
Example - Algorithm
p1 mod p2 = 2y 2 − 2y
P ={
p1 = x 2 + y 2 − 1,
p2 = x − y + 1,
p3 = 2y 2 − 2y
}
Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University)
WS 14/15
9 / 15
Example - Algorithm
p1 mod p2 = 2y 2 − 2y
p2 mod p1 = x − y + 1
P ={
p1 = x 2 + y 2 − 1,
p2 = x − y + 1,
p3 = 2y 2 − 2y
}
Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University)
WS 14/15
9 / 15
Example - Algorithm
P ={
p1 mod p2 = 2y 2 − 2y
p2 mod p1 = x − y + 1
p1 mod p3 = x 2 + y − 1
p1 = x 2 + y 2 − 1,
p2 = x − y + 1,
p3 = 2y 2 − 2y ,
p4 = x 2 + y − 1
}
Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University)
WS 14/15
9 / 15
Example - Algorithm
P ={
p1 = x 2 + y 2 − 1,
p2 = x − y + 1,
p1
p2
p1
p2
p3
p3
mod
mod
mod
mod
mod
mod
p2
p1
p3
p3
p1
p2
= 2y 2 − 2y
=x −y +1
= x2 + y − 1
=x −y +1
= 2y 2 − 2y
= 2y 2 − 2y
p3 = 2y 2 − 2y ,
p4 = x 2 + y − 1
}
Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University)
WS 14/15
9 / 15
Example - Algorithm
P ={
p1 = x 2 + y 2 − 1,
p2 = x − y + 1,
p3 = y 2 − y ,
p4 = x 2 + y − 1
}
p1
p2
p1
p2
p3
p3
p1
p2
p3
p4
p4
p4
mod
mod
mod
mod
mod
mod
mod
mod
mod
mod
mod
mod
p2
p1
p3
p3
p1
p2
p4
p4
p4
p1
p2
p3
= 2y 2 − 2y
=x −y +1
= x2 + y − 1
=x −y +1
= 2y 2 − 2y
= 2y 2 − 2y
= y2 − y
=x −y +1
= 2y 2 − 2y
= −y 2 + y
= y2 − y
= x2 + y − 1
Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University)
WS 14/15
9 / 15
Example - Algorithm
P ={
p1 = x 2 + y 2 − 1,
p2 = x − y + 1,
p3 = y 2 − y ,
p4 = x 2 + y − 1
}
p1
p2
p1
p2
p3
p3
p1
p2
p3
p4
p4
p4
mod
mod
mod
mod
mod
mod
mod
mod
mod
mod
mod
mod
p2
p1
p3
p3
p1
p2
p4
p4
p4
p1
p2
p3
= 2y 2 − 2y
=x −y +1
= x2 + y − 1
=x −y +1
= 2y 2 − 2y
= 2y 2 − 2y
= y2 − y
=x −y +1
= 2y 2 − 2y
= −y 2 + y
= y2 − y
= x2 + y − 1
1 6∈ P, hence no result in general.
Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University)
WS 14/15
9 / 15
Example - Algorithm
P ={
p1 = x 2 + y 2 − 1,
p2 = x − y + 1,
p3 = y 2 − y ,
p4 = x 2 + y − 1
}
p1
p2
p1
p2
p3
p3
p1
p2
p3
p4
p4
p4
mod
mod
mod
mod
mod
mod
mod
mod
mod
mod
mod
mod
p2
p1
p3
p3
p1
p2
p4
p4
p4
p1
p2
p3
= 2y 2 − 2y
=x −y +1
= x2 + y − 1
=x −y +1
= 2y 2 − 2y
= 2y 2 − 2y
= y2 − y
=x −y +1
= 2y 2 − 2y
= −y 2 + y
= y2 − y
= x2 + y − 1
1 6∈ P, hence no result in general.
With y 2 − y = 0 and x − y + 1 = 0 we can obtain (−1, 0) and (0, 1).
Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University)
WS 14/15
9 / 15
Example 1 – Finitely many common roots in R
x2 · y2 − 1 = 0 ∧ x2 − y = 0
The Gröbner basis is:
y
P = {x 2 − y , y 3 − 1}
1 6∈ P, hence there exists a solution
in C. The number of roots is finite,
hence we can use the basis to obtain
the solutions (−1, 1) and (1, 1) which
are in R2 .
Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University)
x
WS 14/15
10 / 15
Example 2 – Infinitely many common roots in R
x 2 y − x 2 + y 3 − y 2 − y + 1 = 0 ∧ x 3 − x 2 + xy 2 − y − y 2 + 1 = 0
The Gröbner basis is:
y
P = {p1 , p2 }
1 6∈ P, hence there exists a solution
in C2 . The number of roots is
infinite, hence there is no general way
to obtain the actual solutions.
Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University)
x
WS 14/15
11 / 15
Example 3 – Common roots in C
x2 + 1 = 0 ∧ x3 + x = 0
The Gröbner basis is:
i
P = {x 2 + 1}
1 6∈ P, hence there exists a
solution, i.e. a common root,
in C. However, this solution
is in C \ R.
Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University)
x
WS 14/15
12 / 15
Extra: Handling inequalities
We only handled =. What about ≤, ≥, <, >, 6=?
Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University)
WS 14/15
13 / 15
Extra: Handling inequalities
We only handled =. What about ≤, ≥, <, >, 6=?
p(x) ≤ 0 ⇔ p(x) + y 2 = 0
p(x) ≥ 0 ⇔ p(x) − y 2 = 0
p(x) < 0 ⇔ p(x) · y 2 + 1 = 0
p(x) > 0 ⇔ p(x) · y 2 − 1 = 0
p(x) 6= 0 ⇔ p(x) · y − 1 = 0
Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University)
WS 14/15
13 / 15
Extra: Ring
Let (R, +, ·) be a ring, that is:
+ is associative,
+ is commutative,
there is an additive identity 0,
there is an additive inverse −a for every a ∈ R,
· is associative,
there is a multiplicative identity 1,
addition and multiplication distribute.
Examples:
Z (· is commutative)
R (is a field)
K [x1 , ..., xn ] (polynomial ring over field K )
Our application: R[x1 , ..., xn ]
Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University)
WS 14/15
14 / 15
Extra: Ideals
Ideal: A subset of a ring, that is closed under + and absorbs ·.
Formally:
I ⊆ R,
(I , +) is a subgroup of (R, +), that is 0 ∈ I , −a ∈ I for all a ∈ I ,
a + b ∈ I for all a, b ∈ I ,
a · b ∈ I for all a ∈ I , b ∈ R,
a · b ∈ I for all a ∈ R, b ∈ I ,
Examples:
R is an ideal of R
Even integers: R = Z, I = 2Z
All polynomials divisible by x 2 + 1: R = R[x], I = R/(x 2 + 1)
Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University)
WS 14/15
15 / 15
© Copyright 2026 Paperzz