Documentation

FMMidgard.DataStructures.List.Unordered.Properties

Midgard Unordered List Properties. #

In this module, we list properties related to Midgard Lists. Properties here are mostly instrumental to prove other Midgard Modules.

Step - Actions Properties #

Prepend #

Prepending elements to lists is always enabled if we give the root node.

theorem MUList.Properties.Prepend_prepends_new {α : Type} {s s' : State.ListST α} {root_id : Tokens.Elem.TId} {key : State.Key} {data : α} (step : Relation.Rel s (State.Actions.UnsafePrepend key data root_id) s') :

Prepending adds a new element to the list, generates an element that was not in the list before.

theorem MUList.Properties.Prepend_others_same {α : Type} {s s' : State.ListST α} {root_id : Tokens.Elem.TId} {key : State.Key} {data : α} (step : Relation.Rel s (State.Actions.UnsafePrepend key data root_id) s') (t : Tokens.Elem.TId) (Hr : ¬t = root_id) (Hl : ¬t = Tokens.State.Tokens.last_id s') :

After prepends all other elements, neither the root nor the just added, remain the same.

Append Properties #

Removes Props #

theorem MUList.Properties.EnabledRemove' {α : Type} {s : State.ListST α} {k : State.Key} {rem anch : Tokens.Elem.TId} (neq : ¬rem = anch) (RemK : State.ListST.is_member k rem s = true) (Anch : State.ListST.is_anchor k anch s = true) :
theorem MUList.Properties.Removes_members {α : Type} {s s' : State.ListST α} {rem anch : Tokens.Elem.TId} (HStep : Relation.Rel s (State.Actions.Remove rem anch) s') :
rem ∈ s
theorem MUList.Properties.NotRemoveSelf {α : Type} {s s' : State.ListST α} {rem anch : Tokens.Elem.TId} (HStep : Relation.Rel s (State.Actions.Remove rem anch) s') :
¬rem = anch
theorem MUList.Properties.Removes_update_anch_mem_and_key' {α : Type} {s s' : State.ListST α} {rem anch : Tokens.Elem.TId} (HStep : Relation.Rel s (State.Actions.Remove rem anch) s') :
Tokens.State.Tokens.get anch s' = (fun (x : Tokens.Elem.TokenD (State.Elemt State.Key α)) => { name := x.name, data := have __src := x.data; { key := __src.key, link := State.ListST.get_link rem s, data := __src.data }, id := x.id }) <$> Tokens.State.Tokens.get anch s
theorem MUList.Properties.Removes_others_mem {α : Type} {s s' : State.ListST α} {rem anch : Tokens.Elem.TId} (HStep : Relation.Rel s (State.Actions.Remove rem anch) s') (t : Tokens.Elem.TId) :
¬t = rem → ∀ (k : State.Key), State.ListST.is_member k t s' = State.ListST.is_member k t s
theorem MUList.Properties.Removes_get_not_removed {α : Type} {s s' : State.ListST α} {rem anch oth : Tokens.Elem.TId} (step : Relation.Rel s (State.Actions.Remove rem anch) s') (H : (Tokens.State.Tokens.get oth s').isSome = true) :
¬oth = rem

ModifyData #

def MUList.Properties.same_but_data_this {α : Type} (tl tr : State.ListToken α) (data : α) :
Equations
  • One or more equations did not get rendered due to their size.
Instances For
    theorem MUList.Properties.ModifyData_modified_stronger {α : Type} {s s' : State.ListST α} {tid : Tokens.Elem.TId} {data : α} {tkns tkns' : Tokens.Elem.TokenD (State.Elemt State.Key α)} (step : Relation.Rel s (State.Actions.ModifyData tid data) s') (HS : Tokens.State.Tokens.get tid s = some tkns) (HS' : Tokens.State.Tokens.get tid s' = some tkns') :
    same_but_data_this tkns tkns' data
    theorem MUList.Properties.ModifyData_modified_stronger' {α : Type} {s s' : State.ListST α} {tid : Tokens.Elem.TId} {data : α} {tkns : Tokens.Elem.TokenD (State.Elemt State.Key α)} (step : Relation.Rel s (State.Actions.ModifyData tid data) s') (HS : Tokens.State.Tokens.get tid s = some tkns) :
    Tokens.State.Tokens.get tid s' = some { name := tkns.name, data := have __src := tkns.data; { key := __src.key, link := __src.link, data := data }, id := tkns.id }

    Well Formed Linked List Properties #

    Correct lists are never empty, root is always alive

    Equations
    Instances For
      theorem MUList.Properties.InvNotEmpty {α : Type} {s s' : State.ListST α} {a : State.Actions α} (Step : Relation.Rel s a s') :

      Not empty invariant.

      We cannot remove root nodes

      theorem MUList.Properties.same_root {α : Type} {s s' : State.ListST α} {i : State.Actions α} {root_id : Tokens.Elem.TId} (pre : State.ListST.is_root_node root_id s = true) (step : Relation.Rel s i s') :

      Midgard Lists do not change of root nodes.

      def MUList.Properties.no_new_root_inv {α : Type} {s s' : State.ListST α} {root_id : Tokens.Elem.TId} {i : State.Actions α} (t_pos_root : State.ListST.is_root_node root_id s' = true) (step : Relation.Rel s i s') :

      Root remains the same invariant backwards

      Equations
      • ⋯ = ⋯
      Instances For

        There is only one root node statmement definition.

        Equations
        Instances For
          theorem MUList.Properties.only_one_root_inv {α : Type} {s s' : State.ListST α} {i : State.Actions α} (pre : only_one_root s) (step : Relation.Rel s i s') :

          Only one root node.

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

              Next keys are alive

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

                  All linked keys are in the list. We test this property using Plausible and Blaster.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    theorem MUList.Properties.burn_id_match {α : Type} {s burnt : State.ListST α} {rem : Tokens.Elem.TId} (HB : Tokens.State.Tokens.burn rem s = some burnt) (inv : IdMatchP s) :
                    IdMatchP burnt
                    Equations
                    Instances For
                      Equations
                      Instances For

                        Prop stating that all nodes can be removed. They can be removed if they have an anchor that it is not themselves. They can be anchors of themselves, but they must accept another anchor too. The root node cannot be remove, so what we say is that all nodes with key can be removed.

                        Equations
                        Instances For