Flattening a walk whose steps are decided: the suspension #
The nested case of the normal form for FO(TC): a walk over an expansion –
whose step formulas read the reachability relations of other walks – becomes
a walk over the base vocabulary
(DescriptiveComplexity.ParamTCSpec.flat), given a
DescriptiveComplexity.Decider for each of its step formulas. The outer walk
is suspended at a node, the decider of the step to a candidate successor
is run, and where it exits yes the outer walk resumes at that successor.
Two ways to pick the candidate #
- Guessing (
det := false): the candidate is chosen nondeterministically. Reachability in the flat walk is then reachability in the outer one (DescriptiveComplexity.ParamTCSpec.reachAt_flat_iff), for any outer walk. - Searching (
det := true): the candidates are tried in the mode-major lexicographic order of nodes, the next one after ano. The flat walk is then functional when the deciders are (DescriptiveComplexity.ParamTCSpec.functional_flat), and it simulates the outer walk provided that one is functional (DescriptiveComplexity.ParamTCSpec.reachAt_flat_iff_of_functional) – as the deterministic reading of a walk is.
A node of the outer walk is encoded with the candidate and every decider's
coordinates at the minimum (DescriptiveComplexity.ParamTCSpec.flatEnc), which
is where the walk resumes after a yes; this is what makes the encoding a
bijection onto the outer nodes the flat walk can stand on.
The flat walk carries its coordinates as a type rather than an arity
(DescriptiveComplexity.CoordWalk), the coordinates of the deciders being a
dependent sum over the pairs of modes; DescriptiveComplexity.CoordWalk.toParam
enumerates them for the DescriptiveComplexity.ParamTCSpec the rest of the
development consumes.
Walks with a type of coordinates #
A parameterized walk whose coordinates are an arbitrary finite type.
- Mode : Type
The modes.
Modes are finite.
- Coord : Type
The coordinates.
Tuples are finite.
- par : ℕ
The number of parameters.
The step formula, one per pair of modes.
Instances For
Dependency graph
A node: a mode and a tuple.
Instances For
Dependency graph
One step, at a valuation of the parameters.
Instances For
Dependency graph
Reachability, at a valuation of the parameters.
Equations
- C.ReachAt z = Relation.ReflTransGen (C.StepAt z)
Instances For
Dependency graph
The walk is functional when no node has two successors.
Equations
Instances For
Dependency graph
The coordinates, enumerated.
Equations
- C.coordEquiv = (Fintype.equivFin C.Coord).trans (finCongr ⋯)
Instances For
Dependency graph
The walk with its coordinates enumerated, as a
DescriptiveComplexity.ParamTCSpec. Reducible, so that its modes and
parameters are those of the walk transparently.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Dependency graph
Dependency graph
Dependency graph
The flat walk #
An arbitrary linear order on the modes of the outer walk, for the search.
Equations
Instances For
Dependency graph
The coordinates of the flat walk: the current tuple and the candidate, then the coordinates of every decider.
Instances For
Dependency graph
The modes of the flat walk: a mode of the outer walk, or a pair of modes with a mode of their decider.
Instances For
Dependency graph
A coordinate belongs to the slice of a pair of modes.
Instances For
Dependency graph
The formulas #
The variables of a decider's step, in the flat walk's.
Equations
Instances For
Dependency graph
The variables of a decider's exit, in the flat walk's step (read on the current tuple).
Equations
Instances For
Dependency graph
The current tuple's coordinate, as a step variable.
Instances For
Dependency graph
The next tuple's coordinate, as a step variable.
Instances For
Dependency graph
Every coordinate outside a slice is copied.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Every decider coordinate of the next tuple is at the minimum.
Equations
- S.minSlicesF D = FirstOrder.Language.Formula.iInf fun (c : (p : S.Mode × S.Mode) × (D p.1 p.2).Coord) => DescriptiveComplexity.minF (S.fnext D (Sum.inr c))
Instances For
Dependency graph
The next tuple is the candidate, with everything else at the minimum.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The current tuple is copied.
Equations
Instances For
Dependency graph
The candidate advances: same mode and the successor tuple, or the next mode with the tuple from the maximum to the minimum.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Entering a decider: the current tuple is copied and the decider's coordinates are reset; when searching, the candidate is the least node.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Running a decider: its step on its slice, everything else copied.
Equations
- S.runF D p d d' = FirstOrder.Language.Formula.relabel (S.flatRunVar D p) ((D p.1 p.2).step d d') ⊓ S.copyExceptF D p
Instances For
Dependency graph
Resuming the outer walk: the decider exits yes, and the walk stands
on the candidate.
Equations
- S.retF D p d = FirstOrder.Language.Formula.relabel (S.flatExitVar D p) ((D p.1 p.2).exit d true) ⊓ S.resetF D
Instances For
Dependency graph
Trying the next candidate: the decider exits no, the candidate
advances, and the decider's coordinates are reset.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The step between two decider nodes: the run, or (when searching) an advance to the start of the next candidate's decider.
Equations
Instances For
Dependency graph
The flat walk: the outer walk with each step decided in place.
Guessing (det = false) or searching (det = true) the candidate.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Tuples of the flat walk #
The current tuple.
Equations
- DescriptiveComplexity.ParamTCSpec.tx t i = t (Sum.inl (Sum.inl i))
Instances For
Dependency graph
The candidate.
Equations
- DescriptiveComplexity.ParamTCSpec.ty t i = t (Sum.inl (Sum.inr i))
Instances For
Dependency graph
The slice of a pair of modes.
Equations
- DescriptiveComplexity.ParamTCSpec.tsl t p c = t (Sum.inr ⟨p, c⟩)
Instances For
Dependency graph
The valuation of a decider's parameters: the current tuple, the candidate and the outer parameters.
Equations
- DescriptiveComplexity.ParamTCSpec.dpar t z = Sum.elim (t ∘ Sum.inl) z
Instances For
Dependency graph
A tuple with one slice replaced.
Equations
Instances For
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
The encoding of a node of the outer walk, at a bottom element a₀.
Equations
Instances For
Dependency graph
Semantics of the formulas #
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
The advance, as a relation between the two nodes.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Dependency graph
Steps of the flat walk #
Dependency graph
Dependency graph
Dependency graph
A step between decider nodes of the same pair of modes: the run, or an advance.
Dependency graph
A step between decider nodes of different pairs of modes: an advance only.
Dependency graph
Correctness #
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Coordinates at the minimum are equal.
Dependency graph
The step deciders decide the steps of the outer walk.
Equations
Instances For
Dependency graph
What the flat walk may have reached from the encoding of a: an outer
node reached from a, or a decider node whose outer node is reached from
a and whose decider has run from its start.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Dependency graph
The flat walk reaches only what the outer walk reaches.
Dependency graph
A run of a decider lifts to the flat walk, on its slice.
Dependency graph
Finishing a step: from the start of the decider of a step that holds, the flat walk reaches the encoding of the step's target.
Dependency graph
Guessing: the flat walk reaches what the outer walk reaches.
Dependency graph
The candidates, ordered.
Instances For
Dependency graph
Searching: from a candidate at or before the successor, the flat walk reaches the encoding of the successor, the outer walk being functional.
Dependency graph
Searching: the flat walk reaches what a functional outer walk reaches.
Dependency graph
Guessing simulates the outer walk, at the encodings.
Dependency graph
Searching simulates a functional outer walk, at the encodings.
Dependency graph
Functionality of the searching flat walk #
Two advances from the same node go to the same node.
Dependency graph
The searching flat walk is functional when the deciders are.