• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
      • Std/lists
      • Std/alists
      • Obags
      • Std/util
      • Std/strings
      • Std/osets
        • Omaps
        • All-by-membership
        • Defset
        • In
        • Primitives
          • Setp
          • Insert
          • Head
          • Tail
          • Sfix
          • Emptyp
          • 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
    • Primitives

    Emptyp

    (emptyp x) recognizes empty sets.

    This function is like endp for lists, but it respects the non-set convention and always returns true for ill-formed sets.

    Definitions and Theorems

    Function: emptyp

    (defun emptyp (x)
      (declare (xargs :guard (setp x)))
      (mbe :logic (or (null x) (not (setp x)))
           :exec (null x)))

    Theorem: emptyp-type

    (defthm emptyp-type
      (or (equal (emptyp x) t)
          (equal (emptyp x) nil))
      :rule-classes :type-prescription)

    Theorem: nonempty-means-set

    (defthm nonempty-means-set
      (implies (not (emptyp x)) (setp x)))

    Theorem: emptyp-sfix-cancel

    (defthm emptyp-sfix-cancel
      (equal (emptyp (sfix x)) (emptyp x)))