• 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

    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))))