• 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
          • Values
            • 4vec
              • 4vec-operations
              • 4vec-p
              • S4vecs
              • 4vec-examples
              • Maybe-4vec
                • Maybe-4vec-fix
                  • Maybe-4vec-case
                  • Maybe-4vec-equiv
                  • Maybe-4vec-some
                  • Maybe-4vec-p
                  • Maybe-4vec-none
                • 4vec-equiv
                • Make-4vec
                • 4vec->upper
                • 4vec->lower
                • 4veclist
                • 4vec-fix
                • Make-honsed-4vec
                • 4vec-index-p
              • 4vec-<<=
              • 3vec
              • 2vec
              • 2vecx
              • 2vecnatx
              • 4vec-x
              • 4vec-1x
              • 4vec-1z
              • 4vec-z
          • Symbolic-test-vector
          • Vl-to-svex
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Maybe-4vec

    Maybe-4vec-fix

    Fixing function for maybe-4vec structures.

    Signature
    (maybe-4vec-fix x) → new-x
    Arguments
    x — Guard (maybe-4vec-p x).
    Returns
    new-x — Type (maybe-4vec-p new-x).

    Definitions and Theorems

    Function: maybe-4vec-fix$inline

    (defun maybe-4vec-fix$inline (x)
      (declare (xargs :guard (maybe-4vec-p x)))
      (let ((__function__ 'maybe-4vec-fix))
        (declare (ignorable __function__))
        (mbe :logic (cond ((not x) nil)
                          (t (b* ((fty::val (4vec-fix x)))
                               fty::val)))
             :exec x)))

    Theorem: maybe-4vec-p-of-maybe-4vec-fix

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

    Theorem: maybe-4vec-fix-when-maybe-4vec-p

    (defthm maybe-4vec-fix-when-maybe-4vec-p
      (implies (maybe-4vec-p x)
               (equal (maybe-4vec-fix x) x)))

    Function: maybe-4vec-equiv$inline

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

    Theorem: maybe-4vec-equiv-is-an-equivalence

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

    Theorem: maybe-4vec-equiv-implies-equal-maybe-4vec-fix-1

    (defthm maybe-4vec-equiv-implies-equal-maybe-4vec-fix-1
      (implies (maybe-4vec-equiv x x-equiv)
               (equal (maybe-4vec-fix x)
                      (maybe-4vec-fix x-equiv)))
      :rule-classes (:congruence))

    Theorem: maybe-4vec-fix-under-maybe-4vec-equiv

    (defthm maybe-4vec-fix-under-maybe-4vec-equiv
      (maybe-4vec-equiv (maybe-4vec-fix x) x)
      :rule-classes (:rewrite :rewrite-quoted-constant))

    Theorem: equal-of-maybe-4vec-fix-1-forward-to-maybe-4vec-equiv

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

    Theorem: equal-of-maybe-4vec-fix-2-forward-to-maybe-4vec-equiv

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

    Theorem: maybe-4vec-equiv-of-maybe-4vec-fix-1-forward

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

    Theorem: maybe-4vec-equiv-of-maybe-4vec-fix-2-forward

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