@[reducible, inline]
Key are nats.
Equations
Instances For
Nodes contain some data and optionally a key and link. The link field states whats the next key in the list. Given two nodes, we can easily check if one follows from the other.
Equations
- MUList.State.instReprElemt = { reprPrec := MUList.State.instReprElemt.repr }
def
MUList.State.instReprElemt.repr
{ε✝ α✝ : Type}
[Repr ε✝]
[Repr α✝]
:
Elemt ε✝ α✝ → Nat → Std.Format
Equations
- One or more equations did not get rendered due to their size.
Instances For
Key serialization operation.
Equations
- MUList.State.serialize_key none = "Node"
- MUList.State.serialize_key (some k) = "Node" ++ toString k
Instances For
@[reducible, inline]
Linked lists are defined as a tokenized linked list structure.
Equations
Instances For
Equations
- MUList.State.ListST.get_key tkn s = match Tokens.State.Tokens.get tkn s with | none => none | some nd => nd.data.key
Instances For
Equations
- MUList.State.ListST.get_link tkn s = match Tokens.State.Tokens.get tkn s with | none => none | some nd => nd.data.link
Instances For
theorem
MUList.State.get_get_key_some
{α : Type}
{s : ListST α}
{tid : Tokens.Elem.TId}
{k : Key}
(h : ListST.get_key tid s = some k)
:
theorem
MUList.State.get_get_key_some'
{α : Type}
{s : ListST α}
{tid : Tokens.Elem.TId}
{k : Key}
(h : Tokens.State.Tokens.get_proj tid (fun (x : Elemt Key α) => x.key) s = some (some k))
:
def
MUList.State.ListST.get_data
{α β : Type}
(tid : Tokens.Elem.TId)
(f : α → β)
(s : ListST α)
:
Option β
Equations
- MUList.State.ListST.get_data tid f s = (f ∘ fun (x : Tokens.Elem.TokenD (MUList.State.Elemt MUList.State.Key α)) => x.data.data) <$> Tokens.State.Tokens.get tid s
Instances For
Equations
- MUList.State.ListST.init root_d = Tokens.State.Tokens.mint' (MUList.State.serialize_key none) { key := none, link := none, data := root_d } Tokens.State.Tokens.init
Instances For
theorem
MUList.State.get_init
{α : Type}
{iv : α}
{tid : Tokens.Elem.TId}
{tkn : Tokens.Elem.TokenD (Elemt Key α)}
(get : Tokens.State.Tokens.get tid (ListST.init iv).fst = some tkn)
:
Equations
- MUList.State.ListST.gen_root_init root_data = Tokens.State.Tokens.mint' (MUList.State.serialize_key none) { key := none, link := none, data := Sum.inl root_data } Tokens.State.Tokens.init
Instances For
def
MUList.State.ListST.upd_link
{α : Type}
(tkn : Tokens.Elem.TId)
(nl : Option Key)
(s : ListST α)
:
Equations
- MUList.State.ListST.upd_link tkn nl s = Tokens.State.Tokens.update_data tkn (fun (t : MUList.State.Elemt MUList.State.Key α) => { key := t.key, link := nl, data := t.data }) s
Instances For
theorem
MUList.State.upd_link_find
{α : Type}
{tkn : Tokens.Elem.TId}
{s : ListST α}
{t : Tokens.Elem.TokenD (Elemt Key α)}
(HF : Tokens.State.Tokens.get tkn s = some t)
(mk : Option Key)
:
theorem
MUList.State.find_upd_link_find_others
{α : Type}
{tkn otkn : Tokens.Elem.TId}
{mk : Option Key}
{s s' : ListST α}
{t : Tokens.Elem.TokenD (Elemt Key α)}
(neq : ¬tkn = otkn)
(HF : Tokens.State.Tokens.get otkn s = some t)
(Upd : ListST.upd_link tkn mk s = some s')
:
theorem
MUList.State.find_upd_link_find
{α : Type}
{tkn : Tokens.Elem.TId}
{mk : Option Key}
{s s' : ListST α}
{t : Tokens.Elem.TokenD (Elemt Key α)}
(HF : Tokens.State.Tokens.get tkn s = some t)
(Upd : ListST.upd_link tkn mk s = some s')
:
theorem
MUList.State.burn_find_some
{α : Type}
{s : ListST α}
{tid : Tokens.Elem.TId}
(HF : (Tokens.State.Tokens.get tid s).isSome = true)
:
theorem
MUList.State.get_key_mem_key_all_keys
{α : Type}
{s : ListST α}
{tid : Tokens.Elem.TId}
{key : Key}
(HM : Tokens.State.Tokens.get_proj tid (fun (x : Elemt Key α) => x.key) s = some (some key))
:
Equations
Instances For
Equations
- MUList.State.ListST.is_root_node nid s = match Tokens.State.Tokens.get nid s with | none => false | some b => MUList.State.midgard_is_root_node b
Instances For
theorem
MUList.State.root_find_and_root
{α : Type}
{id : Tokens.Elem.TId}
{s : ListST α}
(H : ListST.is_root_node id s = true)
:
∃ (nd : Tokens.Elem.TokenD (Elemt Key α)), Tokens.State.Tokens.get id s = some nd ∧ midgard_is_root_node nd = true
Equations
Instances For
Equations
- MUList.State.ListST.is_last_node nid s = match Tokens.State.Tokens.get nid s with | none => false | some b => MUList.State.midgard_is_last_node b
Instances For
theorem
MUList.State.last_find_and_last
{α : Type}
{id : Tokens.Elem.TId}
{s : ListST α}
(H : ListST.is_last_node id s = true)
:
∃ (nd : Tokens.Elem.TokenD (Elemt Key α)), Tokens.State.Tokens.get id s = some nd ∧ midgard_is_last_node nd = true
Equations
Instances For
Equations
- MUList.State.ListST.is_empty nid s = match Tokens.State.Tokens.get nid s with | none => false | some b => MUList.State.midgard_is_empty b
Instances For
Equations
- MUList.State.ListST.is_member key nd s = match Tokens.State.Tokens.get nd s with | none => false | some nd => MUList.State.midgard_is_member key nd
Instances For
theorem
MUList.State.is_member_find
{α : Type}
{k : Key}
{nd : Tokens.Elem.TId}
{s : ListST α}
(H : ListST.is_member k nd s = true)
:
theorem
MUList.State.is_member_and_key
{α : Type}
{s : ListST α}
{k : Key}
{t : Tokens.Elem.TId}
{tkn : Tokens.Elem.TokenD (Elemt Key α)}
(hm : ListST.is_member k t s = true)
(htkn : Tokens.State.Tokens.get t s = some tkn)
:
theorem
MUList.State.is_member_exists_tkn
{α : Type}
{s : ListST α}
{k : Key}
{t : Tokens.Elem.TId}
(hm : ListST.is_member k t s = true)
:
def
MUList.State.ListST.is_anchor
{α : Type}
(key : Key)
(anchor : Tokens.Elem.TId)
(s : ListST α)
:
Equations
- One or more equations did not get rendered due to their size.
Instances For
theorem
MUList.State.is_anchor_get_link
{α : Type}
{key : Key}
{tid : Tokens.Elem.TId}
{s : ListST α}
:
Equations
- One or more equations did not get rendered due to their size.
Instances For
theorem
MUList.State.is_anchor_tokens_get_key_and_token
{α : Type}
{tkn anch : Tokens.Elem.TId}
{s : ListST α}
(st : ListST.is_anchor_tokens tkn anch s = true)
:
- ModifyData {α : Type} : Tokens.Elem.TId → α → Actions α
- UnsafeAppend {α : Type} (key : Key) (data : α) (last : Tokens.Elem.TId) : Actions α
- UnsafePrepend {α : Type} (key : Key) (data : α) (root : Tokens.Elem.TId) : Actions α
- Remove {α : Type} (removed_node anchor_node : Tokens.Elem.TId) : Actions α
Instances For
Equations
- MUList.State.instReprActions = { reprPrec := MUList.State.instReprActions.repr }
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.