• 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
          • Transformations
          • Language
            • Abstract-syntax
            • Dynamic-semantics
              • Exec
              • Find-fun
              • Init-local
              • Write-vars-values
              • Add-vars-values
              • Add-funs
              • Eoutcome
              • Soutcome
              • Ensure-funscope-disjoint
              • Write-var-value
              • Restrict-vars
              • Add-var-value
              • Funinfo
              • Exec-top-block
              • Values
              • Cstate
              • Funinfo+funenv
              • Read-vars-values
              • Read-var-value
              • Funenv
              • Funscope-for-fundefs
              • Exec-path
              • Path-to-var
              • Funinfo+funenv-result
              • Exec-literal
              • Soutcome-result
              • Mode-set-result
              • Literal-evaluation
              • Funscope-result
              • Funinfo-result
              • Funenv-result
              • Eoutcome-result
              • Cstate-result
              • Paths-to-vars
              • Funinfo-for-fundef
              • Lstate
              • Funscope
                • Funscopep
                • Funscope-fix
                  • Funscope-equiv
                • Mode-set
                • Modes
              • Concrete-syntax
              • Static-soundness
              • Static-semantics
              • Errors
            • Yul-json
          • 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
    • Funscope

    Funscope-fix

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

    Signature
    (funscope-fix x) → *
    Arguments
    x — Guard (funscopep x).

    Definitions and Theorems

    Function: funscope-fix

    (defun funscope-fix (x)
      (declare (xargs :guard (funscopep x)))
      (mbe :logic (if (funscopep x) x nil)
           :exec x))

    Theorem: funscopep-of-funscope-fix

    (defthm funscopep-of-funscope-fix
      (funscopep (funscope-fix x)))

    Theorem: funscope-fix-when-funscopep

    (defthm funscope-fix-when-funscopep
      (implies (funscopep x)
               (equal (funscope-fix x) x)))

    Theorem: emptyp-funscope-fix

    (defthm emptyp-funscope-fix
      (implies (or (omap::emptyp x)
                   (not (funscopep x)))
               (omap::emptyp (funscope-fix x))))

    Theorem: emptyp-of-funscope-fix-to-not-funscope-or-emptyp

    (defthm emptyp-of-funscope-fix-to-not-funscope-or-emptyp
      (equal (omap::emptyp (funscope-fix x))
             (or (not (funscopep x))
                 (omap::emptyp x))))

    Function: funscope-equiv$inline

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

    Theorem: funscope-equiv-is-an-equivalence

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

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

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

    Theorem: funscope-fix-under-funscope-equiv

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

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

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

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

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

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

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

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

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