• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
          • Implementation
          • Setp
          • Right
          • Left
          • Head
          • Double-containment
          • Subset
            • Intersect
            • Insert
            • In
            • Delete
            • Union
            • Diff
            • From-list
            • To-list
            • Set-equiv
            • Sfix
            • Pick-a-point
            • Cardinality
            • Set-induct
            • Set-bi-induct
            • Emptyp
          • Soft
          • C
          • Bv
          • Imp-language
          • Event-macros
          • Java
          • Bitcoin
          • Ethereum
          • Yul
          • Zcash
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Set

    Subset

    Check if one set is a subset of the other.

    Signature
    (subset x y) → *
    Arguments
    x — Guard (setp x).
    y — Guard (setp y).

    Time complexity: O(n\log(m)) (Note: the current implementation is inefficient. This should eventually be O(n\log(m/n)), where n < m. This may be implemented similar to diff.)

    Definitions and Theorems

    Function: subset

    (defun subset (x y)
      (declare (xargs :guard (and (setp x) (setp y))))
      (declare (xargs :type-prescription (booleanp (subset x y))))
      (let ((__function__ 'subset))
        (declare (ignorable __function__))
        (or (emptyp x)
            (and (in (head x) y)
                 (subset (left x) y)
                 (subset (right x) y)))))