• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Taspi
      • Bitcoin
      • Riscv
      • Des
      • Ethereum
      • X86isa
      • Sha-2
      • 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
              • Funenv-fix
                • Funenvp
                • Funenv-equiv
              • 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
              • Mode-set
              • Modes
            • Concrete-syntax
            • Static-soundness
            • Static-semantics
            • Errors
          • Yul-json
        • Zcash
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Poseidon
        • Where-do-i-place-my-book
        • Axe
        • Bigmems
        • Builtins
        • Execloader
        • Aleo
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Funenv

    Funenv-fix

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

    Signature
    (funenv-fix x) → fty::newx
    Arguments
    x — Guard (funenvp x).
    Returns
    fty::newx — Type (funenvp fty::newx).

    In the logic, we apply funscope-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: funenv-fix$inline

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

    Theorem: funenvp-of-funenv-fix

    (defthm funenvp-of-funenv-fix
      (b* ((fty::newx (funenv-fix$inline x)))
        (funenvp fty::newx))
      :rule-classes :rewrite)

    Theorem: funenv-fix-when-funenvp

    (defthm funenv-fix-when-funenvp
      (implies (funenvp x)
               (equal (funenv-fix x) x)))

    Function: funenv-equiv$inline

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

    Theorem: funenv-equiv-is-an-equivalence

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

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

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

    Theorem: funenv-fix-under-funenv-equiv

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

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

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

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

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

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

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

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

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

    Theorem: car-of-funenv-fix-x-under-funscope-equiv

    (defthm car-of-funenv-fix-x-under-funscope-equiv
      (funscope-equiv (car (funenv-fix acl2::x))
                      (car acl2::x)))

    Theorem: car-funenv-equiv-congruence-on-x-under-funscope-equiv

    (defthm car-funenv-equiv-congruence-on-x-under-funscope-equiv
      (implies (funenv-equiv acl2::x x-equiv)
               (funscope-equiv (car acl2::x)
                               (car x-equiv)))
      :rule-classes :congruence)

    Theorem: cdr-of-funenv-fix-x-under-funenv-equiv

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

    Theorem: cdr-funenv-equiv-congruence-on-x-under-funenv-equiv

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

    Theorem: cons-of-funscope-fix-x-under-funenv-equiv

    (defthm cons-of-funscope-fix-x-under-funenv-equiv
      (funenv-equiv (cons (funscope-fix acl2::x) acl2::y)
                    (cons acl2::x acl2::y)))

    Theorem: cons-funscope-equiv-congruence-on-x-under-funenv-equiv

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

    Theorem: cons-of-funenv-fix-y-under-funenv-equiv

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

    Theorem: cons-funenv-equiv-congruence-on-y-under-funenv-equiv

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

    Theorem: consp-of-funenv-fix

    (defthm consp-of-funenv-fix
      (equal (consp (funenv-fix acl2::x))
             (consp acl2::x)))

    Theorem: funenv-fix-under-iff

    (defthm funenv-fix-under-iff
      (iff (funenv-fix acl2::x)
           (consp acl2::x)))

    Theorem: funenv-fix-of-cons

    (defthm funenv-fix-of-cons
      (equal (funenv-fix (cons a x))
             (cons (funscope-fix a) (funenv-fix x))))

    Theorem: len-of-funenv-fix

    (defthm len-of-funenv-fix
      (equal (len (funenv-fix acl2::x))
             (len acl2::x)))

    Theorem: funenv-fix-of-append

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

    Theorem: funenv-fix-of-repeat

    (defthm funenv-fix-of-repeat
      (equal (funenv-fix (repeat acl2::n acl2::x))
             (repeat acl2::n (funscope-fix acl2::x))))

    Theorem: list-equiv-refines-funenv-equiv

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

    Theorem: nth-of-funenv-fix

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

    Theorem: funenv-equiv-implies-funenv-equiv-append-1

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

    Theorem: funenv-equiv-implies-funenv-equiv-append-2

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

    Theorem: funenv-equiv-implies-funenv-equiv-nthcdr-2

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

    Theorem: funenv-equiv-implies-funenv-equiv-take-2

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