• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Community
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
        • Warnings
        • Primitives
        • Use-set
        • Syntax
          • Vl-module
          • Vl-vardecl
          • Expressions
          • Vl-fundecl
          • Vl-assign
          • Vl-gateinst
          • Vl-modinst
          • Vl-commentmap
          • Vl-portdecl
          • Vl-taskdecl
          • Vl-design
          • Vl-interface
          • Vl-plainarglist->exprs
          • Vl-taskdecllist->names
          • Vl-fundecllist->names
          • Vl-package
          • Vl-port
          • Vl-udp
          • Vl-paramdecl
          • Vl-genelement
          • Vl-cycledelayrange
          • Vl-namedarg
          • Vl-sort-blockitems-aux
          • Vl-distitem
          • Vl-gatedelay
          • Vl-repetition
          • Vl-typedef
          • Vl-range
          • Vl-gatestrength
          • Vl-program
          • Vl-config
          • Vl-always
          • Vl-datatype-update-dims
          • Vl-import
          • Vl-enumbasetype
          • Vl-repeateventcontrol
          • Vl-paramargs
          • Vl-initial
          • Vl-eventcontrol
          • Vl-udpsymbol-p
          • Vl-maybe-range
          • Vl-maybe-nettypename
          • Vl-maybe-gatestrength
          • Vl-maybe-gatedelay
          • Vl-maybe-delayoreventcontrol
          • Vl-alias
          • Maybe-string-fix
          • Vl-maybe-packeddimension
          • Vl-fwdtypedef
          • Vl-evatom
          • Vl-packeddimension-p
          • Vl-maybe-udpsymbol
          • Vl-maybe-module
          • Vl-maybe-direction
          • Vl-maybe-datatype
          • Vl-maybe-cstrength
          • Vl-direction-p
          • Vl-arguments
          • Vl-maybe-design
          • Vl-udpline
          • Vl-exprdist
          • Vl-context1
          • Vl-genvar
          • Vl-enumitem
          • Vl-datatype-update-udims
          • Vl-datatype-update-pdims
          • Vl-modelement
          • Vl-udpedge
          • Vl-delaycontrol
          • Vl-context
          • Vl-sort-blockitems
          • Vl-distweighttype-p
          • Vl-ctxelement->loc
          • Vl-blockitem
          • Vl-vardecllist
          • Vl-module->ifports
          • Vl-modelement->loc
          • Vl-ctxelement
          • Vl-coretypename-p
          • Vl-packeddimensionlist
          • Vl-modelementlist->genelements
          • Vl-gatetype-p
          • Vl-paramdecllist
          • Vl-lifetime-p
          • Vl-datatype->udims
          • Vl-datatype->pdims
          • Vl-timeunit-p
          • Vl-repetitiontype-p
          • Vl-port->name
          • Vl-importlist
          • Vl-genelement->loc
          • Vl-delayoreventcontrol
          • Vl-cstrength-p
          • Statements
          • Vl-udpentry-p
          • Vl-packeddimension-fix
          • Vl-nettypename-p
          • Vl-portdecllist
            • Vl-portdecllist-p
              • Vl-relocate-portdecls
                • Vl-portdecllist-p-basics
                • Vl-portdecllist->names
                • Vl-reorder-portdecls
                • Vl-portdecllist-names-by-direction
                • Vl-find-portdecl
              • Vl-portdecllist-fix
              • Vl-portdecllist-equiv
            • Vl-port->loc
            • Vl-enumbasekind-fix
            • Vl-arguments->args
            • Vl-taskdecllist
            • Vl-portlist
            • Vl-importpart-p
            • Vl-importpart-fix
            • Vl-fundecllist
            • Vl-blockstmt-p
            • Vl-assignlist
            • Vl-alwaystype-p
            • Vl-typedeflist
            • Vl-syntaxversion-p
            • Vl-randomqualifier-p
            • Vl-modinstlist
            • Vl-gateinstlist
            • Vl-blockitemlist
            • Vl-udptable
            • Vl-udplist
            • Vl-udpentrylist
            • Vl-programlist
            • Vl-paramvaluelist
            • Vl-packagelist
            • Vl-namedparamvaluelist
            • Vl-namedarglist
            • Vl-modulelist
            • Vl-modportlist
            • Vl-modport-portlist
            • Vl-interfacelist
            • Vl-initiallist
            • Vl-genvarlist
            • Vl-fwdtypedeflist
            • Vl-evatomlist
            • Vl-enumitemlist
            • Vl-distlist
            • Vl-configlist
            • Vl-alwayslist
            • Vl-aliaslist
            • Vl-regularportlist
            • Vl-rangelist-list
            • Vl-rangelist
            • Vl-paramdecllist-list
            • Vl-modelementlist
            • Vl-maybe-range-list
            • Vl-interfaceportlist
            • Vl-argumentlist
            • Data-types
          • Getting-started
          • Utilities
          • Loader
          • Transforms
          • Lint
          • Mlib
          • Server
          • Kit
          • Printer
          • Esim-vl
          • Well-formedness
        • Sv
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Relocate
    • Vl-portdecllist-p

    Vl-relocate-portdecls

    (vl-relocate-portdecls loc x) maps change-vl-portdecl across a list.

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

    This is an ordinary defprojection.

    Definitions and Theorems

    Function: vl-relocate-portdecls-exec

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

    Function: vl-relocate-portdecls-nrev

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

    Function: vl-relocate-portdecls

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

    Theorem: vl-portdecllist-p-of-vl-relocate-portdecls

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

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

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

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

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

    Theorem: vl-relocate-portdecls-of-vl-portdecllist-fix-x

    (defthm vl-relocate-portdecls-of-vl-portdecllist-fix-x
      (equal (vl-relocate-portdecls loc (vl-portdecllist-fix x))
             (vl-relocate-portdecls loc x)))

    Theorem: vl-relocate-portdecls-vl-portdecllist-equiv-congruence-on-x

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

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

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

    Theorem: vl-relocate-portdecls-of-revappend

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

    Theorem: nthcdr-of-vl-relocate-portdecls

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

    Theorem: nth-of-vl-relocate-portdecls

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

    Theorem: vl-relocate-portdecls-nrev-removal

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

    Theorem: vl-relocate-portdecls-exec-removal

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

    Theorem: vl-relocate-portdecls-of-take

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

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

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

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

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

    Theorem: member-of-change-vl-portdecl-in-vl-relocate-portdecls

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

    Theorem: vl-relocate-portdecls-of-rev

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

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

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

    Theorem: vl-relocate-portdecls-of-append

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

    Theorem: cdr-of-vl-relocate-portdecls

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

    Theorem: car-of-vl-relocate-portdecls

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

    Theorem: vl-relocate-portdecls-under-iff

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

    Theorem: consp-of-vl-relocate-portdecls

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

    Theorem: len-of-vl-relocate-portdecls

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

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

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

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

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

    Theorem: vl-relocate-portdecls-of-cons

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