• 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-java-primitive-array-model
              • Atj-java-abstract-syntax
              • Atj-input-processing
              • Atj-java-pretty-printer
              • Atj-code-generation
                • Atj-gen-test-method
                • Atj-shallow-code-generation
                • Atj-common-code-generation
                • Atj-shallow-quoted-constant-generation
                • Atj-pre-translation
                  • Atj-pre-translation-array-analysis
                  • Atj-pre-translation-type-annotation
                    • Atj-type-annotate-term
                    • Atj-check-annotated-mv-let-call
                    • Atj-type-conv-allowed-p
                    • Atj-type-annotate-formals+body
                    • Atj-type-rewrap-term
                    • Atj-type-conv
                    • Atj-type-unwrap-term
                    • Atj-type-id
                    • Atj-type-wrap-term
                    • Atj-types-id
                    • Atj-types-of-conv
                    • Atj-types-conv-allowed-p
                    • Atj-type-annotate-var
                    • Atj-type-unannotate-var
                      • Atj-type-of-id
                      • Atj-types-of-id
                      • Atj-type-annotate-mv-nth-terms
                      • Atj-type-annotate-vars
                      • Atj-select-mv-term-types
                      • Atj-type-unannotate-vars
                      • Atj-type-rewrap-terms
                      • Atj-type-wrapped-variable-p
                    • Atj-pre-translation-var-reuse
                    • Atj-pre-translate
                    • Atj-pre-translation-multiple-values
                    • Atj-pre-translation-no-aij-types-analysis
                    • Atj-pre-translation-var-renaming
                    • Atj-pre-translation-remove-return-last
                    • Atj-pre-translation-disjunctions
                    • Atj-pre-translation-trivial-vars
                    • Atj-pre-translation-conjunctions
                    • Atj-pre-translation-unused-vars
                    • Atj-pre-translation-remove-dead-if-branches
                  • Atj-gen-everything
                  • Atj-name-translation
                  • Atj-gen-test-cunit
                  • Atj-gen-test-class
                  • Atj-gen-main-file
                  • Atj-post-translation
                  • Atj-deep-code-generation
                  • Atj-gen-test-methods
                  • Atj-gen-test-file
                  • Atj-gen-env-file
                  • Atj-gen-output-subdir
                • 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-pre-translation-type-annotation

    Atj-type-unannotate-var

    Decompose an annotated ACL2 variable into its unannotated counterpart and its types.

    Signature
    (atj-type-unannotate-var var) → (mv unannotated-var types)
    Arguments
    var — Guard (symbolp var).
    Returns
    unannotated-var — Type (symbolp unannotated-var).
    types — Type (atj-type-listp types).

    This is the inverse of atj-type-annotate-var.

    Definitions and Theorems

    Function: atj-type-unannotate-var

    (defun atj-type-unannotate-var (var)
      (declare (xargs :guard (symbolp var)))
      (let ((__function__ 'atj-type-unannotate-var))
        (declare (ignorable __function__))
        (b* ((string (symbol-name var))
             ((unless (and (> (length string) 0)
                           (eql (char string 0) #\[)))
              (raise "Internal error: ~x0 is not an annotated variable."
                     var)
              (mv nil (list (atj-type-irrelevant))))
             (pos (position #\] string))
             ((unless (natp pos))
              (raise "Internal error: ~x0 is not an annotated variable."
                     var)
              (mv nil (list (atj-type-irrelevant))))
             (types-id (subseq string 1 pos))
             (types (atj-types-of-id types-id))
             (unannotated-string (subseq string (1+ pos)
                                         (length string)))
             (unannotated-var
                  (intern-in-package-of-symbol unannotated-string var)))
          (mv unannotated-var types))))

    Theorem: symbolp-of-atj-type-unannotate-var.unannotated-var

    (defthm symbolp-of-atj-type-unannotate-var.unannotated-var
      (b* (((mv ?unannotated-var ?types)
            (atj-type-unannotate-var var)))
        (symbolp unannotated-var))
      :rule-classes :rewrite)

    Theorem: atj-type-listp-of-atj-type-unannotate-var.types

    (defthm atj-type-listp-of-atj-type-unannotate-var.types
      (b* (((mv ?unannotated-var ?types)
            (atj-type-unannotate-var var)))
        (atj-type-listp types))
      :rule-classes :rewrite)

    Theorem: consp-of-atj-type-unannotate-var.types

    (defthm consp-of-atj-type-unannotate-var.types
      (b* (((mv ?unannotated-var ?types)
            (atj-type-unannotate-var var)))
        (consp types))
      :rule-classes :type-prescription)