• 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
          • Svstmt-case
          • Svstmt-while
          • Svstmt-p
          • Svstmt-if
          • Svstmt-equiv
          • Svstmt-xcond
          • Svstmt-scope
          • Svstmt-assign
          • Svstmt-compile
            • Svstmt-compile.lisp
            • Svstate
              • Svstate-p
              • Svstate-fix
                • Svstate-equiv
                • Make-svstate
                • Svstate->nonblkst
                • Svstate->blkst
                • Change-svstate
            • Svstmt-constraints
            • Svstmt-jump
            • Svstmtlist
            • Svstmt-kind
            • Svstmt.lisp
            • Svstmt-fix
            • Svstmt-count
          • Sv-tutorial
          • Expressions
          • Symbolic-test-vector
          • Vl-to-svex
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Svstate

    Svstate-fix

    Fixing function for svstate structures.

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

    Definitions and Theorems

    Function: svstate-fix$inline

    (defun svstate-fix$inline (x)
      (declare (xargs :guard (svstate-p x)))
      (let ((__function__ 'svstate-fix))
        (declare (ignorable __function__))
        (mbe :logic
             (b* ((blkst (svstack-fix (std::prod-car x)))
                  (nonblkst (svex-alist-fix (std::prod-cdr x))))
               (let ((blkst (svstack-nonempty-fix blkst)))
                 (std::prod-cons blkst nonblkst)))
             :exec x)))

    Theorem: svstate-p-of-svstate-fix

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

    Theorem: svstate-fix-when-svstate-p

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

    Function: svstate-equiv$inline

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

    Theorem: svstate-equiv-is-an-equivalence

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

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

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

    Theorem: svstate-fix-under-svstate-equiv

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

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

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

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

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

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

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

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

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