• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
        • Atj
        • Aij
        • Language
          • Syntax
            • Grammar
            • Unicode-escapes
            • Unicode-input-char
            • Escape-sequence
            • Identifiers
            • Primitive-types
            • Reference-types
            • Keywords
            • Unicode-characters
            • Integer-literals
            • String-literals
            • Octal-digits
            • Hexadecimal-digits
            • Decimal-digits
            • Binary-digits
            • Character-literals
            • Null-literal
            • Floating-point-literals
            • Boolean-literals
            • Package-names
            • Literals
              • Literal
                • Literal-case
                • Literal-fix
                • Literal-equiv
                • Literalp
                • Literal-string
                • Literal-integer
                • Literal-fpoint
                • Literal-char
                • Literal-boolean
                • Literal-kind
                  • Literal-null
            • Semantics
        • Taspi
        • Riscv
        • Bitcoin
        • Des
        • Ethereum
        • X86isa
        • Sha-2
        • Yul
        • Zcash
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Poseidon
        • Where-do-i-place-my-book
        • Axe
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Community
      • Proof-automation
      • ACL2
      • Macro-libraries
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Literal

    Literal-kind

    Get the kind (tag) of a literal structure.

    Signature
    (literal-kind x) → kind
    Arguments
    x — Guard (literalp x).

    Definitions and Theorems

    Function: literal-kind$inline

    (defun literal-kind$inline (x)
      (declare (xargs :guard (literalp x)))
      (let ((__function__ 'literal-kind))
        (declare (ignorable __function__))
        (mbe :logic (cond ((or (atom x) (eq (car x) :integer))
                           :integer)
                          ((eq (car x) :fpoint) :fpoint)
                          ((eq (car x) :char) :char)
                          ((eq (car x) :string) :string)
                          ((eq (car x) :boolean) :boolean)
                          (t :null))
             :exec (car x))))

    Theorem: literal-kind-possibilities

    (defthm literal-kind-possibilities
      (or (equal (literal-kind x) :integer)
          (equal (literal-kind x) :fpoint)
          (equal (literal-kind x) :char)
          (equal (literal-kind x) :string)
          (equal (literal-kind x) :boolean)
          (equal (literal-kind x) :null))
      :rule-classes
      ((:forward-chaining :trigger-terms ((literal-kind x)))))