• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
      • Std/lists
      • Std/alists
      • Obags
        • Bagp
        • Bag
        • Tail
        • Head
        • Emptyp
          • Subbag
          • Intersect
          • Union
          • Insert
          • Difference
          • Delete
          • Cardinality
          • Bfix
          • In
          • Occs
        • 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
    • Obags

    Emptyp

    Check if an obag is empty.

    Signature
    (emptyp bag) → yes/no
    Arguments
    bag — Guard (bagp bag).
    Returns
    yes/no — Type (booleanp yes/no).

    This is similar to set::emptyp for osets.

    Definitions and Theorems

    Function: emptyp

    (defun emptyp (bag)
      (declare (xargs :guard (bagp bag)))
      (let ((__function__ 'emptyp))
        (declare (ignorable __function__))
        (null (bfix bag))))

    Theorem: booleanp-of-emptyp

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

    Theorem: bagp-when-not-emptyp

    (defthm bagp-when-not-emptyp
      (implies (not (emptyp bag)) (bagp bag)))

    Theorem: bfix-when-emptyp

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