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.
Properties after prepending a node to the list.
Prepending adds a new element to the list, generates an element that was not in the list before.
After prepends all other elements, neither the root nor the just added, remain the same.
Append Properties #
Properties after applying append.
Removes Props #
ModifyData #
Equations
- One or more equations did not get rendered due to their size.
Instances For
Well Formed Linked List Properties #
Correct lists are never empty, root is always alive
Equations
- MUList.Properties.NeverEmptyP s = ((List.any s fun (x : Option (Tokens.Elem.TokenD (MUList.State.Elemt MUList.State.Key α))) => x.isSome) = true)
Instances For
Equations
- MUList.Properties.NeverEmptyB s = List.any s fun (x : Option (Tokens.Elem.TokenD (MUList.State.Elemt MUList.State.Key α))) => x.isSome
Instances For
Not empty invariant.
Equations
- ⋯ = ⋯
Instances For
We cannot remove root nodes
Midgard Lists do not change of root nodes.
Root remains the same invariant backwards
Equations
- ⋯ = ⋯
Instances For
There is only one root node statmement definition.
Equations
- MUList.Properties.only_one_root s = ∀ (t t_p : Tokens.Elem.TId), MUList.State.ListST.is_root_node t s = true → MUList.State.ListST.is_root_node t_p s = true → t = t_p
Instances For
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
- MUList.Properties.IdMatchP s = ∀ (i : Tokens.Elem.TId) (nd : Tokens.Elem.TokenD (MUList.State.Elemt MUList.State.Key α)), Tokens.State.Tokens.get i s = some nd → nd.id = i
Instances For
Equations
- MUList.Properties.IdMatchFind s = ∀ {i : Tokens.Elem.TId} {nd : Tokens.Elem.TokenD (MUList.State.Elemt MUList.State.Key α)}, Tokens.State.Tokens.get i s = some nd → nd.id = i
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- MUList.Properties.IdRef s = ∀ (i : Tokens.Elem.TId), i ∈ s → i < List.length s
Instances For
Equations
- One or more equations did not get rendered due to their size.
- MUList.Properties.rememberLastId s (MUList.State.Actions.UnsafeAppend key data last) prev_last = Tokens.State.Tokens.last_id s
- MUList.Properties.rememberLastId s (MUList.State.Actions.Remove rem anch) prev_last = if MUList.State.ListST.is_last_node rem s = true then anch else prev_last
- MUList.Properties.rememberLastId s a prev_last = prev_last
Instances For
Equations
- MUList.Properties.LastUniqueP s = ∀ (i j : Tokens.Elem.TId), MUList.State.ListST.is_last_node i s = true → MUList.State.ListST.is_last_node j s = true → i = j
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
- MUList.Properties.RemovableTokens _hkey = ∃ (anchor : Tokens.Elem.TId), ¬tid = anchor ∧ MUList.State.ListST.is_anchor k anchor s = true