• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
        • Svex-stvs
        • Svex-decomposition-methodology
        • Sv-versus-esim
        • Svex-decomp
          • Decomp.lisp
            • Svex-env-compat-union
            • Svdecomp-symenv-compat-union
            • Svexlists-rewrite-until-same
            • Svdecomp-normalize-svexlist-eval
            • Svex-decomp-process-env-term
            • Map-alist-term-keys-to-val-terms
            • Envmap-extract-union-env
            • Alist-collect-compositions
            • Envmap-entry-extract-env
            • Svdecomp-env-extract
            • Svex-alist-evaluation-to-symenv
            • Envmap-entry-to-term-alist
            • Svar-lookup
            • Svar-alist-keys
            • Map-alist-const-keys-to-val-terms
            • Svdecomp-svex?-eval-compare-term
            • Svdecomp-equal-svex-evals-metafun
            • Svdecomp-equal-svex-alist-evals-metafun
            • Envmap->svex-alist
            • Envmap-to-term-alist
            • Svdecomp-equal-svexlist-evals-metafun
            • Pseudo-term-fix
            • Svdecomp-symenv->term
            • Svdecomp-svex-alist-eval-metafun
            • Svdecomp-ev-symenv
            • Svdecomp-svexlist-eval-metafun
            • Svdecomp-svex-eval-metafun
            • Svdecomp-ev-envmap
            • Envmap
              • Envmap-p
              • Envmap-fix
                • Envmap-equiv
              • Svex-alist-alist
              • Svdecomp-symenv
              • Svdecomp-get-rewrite-limit
            • Svdecomp-hints
          • Svex-compose-dfs
          • Svex-compilation
          • Moddb
          • Svmods
          • Svstmt
          • Sv-tutorial
          • Expressions
          • Symbolic-test-vector
          • Vl-to-svex
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Envmap

    Envmap-fix

    (envmap-fix x) is an fty alist fixing function that follows the fix-keys strategy.

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

    Note that in the execution this is just an inline identity function.

    Definitions and Theorems

    Function: envmap-fix$inline

    (defun envmap-fix$inline (x)
      (declare (xargs :guard (envmap-p x)))
      (let ((__function__ 'envmap-fix))
        (declare (ignorable __function__))
        (mbe :logic
             (if (atom x)
                 x
               (if (consp (car x))
                   (cons (cons (pseudo-term-fix (caar x))
                               (svex-alist-fix (cdar x)))
                         (envmap-fix (cdr x)))
                 (envmap-fix (cdr x))))
             :exec x)))

    Theorem: envmap-p-of-envmap-fix

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

    Theorem: envmap-fix-when-envmap-p

    (defthm envmap-fix-when-envmap-p
      (implies (envmap-p x)
               (equal (envmap-fix x) x)))

    Function: envmap-equiv$inline

    (defun envmap-equiv$inline (x y)
      (declare (xargs :guard (and (envmap-p x) (envmap-p y))))
      (equal (envmap-fix x) (envmap-fix y)))

    Theorem: envmap-equiv-is-an-equivalence

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

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

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

    Theorem: envmap-fix-under-envmap-equiv

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

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

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

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

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

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

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

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

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

    Theorem: cons-of-pseudo-term-fix-k-under-envmap-equiv

    (defthm cons-of-pseudo-term-fix-k-under-envmap-equiv
      (envmap-equiv (cons (cons (pseudo-term-fix acl2::k) acl2::v)
                          x)
                    (cons (cons acl2::k acl2::v) x)))

    Theorem: cons-pseudo-term-equiv-congruence-on-k-under-envmap-equiv

    (defthm cons-pseudo-term-equiv-congruence-on-k-under-envmap-equiv
      (implies (pseudo-term-equiv acl2::k k-equiv)
               (envmap-equiv (cons (cons acl2::k acl2::v) x)
                             (cons (cons k-equiv acl2::v) x)))
      :rule-classes :congruence)

    Theorem: cons-of-svex-alist-fix-v-under-envmap-equiv

    (defthm cons-of-svex-alist-fix-v-under-envmap-equiv
      (envmap-equiv (cons (cons acl2::k (svex-alist-fix acl2::v))
                          x)
                    (cons (cons acl2::k acl2::v) x)))

    Theorem: cons-svex-alist-equiv-congruence-on-v-under-envmap-equiv

    (defthm cons-svex-alist-equiv-congruence-on-v-under-envmap-equiv
      (implies (svex-alist-equiv acl2::v v-equiv)
               (envmap-equiv (cons (cons acl2::k acl2::v) x)
                             (cons (cons acl2::k v-equiv) x)))
      :rule-classes :congruence)

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

    (defthm cons-of-envmap-fix-y-under-envmap-equiv
      (envmap-equiv (cons x (envmap-fix y))
                    (cons x y)))

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

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

    Theorem: envmap-fix-of-acons

    (defthm envmap-fix-of-acons
      (equal (envmap-fix (cons (cons acl2::a acl2::b) x))
             (cons (cons (pseudo-term-fix acl2::a)
                         (svex-alist-fix acl2::b))
                   (envmap-fix x))))

    Theorem: envmap-fix-of-append

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

    Theorem: consp-car-of-envmap-fix

    (defthm consp-car-of-envmap-fix
      (equal (consp (car (envmap-fix x)))
             (consp (envmap-fix x))))