• 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
            • Least-fixpoint
            • Svex-p
            • Svex-select
              • Svex-select-staticify-assignment
              • Svex-select-fix
                • Svex-select-case
                • Svex-select-split-static
                • Svex-select-p
                • Svex-selects-merge
                • Svex-select-replace-indices
                • Svex-select-vars
                • Svex-select-to-svex-with-substitution
                • Svex-select-equiv
                • Svex-select-part
                • Svex-select-count
                • Svex-select-var
                • Svex-select-to-lhs
                • Svex-select-staticp
                • Svex-select-inner-var
                • Svex-select->indices
                • Svex-select-to-svex
                • Svex-select-inner-width
                • Svex-select->width
                • Svex-select-kind
              • 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
    • Svex-select

    Svex-select-fix

    Fixing function for svex-select structures.

    Signature
    (svex-select-fix x) → new-x
    Arguments
    x — Guard (svex-select-p x).
    Returns
    new-x — Type (svex-select-p new-x).

    Definitions and Theorems

    Function: svex-select-fix$inline

    (defun svex-select-fix$inline (x)
     (declare (xargs :guard (svex-select-p x)))
     (let ((__function__ 'svex-select-fix))
      (declare (ignorable __function__))
      (mbe
       :logic
       (case (svex-select-kind x)
        (:var (b* ((name (svar-fix (std::prod-car (cdr x))))
                   (width (nfix (std::prod-cdr (cdr x)))))
                (cons :var (std::prod-cons name width))))
        (:part
         (b*
          ((lsb (svex-fix (std::prod-car (cdr x))))
           (width (nfix (std::prod-car (std::prod-cdr (cdr x)))))
           (subexp
             (svex-select-fix (std::prod-cdr (std::prod-cdr (cdr x))))))
          (cons
            :part (std::prod-cons lsb (std::prod-cons width subexp))))))
       :exec x)))

    Theorem: svex-select-p-of-svex-select-fix

    (defthm svex-select-p-of-svex-select-fix
      (b* ((new-x (svex-select-fix$inline x)))
        (svex-select-p new-x))
      :rule-classes :rewrite)

    Theorem: svex-select-fix-when-svex-select-p

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

    Function: svex-select-equiv$inline

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

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

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

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

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

    Theorem: svex-select-fix-under-svex-select-equiv

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

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

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

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

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

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

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

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

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

    Theorem: svex-select-kind$inline-of-svex-select-fix-x

    (defthm svex-select-kind$inline-of-svex-select-fix-x
      (equal (svex-select-kind$inline (svex-select-fix x))
             (svex-select-kind$inline x)))

    Theorem: svex-select-kind$inline-svex-select-equiv-congruence-on-x

    (defthm svex-select-kind$inline-svex-select-equiv-congruence-on-x
      (implies (svex-select-equiv x x-equiv)
               (equal (svex-select-kind$inline x)
                      (svex-select-kind$inline x-equiv)))
      :rule-classes :congruence)

    Theorem: consp-of-svex-select-fix

    (defthm consp-of-svex-select-fix
      (consp (svex-select-fix x))
      :rule-classes :type-prescription)