• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
      • Std/lists
      • Std/alists
      • Obags
      • Std/util
      • Std/strings
      • Std/osets
        • Omaps
          • Defomap
          • Update
          • Mapp
          • Assoc
          • Update*
          • Size
          • Keys
          • From-lists
          • Update-induction-on-maps
          • Compatiblep
          • Tail
          • Head
          • Restrict
          • Submap
          • Map
          • Rlookup
          • Emptyp
          • Rlookup*
          • Lookup*
          • Delete*
          • Values
          • In*
          • Lookup
            • Delete
            • Mfix
            • Head-val
            • Head-key
            • Omap-induction2
            • Omap-order-rules
          • All-by-membership
          • Defset
          • In
          • Primitives
          • Subset
          • Mergesort
          • Intersect
          • Union
          • Pick-a-point-subset-strategy
          • Delete
          • Double-containment
          • Difference
          • Cardinality
          • Set
          • Intersectp
        • 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

    Lookup

    Value associated to a key in an omap.

    Signature
    (lookup key map) → val
    Arguments
    map — Guard (mapp map).

    Definitions and Theorems

    Function: lookup

    (defun lookup (key map)
      (declare (xargs :guard (mapp map)))
      (declare (xargs :guard (assoc key map)))
      (let ((__function__ 'lookup))
        (declare (ignorable __function__))
        (cdr (assoc key map))))

    Theorem: lookup-when-emptyp

    (defthm lookup-when-emptyp
      (implies (emptyp map)
               (not (lookup key map)))
      :rule-classes (:rewrite :type-prescription))

    Theorem: acl2-count-lookup-<-map

    (defthm acl2-count-lookup-<-map
      (implies (not (emptyp map))
               (< (acl2-count (lookup key map))
                  (acl2-count map))))

    Theorem: lookup-of-tail-when-assoc-tail

    (defthm lookup-of-tail-when-assoc-tail
      (implies (assoc key (tail map))
               (equal (lookup key (tail map))
                      (lookup key map))))