• 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-paramdecllist-p

    Vl-relocate-paramdecls

    (vl-relocate-paramdecls loc x) maps change-vl-paramdecl across a list.

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

    This is an ordinary defprojection.

    Definitions and Theorems

    Function: vl-relocate-paramdecls-exec

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

    Function: vl-relocate-paramdecls-nrev

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

    Function: vl-relocate-paramdecls

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

    Theorem: vl-paramdecllist-p-of-vl-relocate-paramdecls

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

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

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

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

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

    Theorem: vl-relocate-paramdecls-of-vl-paramdecllist-fix-x

    (defthm vl-relocate-paramdecls-of-vl-paramdecllist-fix-x
      (equal (vl-relocate-paramdecls loc (vl-paramdecllist-fix x))
             (vl-relocate-paramdecls loc x)))

    Theorem: vl-relocate-paramdecls-vl-paramdecllist-equiv-congruence-on-x

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

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

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

    Theorem: vl-relocate-paramdecls-of-revappend

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

    Theorem: nthcdr-of-vl-relocate-paramdecls

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

    Theorem: nth-of-vl-relocate-paramdecls

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

    Theorem: vl-relocate-paramdecls-nrev-removal

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

    Theorem: vl-relocate-paramdecls-exec-removal

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

    Theorem: vl-relocate-paramdecls-of-take

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

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

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

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

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

    Theorem: member-of-change-vl-paramdecl-in-vl-relocate-paramdecls

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

    Theorem: vl-relocate-paramdecls-of-rev

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

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

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

    Theorem: vl-relocate-paramdecls-of-append

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

    Theorem: cdr-of-vl-relocate-paramdecls

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

    Theorem: car-of-vl-relocate-paramdecls

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

    Theorem: vl-relocate-paramdecls-under-iff

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

    Theorem: consp-of-vl-relocate-paramdecls

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

    Theorem: len-of-vl-relocate-paramdecls

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

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

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

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

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

    Theorem: vl-relocate-paramdecls-of-cons

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