Documentation

CslibFrontier.Logics.Propositional.CSP.Edge.Walk.Operations

Reversing and joining indexed incidence trails #

These elementary list operations support parent-path assembly in the edge-CSP forest search. Reversal preserves the underlying trail predicate. Prefix validity requires separate reasoning about the selected DAG subpaths; no closure of arbitrary f-walks under reversal is asserted.

Main definitions #

Main results #

def Cslib.Logic.PL.CSP.Walk.reverse {Rel : Type u_1} {V : Type u_2} {F : CSP Rel V} (w : F.Walk) :

Reverse the step order and swap the two incidences of each candidate step.

Instances For
    def Cslib.Logic.PL.CSP.Walk.append {Rel : Type u_1} {V : Type u_2} {F : CSP Rel V} (w z : F.Walk) :

    Concatenate candidate steps, retaining the first candidate's starting variable.

    Instances For

      Reversing all incidence pairs reverses the traversed incidence list.

      @[simp]
      theorem Cslib.Logic.PL.CSP.Walk.edges_reverse {Rel : Type u_1} {V : Type u_2} {F : CSP Rel V} (w : F.Walk) :

      A reversed candidate traverses precisely the original incidences in reverse order.

      theorem Cslib.Logic.PL.CSP.Walk.Linked.finishFrom_reverse {Rel : Type u_1} {V : Type u_2} {F : CSP Rel V} {v : V} {s : List (F.Occurrence × F.Occurrence)} (h : Linked v s) :

      A linked candidate returns to its original start when read in reverse.

      theorem Cslib.Logic.PL.CSP.Walk.Linked.reverse {Rel : Type u_1} {V : Type u_2} {F : CSP Rel V} {v : V} {s : List (F.Occurrence × F.Occurrence)} (h : Linked v s) :

      Incidence linkage is preserved by reversing a trail's candidate steps.

      @[simp]
      theorem Cslib.Logic.PL.CSP.Walk.finish_reverse {Rel : Type u_1} {V : Type u_2} {F : CSP Rel V} (w : F.Walk) (h : Linked w.start w.steps) :

      The endpoint of a reversed linked candidate is its original starting variable.

      theorem Cslib.Logic.PL.CSP.Walk.IsWalk.reverse {Rel : Type u_1} {V : Type u_2} {F : CSP Rel V} {w : F.Walk} (h : w.IsWalk) :

      Reversing a trail preserves linkage and absence of repeated incidences.

      @[simp]
      theorem Cslib.Logic.PL.CSP.Walk.edges_append {Rel : Type u_1} {V : Type u_2} {F : CSP Rel V} (w z : F.Walk) :

      Concatenation appends the two traversed incidence lists.

      theorem Cslib.Logic.PL.CSP.Walk.IsWalk.append {Rel : Type u_1} {V : Type u_2} {F : CSP Rel V} {w z : F.Walk} (hw : w.IsWalk) (hz : z.IsWalk) (hend : w.finish = z.start) (hd : w.edges.Disjoint z.edges) :

      Linked incidence trails concatenate when their incidence lists are disjoint.

      theorem Cslib.Logic.PL.CSP.Walk.flip_reverse {Rel : Type u_1} {V : Type u_2} {F : CSP Rel V} (w : F.Walk) (f : F.OccurrenceLabeling Bool) :
      w.reverse.flip f = w.flip f

      The set of flipped incidences is independent of traversal orientation.

      theorem Cslib.Logic.PL.CSP.Walk.PrefixValid.take {Rel : Type u_1} {V : Type u_2} {F : CSP Rel V} {sem : Rel → List Bool → Bool} {f : F.OccurrenceLabeling Bool} {s : List (F.Occurrence × F.Occurrence)} (h : PrefixValid sem f s) (n : ℕ) :

      Every shorter candidate prefix inherits validity after each of its prefixes.

      Internal consistency is inherited by a shorter candidate prefix.

      theorem Cslib.Logic.PL.CSP.Walk.IsFPrefix.take {Rel : Type u_1} {V : Type u_2} {F : CSP Rel V} {sem : Rel → List Bool → Bool} {f : F.OccurrenceLabeling Bool} {w : F.Walk} (h : IsFPrefix sem f w) (n : ℕ) :
      IsFPrefix sem f (w.take n)

      Every variable-ended prefix inherits the f-prefix conditions.

      theorem Cslib.Logic.PL.CSP.Walk.InternallyConsistent.not_inconsistent_finishFrom_take {Rel : Type u_1} {V : Type u_2} {F : CSP Rel V} {f : F.OccurrenceLabeling Bool} {s : List (F.Occurrence × F.Occurrence)} (h : InternallyConsistent f s) (v : V) {n : ℕ} (hn : 0 < n) (hlt : n < s.length) :

      A positive proper prefix ends at an original internal variable.

      theorem Cslib.Logic.PL.CSP.Walk.IsFPrefix.not_inconsistent_finish_take {Rel : Type u_1} {V : Type u_2} {F : CSP Rel V} {sem : Rel → List Bool → Bool} {f : F.OccurrenceLabeling Bool} {w : F.Walk} (h : IsFPrefix sem f w) {n : ℕ} (hn : 0 < n) (hlt : n < w.steps.length) :

      The endpoint of a positive proper f-prefix is consistent in the original labeling.