Presentation slides

Fragments of ESO and linear-time
computation
Joel Rybicki
Finite model theory seminar
20 April 2012
1 / 39
Outline
Existential second-order logic
Random access machines
ESO and polynomial non-deterministic time
Classifying graph problems
Positive results
Negative results
Conclusions
Open problems
2 / 39
Existential second-order logic
I
Extend FO with second-order existential
quantification of relation and function symbols
I
Let σ ∩ τ = ∅ and ψ ∈ FOσ∪τ . Then
hM, τ i |= ∃σψ
iff there exists a model M∗ such that
M∗ = hM, τ, σi |= ψ
3 / 39
Fragments of ESO
Definition
Let k, d ∈ N+ and τ be a vocabulary. We say that
ϕ ∈ ESOτ [#k, ∀d]
if it holds that
I ϕ ≡ ∃σ∀x0 · · · ∀xd−1 ψ
I #σ ≤ k
I ψ ∈ FOσ∪τ is quantifier-free
We focus on ESO[#1, ∀1].
4 / 39
Skolemization
Theorem (Skolem normal-form)
Every ESO-formula ϕ ≡ ∃σψ where ψ ∈ FO is logically
equivalent to an ESO-formula
ϕ∗ ≡ ∃f0 · · · ∃fn ∀x0 · · · ∀xm ψ 0
where ψ 0 is a quantifier-free FO-formula and f0 , . . . , fn are
function symbols.
5 / 39
Skolemization 2
Lemma
Let σ be a vocabulary such that #σ ≤ 1. Any formula
ϕ ≡ ∃σ∀x0 ∃x1 · · · ∃xm ψ
where ψ is quantifier-free first-order formula can be
expressed in ESO[#1, ∀1].
6 / 39
Random access machines
Let τ be a finite vocabulary. A τ -machine decides a
property of a finite τ -structure:
I
Input: A finite τ -structure M where Dom(M) = [n].
I
Output: Accept or reject.
Solves decision problems such as
“Is the input graph G = hG, E G i Hamiltonian?”
7 / 39
RAM: Memory
Turing machines use tape, τ -RAMs use registers.
I
Cardinality register N initialized to n.
I
Input register s for each s ∈ τ .
I
Accumulators A, B0 , . . . , B#r for accessing input.
I
Working memory: R0 , R1 , . . .
8 / 39
Example input
G = h{0, 1, 2, 3}, E G i
0
i
1
2
j
0
1
2
3
0
0
1
0
0
1
1
0
1
1
2
0
1
0
1
3
0
1
1
0
3
9 / 39
RAM: Instructions
A τ -RAM has a sequence hI0 , . . . , Ik i of instructions:
1. A ← N
2. A ← s[B0 , . . . , Bq ] where q = #s
10 / 39
RAM: Instructions
A τ -RAM has a sequence hI0 , . . . , Ik i of instructions:
1.
2.
3.
4.
A←N
A ← s[B0 , . . . , Bq ] where q = #s
A←0
A←A+1
10 / 39
RAM: Instructions
A τ -RAM has a sequence hI0 , . . . , Ik i of instructions:
1.
2.
3.
4.
5.
A←N
A ← s[B0 , . . . , Bq ] where q = #s
A←0
A←A+1
A ← RA
10 / 39
RAM: Instructions
A τ -RAM has a sequence hI0 , . . . , Ik i of instructions:
1.
2.
3.
4.
5.
6.
7.
A←N
A ← s[B0 , . . . , Bq ] where q = #s
A←0
A←A+1
A ← RA
Bi ← A where i ∈ [#τ + 1]
RA ← Bi where i ∈ [#τ + 1]
10 / 39
RAM: Instructions
A τ -RAM has a sequence hI0 , . . . , Ik i of instructions:
1.
2.
3.
4.
5.
6.
7.
8.
A←N
A ← s[B0 , . . . , Bq ] where q = #s
A←0
A←A+1
A ← RA
Bi ← A where i ∈ [#τ + 1]
RA ← Bi where i ∈ [#τ + 1]
guess(A) — guess an integer bounded by O(n)
10 / 39
RAM: Instructions
A τ -RAM has a sequence hI0 , . . . , Ik i of instructions:
1.
2.
3.
4.
5.
6.
7.
8.
9.
A←N
A ← s[B0 , . . . , Bq ] where q = #s
A←0
A←A+1
A ← RA
Bi ← A where i ∈ [#τ + 1]
RA ← Bi where i ∈ [#τ + 1]
guess(A) — guess an integer bounded by O(n)
if A = Bi then jump to Ia else jump to Ib , where
a, b ∈ [k + 1]
10 / 39
RAM: Instructions
A τ -RAM has a sequence hI0 , . . . , Ik i of instructions:
A←N
A ← s[B0 , . . . , Bq ] where q = #s
A←0
A←A+1
A ← RA
Bi ← A where i ∈ [#τ + 1]
RA ← Bi where i ∈ [#τ + 1]
guess(A) — guess an integer bounded by O(n)
if A = Bi then jump to Ia else jump to Ib , where
a, b ∈ [k + 1]
10. accept
11. reject
1.
2.
3.
4.
5.
6.
7.
8.
9.
10 / 39
Time complexity
Definition
A τ -problem P ⊆ Str(τ ) belongs to NTIME[T (n)] if
I
there exists a τ -NRAM that recognizes P
I
for all finiteτ -structures the running time is bounded
by O T (n)
11 / 39
A refinement of Fagin’s theorem
Theorem (Fagin, 1973)
ESO ≡ NP.
12 / 39
A refinement of Fagin’s theorem
Theorem (Fagin, 1973)
ESO ≡ NP.
Theorem (Grandjean and Olive, 2004)
Let τ be a vocabulary and d ∈ N+ , then
ESO[#d, ∀d] ≡ NTIME[nd ].
Degree of the polynomial = number of FO-variables!
12 / 39
A proof?
Theorem (Grandjean and Olive, 2004)
Let d ∈ N+ , then
ESO[#d, ∀d] ≡ NTIME[nd ].
How to prove the case for d = 1?
I
Similar to proof of Fagin’s theorem
I
Proving ESO[#1, ∀1] ⊆ NTIME[n] is straightforward
I
Showing NTIME[n] ⊆ ESO[#1, ∀1] is not..
13 / 39
ESO[#d, ∀d] ⊆ NTIME[n]
Let ϕ ≡ ∃σ∀x0 · · · ∀xd−1 ψ and suppose M = h[n], τ i is the
input structure.
I
Guess interpretations for symbols in s ∈ σ
I
For function symbols, guess n#s values (the image)
I
For relation symbols, guess n#s bits
14 / 39
ESO[#d, ∀d] ⊆ NTIME[n]
Let ϕ ≡ ∃σ∀x0 · · · ∀xd−1 ψ and suppose M = h[n], τ i is the
input structure.
I
I
Guess interpretations for symbols in s ∈ σ
I
For function symbols, guess n#s values (the image)
I
For relation symbols, guess n#s bits
Iteratively check that h[n], τ, σi |= ∀x0 · · · ∀xd−1 ψ
I
Check nd assignments for symbols x0 , . . . , xd−1
14 / 39
ESO[#d, ∀d] ⊆ NTIME[n]
Let ϕ ≡ ∃σ∀x0 · · · ∀xd−1 ψ and suppose M = h[n], τ i is the
input structure.
I
I
Guess interpretations for symbols in s ∈ σ
I
For function symbols, guess n#s values (the image)
I
For relation symbols, guess n#s bits
Iteratively check that h[n], τ, σi |= ∀x0 · · · ∀xd−1 ψ
I
I
Check nd assignments for symbols x0 , . . . , xd−1
Running time is O(|σ|nd ) + O(nd )
14 / 39
NTIME[n] ⊆ ESO[#1, ∀1]
Theorem
ESO[#1, ∀1] ≡ NTIME[n].
We need..
I
A formula that simulates a τ -NRAM with O(n) running
time
I
We need to refer to cn time steps using n elements
I
A linear order over the domain
I
Easy if d ≥ 3.. non-trivial if d = 1.
15 / 39
A linear order using a single FO-variable
Theorem (Grandjean 1990)
The class of structures definable in ESO[#1, ∀1] is not
enlarged by the addition of a second-order quantifier
∃ord < which states that the symbol < is a linear order
over the domain.
V
I
Construct a υ-formula Φ ≡
I
Defines a so-called arithmetical n-structure using
only one universal quantification
I
Use ESO-quantification ∃υ and replace xi < xj with a
formula order(xi .xj ) that gives a linear order
1≤i≤20
ϕi
16 / 39
Summary of the story so far
I
A family of logics that capture polynomial
non-deterministic time on RAMs
I
Properties definable in ESO[#1, ∀1] can be checked
in O(n) time where n is the cardinality of the input
structure
NRAMs are slightly more powerful than Turing
machines but a natural model of computation
I
17 / 39
Classifying graph problems
18 / 39
Graphs as structures
Definition
A relational structure G = h[n], Ei is a graph if
I
The relation symbol E is binary, i.e., #E = 2
I
The interpretation of E is anti-reflexive and symmetric
19 / 39
The complexity of graph problems
Many properties are very easy in ESO[#1, ∀2]
20 / 39
The complexity of graph problems
Many properties are very easy in ESO[#1, ∀2]
I
independent sets
21 / 39
The complexity of graph problems
Many properties are very easy in ESO[#1, ∀2]
I
independent sets, cliques
22 / 39
The complexity of graph problems
Many properties are very easy in ESO[#1, ∀2]
I
independent sets, cliques, dominating sets
23 / 39
The complexity of graph problems
Many properties are very easy in ESO[#1, ∀2]
I
independent sets, cliques, dominating sets, vertex
covers
24 / 39
The complexity of graph problems
Many properties are very easy in ESO[#1, ∀2]
I
independent sets, cliques, dominating sets, vertex
covers, k-colouring
25 / 39
The complexity of graph problems
What about ESO[#1, ∀1]?
26 / 39
The complexity of graph problems
What about ESO[#1, ∀1]?
I
It has been shown (Durand et al., 2004) that if the
#τ ≤ 1, then
ESOτ [#1, ∀1] ≡ ESOτ [#1, ∀2].
26 / 39
The complexity of graph problems
What about ESO[#1, ∀1]?
I
It has been shown (Durand et al., 2004) that if the
#τ ≤ 1, then
ESOτ [#1, ∀1] ≡ ESOτ [#1, ∀2].
I
But #τ = 2 for graphs!
26 / 39
Nondeterministic vertex-linear time
Definition (Vertex-linear time)
The class NVLIN is the set of graph problems solvable in
linear time on a NRAM.
I
A graph property definable in ESO[#1, ∀1] can be
decided in vertex-linear time
I
If we have ω(n) edges, then the problem is solvable in
sublinear time in the size of the graph
27 / 39
Positive results
I
Recall that we can use the ∃ord operator in
ESO[#1, ∀1]
I
The same theorem gives us a successor function S
and the first element 0
I
Denote ∃ord (<, S, 0) as the quantification of the linear
order and a corresponding successor function
28 / 39
Hamiltonicity of graphs
Definition
A Hamiltonian cycle of graph G is a cycle that spans G.
The following sentence defines the existence of a
Hamiltonian cycle:
∃ (<, S)∀x E x, S(x)
ord
29 / 39
Dominating sets
Definition
A dominating set of G = hV, Ei is a subset D ⊆ V such
that for all v ∈ V either v ∈ D or there exists (u, v) ∈ E
such that u ∈ D.
The decision problem:
I
Input: A graph G and k ∈ N+
I
Output: A bit indicating if G has a dominating set of
size at most k
I
To encode k, add a unary relation K such that
|K| = k
30 / 39
Dominating sets
h
∃D∃h∀x ∃y[x = h(y)]
∧ D(x) → K h(x)
i
∧ D(x) ∨ ∃z D(z) ∧ E(x, z)
There is a set D and a function h such that
I
h is a bijection
I
|D| ≤ |K|
I
D is a dominating set
31 / 39
Lower bounds
I
Class NVLIN contains NP-complete problems
I
Hamiltonian cycles
I
Dominating sets
I
Spanning tree isomorphism
32 / 39
Lower bounds
I
I
Class NVLIN contains NP-complete problems
I
Hamiltonian cycles
I
Dominating sets
I
Spanning tree isomorphism
At the same time, many problems of low deterministic
complexity reside outside NVLIN
I
is the graph a tree (cycle-free)?
I
is the graph Eulerian?
32 / 39
Lower bounds
I
I
I
Class NVLIN contains NP-complete problems
I
Hamiltonian cycles
I
Dominating sets
I
Spanning tree isomorphism
At the same time, many problems of low deterministic
complexity reside outside NVLIN
I
is the graph a tree (cycle-free)?
I
is the graph Eulerian?
Reason: A linear time NRAM cannot check all
possible edges!
32 / 39
The lower bound lemma
Lemma
Let P be a graph problem. If there exists an infinite set
A = {(Gn , Fn ) : Gn = hV, Ei, |V | = n, Fn ∩ E = ∅},
such that for any (Gn , Fn ) ∈ A the following properties
hold:
I Gn ∈ P
I |Fn | ∈ Ω(n2 )
I G +e ∈
/ P for any e ∈ Fn ,
then P ∈
/ NVLIN.
33 / 39
Negative results
Many properties cannot be checked in vertex-linear time..
I
G is a tree
I
G is not a tree
I
G does not have a Hamiltonian cycle
I
G graph has a vertex cover of size at most k
I
See Grandjean and Olive, 2004 for more.
34 / 39
A corollary
Corollary
The class NVLIN is not closed under complement.
Proof:
I
Hamiltonicity is in NVLIN
I
Non-Hamiltonicity is not in NVLIN
35 / 39
Conclusions
I
All formulas we have seen are of the form
∃σ∀xϕ
where ϕ ∈ FOσ∪τ is quantifier-free.
I
Positive results for non-deterministic linear time via
ESO[#1, ∀1]
I
Non-expressibilty results for ESO[#1, ∀1] via NRAMs
I
Several NP-complete problems are of low
non-deterministic complexity..
I
..while many problems in P cannot be solved in
non-deterministic linear time
36 / 39
Open problems
I
The problems studied are solvable either in O(n) time
or require Ω(n2 ) time.
I
Are there natural graph problems that reside between
these two?
37 / 39
Open problems 2
I
Are there strict hierarchies between different logics
ESO[#k, ∀d]?
I
Conjecture: If #τ ≤ 1, then ESO[#1, ∀d] ≡ ESO[∀1]
holds.
I
It is known that ESO[#d, ∀d] ≡ ESO[∀d] ≡ ESO[Var d]
38 / 39
Open problems 2
I
Are there strict hierarchies between different logics
ESO[#k, ∀d]?
I
Conjecture: If #τ ≤ 1, then ESO[#1, ∀d] ≡ ESO[∀1]
holds.
I
I
It is known that ESO[#d, ∀d] ≡ ESO[∀d] ≡ ESO[Var d]
Corollary: If the conjecture holds, for all k and τ ,
ESOτ [#k, ∀∗ ] ( ESOτ [#k + 1, ∀∗ ].
38 / 39
References
I
Etienne Grandjean (1990). First-order spectra with
one variable.
I
Etienne Grandjean and Frédéric Olive (2004). Graph
properties checkable in linear time in the number of
vertices.
I
Arnaud, Durand, Etienne Grandjean, and Frédéric
Olive (2004). New results on arity vs. number of
variables.
39 / 39