• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
          • Omaps
          • Directed-untranslate
          • Include-book-paths
          • Ubi
          • Numbered-names
          • Digits-any-base
          • Context-message-pair
          • With-auto-termination
          • Make-termination-theorem
          • Theorems-about-true-list-lists
          • Checkpoint-list
          • Sublis-expr+
          • Integers-from-to
          • Prove$
          • Defthm<w
          • System-utilities-non-built-in
          • Integer-range-fix
          • Minimize-ruler-extenders
          • Add-const-to-untranslate-preprocess
          • Unsigned-byte-fix
          • Signed-byte-fix
          • Defthmr
          • Paired-names
          • Unsigned-byte-list-fix
          • Signed-byte-list-fix
          • Show-books
          • Typed-tuplep
          • Skip-in-book
          • List-utilities
          • Checkpoint-list-pretty
          • Defunt
          • Keyword-value-list-to-alist
          • Magic-macroexpand
          • Top-command-number-fn
          • Bits-as-digits-in-base-2
          • Show-checkpoint-list
          • Ubyte11s-as-digits-in-base-2048
          • Named-formulas
          • Bytes-as-digits-in-base-256
          • String-utilities
          • Make-keyword-value-list-from-keys-and-value
          • Defmacroq
          • Integer-range-listp
          • Apply-fn-if-known
          • Trans-eval-error-triple
          • Checkpoint-info-list
          • Previous-subsumer-hints
          • Fms!-lst
          • Zp-listp
          • Trans-eval-state
          • Injections
          • Doublets-to-alist
          • Theorems-about-osets
          • Typed-list-utilities
          • Message-utilities
          • Book-runes-alist
          • User-interface
          • Bits/ubyte11s-digit-grouping
          • Bits/bytes-digit-grouping
          • Subsetp-eq-linear
          • Oset-utilities
            • List-in
            • List-notin
            • Typed-osets
              • Osets-of-natural-numbers
                • Nat-setp
                  • Set-all-natp
                • Osets-of-integer-numbers
            • Strict-merge-sort-<
            • Miscellaneous-enumerations
            • Maybe-unquote
            • Thm<w
            • Defthmd<w
            • Io-utilities
          • Set
          • Soft
          • C
          • Bv
          • Imp-language
          • Event-macros
          • Java
          • Riscv
          • 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
    • Osets-of-natural-numbers

    Nat-setp

    Recognize finite sets of natural numbers.

    Signature
    (nat-setp x) → yes/no
    Returns
    yes/no — Type (booleanp yes/no).

    Definitions and Theorems

    Function: nat-setp

    (defun nat-setp (x)
      (declare (xargs :guard t))
      (let ((acl2::__function__ 'nat-setp))
        (declare (ignorable acl2::__function__))
        (and (setp x) (set-all-natp x))))

    Theorem: booleanp-of-nat-setp

    (defthm booleanp-of-nat-setp
      (acl2::b* ((yes/no (nat-setp x)))
        (booleanp yes/no))
      :rule-classes :rewrite)

    Theorem: setp-when-nat-setp

    (defthm setp-when-nat-setp
      (implies (nat-setp nats) (setp nats)))

    Theorem: nat-setp-of-insert

    (defthm nat-setp-of-insert
      (equal (nat-setp (insert nat nats))
             (and (natp nat)
                  (nat-setp (sfix nats)))))

    Theorem: nat-setp-of-union

    (defthm nat-setp-of-union
      (equal (nat-setp (union nats1 nats2))
             (and (nat-setp (sfix nats1))
                  (nat-setp (sfix nats2)))))