• 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
            • Svex-focused-equivalence-checking
            • A4vec-operations
            • Svexlist-eval-gl
            • Aig-symbolic-arithmetic
            • Svex-varmasks/env->aig-env-rec
            • Svex-varmasks->a4env-rec
            • Svexlist/env-list-eval-gl
            • 4vmask-to-a4vec-rec-env
            • 4vmask-to-a4vec-rec
            • Svexlist->a4vecs-for-varlist
            • Svex-varmasks/env->aig-env-stats-rec
            • Svexlist->a4vec-nrev
            • A4veclist/svex-env-list-eval
            • A4vec
            • Svexlist-x-out-unused-vars
            • Svex->a4vec-memotable-correctp
            • A4vec/svex-env-eval
            • Svex-varmasks->a4env
            • Svex-varmasks/env->aig-env-rec-log
            • 4vmask-to-a4vec-env
            • 4veclist-from-bitlist-log-rec
            • Svex-apply-aig
            • Svexlist-vars-for-symbolic-eval
            • Nat-bool-a4env-upper-boundp
            • 4vmask-to-a4vec
            • Svexlist/env-list-vars-for-symbolic-eval
            • Svex-maskbits-for-vars
            • Svexlist->a4vec-aig-env-for-varlist
            • 4vec-from-bitlist
            • Svexlist-full-masks-p
            • Svex-varmasks/env->aig-env-stats
            • Svex-varmasks/env->aig-env
            • Svexlistlist->a4vec
            • Svex-const-concat-args
            • Svex-mask-alist-extract-vars
            • Svexlist->a4vec-top
            • Nat-bool-a4vec-upper-boundp
            • Nat-bool-a4env-lower-boundp
            • Maybe-a3vec-fix
            • Svex-maskbits-ok
            • Svex-envlist-check-boolmasks
            • Svex-env-check-boolmasks
            • Nat-bool-list-upper-boundp
            • Nat-bool-a4vec-lower-boundp
            • Maybe-svexlist-rewrite-fixpoint
            • 4vmask-to-a4vec-varcount
            • A4vec-eval
            • Svexlist-nth
            • A4veclist-nth
            • Nat-bool-list-lower-boundp
            • 4veclist-from-bitlist
            • V2i-first-n
            • A4veclist-eval-gl
            • Svex-envlist-keyset
            • Svex-a4vec-env-eval
            • A4veclist/env-list-eval
            • Svexlist-variable-mask-alist
            • Sparseint-nfix
            • A4veclist-length
            • A4veclist-eval
            • 4vec-boolmaskp
            • Nat-bool-list-nats
            • Nat-bool-a4env-p
            • Nat-bool-listp
            • A4veclist->aiglist
            • Svexlist-rewrite-fixpoint-memo
            • Nat-bool-a4vec-p
            • A4vec->aiglist
            • Svex-is-const-concat
            • Nat-bool-a4env-vars
            • Svexlist-mask-alist-memo
            • Nat-bool-a4vec-vars
            • Svexlist-vars-memo
            • A4vec-constantp
            • Svex-aig-memotable
            • Svex-a4vec-env
            • A4veclistlist
            • A4veclist
              • A4veclist-fix
                • A4veclist-p
                • A4veclist-equiv
              • Symbolic-params-x-out-cond
            • 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
    • A4veclist

    A4veclist-fix

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

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

    In the logic, we apply a4vec-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: a4veclist-fix$inline

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

    Theorem: a4veclist-p-of-a4veclist-fix

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

    Theorem: a4veclist-fix-when-a4veclist-p

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

    Function: a4veclist-equiv$inline

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

    Theorem: a4veclist-equiv-is-an-equivalence

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

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

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

    Theorem: a4veclist-fix-under-a4veclist-equiv

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

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

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

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

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

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

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

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

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

    Theorem: car-of-a4veclist-fix-x-under-a4vec-equiv

    (defthm car-of-a4veclist-fix-x-under-a4vec-equiv
      (a4vec-equiv (car (a4veclist-fix x))
                   (car x)))

    Theorem: car-a4veclist-equiv-congruence-on-x-under-a4vec-equiv

    (defthm car-a4veclist-equiv-congruence-on-x-under-a4vec-equiv
      (implies (a4veclist-equiv x x-equiv)
               (a4vec-equiv (car x) (car x-equiv)))
      :rule-classes :congruence)

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

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

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

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

    Theorem: cons-of-a4vec-fix-x-under-a4veclist-equiv

    (defthm cons-of-a4vec-fix-x-under-a4veclist-equiv
      (a4veclist-equiv (cons (a4vec-fix x) y)
                       (cons x y)))

    Theorem: cons-a4vec-equiv-congruence-on-x-under-a4veclist-equiv

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

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

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

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

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

    Theorem: consp-of-a4veclist-fix

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

    Theorem: a4veclist-fix-under-iff

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

    Theorem: a4veclist-fix-of-cons

    (defthm a4veclist-fix-of-cons
      (equal (a4veclist-fix (cons a x))
             (cons (a4vec-fix a) (a4veclist-fix x))))

    Theorem: len-of-a4veclist-fix

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

    Theorem: a4veclist-fix-of-append

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

    Theorem: a4veclist-fix-of-repeat

    (defthm a4veclist-fix-of-repeat
      (equal (a4veclist-fix (repeat acl2::n x))
             (repeat acl2::n (a4vec-fix x))))

    Theorem: list-equiv-refines-a4veclist-equiv

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

    Theorem: nth-of-a4veclist-fix

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

    Theorem: a4veclist-equiv-implies-a4veclist-equiv-append-1

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

    Theorem: a4veclist-equiv-implies-a4veclist-equiv-append-2

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

    Theorem: a4veclist-equiv-implies-a4veclist-equiv-nthcdr-2

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

    Theorem: a4veclist-equiv-implies-a4veclist-equiv-take-2

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