• 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
        • Svex-compose-dfs
        • Svex-compilation
        • Moddb
        • Svmods
        • Svstmt
        • Sv-tutorial
        • Expressions
          • Rewriting
          • Svex
          • Bit-blasting
          • Functions
          • 4vmask
          • Why-infinite-width
          • Svex-vars
          • Evaluation
            • Svex-xeval
            • Svex-mono-eval
            • Svex-eval
            • Svex-apply
            • Svex-env
              • Svex-env-p
              • Svex-env-reduce
              • Svex-envs-similar
              • Svex-envs-equivalent
              • Svex-env-fix
                • Svex-env-extract
                • Svex-env-lookup
                • Svex-env-acons
                • Svex-env-<<=
                • Svarlist-x-subst
                • Svex-env-equiv
                • Svex-env-boundp
                • Svarlist-x-env
                • Svex-env-fastlookup
              • Svex-alist-eval
              • Svar-boolmasks-lookup
              • Svex-s4eval
              • Svexlist-unquote
              • Svex-alist-eval-for-symbolic
              • Svexlist-eval
              • Svexlist-quotesp
              • Svar-boolmasks
              • Svexlist-s4eval
              • Svexlist-eval-for-symbolic
            • Values
          • Symbolic-test-vector
          • Vl-to-svex
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Svex-env

    Svex-env-fix

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

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

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

    Definitions and Theorems

    Function: svex-env-fix$inline

    (defun svex-env-fix$inline (x)
      (declare (xargs :guard (svex-env-p x)))
      (let ((__function__ 'svex-env-fix))
        (declare (ignorable __function__))
        (mbe :logic
             (if (atom x)
                 nil
               (let ((rest (svex-env-fix (cdr x))))
                 (if (and (consp (car x)) (svar-p (caar x)))
                     (let ((fty::first-key (caar x))
                           (fty::first-val (4vec-fix (cdar x))))
                       (cons (cons fty::first-key fty::first-val)
                             rest))
                   rest)))
             :exec x)))

    Theorem: svex-env-p-of-svex-env-fix

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

    Theorem: svex-env-fix-when-svex-env-p

    (defthm svex-env-fix-when-svex-env-p
      (implies (svex-env-p x)
               (equal (svex-env-fix x) x)))

    Function: svex-env-equiv$inline

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

    Theorem: svex-env-equiv-is-an-equivalence

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

    Theorem: svex-env-equiv-implies-equal-svex-env-fix-1

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

    Theorem: svex-env-fix-under-svex-env-equiv

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

    Theorem: equal-of-svex-env-fix-1-forward-to-svex-env-equiv

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

    Theorem: equal-of-svex-env-fix-2-forward-to-svex-env-equiv

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

    Theorem: svex-env-equiv-of-svex-env-fix-1-forward

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

    Theorem: svex-env-equiv-of-svex-env-fix-2-forward

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

    Theorem: cons-of-4vec-fix-v-under-svex-env-equiv

    (defthm cons-of-4vec-fix-v-under-svex-env-equiv
      (svex-env-equiv (cons (cons acl2::k (4vec-fix acl2::v))
                            x)
                      (cons (cons acl2::k acl2::v) x)))

    Theorem: cons-4vec-equiv-congruence-on-v-under-svex-env-equiv

    (defthm cons-4vec-equiv-congruence-on-v-under-svex-env-equiv
      (implies (4vec-equiv acl2::v v-equiv)
               (svex-env-equiv (cons (cons acl2::k acl2::v) x)
                               (cons (cons acl2::k v-equiv) x)))
      :rule-classes :congruence)

    Theorem: cons-of-svex-env-fix-y-under-svex-env-equiv

    (defthm cons-of-svex-env-fix-y-under-svex-env-equiv
      (svex-env-equiv (cons x (svex-env-fix y))
                      (cons x y)))

    Theorem: cons-svex-env-equiv-congruence-on-y-under-svex-env-equiv

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

    Theorem: svex-env-fix-of-acons

    (defthm svex-env-fix-of-acons
      (equal (svex-env-fix (cons (cons acl2::a acl2::b) x))
             (let ((rest (svex-env-fix x)))
               (if (and (svar-p acl2::a))
                   (let ((fty::first-key acl2::a)
                         (fty::first-val (4vec-fix acl2::b)))
                     (cons (cons fty::first-key fty::first-val)
                           rest))
                 rest))))

    Theorem: hons-assoc-equal-of-svex-env-fix

    (defthm hons-assoc-equal-of-svex-env-fix
      (equal (hons-assoc-equal acl2::k (svex-env-fix x))
             (let ((fty::pair (hons-assoc-equal acl2::k x)))
               (and (svar-p acl2::k)
                    fty::pair
                    (cons acl2::k (4vec-fix (cdr fty::pair)))))))

    Theorem: svex-env-fix-of-append

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

    Theorem: consp-car-of-svex-env-fix

    (defthm consp-car-of-svex-env-fix
      (equal (consp (car (svex-env-fix x)))
             (consp (svex-env-fix x))))