• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Debugging
    • Projects
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
        • Svex-stvs
        • Svex-fixpoint-decomposition-methodology
        • Sv-versus-esim
        • Svex-decomp
        • Svex-compose-dfs
        • Moddb
        • Svex-compilation
        • Svmods
        • Svstmt
        • Sv-tutorial
        • Expressions
          • Rewriting
          • Svex
            • Svar
            • Least-fixpoint
            • Svex-p
            • Svex-select
            • Svex-alist
              • Svex-alist-p
              • Svex-alist-fix
                • Svex-alist-vars
                • Svex-alist-eval
                • Svex-lookup
                • Svex-fastacons
                • Svex-alist-vals
                • Svex-acons
                • Svex-alist-keys
                • Svex-alist-equiv
                • Svex-fastlookup
              • Svex-equiv
              • Svexlist
              • Svex-call
              • Fnsym
              • Svex-quote
              • Svex-var
              • Svcall-rw
              • Svcall
              • Svex-kind
              • Svcall*
              • Svex-fix
              • Svex-count
              • Svex-1z
              • Svex-1x
              • Svex-z
              • Svex-x
            • Bit-blasting
            • Functions
            • 4vmask
            • Why-infinite-width
            • Svex-vars
            • Evaluation
            • Values
          • Symbolic-test-vector
          • Vl-to-svex
        • Fgl
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Testing-utilities
      • Math
    • Svex-alist

    Svex-alist-fix

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

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

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

    Definitions and Theorems

    Function: svex-alist-fix$inline

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

    Theorem: svex-alist-p-of-svex-alist-fix

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

    Theorem: svex-alist-fix-when-svex-alist-p

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

    Function: svex-alist-equiv$inline

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

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

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

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

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

    Theorem: svex-alist-fix-under-svex-alist-equiv

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Theorem: svex-alist-fix-of-acons

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

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

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

    Theorem: svex-alist-fix-of-append

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

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

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