• 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
            • Abstract-syntax
            • Integer-ranges
            • Implementation-environments
            • Dynamic-semantics
            • Static-semantics
            • Grammar
            • Integer-formats
            • Types
            • Portable-ascii-identifiers
            • Values
            • Integer-operations
            • Computation-states
              • Write-object
              • Objdesign-of-var
              • Compustate-scopes-numbers
              • Create-var
              • Read-object
              • Compustate
              • Frame
              • Enter-scope
              • Compustate-scopes-numbers-aux
              • Compustate-option
              • Push-frame
              • Exit-scope
              • Compustate-frames-number
              • Compustate-option-result
              • Scope-list-result
              • Pop-frame
              • Compustate-result
              • Scope-result
              • Compustate-top-frame-scopes-number
              • Top-frame
              • Heap
              • Scope
                • Scope-fix
                  • Scopep
                  • Scope-equiv
                • Scope-list
                • Frame-list
              • Object-designators
              • Operations
              • Errors
              • Tag-environments
              • Function-environments
              • Character-sets
              • Flexible-array-member-removal
              • Arithmetic-operations
              • Pointer-operations
              • Bytes
              • Keywords
              • Real-operations
              • Array-operations
              • Scalar-operations
              • Structure-operations
            • Representation
            • Transformation-tools
            • 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
    • Scope

    Scope-fix

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

    Signature
    (scope-fix x) → *
    Arguments
    x — Guard (scopep x).

    Definitions and Theorems

    Function: scope-fix

    (defun scope-fix (x)
      (declare (xargs :guard (scopep x)))
      (mbe :logic (if (scopep x) x nil)
           :exec x))

    Theorem: scopep-of-scope-fix

    (defthm scopep-of-scope-fix
      (scopep (scope-fix x)))

    Theorem: scope-fix-when-scopep

    (defthm scope-fix-when-scopep
      (implies (scopep x)
               (equal (scope-fix x) x)))

    Theorem: emptyp-scope-fix

    (defthm emptyp-scope-fix
      (implies (or (omap::emptyp x) (not (scopep x)))
               (omap::emptyp (scope-fix x))))

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

    (defthm emptyp-of-scope-fix-to-not-scope-or-emptyp
      (equal (omap::emptyp (scope-fix x))
             (or (not (scopep x)) (omap::emptyp x))))

    Function: scope-equiv$inline

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

    Theorem: scope-equiv-is-an-equivalence

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

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

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

    Theorem: scope-fix-under-scope-equiv

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

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

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

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

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

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

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

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

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