• 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
          • Syntax-for-tools
          • Atc
          • Language
          • Representation
          • Transformation-tools
            • Simpadd0
            • Deftrans
            • Splitgso
            • Constant-propagation
              • Value-to-expr
              • Const-prop-eval-impure-binop-expr
              • Env
                • Envp
                • Env-fix
                • Union-env
                • Env-equiv
                • Write-env
                • Declare-var-env
                • Read-env
                • Push-scope-env
                • In-scope-env
                • Pop-scope-env
                • Merge-block-env
                • Env-block
                  • Env-blockp
                  • Env-block-fix
                    • Env-block-equiv
                • Const-prop-eval-pure-binop-expr
                • Const-prop-filepath-transunit-map
                • Const-prop-eval-unop-expr
                • Const-prop-transunit-ensemble
                • Const-prop-fundef
                • Value-result-to-option
                • Const-prop-extdecl-list
                • Const-prop-extdecl
                • Zero-valuep
                • Iconst-to-value
                • Const-to-value
                • Expr-to-ident
                • Const-prop-transunit
                • Pure-binopp
                • Const-prop-initdeclor-list
                • Const-prop-initdeclor
                • Const-prop-structdeclor-list
                • Const-prop-structdecl-list
                • Const-prop-param-declon-list
                • Const-prop-initer-option
                • Const-prop-initer
                • Const-prop-expr-option
                • Const-prop-dirabsdeclor-option
                • Const-prop-dirabsdeclor
                • Const-prop-const-expr-option
                • Const-prop-absdeclor-option
                • Const-prop-type-spec
                • Const-prop-strunispec
                • Const-prop-structdeclor
                • Const-prop-structdecl
                • Const-prop-statassert
                • Const-prop-spec/qual-list
                • Const-prop-spec/qual
                • Const-prop-param-declor
                • Const-prop-param-declon
                • Const-prop-member-designor
                • Const-prop-genassoc-list
                • Const-prop-genassoc
                • Const-prop-expr-list
                • Const-prop-expr
                • Const-prop-enumspec
                • Const-prop-enumer-list
                • Const-prop-dirdeclor
                • Const-prop-desiniter-list
                • Const-prop-desiniter
                • Const-prop-designor-list
                • Const-prop-designor
                • Const-prop-declor-option
                • Const-prop-decl-spec-list
                • Const-prop-decl-spec
                • Const-prop-decl-list
                • Const-prop-block-item-list
                • Const-prop-align-spec
                • Const-prop-absdeclor
                • Const-prop-tyname
                • Const-prop-stmt
                • Const-prop-label
                • Const-prop-enumer
                • Const-prop-declor
                • Const-prop-decl
                • Const-prop-const-expr
                • Const-prop-block-item
              • Split-fn
              • Copy-fn
              • Specialize
              • Split-all-gso
              • Rename
              • Utilities
            • Insertion-sort
            • Pack
          • Bv
          • Imp-language
          • Event-macros
          • Java
          • Bitcoin
          • Ethereum
          • Yul
          • Zcash
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Env-block

    Env-block-fix

    (env-block-fix x) is a usual ACL2::fty omap fixing function.

    Signature
    (env-block-fix x) → *
    Arguments
    x — Guard (env-blockp x).

    Definitions and Theorems

    Function: env-block-fix

    (defun env-block-fix (x)
      (declare (xargs :guard (env-blockp x)))
      (mbe :logic (if (env-blockp x) x nil)
           :exec x))

    Theorem: env-blockp-of-env-block-fix

    (defthm env-blockp-of-env-block-fix
      (env-blockp (env-block-fix x)))

    Theorem: env-block-fix-when-env-blockp

    (defthm env-block-fix-when-env-blockp
      (implies (env-blockp x)
               (equal (env-block-fix x) x)))

    Theorem: emptyp-env-block-fix

    (defthm emptyp-env-block-fix
      (implies (or (omap::emptyp x)
                   (not (env-blockp x)))
               (omap::emptyp (env-block-fix x))))

    Theorem: emptyp-of-env-block-fix-to-not-env-block-or-emptyp

    (defthm emptyp-of-env-block-fix-to-not-env-block-or-emptyp
      (equal (omap::emptyp (env-block-fix x))
             (or (not (env-blockp x))
                 (omap::emptyp x))))

    Function: env-block-equiv$inline

    (defun env-block-equiv$inline (acl2::x acl2::y)
      (declare (xargs :guard (and (env-blockp acl2::x)
                                  (env-blockp acl2::y))))
      (equal (env-block-fix acl2::x)
             (env-block-fix acl2::y)))

    Theorem: env-block-equiv-is-an-equivalence

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

    Theorem: env-block-equiv-implies-equal-env-block-fix-1

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

    Theorem: env-block-fix-under-env-block-equiv

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

    Theorem: equal-of-env-block-fix-1-forward-to-env-block-equiv

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

    Theorem: equal-of-env-block-fix-2-forward-to-env-block-equiv

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

    Theorem: env-block-equiv-of-env-block-fix-1-forward

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

    Theorem: env-block-equiv-of-env-block-fix-2-forward

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