• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • 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-list
                • Scope-list-fix
                  • Scope-list-equiv
                  • Scope-listp
                • 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
            • Transformation-tools
            • Representation
            • Insertion-sort
            • Pack
          • Bv
          • Imp-language
          • Event-macros
          • Java
          • Riscv
          • 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-list

    Scope-list-fix

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

    Signature
    (scope-list-fix x) → fty::newx
    Arguments
    x — Guard (scope-listp x).
    Returns
    fty::newx — Type (scope-listp fty::newx).

    In the logic, we apply scope-fix to each member of the x. In the execution, none of that is actually necessary and this is just an inlined identity function.

    Definitions and Theorems

    Function: scope-list-fix$inline

    (defun scope-list-fix$inline (x)
      (declare (xargs :guard (scope-listp x)))
      (let ((__function__ 'scope-list-fix))
        (declare (ignorable __function__))
        (mbe :logic
             (if (atom x)
                 nil
               (cons (scope-fix (car x))
                     (scope-list-fix (cdr x))))
             :exec x)))

    Theorem: scope-listp-of-scope-list-fix

    (defthm scope-listp-of-scope-list-fix
      (b* ((fty::newx (scope-list-fix$inline x)))
        (scope-listp fty::newx))
      :rule-classes :rewrite)

    Theorem: scope-list-fix-when-scope-listp

    (defthm scope-list-fix-when-scope-listp
      (implies (scope-listp x)
               (equal (scope-list-fix x) x)))

    Function: scope-list-equiv$inline

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

    Theorem: scope-list-equiv-is-an-equivalence

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

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

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

    Theorem: scope-list-fix-under-scope-list-equiv

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

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

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

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

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

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

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

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

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

    Theorem: car-of-scope-list-fix-x-under-scope-equiv

    (defthm car-of-scope-list-fix-x-under-scope-equiv
      (scope-equiv (car (scope-list-fix acl2::x))
                   (car acl2::x)))

    Theorem: car-scope-list-equiv-congruence-on-x-under-scope-equiv

    (defthm car-scope-list-equiv-congruence-on-x-under-scope-equiv
      (implies (scope-list-equiv acl2::x x-equiv)
               (scope-equiv (car acl2::x)
                            (car x-equiv)))
      :rule-classes :congruence)

    Theorem: cdr-of-scope-list-fix-x-under-scope-list-equiv

    (defthm cdr-of-scope-list-fix-x-under-scope-list-equiv
      (scope-list-equiv (cdr (scope-list-fix acl2::x))
                        (cdr acl2::x)))

    Theorem: cdr-scope-list-equiv-congruence-on-x-under-scope-list-equiv

    (defthm cdr-scope-list-equiv-congruence-on-x-under-scope-list-equiv
      (implies (scope-list-equiv acl2::x x-equiv)
               (scope-list-equiv (cdr acl2::x)
                                 (cdr x-equiv)))
      :rule-classes :congruence)

    Theorem: cons-of-scope-fix-x-under-scope-list-equiv

    (defthm cons-of-scope-fix-x-under-scope-list-equiv
      (scope-list-equiv (cons (scope-fix acl2::x) acl2::y)
                        (cons acl2::x acl2::y)))

    Theorem: cons-scope-equiv-congruence-on-x-under-scope-list-equiv

    (defthm cons-scope-equiv-congruence-on-x-under-scope-list-equiv
      (implies (scope-equiv acl2::x x-equiv)
               (scope-list-equiv (cons acl2::x acl2::y)
                                 (cons x-equiv acl2::y)))
      :rule-classes :congruence)

    Theorem: cons-of-scope-list-fix-y-under-scope-list-equiv

    (defthm cons-of-scope-list-fix-y-under-scope-list-equiv
      (scope-list-equiv (cons acl2::x (scope-list-fix acl2::y))
                        (cons acl2::x acl2::y)))

    Theorem: cons-scope-list-equiv-congruence-on-y-under-scope-list-equiv

    (defthm cons-scope-list-equiv-congruence-on-y-under-scope-list-equiv
      (implies (scope-list-equiv acl2::y y-equiv)
               (scope-list-equiv (cons acl2::x acl2::y)
                                 (cons acl2::x y-equiv)))
      :rule-classes :congruence)

    Theorem: consp-of-scope-list-fix

    (defthm consp-of-scope-list-fix
      (equal (consp (scope-list-fix acl2::x))
             (consp acl2::x)))

    Theorem: scope-list-fix-under-iff

    (defthm scope-list-fix-under-iff
      (iff (scope-list-fix acl2::x)
           (consp acl2::x)))

    Theorem: scope-list-fix-of-cons

    (defthm scope-list-fix-of-cons
      (equal (scope-list-fix (cons a x))
             (cons (scope-fix a)
                   (scope-list-fix x))))

    Theorem: len-of-scope-list-fix

    (defthm len-of-scope-list-fix
      (equal (len (scope-list-fix acl2::x))
             (len acl2::x)))

    Theorem: scope-list-fix-of-append

    (defthm scope-list-fix-of-append
      (equal (scope-list-fix (append std::a std::b))
             (append (scope-list-fix std::a)
                     (scope-list-fix std::b))))

    Theorem: scope-list-fix-of-repeat

    (defthm scope-list-fix-of-repeat
      (equal (scope-list-fix (repeat acl2::n acl2::x))
             (repeat acl2::n (scope-fix acl2::x))))

    Theorem: list-equiv-refines-scope-list-equiv

    (defthm list-equiv-refines-scope-list-equiv
      (implies (list-equiv acl2::x acl2::y)
               (scope-list-equiv acl2::x acl2::y))
      :rule-classes :refinement)

    Theorem: nth-of-scope-list-fix

    (defthm nth-of-scope-list-fix
      (equal (nth acl2::n (scope-list-fix acl2::x))
             (if (< (nfix acl2::n) (len acl2::x))
                 (scope-fix (nth acl2::n acl2::x))
               nil)))

    Theorem: scope-list-equiv-implies-scope-list-equiv-append-1

    (defthm scope-list-equiv-implies-scope-list-equiv-append-1
      (implies (scope-list-equiv acl2::x fty::x-equiv)
               (scope-list-equiv (append acl2::x acl2::y)
                                 (append fty::x-equiv acl2::y)))
      :rule-classes (:congruence))

    Theorem: scope-list-equiv-implies-scope-list-equiv-append-2

    (defthm scope-list-equiv-implies-scope-list-equiv-append-2
      (implies (scope-list-equiv acl2::y fty::y-equiv)
               (scope-list-equiv (append acl2::x acl2::y)
                                 (append acl2::x fty::y-equiv)))
      :rule-classes (:congruence))

    Theorem: scope-list-equiv-implies-scope-list-equiv-nthcdr-2

    (defthm scope-list-equiv-implies-scope-list-equiv-nthcdr-2
      (implies (scope-list-equiv acl2::l l-equiv)
               (scope-list-equiv (nthcdr acl2::n acl2::l)
                                 (nthcdr acl2::n l-equiv)))
      :rule-classes (:congruence))

    Theorem: scope-list-equiv-implies-scope-list-equiv-take-2

    (defthm scope-list-equiv-implies-scope-list-equiv-take-2
      (implies (scope-list-equiv acl2::l l-equiv)
               (scope-list-equiv (take acl2::n acl2::l)
                                 (take acl2::n l-equiv)))
      :rule-classes (:congruence))