Jul 5, 2016 - Introduction. Separateness of variables. The Separated Fragment. Conclusion. What is separateness good for? We can rearrange quantifiers:.
Deciding First-Order Satisfiability when Universal and Existential Variables are Separated Thomas Sturm
Marco Voigt
July 05, 2016
Christoph Weidenbach
Introduction
Separateness of variables
The Separated Fragment
Conclusion
Our setting We treat classical first-order logic
with equality and constants
without non-constant function symbols
∀x∃y . P(x, y ) ∧ ¬Q(c, x) x ≈c f (y )
The Decision Problem: Given a sentence ϕ, does it have a model?
le cidab
unde
Decidable fragments are known.
July 05, 2016
2/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
Our setting We treat classical first-order logic
with equality and constants
without non-constant function symbols
∀x∃y . P(x, y ) ∧ ¬Q(c, x) x ≈c f (y )
The Decision Problem: Given a sentence ϕ, does it have a model?
le cidab
unde
Decidable fragments are known.
July 05, 2016
2/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
Our setting We treat classical first-order logic
with equality and constants
without non-constant function symbols
∀x∃y . P(x, y ) ∧ ¬Q(c, x) x ≈c f (y )
The Decision Problem: Given a sentence ϕ, does it have a model?
le cidab
unde
Decidable fragments are known.
July 05, 2016
2/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
Our setting We treat classical first-order logic
with equality and constants
without non-constant function symbols
∀x∃y . P(x, y ) ∧ ¬Q(c, x) x ≈c f (y )
The Decision Problem: Given a sentence ϕ, does it have a model?
le cidab
unde
Decidable fragments are known.
July 05, 2016
2/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
Two classical decidable fragments Criterion only unary predicates ∃∗ ∀∗ ψ ∃∗ ∀ ∃∗ ψ ∃∗ ∀∀ ∃∗ ψ
Discoverer(s) Löwenheim 1915 Bernays and Schönfinkel 1928, Ramsey 1932 Ackermann 1928 Gödel 1932, Kalmár 1933, Schütte 1934
July 05, 2016
3/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
Two classical decidable fragments Criterion only unary predicates ∃∗ ∀∗ ψ orthogonal ∃∗ ∀ ∃∗ ψ criteria ∃∗ ∀∀ ∃∗ ψ
Discoverer(s) Löwenheim 1915 Bernays and Schönfinkel 1928, Ramsey 1932 Ackermann 1928 Gödel 1932, Kalmár 1933, Schütte 1934
July 05, 2016
3/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
Two classical decidable fragments Criterion only unary predicates ∃∗ ∀∗ ψ orthogonal ∃∗ ∀ ∃∗ ψ! ng criteria too stro ∃∗ ∀∀ ∃∗ ψ
Discoverer(s) Löwenheim 1915 Bernays and Schönfinkel 1928, Ramsey 1932 Ackermann 1928 Gödel 1932, Kalmár 1933, Schütte 1934
July 05, 2016
3/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
A new decidable fragment Criterion only unary predicates ∃∗ ∀∗ ψ ∃∗ ∀ ∃∗ ψ
∗ ∗ ∗ ∃∃∗∗(∀ ∀∀ ∃∃∗)ψψ
P(. . . x . . . y . . .)
Discoverer(s) Löwenheim 1915 Bernays and Schönfinkel 1928, Ramsey 1932 Ackermann 1928 Gödel 1932, Kalmár 1933, Schütte 1934
July 05, 2016
3/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
A new decidable fragment Criterion only unary predicates ∃∗ ∀∗ ψ ∃∗ ∀ ∃∗ ψ
∗ ∗ ∗ ∃∃∗∗(∀ ∀∀ ∃∃∗)ψψ
P(. . . x . . . y . . .)
Discoverer(s) Löwenheim 1915 Bernays and Schönfinkel 1928, Ramsey 1932 Ackermann 1928 Gödel 1932, Kalmár 1933, Separated Fragment Schütte 1934 no atom may contain blue and red variables
July 05, 2016
(SF)
3/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
What is separateness good for? We can rearrange quantifiers:
∀~x1 ∃~y1 . . . ∀~xn ∃~yn . ψ is equivalent to ∃~u ∀~v. ψ 0 if blue variables are separated from red ones in ψ.
July 05, 2016
4/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
Example: rearranging quantifiers
∀x∃y .
P(x) ↔ Q(y )
is equivalent to ∃y1 y2 ∀x. P(x) → Q(y1 ) ∧ Q(y2 ) → P(x)
July 05, 2016
5/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
Example: rearranging quantifiers Original:
∀x∃y .P(x) ↔ Q(y ).
Transform into DNF: ∃y ∀x∃y ∀x∃y W
V ¬P(x) ¬Q(y21)) ¬P(x1 ) ∃y1 .¬Q(y
V ∃y2Q(y . Q(y 1 )2 )
∀x. P(xP(x) 2)
July 05, 2016
6/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
Example: rearranging quantifiers Original:
∀x∃y .P(x) ↔ Q(y ).
Pull in ∃y : ∀x∃y ∀x∃y W
V ¬P(x) ¬Q(y21)) ¬P(x1 ) ∃y1 .¬Q(y
V ∃y2Q(y . Q(y 1 )2 )
∀x. P(xP(x) 2)
July 05, 2016
6/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
Example: rearranging quantifiers Original:
∀x∃y .P(x) ↔ Q(y ).
Pull in ∃y :
∀x∃y ∀x∃y W
V ¬P(x)1 ) ∃y1 .¬Q(y ¬Q(y21)) ¬P(x
V ∃y2Q(y . Q(y 1 )2 )
∀x. P(xP(x) 2)
July 05, 2016
6/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
Example: rearranging quantifiers Original:
∀x∃y .P(x) ↔ Q(y ).
Transform into “CNF”: ∃y ∀x∃y ∀x W
V
V
¬P(x) ¬Q(y21)) ∃y ∃y12Q(y . Q(y ¬P(x1 ) ∃y12.¬Q(y 1 )2 )
∀x. P(xP(x) 2)
July 05, 2016
6/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
Example: rearranging quantifiers Original:
∀x∃y .P(x) ↔ Q(y ).
Transform into “CNF”: ∃y
∀x∃y ∀x W
V
V
¬P(x)1 ) ∃y12.¬Q(y ¬Q(y21)) ∃y ∃y12Q(y . Q(y ¬P(x 1 )2 )
∀x. P(xP(x) 2)
July 05, 2016
6/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
Example: rearranging quantifiers Original:
∀x∃y .P(x) ↔ Q(y ).
Pull in ∀x: ∃y ∀x∃y ∀x W V
V W
V W
¬P(x) ∃y22¬Q(y . Q(y2 ) ¬P(x1 ) ∃y∃y Q(y1 )1 ) ∃y 1 .1¬Q(y
∀x.P(x P(x) 2)
July 05, 2016
6/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
Example: rearranging quantifiers Original:
∀x∃y .P(x) ↔ Q(y ).
Pull in ∀x: ∃y
∀x∃y ∀x W V
V W
V W
¬P(x)1 ) ∃y∃y ∃y22¬Q(y . Q(y2 ) ¬P(x Q(y1 )1 ) ∃y 1 .1¬Q(y
∀x.P(x P(x) 2)
July 05, 2016
6/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
Example: rearranging quantifiers Original:
∀x∃y .P(x) ↔ Q(y ).
Pull out ∃y1 and ∃y2 : ∀x∃y W V
V W
V W
∃y22¬Q(y . Q(y2 ) ∀x ∀x. P(x) ∀x1¬P(x) ¬P(x1 ) ∃y∃y Q(y1 )1 ) ∃y 1 .1¬Q(y 2 P(x 2)
July 05, 2016
6/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
Example: rearranging quantifiers Original:
∀x∃y .P(x) ↔ Q(y ).
Pull out ∃y1 and ∃y2 :
∀x∃y W V
V W
V W
¬P(x)1 ) ∃y∃y ∃y22¬Q(y . Q(y2 ) ∀x ∀x. P(x) ∀x1¬P(x Q(y1 )1 ) ∃y 1 .1¬Q(y 2 P(x 2)
July 05, 2016
6/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
Example: rearranging quantifiers Original:
∀x∃y .P(x) ↔ Q(y ).
Pull out ∀x1 and ∀x2 : ∃y1∀x∃y ∃y2 W V
V W
V W
∀x1¬P(x) ¬P(x1 ) ∃y1 . ¬Q(y Q(y1 )1 )
∃y2¬Q(y . Q(y2 ) ∀x ∀x. P(x) 2 P(x 2)
July 05, 2016
6/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
Example: rearranging quantifiers Original:
∀x∃y .P(x) ↔ Q(y ).
Pull out ∀x1 and ∀x2 : ∃y1∀x∃y ∃y2 W V
V W
V W
¬P(x)1 ) ∃y1 . ¬Q(y Q(y1 )1 ) ∀x1¬P(x
∃y2¬Q(y . Q(y2 ) ∀x ∀x. P(x) 2) 2 P(x
July 05, 2016
6/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
Example: rearranging quantifiers Original:
∀x∃y .P(x) ↔ Q(y ).
Pull out ∀x1 and ∀x2 : ∃y1∀x∃y ∃y2 ∀x W V
V W ¬P(x) ¬P(x1 ) ∃y1 . ¬Q(y Q(y1 )1 )
V W ∃y2¬Q(y . Q(y2 )
∀x.P(x P(x) 2)
equivalent: ∃y1 y2 ∀x. P(x) → Q(y1 ) ∧ Q(y2 ) → P(x) July 05, 2016
6/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
Key insight Transposition Lemma For every first-order formula ∀~x1 ∃~y1 . . . ∀~xn ∃~yn . ψ (~x1 , . . . , ~xn , ~y1 , . . . , ~yn , ~z) where ψ is quantifier free and blue variables are separated from red variables in ψ we find an equivalent formula ∃~u ∀~v. ψ 0 (~u, ~v, ~z). One application: showing decidability of SF sentences.
July 05, 2016
7/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
Key insight Transposition Lemma For every first-order formula ∀~x1 ∃~y1 . . . ∀~xn ∃~yn . ψ (~x1 , . . . , ~xn , ~y1 , . . . , ~yn , ~z) where ψ is quantifier free and blue variables are separated from red variables in ψ we find an equivalent formula ∃~u ∀~v. ψ 0 (~u, ~v, ~z). One application: showing decidability of SF sentences.
July 05, 2016
7/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
The Separated Fragment (SF) Definition The Separated Fragment (SF) comprises all first-order sentences ∃~z ∀~x1 ∃~y1 . . . ∀~xn ∃~yn . ψ such that (1) ~x1 ∪ . . . ∪ ~xn and ~y1 ∪ . . . ∪ ~yn are separated in ψ, (2) ψ is quantifier free.
(3) equality is allowed, (4) constants are allowed.
July 05, 2016
8/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
The Separated Fragment (SF) Proposition Every sentence
∃~z ∀~x. ψ
belongs to SF.
SF contains all Bernays–Schönfinkel–Ramsey sentences.
Proposition Every sentence ∃~z ∀~x1 ∃~y1 . . . ∀~xn ∃~yn . ψ where ψ contains only unary predicates belongs to SF. SF contains all relational monadic sentences.
July 05, 2016
9/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
The Separated Fragment (SF) Proposition Every sentence
∃~z ∀~x. ψ
belongs to SF.
SF contains all Bernays–Schönfinkel–Ramsey sentences.
Proposition Every sentence ∃~z ∀~x1 ∃~y1 . . . ∀~xn ∃~yn . ψ where ψ contains only unary predicates belongs to SF. SF contains all relational monadic sentences.
July 05, 2016
9/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
Decidability of SF Theorem Satisfiability of SF sentences is decidable. Proof: Employing the Transposition Lemma, any SF sentence ∃~z ∀~x1 ∃~y1 . . . ∀~xn ∃~yn . ψ can be transformed into an equivalent BSR sentence ∃~z ∃~u ∀~v. ψ 0 .
SF inherits the finite model property from BSR. July 05, 2016
10/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
Decidability of SF Theorem Satisfiability of SF sentences is decidable. Proof: Employing the Transposition Lemma, any SF sentence ∃~z ∀~x1 ∃~y1 . . . ∀~xn ∃~yn . ψ can be transformed into an equivalent BSR sentence ∃~z ∃~u ∀~v. ψ 0 .
SF inherits the finite model property from BSR. July 05, 2016
10/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
Finite model property
Every satisfiable SF sentence ϕ has a finite model of size ) len(ϕ) 2 . . . 2
2
height depends on # quantifier alternations.
An upper bound is best determined by a semantic analysis.
July 05, 2016
11/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
Finite model property
Every satisfiable SF sentence ϕ has a finite model of size ) len(ϕ) 2 . . . 2
2
height depends on # quantifier alternations.
An upper bound is best determined by a semantic analysis.
July 05, 2016
11/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
A semantic point of view Original:
∀x∃y . ψ
SF sentence
with quantifier-free ψ.
CNF: ∀x∃y ∧ ∨ ∨
∨ ∨
χ1 (x) η1 (y)
∨
∨ ∨
χ2 (x) η2 (y)
...
∨
∨
χk (x) ηk (y)
July 05, 2016
12/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
A semantic point of view: Fingerprints ∀x∃y ∧ ∨
∨
χ1 (x) η1 (y)
χ2 (x) η2 (y)
∨ ...
χk (x) ηk (y)
Given any model M and any domain element a, we can construct a a’s fingerprint: M, [y 7→ a] |= η1 (y )
M, [y 7→ a] 6|= η2 (y )
...
M, [y 7→ a] |= ηk (y )
July 05, 2016
13/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
A semantic point of view: Fingerprints ∀x∃y ∧ ∨
∨
χ1 (x) η1 (y)
χ2 (x) η2 (y)
∨ ...
χk (x) ηk (y)
Given any model M and any domain element a: a’s fingerprint
characterizes a sufficiently.
Elements with identical fingerprints are indistinguishable.
July 05, 2016
14/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
A semantic point of view: Condensing models We can partition M’s domain finitely:
. . . one partition for every occurring fingerprint.
July 05, 2016
15/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
A semantic point of view: Condensing models Partitions can be condensed into single elements:
If there is a model at all, then there exists a finite model.
July 05, 2016
16/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
A semantic point of view: Fingerprints II ∀x1 ∃y1 ∀x2 ∃y2 ∧ ∨ χ1 (x1 , x2 )
∨ η1 (y1 , y2 )
...
χk (x1 , x2 )
ηk (y1 , y2 )
?
M, [y1 7→ a, y2 7→ b] |= ηi (y1 , y2 )
for i = 1, . . . , k
fingerprints for pairs ha, bi: fingerprints for elements a:
July 05, 2016
17/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
A semantic point of view: Finite models Theorem Every satisfiable SF sentence ϕ = ∃~z ∀~x1 ∃~y1 . . . ∀~xn ∃~yn . ψ has a model of size
2 poly(len(ϕ)) · 2
. . 2.
2len(ϕ)
) height n
SF-satisfiability can be decided in nondeterministic n-fold exponential time.
July 05, 2016
18/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
A semantic point of view: Finite models Theorem Every satisfiable SF sentence ϕ = ∃~z ∀~x1 ∃~y1 . . . ∀~xn ∃~yn . ψ has a model of size
2 poly(len(ϕ)) · 2
. . 2.
2len(ϕ)
) height n
SF-satisfiability can be decided in nondeterministic n-fold exponential time.
July 05, 2016
18/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
We have seen... ... the concept of separateness of variables: quantifiers binding separated variables can be rearranged: ∀~x1 ∃~y1 . . . ∀~xn ∃~yn .ψ
∃~u ∀~v.ψ 0
... the Separated Fragment (SF): a new decidable first-order formula fragment that enjoys the finite model property and contains the BSR fragment and the monadic fragment.
July 05, 2016
19/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
In addition, the paper includes... ... more results concerning the computational complexity in special cases:
∃∗ ∀∗ ∃∗ -SF-sentences: NEXPTIME-complete strongly separated sentences ∃~z ∀~x1 ∃~y1 ∀~x2 ∃~y2 . . . ∀~xn ∃~yn . ψ : decidable in 2-NEXPTIME
... a methodology facilitating automated reasoning over SF sentences:
∀~x ∃~y.ψ
W ∀~x ∃~y.ψ ∧ ` ~y ≈ ~c` W V|~y| V|~y| ~ ~ ~ ∀~x~y. ` i=1 Fi (x, yi ) → ψ ∧ i=1 Fi (x, c` )
... extensions of SF:
x ≈y P(f (g(x)))
in sentences exhibiting the finite model property unary functions under unary predicates July 05, 2016
20/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
Further steps Establish lower bounds on the computational complexity. Conjecture: prefix ∃∗ (∀∗ ∃∗ )k leads to k -NEXPTIME-hardness. Investigate separateness in interpreted logics, e.g. arithmetic. We suspect improvements in complexity of satisfiability. Generalize SF: ∃z ∀x1 ∃y1 ∀x2 . . . . Q(y1 , x2 ) . . .
Thank You! July 05, 2016
21/21
Introduction
Separateness of variables
The Separated Fragment
Conclusion
Further steps Establish lower bounds on the computational complexity. Conjecture: prefix ∃∗ (∀∗ ∃∗ )k leads to k -NEXPTIME-hardness. Investigate separateness in interpreted logics, e.g. arithmetic. We suspect improvements in complexity of satisfiability. Generalize SF: ∃z ∀x1 ∃y1 ∀x2 . . . . Q(y1 , x2 ) . . .
Thank You! July 05, 2016
21/21