Documentation

FMMidgard.ProofProtocol.Catalogue.ScriptDef

Script Definition #

Script here is a list of steps, stateful computations that may fail. Eventually, we also need them to signal when they've ended, so the Computation Thread knows when to end.

Script definition. Defines how computations threads are initialized and steps to proceed.

Instances For
    @[reducible, inline]
    Equations
    Instances For
      @[reducible, inline]
      Equations
      Instances For
        structure ScriptsDefinition.Script (κ α β : Type) :
        • init : κ → α
        • steps : CompM α β
        Instances For
          def ScriptsDefinition.last_step_comb {α β : Type} (step : StepM α β) :
          StepM α β
          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            def ScriptsDefinition.runCompM {α β : Type} (st : α) (steps : CompM α β) (ins : List β) :
            Equations
            Instances For
              def ScriptsDefinition.Execution {κ α β : Type} (scr : Script κ α β) (init : κ) (ins : List β) :
              Equations
              Instances For
                def ScriptsDefinition.SuccessfulEx {κ α β : Type} (scr : Script κ α β) (init : κ) (ins : List β) :
                Equations
                Instances For
                  inductive ScriptsDefinition.MPTOps (ε ℍ : Type) :
                  • Membership {ε ℍ : Type} : ε → ℍ → MPTOps ε ℍ
                  • NonMembership {ε ℍ : Type} : ε → ℍ → MPTOps ε ℍ
                  Instances For

                    List Operations #

                    Before implementing Merkle Trees, we can implement everthing using Lists.

                    The main difference is that when we search for elements, we need to provide a witness, i.e. a path, along with the corresponding element.

                    theorem ListWitness.listIndex_cons {α : Type} {ls : List α} {a : α} {p : ListSimulation.Path} (h : α) (H : listIndex p ls = some a) :
                    listIndex p.There (h :: ls) = some a
                    def ListWitness.findWitness?' {α β : Type} (f : α → Option β) (as : List α) (acc : ListSimulation.Path) :
                    Equations
                    Instances For
                      theorem ListWitness.findWitness_path_add {α β : Type} {b : β} {f : α → Option β} {as : List α} {acc path : ListSimulation.Path} (H : findWitness?' f as acc = some (b, path)) :
                      ∃ (n : ℕ), ListSimulation.Path.add n acc = path
                      @[reducible, inline]
                      abbrev ListWitness.findWitness? {α β : Type} (f : α → Option β) (as : List α) :
                      Equations
                      Instances For
                        def ListWitness.findWitnessB {α : Type} (f : α → Bool) :
                        Equations
                        Instances For
                          theorem ListWitness.correctWitId {α : Type} [DecidableEq α] {path acc : ListSimulation.Path} {a a' : α} {as : List α} (H : findWitness?' (fun (a' : α) => if (a' == a) = true then some a' else none) as acc = some (a', path)) :
                          theorem ListWitness.correctWit {α β : Type} {b : β} {path acc : ListSimulation.Path} {f : α → Option β} {as : List α} (H : findWitness?' f as acc = some (b, path)) :
                          ∃ (a : α), listIndex (ListSimulation.path_minus path acc) as = some a ∧ f a = some b
                          theorem ListWitness.findWitness_none {α β : Type} {acc : ListSimulation.Path} {f : α → Option β} {as : List α} (H : findWitness?' f as acc = none) (a : α) (aIn : a ∈ as) :
                          f a = none
                          theorem ListWitness.witness_path_less_length {α β : Type} {b : β} {path : ListSimulation.Path} {f : α → Option β} {as : List α} (H : findWitness? f as = some (b, path)) :
                          theorem ListWitness.witness_valid_path {α : Type} [DecidableEq α] {b : α} {path : ListSimulation.Path} (v : α) {as : List α} (H : findWitness? (fun (v' : α) => if (v == v') = true then some v else none) as = some (b, path)) :
                          Equations
                          Instances For
                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              theorem ListWitness.findmem_none_nonmem {α : Type} [LinearOrder α] {v hd : α} {as : List α} (asLT : List.Sorted (fun (x1 x2 : α) => x1 < x2) (hd :: as)) (H : findNMWitness? v hd as = none) :
                              (findWitness? (fun (v' : α) => if (v == v') = true then some v else none) (hd :: as)).isSome = true
                              theorem ListWitness.findnon_mem_none_find {α : Type} [LinearOrder α] {v hd : α} {as : List α} (asLT : List.Sorted (fun (x1 x2 : α) => x1 < x2) (hd :: as)) (H : (findWitness? (fun (v' : α) => if (v == v') = true then some v else none) (hd :: as)).isSome = true) :
                              theorem ListWitness.nonmem_find'_notfirst {α : Type} [LinearOrder α] {v hd t : α} {patht acc : ListSimulation.Path} {as : List α} {res : ListSimulation.NonMemProof α} (H : findNMWitness?' v hd acc as = some res) (t✝ : α) (path : ListSimulation.Path) :
                              theorem ListWitness.nonmem_find'_last_or_between {α : Type} [LinearOrder α] {v hd : α} {acc : ListSimulation.Path} {as : List α} {res : ListSimulation.NonMemProof α} (H : findNMWitness?' v hd acc as = some res) :
                              theorem ListWitness.findnon_mem_first {α : Type} [LinearOrder α] {v hd t : α} {patht : ListSimulation.Path} {as : List α} (H : findNMWitness? v hd as = some (ListSimulation.NonMemProof.NonMemFirst t patht)) :
                              theorem ListWitness.findnon_mem_correct' {α : Type} [LinearOrder α] {v hd : α} {wit : ListSimulation.NonMemProof α} {acc : ListSimulation.Path} {as : List α} (lt : hd < v) (sort : List.Sorted (fun (x1 x2 : α) => x1 < x2) (hd :: as)) (H : findNMWitness?' v hd acc as = some wit) :
                              theorem ListWitness.findnon_mem_correct {α : Type} [LinearOrder α] {v hd : α} {wit : ListSimulation.NonMemProof α} {as : List α} (sort : List.Sorted (fun (x1 x2 : α) => x1 < x2) (hd :: as)) (H : findNMWitness? v hd as = some wit) :
                              theorem ListWitness.non_mem_find {α : Type} [l : LinearOrder α] {v : α} {wit : ListSimulation.NonMemProof α} {as : List α} (ne : ¬as = []) (sort : List.Sorted (fun (x1 x2 : α) => x1 < x2) as) (H : ListSimulation.check_non_membership wit v as ne = true) :
                              findNMWitness? v (as.head ne) as.tail = some wit
                              axiom ListWitness.forall_not_witness_eq_none {α : Type} [l : LinearOrder α] {ls : List α} {e hd : α} (lsSorted : List.Sorted (fun (x1 x2 : α) => x1 < x2) (hd :: ls)) (H : ∀ (wit : ListSimulation.NonMemProof α), ¬findNMWitness? e hd ls = some wit) :