• 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
            • Insert-all
            • 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
    • Insert

    Insert-all

    Add a list of values to the set.

    Signature
    (insert-all list set) → set$
    Arguments
    list — Guard (true-listp list).
    set — Guard (setp set).
    Returns
    set$ — Type (setp set$).

    Time complexity: O(n\log(n+m)), where n is the size of the list, and m is the size of the set.

    Definitions and Theorems

    Function: insert-all

    (defun insert-all (list set)
      (declare (xargs :guard (and (true-listp list) (setp set))))
      (let ((__function__ 'insert-all))
        (declare (ignorable __function__))
        (if (endp list)
            (sfix set)
          (insert-all (rest list)
                      (insert (first list) set)))))

    Theorem: setp-of-insert-all

    (defthm setp-of-insert-all
      (b* ((set$ (insert-all list set)))
        (setp set$))
      :rule-classes :rewrite)