Descriptive complexity is a branch of computational complexity theory and of finite model theory that characterizes complexity classes by the type of logic needed to express the languages in them. For example, PH, the union of all complexity classes in the polynomial hierarchy, is precisely the class of languages expressible by statements of second-order logic. This connection between complexity and the logic of finite structures allows results to be transferred easily from one area to the other, facilitating new proof methods and providing additional evidence that the main complexity classes are somehow "natural" and not tied to the specific abstract machines used to define them.
Specifically, each logical system produces a set of queries expressible in it. The queries – when restricted to finite structures – correspond to the computational problems of traditional complexity theory.
The first main result of descriptive complexity was Fagin's theorem, shown by Ronald Fagin in 1974. It established that NP is precisely the set of languages expressible by sentences of existential second-order logic; that is, second-order logic excluding universal quantification over relations, functions, and subsets. Many other classes were later characterized in such a manner.
When we use the logic formalism to describe a computational problem, the input is a finite structure, and the elements of that structure are the domain of discourse. Usually the input is either a string (of bits or over an alphabet) and the elements of the logical structure represent positions of the string, or the input is a graph and the elements of the logical structure represent its vertices. The length of the input will be measured by the size of the respective structure.Whatever the structure is, we can assume that there are relations that can be tested, for example "
E(x,y)
P(n)
In descriptive complexity theory we often assume that there is a total order over the elements and that we can check equality between elements. This lets us consider elements as numbers: the element represents the number if and only if there are
(n-1)
y<x
bit(x,k)
plus(x,y,z)
x+y=z
times(x,y,z)
x*y=z
If we restrict ourselves to ordered structures with a successor relation and basic arithmetical predicates, then we get the following characterisations:
In circuit complexity, first-order logic with arbitrary predicates can be shown to be equal to AC0, the first class in the AC hierarchy. Indeed, there is a natural translation from FO's symbols to nodes of circuits, with
\forall,\exists
\land
\lor
First-order logic gains substantially in expressive power when it is augmented with an operator that computes the transitive closure of a binary relation. The resulting transitive closure logic is known to characterise non-deterministic logarithmic space (NL) on ordered structures. This was used by Immerman to show that NL is closed under complement (i. e. that NL = co-NL).[10]
When restricting the transitive closure operator to deterministic transitive closure, the resulting logic exactly characterises logarithmic space on ordered structures.
On structures that have a successor function, NL can also be characterised by second-order Krom formulae.
SO-Krom is the set of boolean queries definable with second-order formulae in conjunctive normal form such that the first-order quantifiers are universal and the quantifier-free part of the formula is in Krom form, which means that the first-order formula is a conjunction of disjunctions, and in each "disjunction" there are at most two variables. Every second-order Krom formula is equivalent to an existential second-order Krom formula.
SO-Krom characterises NL on structures with a successor function.[11]
On ordered structures, first-order least fixed-point logic captures PTIME:
FO[LFP] is the extension of first-order logic by a least fixed-point operator, which expresses the fixed-point of a monotone expression. This augments first-order logic with the ability to express recursion. The Immerman–Vardi theorem, shown independently by Immerman and Vardi, shows that FO[LFP] characterises PTIME on ordered structures.[12] [13]
As of 2022, it is still open whether there is a natural logic characterising PTIME on unordered structures.
The Abiteboul–Vianu theorem states that FO[LFP]=FO[PFP] on all structures if and only if FO[LFP]=FO[PFP]; hence if and only if P=PSPACE. This result has been extended to other fixpoints.[14]
In the presence of a successor function, PTIME can also be characterised by second-order Horn formulae.
SO-Horn is the set of boolean queries definable with SO formulae in disjunctive normal form such that the first-order quantifiers are all universal and the quantifier-free part of the formula is in Horn form, which means that it is a big AND of OR, and in each "OR" every variable except possibly one are negated.
This class is equal to P on structures with a successor function.[15]
Those formulae can be transformed to prenex formulas in existential second-order Horn logic.
Ronald Fagin's 1974 proof that the complexity class NP was characterised exactly by those classes of structures axiomatizable in existential second-order logic was the starting point of descriptive complexity theory.[16]
Since the complement of an existential formula is a universal formula, it follows immediately that co-NP is characterized by universal second-order logic.
SO, unrestricted second-order logic, is equal to the Polynomial hierarchy PH. More precisely, we have the following generalisation of Fagin's theorem: The set of formulae in prenex normal form where existential and universal quantifiers of second order alternate k times characterise the kth level of the polynomial hierarchy.[17]
Unlike most other characterisations of complexity classes, Fagin's theorem and its generalisation do not presuppose a total ordering on the structures. This is because existential second-order logic is itself sufficiently expressive to refer to the possible total orders on a structure using second-order variables.[18]
The class of all problems computable in polynomial space, PSPACE, can be characterised by augmenting first-order logic with a more expressive partial fixed-point operator.
Partial fixed-point logic, FO[PFP], is the extension of first-order logic with a partial fixed-point operator, which expresses the fixed-point of a formula if there is one and returns 'false' otherwise.
Partial fixed-point logic characterises PSPACE on ordered structures.[19]
Second-order logic can be extended by a transitive closure operator in the same way as first-order logic, resulting in SO[TC]. The TC operator can now also take second-order variables as argument. SO[TC] characterises PSPACE. Since ordering can be referenced in second-order logic, this characterisation does not presuppose ordered structures.[20]
The time complexity class ELEMENTARY of elementary functions can be characterised by HO, the complexity class of structures that can be recognized by formulas of higher-order logic. Higher-order logic is an extension of first-order logic and second-order logic with higher-order quantifiers. There is a relation between the
i
i-1
We define higher-order variables. A variable of order
i>1
k
k
i-1
HO
i
i
i | |
j |
\phi=\exists
i | |
\overline{X | |
1}\forall\overline{X |
i}... | |
2 |
Q
i}\psi | |
\overline{X | |
j |
Q
Q\overline{Xi}
\overline{Xi}
i
i | |
j |
j
i
\exists
i-1
Using the standard notation of the tetration,
0(x)=x | |
\exp | |
2 |
i+1 | |
\exp | |
2 |
| ||||||||||
(x)=2 |
i+1 | |
\exp | |
2 |
| |||||||||||||||||
(x)=2 |
i
2
Every formula of order
i
i
i-1
HO is equal to the class ELEMENTARY of elementary functions. To be more precise,
i | |
HO | |
0 |
=
i-2 | |
NTIME(\exp | |
2 |
(nO(1)))
(i-2)
nc
c
O(1) | |
\existsSO=HO | |
0=NTIME(n |
)={\color{Blue}NP
i | |
HO | |
j={\color{Blue}NTIME |