Documentation

Validator.PlanningTask.Basic

Additional definitions for the STRIPS formalism #

This file extends Validator.PlanningTask.Core by implementing

Path #

snoc #

def Validator.Path.snoc {n : } {pt : STRIPS n} (a : Action n) {s1 : State n} (s2 : State n) {s3 : State n} (ha : a pt.actions) (π : Path pt s1 s2) (succ : Successor a s2 s3) :
Path pt s1 s3

In Path.cons, paths are expanded by adding states at the front of the path (leaving the last state unchanged). Path.snoc allows to extend the path at the back, leaving the first state unchanged. The name snoc comes from reading cons in reverse order.

Equations
Instances For
    def Validator.Path.length {n : } {pt : STRIPS n} {s s' : State n} :
    Path pt s s'

    The length of a path.

    Equations
    Instances For
      @[simp]
      theorem Validator.Path.length_snoc {n : } {pt : STRIPS n} {a : Action n} {s1 s2 s3 : State n} {ha : a pt.actions} {π : Path pt s1 s2} {succ : Successor a s2 s3} :
      (snoc a s2 ha π succ).length = π.length + 1
      @[irreducible]
      theorem Validator.Path.cons_to_snoc {n : } {pt : STRIPS n} {a : Action n} {s1 s2 s3 : State n} (ha : a pt.actions) (succ : Successor a s1 s2) (π : Path pt s2 s3) :
      ∃ (s2' : State n) (a' : Action n) (ha' : a' pt.actions) (π' : Path pt s1 s2') (succ' : Successor a' s2' s3), cons a s2 ha succ π = snoc a' s2' ha' π' succ' π.length = π'.length

      Convert Path.cons, where we have access to the first action and the second state of the path, to Path.snoc, where we have access to the last action and the second to last state of the path.

      theorem Validator.Path.snocCases {n : } {pt : STRIPS n} {motive : (s s' : State n) → Path pt s s'Prop} {s s' : State n} (π : Path pt s s') (empty : ∀ (s : State n), motive s s (empty s)) (snoc : ∀ (a : Action n) {s1 : State n} (s2 : State n) {s3 : State n} (ha : a pt.actions) (π' : Path pt s1 s2) (succ : Successor a s2 s3), motive s1 s3 (snoc a s2 ha π' succ)) :
      motive s s' π

      Allows to perform cases with Path.empty and Path.snoc instead of Path.empty and Path.cons.

      append #

      def Validator.Path.append {n : } {pt : STRIPS n} {s1 s2 s3 : State n} :
      Path pt s1 s2Path pt s2 s3Path pt s1 s3

      Given a path form a s1 to s2 and a path from s2 to s3, we obtain a path from s1 to s3.

      Equations
      Instances For
        instance Validator.Path.instHAppend {n : } {pt : STRIPS n} {s1 s2 s3 : State n} :
        HAppend (Path pt s1 s2) (Path pt s2 s3) (Path pt s1 s3)
        Equations

        Mem #

        def Validator.Path.Mem {n : } {pt : STRIPS n} {s1 s2 : State n} (s : State n) (π : Path pt s1 s2) :

        A state s is a member of a path π if π traverses through s.

        Equations
        Instances For
          instance Validator.Path.instMembershipState {n : } {pt : STRIPS n} {s1 s2 : State n} :
          Membership (State n) (Path pt s1 s2)
          Equations
          @[simp]
          theorem Validator.Path.mem_empty {n : } {pt : STRIPS n} {s s' : State n} :
          s empty s' s = s'
          @[simp]
          theorem Validator.Path.mem_cons {n : } {pt : STRIPS n} {a : Action n} {s1 s2 s3 : State n} {ha : a pt.actions} {succ : Successor a s1 s2} {π : Path pt s2 s3} {s : State n} :
          s cons a s2 ha succ π s = s1 s π
          @[simp]
          theorem Validator.Path.mem_snoc {n : } {pt : STRIPS n} {a : Action n} {s1 s2 s3 : State n} {ha : a pt.actions} {π : Path pt s1 s2} {succ : Successor a s2 s3} {s : State n} :
          s snoc a s2 ha π succ s = s3 s π
          theorem Validator.Path.first_mem {n : } {pt : STRIPS n} {s1 s2 : State n} (π : Path pt s1 s2) :
          s1 π
          theorem Validator.Path.last_mem {n : } {pt : STRIPS n} {s1 s2 : State n} (π : Path pt s1 s2) :
          s2 π
          theorem Validator.Path.mem_append {n : } {pt : STRIPS n} {s1 s2 s3 : State n} (π₁ : Path pt s1 s2) (π₂ : Path pt s2 s3) (s : State n) :
          s π₁ ++ π₂ s π₁ s π₂

          split #

          @[irreducible]
          theorem Validator.Path.split {n : } {pt : STRIPS n} {s1 s2 s : State n} (π : Path pt s1 s2) (h : s π) :
          Nonempty (Path pt s1 s × Path pt s s2)

          If a state s lies on a path π from s1 to s2, then there is a path from the s1 to s and a path from s to s2.

          Additional definitions for STRIPS #

          Reachable #

          @[reducible, inline]
          abbrev Validator.Reachable {n : } (pt : STRIPS n) (s s' : State n) :

          A state s' is reachable from s if there is a path from s to s'. This is the Prop version of Path.

          Equations
          Instances For
            theorem Validator.reachable_self {n : } {pt : STRIPS n} (s : State n) :
            Reachable pt s s

            states and goal_states #

            The set of all goal states of the given planning problem.

            Equations
            Instances For

              progression and regression #

              def Validator.STRIPS.progression' {n : } :
              STRIPS n(S : States n) → (a : Action n) → States n

              The progression of a set of states S by an action a.

              Equations
              Instances For
                def Validator.STRIPS.progression {n : } (pt : STRIPS n) (S : States n) (A : Actions n) :

                The progression of a set of states S by a set of actions A.

                Equations
                Instances For
                  def Validator.STRIPS.regression' {n : } :
                  STRIPS n(S : States n) → (a : Action n) → States n

                  The regression of a set of states S by an action a.

                  Equations
                  Instances For
                    def Validator.STRIPS.regression {n : } (pt : STRIPS n) (S : States n) (A : Actions n) :

                    The regression of a set of states S by a set of actions A.

                    Equations
                    Instances For
                      theorem Validator.mem_progression {n : } {pt : STRIPS n} {A : Actions n} {S : States n} (s : State n) :
                      s pt.progression S A aA, s'S, Successor a s' s
                      theorem Validator.mem_progression_of_successor {n : } {pt : STRIPS n} {S : States n} {s s' : State n} {A : Actions n} {a : Action n} (hs : s S) (ha : a A) (h : Successor a s s') :
                      s' pt.progression S A
                      theorem Validator.progression_union_states {n : } {pt : STRIPS n} {S1 S2 : States n} {A : Actions n} :
                      pt.progression (S1 S2) A = pt.progression S1 A pt.progression S2 A
                      theorem Validator.progression_union_actions {n : } {pt : STRIPS n} {S : States n} {A1 A2 : Actions n} :
                      pt.progression S (A1 A2) = pt.progression S A1 pt.progression S A2
                      theorem Validator.progression_monotone_states {n : } {pt : STRIPS n} {A : Actions n} :
                      Monotone fun (x : States n) => pt.progression x A
                      theorem Validator.mem_regression {n : } {pt : STRIPS n} {S : States n} {A : Actions n} (s : State n) :
                      s pt.regression S A aA, s'S, Successor a s s'
                      theorem Validator.mem_regression_of_successor {n : } {pt : STRIPS n} {S : States n} {s s' : State n} {A : Actions n} {a : Action n} (hs : s S) (ha : a A) (h : Successor a s' s) :
                      s' pt.regression S A
                      theorem Validator.sub_progression_iff_sub_regression {n : } {pt : STRIPS n} {S S' : States n} {A : Actions n} :
                      pt.progression S A S' pt.regression S' A S