• 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
              • Jfield
              • Jexprs
              • Jliteral
              • Junop
              • Jlocvar
              • Jcunit
              • Jaccess
              • Maybe-jexpr
              • Jparam
              • Jimport
              • Jcinitializer
              • Jresult
                • Jresult-case
                • Jresult-fix
                  • Jresult-equiv
                  • Jresult-type
                  • Jresultp
                  • Jresult-void
                  • Jresult-kind
                • 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
    • Jresult

    Jresult-fix

    Fixing function for jresult structures.

    Signature
    (jresult-fix x) → new-x
    Arguments
    x — Guard (jresultp x).
    Returns
    new-x — Type (jresultp new-x).

    Definitions and Theorems

    Function: jresult-fix$inline

    (defun jresult-fix$inline (x)
      (declare (xargs :guard (jresultp x)))
      (let ((__function__ 'jresult-fix))
        (declare (ignorable __function__))
        (mbe :logic
             (case (jresult-kind x)
               (:type (b* ((get (jtype-fix (std::da-nth 0 (cdr x)))))
                        (cons :type (list get))))
               (:void (cons :void (list))))
             :exec x)))

    Theorem: jresultp-of-jresult-fix

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

    Theorem: jresult-fix-when-jresultp

    (defthm jresult-fix-when-jresultp
      (implies (jresultp x)
               (equal (jresult-fix x) x)))

    Function: jresult-equiv$inline

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

    Theorem: jresult-equiv-is-an-equivalence

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

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

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

    Theorem: jresult-fix-under-jresult-equiv

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

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

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

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

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

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

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

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

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

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

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

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

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

    Theorem: consp-of-jresult-fix

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