In mathematical logic, fixed-point logics are extensions of classical predicate logic that have been introduced to express recursion. Their development has been motivated by descriptive complexity theory and their relationship to database query languages, in particular to Datalog. Least fixed-point logic was first studied systematically by Yiannis N. Moschovakis in 1974, and it was introduced to computer scientists in 1979, when Alfred Aho and Jeffrey Ullman suggested fixed-point logic as an expressive database query language. Partial fixed-point logic For a relational signature X, FO[PFP](X) is the set of formulas formed from X using first-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 . Let be an integer, be vectors of variables, be a second-order variable of arity , and let be an FO(PFP,X) function using and as variables. We can iteratively define such that and (meaning with substituted for the second-order variable ). Then, either there is a fixed point, or the list of s is cyclic. is defined as the value of the fixed point of on if there is a fixed point, else as false. Since s are properties of arity , there are at most values for the s, so with a polynomial-space counter we can check if there is a loop or not. It has been proven that on ordered finite structures, a property is expressible in FO(PFP,X) if and only if it lies in PSPACE. Least fixed-point logic 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 of (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 is , then always implies ). Due to monotonicity, we only add vectors to the truth table of , and since there are only possible vectors we will always find a fixed point before iterations. The Immerman-Vardi theorem, shown independently by Immerman and Vardi, shows that FO(LFP,X) characterises P on all ordered structures. The expressivity of