• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Debugging
    • Projects
    • Std
      • Std/lists
      • Std/alists
      • Obags
      • Std/util
      • Std/strings
      • Std/io
      • Std/osets
        • Omaps
        • All-by-membership
        • In
        • Defset
        • Primitives
        • Subset
        • Mergesort
        • Intersect
        • Union
        • Pick-a-point-subset-strategy
        • Delete
        • Difference
        • Cardinality
        • Set
        • Double-containment
        • Intersectp
        • Std/system
        • Std/basic
        • Std/typed-lists
        • Std/bitsets
        • Std/testing
        • Std/typed-alists
        • Std/stobjs
        • Std-extensions
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Testing-utilities
      • Math
    • 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 empty.

    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 (empty (intersect x y)))
                :exec (fast-intersectp x y)))