• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Riscv
      • Taspi
      • Bitcoin
      • Des
      • Ethereum
      • X86isa
      • Sha-2
      • Yul
      • Zcash
      • Proof-checker-itp13
      • Regex
      • ACL2-programming-language
      • Json
      • Jfkr
      • Equational
      • Cryptography
      • Poseidon
      • Where-do-i-place-my-book
      • Axe
      • Aleo
        • Aleobft
        • Aleovm
        • Leo
          • Grammar
          • Early-version
            • Json2ast
            • Testing
            • Definition
              • Flattening
              • Abstract-syntax
              • Dynamic-semantics
                • Execution
                  • Exec-expressions/statements
                  • Init-for-loop
                  • Exec-file-main
                  • Update-variable-value-in-scope-list
                  • Step-for-loop
                  • Update-variable-value-in-scope
                  • Expr-value-to-value
                  • Exec-binary
                  • Exec-expression
                  • Init-vcscope-dinfo-call
                  • Value?+denv
                  • Exec-statement
                  • End-of-for-loop-p
                  • Expr-value
                    • Expr-value-case
                    • Expr-value-fix
                      • Expr-value-equiv
                      • Expr-valuep
                      • Expr-value-value
                      • Expr-value-location
                      • Expr-value-kind
                    • Evalue+denv
                    • Write-location
                    • Read-location
                    • Exec-for-loop-iterations
                    • Update-variable-value
                    • Exec-unary
                    • Values+denv
                    • Init-vcscope-dinfo-loop
                    • Extend-denv-with-structdecl
                    • Exec-var/const
                    • Valuemap+denv
                    • Namevalue+denv
                    • Extend-denv-with-fundecl
                    • Ensure-boolean
                    • Int+denv
                    • Push-vcscope-dinfo
                    • Extend-denv-with-topdecl-list
                    • Exec-literal
                    • Build-denv-from-file
                    • Namevalue+denv-result
                    • Extend-denv-with-topdecl
                    • Evalue+denv-result
                    • Value?+denv-result
                    • Values+denv-result
                    • Valuemap+denv-result
                    • Int+denv-result
                    • Push-call-dinfo
                    • Exec-print
                    • Pop-vcscope-dinfo
                    • Exec-if
                    • Exec-function
                    • Pop-call-dinfo
                    • Exec-statement-list
                    • Exec-block
                    • Exec-struct-init-list
                    • Exec-struct-init
                    • Exec-expression-list
                  • Values
                  • Dynamic-environments
                  • Arithmetic-operations
                  • Curve-parameterization
                  • Shift-operations
                  • Errors
                  • Value-expressions
                  • Locations
                  • Input-execution
                  • Edwards-bls12-generator
                  • Equality-operations
                  • Logical-operations
                  • Program-execution
                  • Ordering-operations
                  • Bitwise-operations
                  • Literal-evaluation
                  • Type-maps-for-struct-components
                  • Output-execution
                  • Tuple-operations
                  • Struct-operations
                • Compilation
                • Static-semantics
                • Concrete-syntax
        • 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
    • Expr-value

    Expr-value-fix

    Fixing function for expr-value structures.

    Signature
    (expr-value-fix x) → new-x
    Arguments
    x — Guard (expr-valuep x).
    Returns
    new-x — Type (expr-valuep new-x).

    Definitions and Theorems

    Function: expr-value-fix$inline

    (defun expr-value-fix$inline (x)
     (declare (xargs :guard (expr-valuep x)))
     (let ((__function__ 'expr-value-fix))
      (declare (ignorable __function__))
      (mbe
         :logic
         (case (expr-value-kind x)
           (:location (b* ((get (location-fix (std::da-nth 0 (cdr x)))))
                        (cons :location (list get))))
           (:value (b* ((get (value-fix (std::da-nth 0 (cdr x)))))
                     (cons :value (list get)))))
         :exec x)))

    Theorem: expr-valuep-of-expr-value-fix

    (defthm expr-valuep-of-expr-value-fix
      (b* ((new-x (expr-value-fix$inline x)))
        (expr-valuep new-x))
      :rule-classes :rewrite)

    Theorem: expr-value-fix-when-expr-valuep

    (defthm expr-value-fix-when-expr-valuep
      (implies (expr-valuep x)
               (equal (expr-value-fix x) x)))

    Function: expr-value-equiv$inline

    (defun expr-value-equiv$inline (acl2::x acl2::y)
      (declare (xargs :guard (and (expr-valuep acl2::x)
                                  (expr-valuep acl2::y))))
      (equal (expr-value-fix acl2::x)
             (expr-value-fix acl2::y)))

    Theorem: expr-value-equiv-is-an-equivalence

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

    Theorem: expr-value-equiv-implies-equal-expr-value-fix-1

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

    Theorem: expr-value-fix-under-expr-value-equiv

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

    Theorem: equal-of-expr-value-fix-1-forward-to-expr-value-equiv

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

    Theorem: equal-of-expr-value-fix-2-forward-to-expr-value-equiv

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

    Theorem: expr-value-equiv-of-expr-value-fix-1-forward

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

    Theorem: expr-value-equiv-of-expr-value-fix-2-forward

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

    Theorem: expr-value-kind$inline-of-expr-value-fix-x

    (defthm expr-value-kind$inline-of-expr-value-fix-x
      (equal (expr-value-kind$inline (expr-value-fix x))
             (expr-value-kind$inline x)))

    Theorem: expr-value-kind$inline-expr-value-equiv-congruence-on-x

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

    Theorem: consp-of-expr-value-fix

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