• 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-fix
                  • Primitive-typep
                    • Primitive-type-case
                    • Primitive-type-equiv
                    • Primitive-type-kind
                    • Primitive-type-short
                    • Primitive-type-long
                    • Primitive-type-int
                    • Primitive-type-float
                    • Primitive-type-double
                    • Primitive-type-char
                    • Primitive-type-byte
                    • Primitive-type-boolean
                  • Primitive-type-<=
                  • Numeric-type
                  • 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
    • Primitive-type

    Primitive-typep

    Recognizer for primitive-type structures.

    Signature
    (primitive-typep x) → *

    Definitions and Theorems

    Function: primitive-typep

    (defun primitive-typep (x)
      (declare (xargs :guard t))
      (let ((__function__ 'primitive-typep))
        (declare (ignorable __function__))
        (and (consp x)
             (cond ((or (atom x) (eq (car x) :boolean))
                    (and (true-listp (cdr x))
                         (eql (len (cdr x)) 0)
                         (b* nil t)))
                   ((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-primitive-typep

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