• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
      • Std/lists
      • Omaps
        • Defomap
        • Update
        • Mapp
        • Assoc
        • Update*
        • From-lists
        • Keys
        • List-lookup
        • Size
        • Compatiblep
        • Submap
        • Tail
        • Restrict
        • Head
        • Update-induction-on-maps
        • Rlookup
        • Lookup
        • List-notin
        • Emptyp
        • Rlookup*
        • Map
        • Lookup*
        • Values
        • List-in
        • Delete*
        • In*
        • Delete
        • From-alist
          • Mfix
          • Head-val
          • Head-key
          • Omap-induction2
          • Omap-order-rules
        • Std/alists
        • Obags
        • Std/util
        • Std/strings
        • Std/osets
        • Std/io
        • Std/basic
        • Std/system
        • Std/typed-lists
        • Std/bitsets
        • Std/testing
        • Std/typed-alists
        • Std/stobjs
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Omaps

    From-alist

    Build an omap from an alist.

    Signature
    (from-alist alist) → map
    Arguments
    alist — Guard (alistp alist).
    Returns
    map — Type (mapp map).

    If there are duplicate keys in the alist, the leftmost one, with the corresponding value, will be in the resulting omap. This is consistent with the shadowing of alists.

    Definitions and Theorems

    Function: from-alist

    (defun from-alist (alist)
      (declare (xargs :guard (alistp alist)))
      (let ((__function__ 'from-alist))
        (declare (ignorable __function__))
        (cond ((endp alist) nil)
              (t (update (caar alist)
                         (cdar alist)
                         (from-alist (cdr alist)))))))

    Theorem: mapp-of-from-alist

    (defthm mapp-of-from-alist
      (b* ((map (from-alist alist)))
        (mapp map))
      :rule-classes :rewrite)