Documentation

DescriptiveComplexity.TransitiveClosureDecideReachDet

Deciding reachability in a deterministic walk: a step budget #

The atom case of the normal form for FO(DTC): the reachability relation of a walk read through its determinization (DescriptiveComplexity.ParamTCSpec.det) has a functional DescriptiveComplexity.Decider (DescriptiveComplexity.ParamTCSpec.detReachDecider). No inductive counting is involved: the decider follows the one run of the walk from the first endpoint, exits yes on standing at the second, and exits no when the run is stuck – either because the walk has no step to take, or because a step budget is exhausted.

The budget is the walk's own set of nodes: a second node, carried beside the current one and advanced by one at every step in the mode-major lexicographic order of nodes (DescriptiveComplexity.ParamTCSpec.cntSuccF), so that the run may take exactly as many steps as there are nodes. A node reachable along a functional relation is reached in fewer steps than that (DescriptiveComplexity.exists_iterate_lt_card), so a run that has not arrived when the budget runs out never will. This is the argument of DescriptiveComplexity.LOGSPACE_eq_coLOGSPACE, with parameters.

theorem DescriptiveComplexity.covBy_right_unique {α : Type} [LinearOrder α] {a b c : α} (hb : a b) (hc : a c) :
b = c

In a linear order, an element covers at most one element.

Dependency graph

The counter #

@[instance_reducible]

An arbitrary linear order on the modes, for the counter.

Equations
Instances For
    Dependency graph
    @[reducible, inline]

    The counter's values: the nodes of the walk, mode-major then lexicographically on tuples.

    Equations
    Instances For
      Dependency graph
      @[reducible, inline]

      The counter holding a mode and a tuple.

      Equations
      Instances For
        Dependency graph
        @[reducible, inline]

        The coordinates of the decider: the current tuple, then the counter's.

        Equations
        Instances For
          Dependency graph

          The formulas #

          The variables of the determinized step, in the decider's step.

          Equations
          Instances For
            Dependency graph

            “The current tuple is the second endpoint, and the mode is its mode.”

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              Dependency graph

              The counter advances by one: same mode and the successor tuple, or the next mode with the tuple going from the maximum to the minimum.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                Dependency graph

                The run step: the determinized step of the walk, off the target, the counter advancing.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  Dependency graph

                  The variables of a step, with the next tuple quantified.

                  Equations
                  Instances For
                    Dependency graph

                    “Some run step is available.”

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      Dependency graph
                      @[reducible]

                      The decider of reachability in the deterministic reading between two modes, at the two endpoints and the parameters: it enters the walk at the first endpoint with the counter at its least value, follows the one run, exits yes on standing at the second endpoint and no when no run step is available.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        Dependency graph

                        Semantics of the formulas #

                        Dependency graph
                        Dependency graph
                        theorem DescriptiveComplexity.ParamTCSpec.realize_runStepF {L : FirstOrder.Language} (W : ParamTCSpec (L.sum FirstOrder.Language.order)) {A : Type} [L.Structure A] [LinearOrder A] (mb : W.Mode) (w : W.AtomParA) [Nonempty A] (m c m' c' : W.Mode) (t t' : W.DCoordA) :
                        (W.runStepF mb m c m' c').Realize (Sum.elim (Sum.elim t t') w) W.det.StepAt (w W.parIx) (m, t Sum.inl) (m', t' Sum.inl) ¬(m = mb t Sum.inl = w W.rightIx) W.cntOf c (t Sum.inr) W.cntOf c' (t' Sum.inr)
                        Dependency graph

                        Steps and exits of the decider #

                        theorem DescriptiveComplexity.ParamTCSpec.detReachDecider_stepAt_none_some {L : FirstOrder.Language} (W : ParamTCSpec (L.sum FirstOrder.Language.order)) {A : Type} [L.Structure A] [LinearOrder A] (ma mb : W.Mode) (w : W.AtomParA) (m c : W.Mode) (t t' : W.DCoordA) :
                        (W.detReachDecider ma mb).StepAt w (none, t) (some (m, c), t') m = ma (∀ (c' : W.Mode), c c') t' Sum.inl = w W.leftIx ∀ (i : Fin W.k) (a : A), t' (Sum.inr i) a
                        Dependency graph
                        Dependency graph
                        Dependency graph
                        Dependency graph
                        Dependency graph
                        Dependency graph

                        The run #

                        @[reducible, inline]

                        The one step of the determinized walk, as a function.

                        Equations
                        Instances For
                          Dependency graph
                          theorem DescriptiveComplexity.ParamTCSpec.detNext_functional {L : FirstOrder.Language} (W : ParamTCSpec (L.sum FirstOrder.Language.order)) {A : Type} [L.Structure A] [LinearOrder A] (w : W.AtomParA) (u v v' : W.Node A) (hv : W.det.StepAt (w W.parIx) u v) (hv' : W.det.StepAt (w W.parIx) u v') :
                          v = v'
                          Dependency graph
                          def DescriptiveComplexity.ParamTCSpec.DetInv {L : FirstOrder.Language} (W : ParamTCSpec (L.sum FirstOrder.Language.order)) {A : Type} [L.Structure A] [LinearOrder A] (ma mb : W.Mode) (w : W.AtomParA) (i : ) (m c : W.Mode) (t : W.DCoordA) :

                          What a node of the decider records: the current node is the i-th of the run from the first endpoint, the counter has rank i, and no earlier node of the run was the second endpoint.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            Dependency graph

                            Reachability in the determinized walk is iteration of its step.

                            Dependency graph
                            Dependency graph
                            theorem DescriptiveComplexity.ParamTCSpec.not_reach_of_stuck {L : FirstOrder.Language} (W : ParamTCSpec (L.sum FirstOrder.Language.order)) {A : Type} [L.Structure A] [LinearOrder A] (ma mb : W.Mode) (w : W.AtomParA) [Nonempty A] [Finite A] {i : } {m c : W.Mode} {t : W.DCoordA} (hinv : W.DetInv ma mb w i m c t) (htgt : ¬(m = mb t Sum.inl = w W.rightIx)) (hstuck : ¬∃ (b : (W.detReachDecider ma mb).Node A), (W.detReachDecider ma mb).StepAt w (some (m, c), t) b) :

                            A stuck run does not reach the target.

                            Dependency graph
                            theorem DescriptiveComplexity.ParamTCSpec.detReachDecider_run {L : FirstOrder.Language} (W : ParamTCSpec (L.sum FirstOrder.Language.order)) {A : Type} [L.Structure A] [LinearOrder A] (ma mb : W.Mode) (w : W.AtomParA) [Nonempty A] [Finite A] (κ : W.Counter A) (m c : W.Mode) (t : W.DCoordA) (i : ) :
                            W.cntOf c (t Sum.inr) = κW.DetInv ma mb w i m c t(W.det.ReachAt (w W.parIx) (ma, w W.leftIx) (mb, w W.rightIx)∃ (b : (W.detReachDecider ma mb).Node A), (W.detReachDecider ma mb).ReachAt w (some (m, c), t) b (W.detReachDecider ma mb).ExitAt w b true) (¬W.det.ReachAt (w W.parIx) (ma, w W.leftIx) (mb, w W.rightIx)∃ (b : (W.detReachDecider ma mb).Node A), (W.detReachDecider ma mb).ReachAt w (some (m, c), t) b (W.detReachDecider ma mb).ExitAt w b false)

                            The run decides, from any node the invariant admits: it exits yes if the target is reachable, no if not. Proved downwards along the counter.

                            Dependency graph
                            theorem DescriptiveComplexity.ParamTCSpec.detReachDecider_inv {L : FirstOrder.Language} (W : ParamTCSpec (L.sum FirstOrder.Language.order)) {A : Type} [L.Structure A] [LinearOrder A] (ma mb : W.Mode) (w : W.AtomParA) [Nonempty A] [Finite A] (t : W.DCoordA) {b : (W.detReachDecider ma mb).Node A} (h : (W.detReachDecider ma mb).ReachAt w (none, t) b) :
                            b = (none, t) ∃ (m : W.Mode) (c : W.Mode) (t' : W.DCoordA) (i : ), b = (some (m, c), t') W.DetInv ma mb w i m c t'

                            What the decider may have reached from its start: its start, or a node the invariant admits.

                            Dependency graph

                            The decider decides reachability in the deterministic reading between its two modes, at the two endpoints and the parameters.

                            Dependency graph
                            Dependency graph

                            The deciders of a family, read deterministically #

                            The deterministic reachability deciders of a family: one per relation variable of its block, deciding the reachability relations of the family's deterministic reading.

                            Equations
                            Instances For
                              Dependency graph

                              The deciders decide the deterministic reading's reachability relations.

                              Dependency graph
                              Dependency graph