• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • C
      • Proof-checker-array
      • Soft
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Ethereum
      • Leftist-trees
      • Java
        • Atj
          • Atj-implementation
            • Atj-types
            • Atj-java-primitive-array-model
            • Atj-java-abstract-syntax
              • Jbinop
              • Jmethod
              • Jtype
                • Jtype-case
                • Jtypep
                • Jtype-fix
                  • Jtype-equiv
                  • Jtype-count
                  • Jtype-prim
                  • Jtype-class
                  • Jtype-array
                  • Jtype-kind
                • Jfield
                • Jexprs
                • Jliteral
                • Junop
                • Jlocvar
                • Jcunit
                • Jaccess
                • Maybe-jexpr
                • Jparam
                • Jimport
                • Jcinitializer
                • Jresult
                • Jstatems+jblocks
                • Jexpr-get-field
                • Jliteral-long-dec-nouscores
                • Nat-to-dec-chars-theorems
                • Jmethods-to-jcbody-elements
                • Jclasses-to-jcbody-elements
                • Jblock-locvar-final
                • Jblock-locvar
                • Jliteral-int-dec-nouscores
                • Jfields-to-jcbody-elements
                • Jblock-for
                • Jblock-smethod
                • Jblock-imethod
                • Jblock-ifelse
                • Jblock-asg-name
                • Jparam-list->types
                • Jparam-list->names
                • Jexpr-lit-long-dec-nouscores
                • Jexpr-lit-int-dec-nouscores
                • Jexpr-literal-string
                • Jexpr-literal-floating
                • Jexpr-literal-character
                • Jblock-while
                • Jblock-method
                • Jblock-if
                • Jblock-expr
                • Jblock-do
                • Jblock-asg
                • Jexpr-name-list
                • Jblock-throw
                • Jblock-return
                • Jparam-list
                • Jimport-list
                • Jexpr-literal-true
                • Jexpr-literal-null
                • Jexpr-literal-false
                • Jexpr-literal-1
                • Jexpr-literal-0
                • Jclass-list
                • Jblock-continue
                • Jtype-short
                • Jtype-long
                • Jtype-list
                • Jtype-int
                • Jtype-float
                • Jtype-double
                • Jtype-char
                • Jtype-byte
                • Jtype-boolean
                • Jmethod-list
                • Jliteral-list
                • Jfield-list
                • Jblock-list
                • Jblock-break
                • Jclasses+jcmembers
              • 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
        • Taspi
        • Bitcoin
        • Zcash
        • Des
        • X86isa
        • Sha-2
        • Yul
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Axe
        • Poseidon
        • Where-do-i-place-my-book
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Community
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Jtype

    Jtype-fix

    Fixing function for jtype structures.

    Signature
    (jtype-fix x) → new-x
    Arguments
    x — Guard (jtypep x).
    Returns
    new-x — Type (jtypep new-x).

    Definitions and Theorems

    Function: jtype-fix$inline

    (defun jtype-fix$inline (x)
     (declare (xargs :guard (jtypep x)))
     (let ((__function__ 'jtype-fix))
      (declare (ignorable __function__))
      (mbe
       :logic
       (case (jtype-kind x)
        (:prim (b* ((type (primitive-type-fix (std::da-nth 0 (cdr x)))))
                 (cons :prim (list type))))
        (:class (b* ((name (str-fix (std::da-nth 0 (cdr x)))))
                  (cons :class (list name))))
        (:array (b* ((comp (jtype-fix (std::da-nth 0 (cdr x)))))
                  (cons :array (list comp)))))
       :exec x)))

    Theorem: jtypep-of-jtype-fix

    (defthm jtypep-of-jtype-fix
      (b* ((new-x (jtype-fix$inline x)))
        (jtypep new-x))
      :rule-classes :rewrite)

    Theorem: jtype-fix-when-jtypep

    (defthm jtype-fix-when-jtypep
      (implies (jtypep x)
               (equal (jtype-fix x) x)))

    Function: jtype-equiv$inline

    (defun jtype-equiv$inline (acl2::x acl2::y)
      (declare (xargs :guard (and (jtypep acl2::x)
                                  (jtypep acl2::y))))
      (equal (jtype-fix acl2::x)
             (jtype-fix acl2::y)))

    Theorem: jtype-equiv-is-an-equivalence

    (defthm jtype-equiv-is-an-equivalence
      (and (booleanp (jtype-equiv x y))
           (jtype-equiv x x)
           (implies (jtype-equiv x y)
                    (jtype-equiv y x))
           (implies (and (jtype-equiv x y)
                         (jtype-equiv y z))
                    (jtype-equiv x z)))
      :rule-classes (:equivalence))

    Theorem: jtype-equiv-implies-equal-jtype-fix-1

    (defthm jtype-equiv-implies-equal-jtype-fix-1
      (implies (jtype-equiv acl2::x x-equiv)
               (equal (jtype-fix acl2::x)
                      (jtype-fix x-equiv)))
      :rule-classes (:congruence))

    Theorem: jtype-fix-under-jtype-equiv

    (defthm jtype-fix-under-jtype-equiv
      (jtype-equiv (jtype-fix acl2::x)
                   acl2::x)
      :rule-classes (:rewrite :rewrite-quoted-constant))

    Theorem: equal-of-jtype-fix-1-forward-to-jtype-equiv

    (defthm equal-of-jtype-fix-1-forward-to-jtype-equiv
      (implies (equal (jtype-fix acl2::x) acl2::y)
               (jtype-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)

    Theorem: equal-of-jtype-fix-2-forward-to-jtype-equiv

    (defthm equal-of-jtype-fix-2-forward-to-jtype-equiv
      (implies (equal acl2::x (jtype-fix acl2::y))
               (jtype-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)

    Theorem: jtype-equiv-of-jtype-fix-1-forward

    (defthm jtype-equiv-of-jtype-fix-1-forward
      (implies (jtype-equiv (jtype-fix acl2::x)
                            acl2::y)
               (jtype-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)

    Theorem: jtype-equiv-of-jtype-fix-2-forward

    (defthm jtype-equiv-of-jtype-fix-2-forward
      (implies (jtype-equiv acl2::x (jtype-fix acl2::y))
               (jtype-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)

    Theorem: jtype-kind$inline-of-jtype-fix-x

    (defthm jtype-kind$inline-of-jtype-fix-x
      (equal (jtype-kind$inline (jtype-fix x))
             (jtype-kind$inline x)))

    Theorem: jtype-kind$inline-jtype-equiv-congruence-on-x

    (defthm jtype-kind$inline-jtype-equiv-congruence-on-x
      (implies (jtype-equiv x x-equiv)
               (equal (jtype-kind$inline x)
                      (jtype-kind$inline x-equiv)))
      :rule-classes :congruence)

    Theorem: consp-of-jtype-fix

    (defthm consp-of-jtype-fix
      (consp (jtype-fix x))
      :rule-classes :type-prescription)