• 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

    Emptyp

    Check if an omap is empty.

    Signature
    (emptyp map) → yes/no
    Arguments
    map — Guard (mapp map).
    Returns
    yes/no — Type (booleanp yes/no).

    This is similar to set::emptyp for osets.

    Definitions and Theorems

    Function: emptyp

    (defun emptyp (map)
      (declare (xargs :guard (mapp map)))
      (let ((__function__ 'emptyp))
        (declare (ignorable __function__))
        (null (mfix map))))

    Theorem: booleanp-of-emptyp

    (defthm booleanp-of-emptyp
      (b* ((yes/no (emptyp map)))
        (booleanp yes/no))
      :rule-classes :rewrite)

    Theorem: mapp-when-not-emptyp

    (defthm mapp-when-not-emptyp
      (implies (not (emptyp map)) (mapp map)))

    Theorem: mfix-when-emptyp

    (defthm mfix-when-emptyp
      (implies (emptyp x)
               (equal (mfix x) nil)))

    Theorem: mapp-non-nil-implies-not-emptyp

    (defthm mapp-non-nil-implies-not-emptyp
      (implies (and (mapp map) map)
               (not (emptyp map))))

    Theorem: acl2-count-head-when-not-emptyp

    (defthm acl2-count-head-when-not-emptyp
      (implies (not (emptyp map))
               (< (+ (acl2-count (car (car map)))
                     (acl2-count (cdr (car map))))
                  (acl2-count map))))

    Theorem: emptyp-of-mfix-map

    (defthm emptyp-of-mfix-map
      (equal (emptyp (mfix map))
             (emptyp map)))

    Theorem: emptyp-mequiv-congruence-on-map

    (defthm emptyp-mequiv-congruence-on-map
      (implies (mequiv map map-equiv)
               (equal (emptyp map) (emptyp map-equiv)))
      :rule-classes :congruence)