• 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
        • Set
        • C
        • Soft
        • Bv
        • Imp-language
        • Ethereum
        • Event-macros
        • Java
          • Atj
          • Aij
          • Language
            • Syntax
              • Grammar
              • Unicode-escapes
              • Unicode-input-char
              • Escape-sequence
              • Identifiers
              • Primitive-types
                • Primitive-type
                • Primitive-type-<=
                • Numeric-type
                  • Numeric-type-fix
                  • Numeric-type-case
                  • Numeric-type-equiv
                  • Numeric-typep
                    • Numeric-type-kind
                    • Numeric-type-short
                    • Numeric-type-long
                    • Numeric-type-int
                    • Numeric-type-float
                    • Numeric-type-double
                    • Numeric-type-char
                    • Numeric-type-byte
                  • Primitive-type-<
                  • Integral-type
                  • Primitive-type-<1
                  • Floating-point-type
                • Reference-types
                • Unicode-characters
                • Keywords
                • Integer-literals
                • String-literals
                • Octal-digits
                • Hexadecimal-digits
                • Decimal-digits
                • Binary-digits
                • Character-literals
                • Null-literal
                • Floating-point-literals
                • Boolean-literals
                • Package-names
                • Literals
              • Semantics
          • Riscv
          • Bitcoin
          • Zcash
          • Yul
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Axe
          • Lists-light
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Numeric-type

    Numeric-typep

    Recognizer for numeric-type structures.

    Signature
    (numeric-typep x) → *

    Definitions and Theorems

    Function: numeric-typep

    (defun numeric-typep (x)
      (declare (xargs :guard t))
      (let ((__function__ 'numeric-typep))
        (declare (ignorable __function__))
        (and (consp x)
             (cond ((or (atom x) (eq (car x) :char))
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 0)
                         (b* nil t)))
                   ((eq (car x) :byte)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 0)
                         (b* nil t)))
                   ((eq (car x) :short)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 0)
                         (b* nil t)))
                   ((eq (car x) :int)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 0)
                         (b* nil t)))
                   ((eq (car x) :long)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 0)
                         (b* nil t)))
                   ((eq (car x) :float)
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 0)
                         (b* nil t)))
                   (t (and (eq (car x) :double)
                           (and (true-listp (cdr x))
                                (eql (len (cdr x)) 0))
                           (b* nil t)))))))

    Theorem: consp-when-numeric-typep

    (defthm consp-when-numeric-typep
      (implies (numeric-typep x) (consp x))
      :rule-classes :compound-recognizer)