Rather than allow induction over arbitrary predicates, transitive closure logic allows only
transitive closures to be expressed directly. FO[TC](
X) is the set of formulas formed from
X using first-order connectives and predicates, second-order variables as well as a transitive closure operator \operatorname{TC} used to form formulas of the form [\operatorname{TC}_{\vec{x},\vec{y}} \varphi]\vec{s}\vec{t}, where \vec{x} and \vec{y} are tuples of pairwise distinct first-order variables, \vec{t} and \vec{s} tuples of terms and the lengths of \vec{x}, \vec{y}, \vec{s} and \vec{t} coincide. TC is defined as follows: Let be a positive integer and u,v,x,y be vectors of variables. Then \mathsf{TC}(\varphi_{u,v})(x,y) is true if there exist vectors of variables (z_i) such that z_1=x, z_n=y, and for all i, \varphi(z_i,z_{i+1}) is true. Here, is a formula written in FO(TC) and \varphi(x,y) means that the variables and are replaced by and . Over ordered structures, FO[TC] characterises the complexity class
NL. This characterisation is a crucial part of Immerman's proof that NL is closed under complement (NL = co-NL). ==Deterministic transitive closure logic ==