• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • 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
        • Soft
        • C
        • Bv
        • Imp-language
        • Event-macros
        • Java
        • Bitcoin
        • Ethereum
        • Yul
        • Zcash
        • ACL2-programming-language
        • Prime-fields
        • Json
        • Syntheto
          • Process-syntheto-toplevel-fn
          • Translation
          • Language
            • Static-semantics
              • Check-expression-fns
              • Subtypep
              • Match-type
              • Check-product-update-expression
              • Get-builtin-function-in/out/pre-post
              • Check-sum-update-expression
              • Check-sum-field-expression
              • Check-strict-binary-expression
              • Check-lt/le/gt/ge-expression
              • Check-eq/ne-expression
              • Check-div/rem-expression
              • Check-add/sub/mul-expression
              • Align-let-vars-values
              • Check-iff-expression
              • Check-function-definition-top/nontop
              • Check-sum-construct-expression
              • Check-rem-expression
              • Check-mul-expression
              • Check-sub-expression
              • Check-div-expression
              • Check-add-expression
              • Check-ne-expression
              • Check-lt-expression
              • Check-le-expression
              • Check-gt-expression
              • Check-ge-expression
              • Check-eq-expression
              • Check-function-specifier
              • Type-result
              • Check-product-construct-expression
              • Supremum-type
              • Check-call-expression
              • Check-product-field-expression
              • Check-function-definer
              • Make-subproof-obligations
              • Get-function-in/out/pre/post
              • Check-sum-test-expression
              • Match-field
              • Decompose-expression
              • Match-to-target
              • Check-unary-expression
              • Max-supertype
              • Match-type-list
              • Check-minus-expression
              • Check-type-definition
              • Check-not-expression
              • Check-type-product
              • Match-field-list
              • Check-type-subset
              • Check-type-definition-in-recursion
              • Align-let-vars-values-aux
              • Non-trivial-proof-obligation
              • Check-type-recursion
              • Check-function-specification
              • Check-toplevel
              • Supremum-type-list
              • Check-component-expression
              • Check-branch-list
              • Check-function-recursion
              • Check-function-definition
              • Binding
              • Check-function-header
              • Check-function-definition-list
              • Check-type-definition-list-in-recursion
              • Check-theorem
              • Check-nonstrict-binary-expression
              • Context-add-variables
              • Decompose-expression-aux
              • Check-alternative
              • Check-multi-expression
              • Check-type-sum
              • Check-type
              • Check-alternative-list
              • Context-add-condition
              • Check-type-definer
              • Check-transform
              • Check-variable
              • Check-transform-args
              • Check-toplevel-list
              • Context-add-condition-list
              • Check-if/when/unless-expression
              • Initializers-to-variable-substitution
              • Context-add-binding
              • Check-function-header-list
              • Context-add-toplevel
              • Ensure-single-type
              • Max-supertypes
              • Check-bind-expression
              • Check-type-list
              • Check-literal
              • Literal-type
              • Check-expression-list
              • Variable-context
                • Variable-context-fix
                  • Variable-contextp
                  • Variable-context-equiv
                  • Typed-variables-to-variable-context
                • Check-cond-expression
                • Check-branch
                • Args-without-defaults
                • Check-expression
                • *builtin-function-names*
                • Function-called-in
              • Abstract-syntax
              • Outcome
              • Abstract-syntax-operations
              • Outcome-list
              • Outcomes
            • Process-syntheto-toplevel
            • Shallow-embedding
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Variable-context

    Variable-context-fix

    (variable-context-fix x) is a usual ACL2::fty omap fixing function.

    Signature
    (variable-context-fix x) → *
    Arguments
    x — Guard (variable-contextp x).

    Definitions and Theorems

    Function: variable-context-fix

    (defun variable-context-fix (x)
      (declare (xargs :guard (variable-contextp x)))
      (mbe :logic (if (variable-contextp x) x nil)
           :exec x))

    Theorem: variable-contextp-of-variable-context-fix

    (defthm variable-contextp-of-variable-context-fix
      (variable-contextp (variable-context-fix x)))

    Theorem: variable-context-fix-when-variable-contextp

    (defthm variable-context-fix-when-variable-contextp
      (implies (variable-contextp x)
               (equal (variable-context-fix x) x)))

    Theorem: emptyp-variable-context-fix

    (defthm emptyp-variable-context-fix
      (implies (or (omap::emptyp x)
                   (not (variable-contextp x)))
               (omap::emptyp (variable-context-fix x))))

    Theorem: emptyp-of-variable-context-fix-to-not-variable-context-or-emptyp

    (defthm
       emptyp-of-variable-context-fix-to-not-variable-context-or-emptyp
      (equal (omap::emptyp (variable-context-fix x))
             (or (not (variable-contextp x))
                 (omap::emptyp x))))

    Function: variable-context-equiv$inline

    (defun variable-context-equiv$inline (acl2::x acl2::y)
      (declare (xargs :guard (and (variable-contextp acl2::x)
                                  (variable-contextp acl2::y))))
      (equal (variable-context-fix acl2::x)
             (variable-context-fix acl2::y)))

    Theorem: variable-context-equiv-is-an-equivalence

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

    Theorem: variable-context-equiv-implies-equal-variable-context-fix-1

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

    Theorem: variable-context-fix-under-variable-context-equiv

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

    Theorem: equal-of-variable-context-fix-1-forward-to-variable-context-equiv

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

    Theorem: equal-of-variable-context-fix-2-forward-to-variable-context-equiv

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

    Theorem: variable-context-equiv-of-variable-context-fix-1-forward

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

    Theorem: variable-context-equiv-of-variable-context-fix-2-forward

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