• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • 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
                • S4vec-p
                • S4vec-part-install
                • S4vec-?!
                • S4vec-fix
                • S4vec-rev-blocks
                • Sparseint-rev-blocks
                • S4vec-part-select
                • S3vec-bit?
                • S4vec-concat
                • S4vec-bitmux
                • S4vec-bit?!
                • S3vec-?*
                • S3vec-?
                • Svex-s4apply
                • S4vec-bit?
                • S4vec-?*
                • S4vec-?
                • S4vec-===*
                • S4vec-pow
                • S4vec
                • S4vec-sign-ext
                • S4vec-override
                • S4vec-zero-ext
                • S4vec-wildeq-safe
                • S4vec-symwildeq
                • S4vec-shift-core
                • S4vec-remainder
                • S4vec-quotient
                • S4vec-bitxor
                • S3vec-bitxor
                • S4vec-resor
                • S4vec-resand
                • S4vec-bit-index
                • S4vec-bit-extract
                • S3vec-bitor
                • S3vec-bitand
                • S4vec->4vec
                • S4vec-wildeq
                • S4vec-times
                • S4vec-rsh
                • S4vec-plus
                • S4vec-minus
                • S4vec-bitand
                • S4vec-===
                • S4vec-<
                • S4vec-res
                • S4vec-lsh
                • S4vec-bitor
                • S4vec-==
                • S3vec-==
                • S4vec-equal
                • S3vec-reduction-or
                • S3vec-reduction-and
                • S4vec-sparseint-val
                • S4vec-parity
                • S4vec-countones
                • S2vec
                • S4vec-reduction-or
                • S4vec-reduction-and
                • S4vec-onehot0
                • S4vec-onehot
                • S4vec-offset
                • S3vec-bitnot
                • 4vec->s4vec
                • S4vec-xdet
                • S4vec-uminus
                • S4vec-onset
                • S4vec-clog2
                • S4vec-bitnot
                • S4vec-1mask
                • S3vec-fix
                • S4vec->upper
                • S4vec->lower
                • S4vec-index-p
                • S4veclist
                  • S4veclist-fix
                    • S4veclist-nth-safe
                    • S4veclist-equiv
                    • S4veclist-p
                  • S4vec-xfree-p
                  • S4vec-2vec-p
                  • S3vec-p
                  • S2vec->val
                  • S2vec-p
                  • S4vec-correct-fn
                  • S4vec-correct-formal-evals
                • 4vec-examples
                • Maybe-4vec
                • 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
    • S4veclist

    S4veclist-fix

    (s4veclist-fix x) is a usual fty list fixing function.

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

    In the logic, we apply s4vec-fix to each member of the x. In the execution, none of that is actually necessary and this is just an inlined identity function.

    Definitions and Theorems

    Function: s4veclist-fix$inline

    (defun s4veclist-fix$inline (x)
      (declare (xargs :guard (s4veclist-p x)))
      (let ((__function__ 's4veclist-fix))
        (declare (ignorable __function__))
        (mbe :logic
             (if (atom x)
                 nil
               (cons (s4vec-fix (car x))
                     (s4veclist-fix (cdr x))))
             :exec x)))

    Theorem: s4veclist-p-of-s4veclist-fix

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

    Theorem: s4veclist-fix-when-s4veclist-p

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

    Function: s4veclist-equiv$inline

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

    Theorem: s4veclist-equiv-is-an-equivalence

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

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

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

    Theorem: s4veclist-fix-under-s4veclist-equiv

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

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

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

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

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

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

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

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

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

    Theorem: car-of-s4veclist-fix-x-under-s4vec-equiv

    (defthm car-of-s4veclist-fix-x-under-s4vec-equiv
      (s4vec-equiv (car (s4veclist-fix x))
                   (car x)))

    Theorem: car-s4veclist-equiv-congruence-on-x-under-s4vec-equiv

    (defthm car-s4veclist-equiv-congruence-on-x-under-s4vec-equiv
      (implies (s4veclist-equiv x x-equiv)
               (s4vec-equiv (car x) (car x-equiv)))
      :rule-classes :congruence)

    Theorem: cdr-of-s4veclist-fix-x-under-s4veclist-equiv

    (defthm cdr-of-s4veclist-fix-x-under-s4veclist-equiv
      (s4veclist-equiv (cdr (s4veclist-fix x))
                       (cdr x)))

    Theorem: cdr-s4veclist-equiv-congruence-on-x-under-s4veclist-equiv

    (defthm cdr-s4veclist-equiv-congruence-on-x-under-s4veclist-equiv
      (implies (s4veclist-equiv x x-equiv)
               (s4veclist-equiv (cdr x) (cdr x-equiv)))
      :rule-classes :congruence)

    Theorem: cons-of-s4vec-fix-x-under-s4veclist-equiv

    (defthm cons-of-s4vec-fix-x-under-s4veclist-equiv
      (s4veclist-equiv (cons (s4vec-fix x) y)
                       (cons x y)))

    Theorem: cons-s4vec-equiv-congruence-on-x-under-s4veclist-equiv

    (defthm cons-s4vec-equiv-congruence-on-x-under-s4veclist-equiv
      (implies (s4vec-equiv x x-equiv)
               (s4veclist-equiv (cons x y)
                                (cons x-equiv y)))
      :rule-classes :congruence)

    Theorem: cons-of-s4veclist-fix-y-under-s4veclist-equiv

    (defthm cons-of-s4veclist-fix-y-under-s4veclist-equiv
      (s4veclist-equiv (cons x (s4veclist-fix y))
                       (cons x y)))

    Theorem: cons-s4veclist-equiv-congruence-on-y-under-s4veclist-equiv

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

    Theorem: consp-of-s4veclist-fix

    (defthm consp-of-s4veclist-fix
      (equal (consp (s4veclist-fix x))
             (consp x)))

    Theorem: s4veclist-fix-under-iff

    (defthm s4veclist-fix-under-iff
      (iff (s4veclist-fix x) (consp x)))

    Theorem: s4veclist-fix-of-cons

    (defthm s4veclist-fix-of-cons
      (equal (s4veclist-fix (cons a x))
             (cons (s4vec-fix a) (s4veclist-fix x))))

    Theorem: len-of-s4veclist-fix

    (defthm len-of-s4veclist-fix
      (equal (len (s4veclist-fix x)) (len x)))

    Theorem: s4veclist-fix-of-append

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

    Theorem: s4veclist-fix-of-repeat

    (defthm s4veclist-fix-of-repeat
      (equal (s4veclist-fix (repeat acl2::n x))
             (repeat acl2::n (s4vec-fix x))))

    Theorem: list-equiv-refines-s4veclist-equiv

    (defthm list-equiv-refines-s4veclist-equiv
      (implies (list-equiv x y)
               (s4veclist-equiv x y))
      :rule-classes :refinement)

    Theorem: nth-of-s4veclist-fix

    (defthm nth-of-s4veclist-fix
      (equal (nth acl2::n (s4veclist-fix x))
             (if (< (nfix acl2::n) (len x))
                 (s4vec-fix (nth acl2::n x))
               nil)))

    Theorem: s4veclist-equiv-implies-s4veclist-equiv-append-1

    (defthm s4veclist-equiv-implies-s4veclist-equiv-append-1
      (implies (s4veclist-equiv x fty::x-equiv)
               (s4veclist-equiv (append x y)
                                (append fty::x-equiv y)))
      :rule-classes (:congruence))

    Theorem: s4veclist-equiv-implies-s4veclist-equiv-append-2

    (defthm s4veclist-equiv-implies-s4veclist-equiv-append-2
      (implies (s4veclist-equiv y fty::y-equiv)
               (s4veclist-equiv (append x y)
                                (append x fty::y-equiv)))
      :rule-classes (:congruence))

    Theorem: s4veclist-equiv-implies-s4veclist-equiv-nthcdr-2

    (defthm s4veclist-equiv-implies-s4veclist-equiv-nthcdr-2
      (implies (s4veclist-equiv acl2::l l-equiv)
               (s4veclist-equiv (nthcdr acl2::n acl2::l)
                                (nthcdr acl2::n l-equiv)))
      :rule-classes (:congruence))

    Theorem: s4veclist-equiv-implies-s4veclist-equiv-take-2

    (defthm s4veclist-equiv-implies-s4veclist-equiv-take-2
      (implies (s4veclist-equiv acl2::l l-equiv)
               (s4veclist-equiv (take acl2::n acl2::l)
                                (take acl2::n l-equiv)))
      :rule-classes (:congruence))