• 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
        • 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
    • Std/osets

    Intersectp

    (intersectp x y) checks whether X and Y have any common members.

    Logically we just check whether the intersect of X and Y is emptyp.

    In the execution, we use a faster function that checks for any common members and doesn't build any new sets.

    Definitions and Theorems

    Function: intersectp

    (defun intersectp (x y)
      (declare (xargs :guard (and (setp x) (setp y))))
      (mbe :logic (not (emptyp (intersect x y)))
           :exec (fast-intersectp x y)))