• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
        • Warnings
        • Primitives
        • Use-set
        • Syntax
        • Getting-started
        • Utilities
        • Loader
        • Transforms
        • Lint
        • Mlib
          • Scopestack
          • Filtering-by-name
          • Vl-namefactory
          • Substitution
          • Allexprs
          • Hid-tools
          • Vl-consteval
          • Range-tools
          • Lvalexprs
          • Hierarchy
          • Finding-by-name
          • Expr-tools
          • Expr-slicing
          • Stripping-functions
          • Stmt-tools
          • Modnamespace
          • Vl-parse-expr-from-str
          • Welltyped
          • Reordering-by-name
          • Flat-warnings
          • Genblob
          • Expr-building
          • Datatype-tools
          • Syscalls
          • Relocate
            • Vl-relocate-paramdecls
            • Vl-relocate-portdecls
            • Vl-relocate-gateinsts
            • Vl-relocate-vardecls
            • Vl-relocate-modinsts
              • Vl-relocate-assigns
            • Expr-cleaning
            • Namemangle
            • Caremask
            • Port-tools
            • Lvalues
          • Server
          • Kit
          • Printer
          • Esim-vl
          • Well-formedness
        • Sv
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Relocate
    • Vl-modinstlist-p

    Vl-relocate-modinsts

    (vl-relocate-modinsts loc x) maps change-vl-modinst across a list.

    Signature
    (vl-relocate-modinsts loc x) → new-x
    Arguments
    loc — Guard (vl-location-p loc).
    x — Guard (vl-modinstlist-p x).
    Returns
    new-x — Type (vl-modinstlist-p new-x).

    This is an ordinary defprojection.

    Definitions and Theorems

    Function: vl-relocate-modinsts-exec

    (defun vl-relocate-modinsts-exec (loc x acc)
      (declare (xargs :guard (and (vl-location-p loc)
                                  (vl-modinstlist-p x))))
      (declare (xargs :guard t))
      (let ((__function__ 'vl-relocate-modinsts-exec))
        (declare (ignorable __function__))
        (if (consp x)
            (vl-relocate-modinsts-exec
                 loc (cdr x)
                 (cons (change-vl-modinst (car x) :loc loc)
                       acc))
          acc)))

    Function: vl-relocate-modinsts-nrev

    (defun vl-relocate-modinsts-nrev (loc x nrev)
      (declare (xargs :stobjs (nrev)))
      (declare (xargs :guard (and (vl-location-p loc)
                                  (vl-modinstlist-p x))))
      (declare (xargs :guard t))
      (let ((__function__ 'vl-relocate-modinsts-nrev))
        (declare (ignorable __function__))
        (if (atom x)
            (nrev-fix nrev)
          (let ((nrev (nrev-push (change-vl-modinst (car x) :loc loc)
                                 nrev)))
            (vl-relocate-modinsts-nrev loc (cdr x)
                                       nrev)))))

    Function: vl-relocate-modinsts

    (defun vl-relocate-modinsts (loc x)
     (declare (xargs :guard (and (vl-location-p loc)
                                 (vl-modinstlist-p x))))
     (declare (xargs :guard t))
     (let ((__function__ 'vl-relocate-modinsts))
      (declare (ignorable __function__))
      (mbe
          :logic
          (if (consp x)
              (cons (change-vl-modinst (car x) :loc loc)
                    (vl-relocate-modinsts loc (cdr x)))
            nil)
          :exec
          (if (atom x)
              nil
            (with-local-nrev (vl-relocate-modinsts-nrev loc x nrev))))))

    Theorem: vl-modinstlist-p-of-vl-relocate-modinsts

    (defthm vl-modinstlist-p-of-vl-relocate-modinsts
      (b* ((new-x (vl-relocate-modinsts loc x)))
        (vl-modinstlist-p new-x))
      :rule-classes :rewrite)

    Theorem: vl-relocate-modinsts-of-vl-location-fix-loc

    (defthm vl-relocate-modinsts-of-vl-location-fix-loc
      (equal (vl-relocate-modinsts (vl-location-fix loc)
                                   x)
             (vl-relocate-modinsts loc x)))

    Theorem: vl-relocate-modinsts-vl-location-equiv-congruence-on-loc

    (defthm vl-relocate-modinsts-vl-location-equiv-congruence-on-loc
      (implies (vl-location-equiv loc loc-equiv)
               (equal (vl-relocate-modinsts loc x)
                      (vl-relocate-modinsts loc-equiv x)))
      :rule-classes :congruence)

    Theorem: vl-relocate-modinsts-of-vl-modinstlist-fix-x

    (defthm vl-relocate-modinsts-of-vl-modinstlist-fix-x
      (equal (vl-relocate-modinsts loc (vl-modinstlist-fix x))
             (vl-relocate-modinsts loc x)))

    Theorem: vl-relocate-modinsts-vl-modinstlist-equiv-congruence-on-x

    (defthm vl-relocate-modinsts-vl-modinstlist-equiv-congruence-on-x
      (implies (vl-modinstlist-equiv x x-equiv)
               (equal (vl-relocate-modinsts loc x)
                      (vl-relocate-modinsts loc x-equiv)))
      :rule-classes :congruence)

    Theorem: vl-relocate-modinsts-of-update-nth

    (defthm vl-relocate-modinsts-of-update-nth
     (implies
      (<= (nfix acl2::n) (len acl2::x))
      (equal (vl-relocate-modinsts loc
                                   (update-nth acl2::n acl2::v acl2::x))
             (update-nth acl2::n
                         (change-vl-modinst acl2::v :loc loc)
                         (vl-relocate-modinsts loc acl2::x))))
     :rule-classes ((:rewrite)))

    Theorem: vl-relocate-modinsts-of-revappend

    (defthm vl-relocate-modinsts-of-revappend
      (equal (vl-relocate-modinsts loc (revappend acl2::x acl2::y))
             (revappend (vl-relocate-modinsts loc acl2::x)
                        (vl-relocate-modinsts loc acl2::y)))
      :rule-classes ((:rewrite)))

    Theorem: nthcdr-of-vl-relocate-modinsts

    (defthm nthcdr-of-vl-relocate-modinsts
      (equal (nthcdr acl2::n
                     (vl-relocate-modinsts loc acl2::x))
             (vl-relocate-modinsts loc (nthcdr acl2::n acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: nth-of-vl-relocate-modinsts

    (defthm nth-of-vl-relocate-modinsts
      (equal (nth acl2::n
                  (vl-relocate-modinsts loc acl2::x))
             (and (< (nfix acl2::n) (len acl2::x))
                  (change-vl-modinst (nth acl2::n acl2::x)
                                     :loc loc)))
      :rule-classes ((:rewrite)))

    Theorem: vl-relocate-modinsts-nrev-removal

    (defthm vl-relocate-modinsts-nrev-removal
      (equal (vl-relocate-modinsts-nrev loc acl2::x nrev)
             (append nrev
                     (vl-relocate-modinsts loc acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: vl-relocate-modinsts-exec-removal

    (defthm vl-relocate-modinsts-exec-removal
      (equal (vl-relocate-modinsts-exec loc acl2::x acl2::acc)
             (revappend (vl-relocate-modinsts loc acl2::x)
                        acl2::acc))
      :rule-classes ((:rewrite)))

    Theorem: vl-relocate-modinsts-of-take

    (defthm vl-relocate-modinsts-of-take
      (implies (<= (nfix acl2::n) (len acl2::x))
               (equal (vl-relocate-modinsts loc (take acl2::n acl2::x))
                      (take acl2::n
                            (vl-relocate-modinsts loc acl2::x))))
      :rule-classes ((:rewrite)))

    Theorem: set-equiv-congruence-over-vl-relocate-modinsts

    (defthm set-equiv-congruence-over-vl-relocate-modinsts
      (implies (set-equiv acl2::x acl2::y)
               (set-equiv (vl-relocate-modinsts loc acl2::x)
                          (vl-relocate-modinsts loc acl2::y)))
      :rule-classes ((:congruence)))

    Theorem: subsetp-of-vl-relocate-modinsts-when-subsetp

    (defthm subsetp-of-vl-relocate-modinsts-when-subsetp
      (implies (subsetp acl2::x acl2::y)
               (subsetp (vl-relocate-modinsts loc acl2::x)
                        (vl-relocate-modinsts loc acl2::y)))
      :rule-classes ((:rewrite)))

    Theorem: member-of-change-vl-modinst-in-vl-relocate-modinsts

    (defthm member-of-change-vl-modinst-in-vl-relocate-modinsts
      (implies (member acl2::k acl2::x)
               (member (change-vl-modinst acl2::k :loc loc)
                       (vl-relocate-modinsts loc acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: vl-relocate-modinsts-of-rev

    (defthm vl-relocate-modinsts-of-rev
      (equal (vl-relocate-modinsts loc (rev acl2::x))
             (rev (vl-relocate-modinsts loc acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: vl-relocate-modinsts-of-list-fix

    (defthm vl-relocate-modinsts-of-list-fix
      (equal (vl-relocate-modinsts loc (list-fix acl2::x))
             (vl-relocate-modinsts loc acl2::x))
      :rule-classes ((:rewrite)))

    Theorem: vl-relocate-modinsts-of-append

    (defthm vl-relocate-modinsts-of-append
      (equal (vl-relocate-modinsts loc (append acl2::a acl2::b))
             (append (vl-relocate-modinsts loc acl2::a)
                     (vl-relocate-modinsts loc acl2::b)))
      :rule-classes ((:rewrite)))

    Theorem: cdr-of-vl-relocate-modinsts

    (defthm cdr-of-vl-relocate-modinsts
      (equal (cdr (vl-relocate-modinsts loc acl2::x))
             (vl-relocate-modinsts loc (cdr acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: car-of-vl-relocate-modinsts

    (defthm car-of-vl-relocate-modinsts
      (equal (car (vl-relocate-modinsts loc acl2::x))
             (and (consp acl2::x)
                  (change-vl-modinst (car acl2::x)
                                     :loc loc)))
      :rule-classes ((:rewrite)))

    Theorem: vl-relocate-modinsts-under-iff

    (defthm vl-relocate-modinsts-under-iff
      (iff (vl-relocate-modinsts loc acl2::x)
           (consp acl2::x))
      :rule-classes ((:rewrite)))

    Theorem: consp-of-vl-relocate-modinsts

    (defthm consp-of-vl-relocate-modinsts
      (equal (consp (vl-relocate-modinsts loc acl2::x))
             (consp acl2::x))
      :rule-classes ((:rewrite)))

    Theorem: len-of-vl-relocate-modinsts

    (defthm len-of-vl-relocate-modinsts
      (equal (len (vl-relocate-modinsts loc acl2::x))
             (len acl2::x))
      :rule-classes ((:rewrite)))

    Theorem: true-listp-of-vl-relocate-modinsts

    (defthm true-listp-of-vl-relocate-modinsts
      (true-listp (vl-relocate-modinsts loc acl2::x))
      :rule-classes :type-prescription)

    Theorem: vl-relocate-modinsts-when-not-consp

    (defthm vl-relocate-modinsts-when-not-consp
      (implies (not (consp acl2::x))
               (equal (vl-relocate-modinsts loc acl2::x)
                      nil))
      :rule-classes ((:rewrite)))

    Theorem: vl-relocate-modinsts-of-cons

    (defthm vl-relocate-modinsts-of-cons
      (equal (vl-relocate-modinsts loc (cons acl2::a acl2::b))
             (cons (change-vl-modinst acl2::a :loc loc)
                   (vl-relocate-modinsts loc acl2::b)))
      :rule-classes ((:rewrite)))