Inmathematical logic,fixed-point logics are extensions of classical predicate logic that have been introduced to express recursion. Their development has been motivated bydescriptive complexity theory and their relationship todatabase query languages, in particular toDatalog.
Least fixed-point logic was first studied systematically byYiannis N. Moschovakis in 1974,[1] and it was introduced to computer scientists in 1979, whenAlfred Aho andJeffrey Ullman suggested fixed-point logic as an expressive database query language.[2]
For arelational signatureX, FO[PFP](X) is the set of formulas formed fromX usingfirst-order connectives and predicates,second-order variables as well as a partial fixed point operator used to form formulas of the form, where is a second-order variable, a tuple of first-order variables, a tuple of terms and the lengths of and coincide with the arity of.
Letk be an integer, be vectors ofk variables,P be a second-order variable of arityk, and letφ be an FO(PFP,X) function usingx andP as variables. We can iteratively define such that and (meaningφ with substituted for the second-order variableP). Then, either there is a fixed point, or the list ofs is cyclic.[3]
is defined as the value of the fixed point of ony if there is a fixed point, else as false.[4] SincePs are properties of arityk, there are at most values for thes, so with a polynomial-space counter we can check if there is a loop or not.[5]
It has been proven that on ordered finite structures, a property is expressible in FO(PFP,X) if and only if it lies inPSPACE.[6]
Since the iterated predicates involved in calculating the partial fixed point are not in general monotone, the fixed-point may not always exist. FO(LFP,X),least fixed-point logic, is the set of formulas in FO(PFP,X) where the partial fixed point is taken only over such formulasφ that only contain positive occurrences ofP (that is, occurrences preceded by an even number of negations). This guarantees monotonicity of the fixed-point construction (That is, if the second order variable isP, then always implies).
Due to monotonicity, we only add vectors to the truth table ofP, and since there are only possible vectors we will always find a fixed point before iterations. The Immerman-Vardi theorem, shown independently byImmerman[7] andVardi,[8] shows that FO(LFP,X) characterisesP on all ordered structures.
The expressivity of least-fixed point logic coincides exactly with the expressivity of the database querying languageDatalog, showing that, on ordered structures, Datalog can express exactly those queries executable in polynomial time.[9]
Another way to ensure the monotonicity of the fixed-point construction is by only adding new tuples to at every stage of iteration, without removing tuples for which no longer holds. Formally, we define as where.
This inflationary fixed-point agrees with the least-fixed point where the latter is defined. Although at first glance it seems as if inflationary fixed-point logic should be more expressive than least fixed-point logic since it supports a wider range of fixed-point arguments, in fact, every FO[IFP](X)-formula is equivalent to an FO[LFP](X)-formula.[10]
While all the fixed-point operators introduced so far iterated only on the definition of a single predicate, many computer programs are more naturally thought of as iterating over several predicates simultaneously. By either increasing thearity of the fixed-point operators or by nesting them, every simultaneous least, inflationary or partial fixed-point can in fact be expressed using the corresponding single-iteration constructions discussed above.[11]
Rather than allow induction over arbitrary predicates, transitive closure logic allows onlytransitive closures to be expressed directly.
FO[TC](X) is the set of formulas formed fromX using first-order connectives and predicates, second-order variables as well as a transitive closure operator used to form formulas of the form, where and are tuples of pairwise distinct first-order variables, and tuples of terms and the lengths of,, and coincide.
TC is defined as follows: Letk be a positive integer and be vectors ofk variables. Then is true if there existn vectors of variables such that, and for all, is true. Here,φ is a formula written in FO(TC) and means that the variablesu andv are replaced byx andy.
Over ordered structures, FO[TC] characterises the complexity classNL.[12] This characterisation is a crucial part of Immerman's proof that NL is closed under complement (NL = co-NL).[13]
FO[DTC](X) is defined as FO(TC,X) where the transitive closure operator is deterministic. This means that when we apply, we know that for allu, there exists at most onev such that.
We can suppose that issyntactic sugar for where.
Over ordered structures, FO[DTC] characterises the complexity classL.[12]
The fixed-point operations that we defined so far iterate the inductive definitions of the predicates mentioned in the formula indefinitely, until a fixed point is reached. In implementations, it may be necessary to bound the number of iterations to limit the computation time. The resulting operators are also of interest from a theoretical point of view since they can also be used to characterise complexity classes.
We will define first-order with iteration,; here is a (class of) functions from integers to integers, and for different classes of functions we will obtain different complexity classes.
In this section we will write to mean and to mean. We first need to define quantifier blocks (QB), a quantifier block is a list where thes are quantifier-free FO-formulae ands are either or. IfQ is a quantifiers block then we will call the iteration operator, which is defined asQ written time. One should pay attention that here there are quantifiers in the list, but onlyk variables and each of those variable are used times.[14]
We can now define to be the FO-formulae with an iteration operator whose exponent is in the class, and we obtain the following equalities: