• 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

    Diff

    Set difference.

    Signature
    (diff x y) → set
    Arguments
    x — Guard (setp x).
    y — Guard (setp y).
    Returns
    set — Type (setp set).

    Time complexity: O(n\log(m/n)) (where n < m).

    Definitions and Theorems

    Function: diff

    (defun diff (x y)
      (declare (xargs :guard (and (setp x) (setp y))))
      (let ((__function__ 'diff))
        (declare (ignorable __function__))
        (tree-diff (sfix x) (sfix y))))

    Theorem: setp-of-diff

    (defthm setp-of-diff
      (b* ((set (diff x y))) (setp set))
      :rule-classes :rewrite)