• 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-types-of-conv

    Source and destination ATJ types of a conversion function.

    Signature
    (atj-types-of-conv conv) → (mv src-types dst-types)
    Arguments
    conv — Guard (symbolp conv).
    Returns
    src-types — Type (atj-type-listp src-types).
    dst-types — Type (atj-type-listp dst-types).

    This is the inverse of atj-type-conv.

    Definitions and Theorems

    Function: atj-types-of-conv

    (defun atj-types-of-conv (conv)
      (declare (xargs :guard (symbolp conv)))
      (let ((__function__ 'atj-types-of-conv))
        (declare (ignorable __function__))
        (b* ((string (symbol-name conv))
             ((unless (and (> (length string) 0)
                           (eql (char string 0) #\[)
                           (eql (char string (1- (length string)))
                                #\])))
              (raise "Internal error: ~x0 is not a conversion function."
                     conv)
              (mv (list (atj-type-irrelevant))
                  (list (atj-type-irrelevant))))
             (pos (position #\> string))
             ((unless (natp pos))
              (raise "Internal error: ~x0 is not a conversion function."
                     conv)
              (mv (list (atj-type-irrelevant))
                  (list (atj-type-irrelevant))))
             (src-id (subseq string 1 pos))
             (dst-id (subseq string (1+ pos)
                             (1- (length string))))
             (src-types (atj-types-of-id src-id))
             (dst-types (atj-types-of-id dst-id)))
          (mv src-types dst-types))))

    Theorem: atj-type-listp-of-atj-types-of-conv.src-types

    (defthm atj-type-listp-of-atj-types-of-conv.src-types
      (b* (((mv ?src-types ?dst-types)
            (atj-types-of-conv conv)))
        (atj-type-listp src-types))
      :rule-classes :rewrite)

    Theorem: atj-type-listp-of-atj-types-of-conv.dst-types

    (defthm atj-type-listp-of-atj-types-of-conv.dst-types
      (b* (((mv ?src-types ?dst-types)
            (atj-types-of-conv conv)))
        (atj-type-listp dst-types))
      :rule-classes :rewrite)

    Theorem: consp-of-atj-types-of-conv.src-types

    (defthm consp-of-atj-types-of-conv.src-types
      (b* (((mv ?src-types ?dst-types)
            (atj-types-of-conv conv)))
        (consp src-types))
      :rule-classes :type-prescription)

    Theorem: consp-of-atj-types-of-conv.dst-types

    (defthm consp-of-atj-types-of-conv.dst-types
      (b* (((mv ?src-types ?dst-types)
            (atj-types-of-conv conv)))
        (consp dst-types))
      :rule-classes :type-prescription)