• 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
            • Svar
              • Svar-p
              • Svar-fix
              • Make-svar
              • Svar-equiv
              • Svar->props
              • Svar->delay
              • Svar->bits
              • Change-svar
              • Svarlist
              • Svar->name
              • Svar-map
                • Svar-map-p
                • Svar-map-fix
                  • Svar-map-equiv
                • Svar-alist
              • Least-fixpoint
              • Svex-p
              • Svex-select
              • Svex-alist
              • 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
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Svar-map

    Svar-map-fix

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

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

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

    Definitions and Theorems

    Function: svar-map-fix$inline

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

    Theorem: svar-map-p-of-svar-map-fix

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

    Theorem: svar-map-fix-when-svar-map-p

    (defthm svar-map-fix-when-svar-map-p
      (implies (svar-map-p x)
               (equal (svar-map-fix x) x)))

    Function: svar-map-equiv$inline

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

    Theorem: svar-map-equiv-is-an-equivalence

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

    Theorem: svar-map-equiv-implies-equal-svar-map-fix-1

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

    Theorem: svar-map-fix-under-svar-map-equiv

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

    Theorem: equal-of-svar-map-fix-1-forward-to-svar-map-equiv

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

    Theorem: equal-of-svar-map-fix-2-forward-to-svar-map-equiv

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

    Theorem: svar-map-equiv-of-svar-map-fix-1-forward

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

    Theorem: svar-map-equiv-of-svar-map-fix-2-forward

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

    Theorem: cons-of-svar-fix-v-under-svar-map-equiv

    (defthm cons-of-svar-fix-v-under-svar-map-equiv
      (svar-map-equiv (cons (cons acl2::k (svar-fix acl2::v))
                            x)
                      (cons (cons acl2::k acl2::v) x)))

    Theorem: cons-svar-equiv-congruence-on-v-under-svar-map-equiv

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

    Theorem: cons-of-svar-map-fix-y-under-svar-map-equiv

    (defthm cons-of-svar-map-fix-y-under-svar-map-equiv
      (svar-map-equiv (cons x (svar-map-fix y))
                      (cons x y)))

    Theorem: cons-svar-map-equiv-congruence-on-y-under-svar-map-equiv

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

    Theorem: svar-map-fix-of-acons

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

    Theorem: hons-assoc-equal-of-svar-map-fix

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

    Theorem: svar-map-fix-of-append

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

    Theorem: consp-car-of-svar-map-fix

    (defthm consp-car-of-svar-map-fix
      (equal (consp (car (svar-map-fix x)))
             (consp (svar-map-fix x))))