From the Krom fragment to FO(TC), through the complement #
The formula layer of the converse translation: the implication graph of a Krom
program, walked by a DescriptiveComplexity.TCSpec.
DescriptiveComplexity.KromImpl.exists_holds_iff says that a Krom program is
satisfiable exactly when no goal clause fires and no literal reaches its own
negation and back, and DescriptiveComplexity.TwoCnf.carryReach_iff turns the second
condition – a conjunction of two reachabilities – into a single walk of the
cycle-witnessing graph, on nodes carrying the start literal, the current one
and a flag. This file expresses that walk as first-order data:
- a node's two literals are two modes (a relation variable of the block and a
sign, twice) together with two tuples of dimension
DescriptiveComplexity.clauseDim, holding the canonically padded arguments of the two atoms – the same encoding the Horn and Krom discharges use; - the flag is a third component of the mode;
- an edge of the implication graph is
DescriptiveComplexity.KromTC.edgeCaseF: for one clause of the program and one choice of which of its literal slots is the source and which the target, the clause's guard holds at some valuation of itskvariables, and the two node tuples hold the canonically padded arguments of the two atoms at that valuation. Quantifying the valuation existentially and taking the disjunction over the program gives the transition formula.
The walk starts at a node whose two literals agree and whose flag is down, and
accepts when they agree again with the flag up; one extra mode accepts
reflexively when a goal clause fires, the empty clause of the 2-CNF. So the
specification accepts exactly when the program is unsatisfiable
(DescriptiveComplexity.KromTC.accepts_iff_not_exists_holds), which is
DescriptiveComplexity.TCDefinable.compl_of_sigmaSOKromDefinable: the complement of
an SO-Krom definable problem is FO(TC) definable. With the direction proved
in DescriptiveComplexity.TransitiveClosureKrom this is an equivalence,
co-NL(Krom) = NL(TC) (DescriptiveComplexity.mem_NL_iff_tcDefinable_compl); what it
is not is REACH ∈ NL, which needs the complementation of FO(TC) itself
(Immerman–Szelepcsényi).
The two halves of a node's tuple #
The first half of a node's tuple: the arguments of the start literal's atom.
Equations
Instances For
Dependency graph
The second half of a node's tuple: the arguments of the current literal's atom.
Equations
Instances For
Dependency graph
The edge formula #
One way for a clause to contribute an edge: its guard holds at some
valuation of its k universally quantified variables, the coordinates selected
by u hold the canonically padded arguments of the source atom at that
valuation, and those selected by w hold the arguments of the target atom.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Dependency graph
The literal a node denotes #
The literal denoted by a relation variable, a sign and a tuple: the atom
holds the first B.arity i coordinates.
Equations
- DescriptiveComplexity.KromTC.litAt i s w = (⟨i, DescriptiveComplexity.pref ⋯ w⟩, s)
Instances For
Dependency graph
Dependency graph
Dependency graph
The literal of a Krom literal, read at the prefix of a clause tuple, is the literal its atom denotes at the canonical padding of its arguments.
Dependency graph
The edges a clause contributes #
All the ways one clause contributes an edge from the literal (i, s) to
the literal (j, t).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Dependency graph
The edges of the program #
The transition formula proper: the disjunction over the program of the edges
each clause contributes. Its realization is a step of the implication graph of
DescriptiveComplexity.KromImpl.clauseRel, together with the canonicity of the two node
tuples – which the formula forces, each disjunct pinning both tuples to the
padded arguments of its atoms.
Decoding a node tuple from the literal it denotes: under canonicity, the tuple is the canonical padding of the literal's arguments.
Dependency graph
The edge relation of the whole program, from the literal (i, s) to the
literal (j, t).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The transition formula is the implication graph: it holds exactly when both node tuples are canonically padded and the literals they denote form an edge.
Dependency graph
The specification #
The nodes of the walk are the nodes of the cycle-witnessing graph of
DescriptiveComplexity.TwoCnf.carryReach_iff: the start literal, the current literal
and a flag. The two literals' relation variables and signs, and the flag, are
the mode; their arguments are the two halves of the tuple. One extra mode
accepts reflexively when a goal clause fires.
A literal's share of a mode: a relation variable of the block and a sign.
Equations
Instances For
Dependency graph
The modes of the walk: the two literals' shares and the flag, or the mode that reports a firing goal clause.
Equations
Instances For
Dependency graph
Some goal clause of the program fires.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Dependency graph
The starting nodes: the current literal is the start, the flag is down, and both halves of the tuple are the same canonical padding – or a firing goal clause, in the reporting mode.
Equations
- One or more equations did not get rendered due to their size.
- DescriptiveComplexity.KromTC.srcF prog (Sum.inr PUnit.unit) = DescriptiveComplexity.KromTC.goalF prog
Instances For
Dependency graph
The accepting nodes: the current literal is the start again, with the flag up – or a firing goal clause.
Equations
- One or more equations did not get rendered due to their size.
- DescriptiveComplexity.KromTC.tgtF prog (Sum.inr PUnit.unit) = DescriptiveComplexity.KromTC.goalF prog
Instances For
Dependency graph
The payload of a walk mode: the two literals' shares and the flag.
Equations
Instances For
Dependency graph
One step between two walk modes, as a formula on the two nodes' tuples: the start is kept, the current literal moves along an edge of the implication graph, and the flag may go up only on arrival at the negation of the start.
Stated on the payloads rather than on DescriptiveComplexity.KromTC.Mode, so that its
realization lemma applies without unfolding a match.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
One step: a step between walk modes, and nothing into or out of the mode that reports a firing goal clause.
Equations
- DescriptiveComplexity.KromTC.stepF prog (Sum.inl p) (Sum.inl q) = DescriptiveComplexity.KromTC.stepWalkF prog p q
- DescriptiveComplexity.KromTC.stepF prog x✝¹ x✝ = ⊥
Instances For
Dependency graph
Realization of a step between walk modes, spelled out.
Dependency graph
The specification: the cycle-witnessing walk of the program's implication graph, plus the mode reporting a firing goal clause.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Realization of a step of the specification, between walk modes.
Dependency graph
There is no step out of the goal-reporting mode.
Dependency graph
There is no step into the goal-reporting mode.
Dependency graph
Nodes and carry nodes #
The carry node a walk node denotes.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The walk mode of a carry node.
Equations
Instances For
Dependency graph
The tuple of a carry node: the two atoms, canonically padded.
Equations
- DescriptiveComplexity.KromTC.tupleOf a₀ n i = Fin.addCases (DescriptiveComplexity.pad a₀ n.1.1.snd) (DescriptiveComplexity.pad a₀ n.2.1.1.snd) i
Instances For
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Decoding the encoding gives the carry node back.
Dependency graph
A carry step lifts to a step of the specification, at the canonically padded nodes.
Dependency graph
A step of the specification is a carry step of the decoded nodes.
Dependency graph
Walks #
A walk of the cycle-witnessing graph lifts to a walk of the specification, at the canonically padded nodes.
Dependency graph
A walk of the specification out of a walk mode is one of the cycle-witnessing graph: the goal-reporting mode is never entered, so every node along the way decodes to a carry node.
Dependency graph
The endpoints #
A walk node is a starting node exactly when its current literal is its start, its flag is down, and its two halves are the same canonical tuple.
Dependency graph
A walk node is accepting exactly when its current literal is its start again, with the flag up.
Dependency graph
The goal-reporting mode is a starting mode exactly when a goal clause fires.
Dependency graph
The goal-reporting mode is accepting exactly when a goal clause fires.
Dependency graph
Correctness #
Correctness: the specification accepts exactly when the program is
unsatisfiable – either a goal clause fires, in the reporting mode, or some
literal of the implication graph reaches its own negation and back, which the
cycle-witnessing walk sees as a walk from (p, p, false) to (p, p, true).
Dependency graph
The complement of an SO-Krom definable problem is FO(TC) definable: a
Krom program instantiated in a structure is a 2-CNF on the atoms of its block,
so it is unsatisfiable exactly when a goal clause fires or some literal reaches
its own negation and back, and the second condition is a single walk of the
cycle-witnessing graph – whose nodes are a pair of literals and a flag, i.e. a
mode and two canonically padded tuples. Together with
DescriptiveComplexity.SigmaSOKromDefinable.compl_of_tcDefinable this gives
co-NL(Krom) = NL(TC); it is upgraded to NL = coNL by Immerman–Szelepcsényi
(DescriptiveComplexity.NL_eq_coNL).
Dependency graph
The two translations compose: a problem is SO-Krom definable exactly
when its complement is FO(TC) definable, co-NL(Krom) = NL(TC).
Dependency graph
NL is the complements of the FO(TC) definable problems.