• 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
            • Atj-implementation
              • Atj-types
                • Atj-type-<=
                • Atj-function-type
                • Atj-type-to-jitype
                • Atj-type
                • Atj-function-type-of-min-input-types
                • Atj-type-top-join
                • Atj-atype
                • Atj-type-bottom-meet
                • Atj-type-bottom-<=
                • Atj-type-top-<=
                • Atj-type-top-list-join
                • Atj-type-bottom-list-<=
                • Atj-type-top-list-<=
                • Atj-type-bottom-list-meet
                • Atj-type-list-<=
                • Atj-type-to-pred
                • Atj-maybe-function-type-info
                • Atj-atype-<=
                • Atj-maybe-function-type
                • Atj-maybe-type
                • Atj-type-to-keyword
                • Atj-function-type-info
                • Atj-type-list-join
                • Atj-type-list-to-type
                • Atj-type-list-<
                • Atj-type-list-meet
                • Atj-type-from-keyword
                  • Atj-function-type-of-min-input-types-aux
                  • Atj-type-<
                  • Atj-type-list-to-type-list-list
                  • Atj-number-of-results
                  • Atj-function-type-info-default
                  • Atj-type-to-pred-gen-mono-thms-2
                  • Atj-get-function-type-info-from-table
                  • Atj-get-function-type-info
                  • Atj-type-to-pred-gen-mono-thms-1
                  • Atj-type-to-pred-gen-mono-thm
                  • Atj-type-meet
                  • Atj-type-to-type-list
                  • Atj-type-list-to-jitype-list
                  • Atj-type-join
                  • Atj-type-of-value
                  • Atj-type-list-to-keyword-list
                  • Atj-type-semilattices
                  • Atj-type-to-pred-gen-mono-thms
                  • Atj-function-type-info->outputs
                  • Atj-function-type-list->outputs
                  • Atj-function-type-list->inputs
                  • Atj-type-list-from-keyword-list
                  • Atj-type-irrelevant
                  • Atj-symbol-type-alist
                  • Atj-type-list
                  • Atj-function-type-list
                  • Atj-type-list-list
                  • Atj-maybe-type-list
                  • Atj-function-type-info-table
                  • *atj-function-type-info-table-name*
                • Atj-java-primitive-array-model
                • Atj-java-abstract-syntax
                • Atj-input-processing
                • Atj-java-pretty-printer
                • Atj-code-generation
                • Atj-java-primitives
                • Atj-java-primitive-arrays
                • Atj-type-macros
                • Atj-java-syntax-operations
                • Atj-fn
                • Atj-library-extensions
                • Atj-java-input-types
                • Atj-test-structures
                • Aij-notions
                • Atj-macro-definition
              • Atj-tutorial
            • Aij
            • Language
          • 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
    • Atj-types

    Atj-type-from-keyword

    Map keywords back to ATJ types.

    Signature
    (atj-type-from-keyword kwd) → type
    Arguments
    kwd — Guard (keywordp kwd).
    Returns
    type — Type (atj-typep type).

    This is the inverse of atj-type-to-keyword.

    An error occurs if the keyword does not correspond to any ATJ type.

    Definitions and Theorems

    Function: atj-type-from-keyword

    (defun atj-type-from-keyword (kwd)
     (declare (xargs :guard (keywordp kwd)))
     (let ((__function__ 'atj-type-from-keyword))
      (declare (ignorable __function__))
      (case kwd
       (:ainteger (atj-type-acl2 (atj-atype-integer)))
       (:arational (atj-type-acl2 (atj-atype-rational)))
       (:anumber (atj-type-acl2 (atj-atype-number)))
       (:acharacter (atj-type-acl2 (atj-atype-character)))
       (:astring (atj-type-acl2 (atj-atype-string)))
       (:asymbol (atj-type-acl2 (atj-atype-symbol)))
       (:aboolean (atj-type-acl2 (atj-atype-boolean)))
       (:acons (atj-type-acl2 (atj-atype-cons)))
       (:avalue (atj-type-acl2 (atj-atype-value)))
       (:jboolean (atj-type-jprim (primitive-type-boolean)))
       (:jchar (atj-type-jprim (primitive-type-char)))
       (:jbyte (atj-type-jprim (primitive-type-byte)))
       (:jshort (atj-type-jprim (primitive-type-short)))
       (:jint (atj-type-jprim (primitive-type-int)))
       (:jlong (atj-type-jprim (primitive-type-long)))
       (:jfloat (atj-type-jprim (primitive-type-float)))
       (:jdouble (atj-type-jprim (primitive-type-double)))
       (:jboolean[] (atj-type-jprimarr (primitive-type-boolean)))
       (:jchar[] (atj-type-jprimarr (primitive-type-char)))
       (:jbyte[] (atj-type-jprimarr (primitive-type-byte)))
       (:jshort[] (atj-type-jprimarr (primitive-type-short)))
       (:jint[] (atj-type-jprimarr (primitive-type-int)))
       (:jlong[] (atj-type-jprimarr (primitive-type-long)))
       (:jfloat[] (atj-type-jprimarr (primitive-type-float)))
       (:jdouble[] (atj-type-jprimarr (primitive-type-double)))
       (otherwise
        (prog2$
           (raise "The keyword ~x0 does not correspond to any ATJ type."
                  kwd)
           (atj-type-irrelevant))))))

    Theorem: atj-typep-of-atj-type-from-keyword

    (defthm atj-typep-of-atj-type-from-keyword
      (b* ((type (atj-type-from-keyword kwd)))
        (atj-typep type))
      :rule-classes :rewrite)

    Theorem: atj-type-from-keyword-of-atj-type-to-keyword

    (defthm atj-type-from-keyword-of-atj-type-to-keyword
      (equal (atj-type-from-keyword (atj-type-to-keyword type))
             (atj-type-fix type)))