• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Fgl
      • Vwsim
      • Vl
        • Syntax
          • Vl-module
          • Vl-vardecl
          • Vl-fundecl
          • Vl-interface
          • Vl-design
          • Vl-assign
          • Vl-modinst
          • Vl-gateinst
          • Vl-taskdecl
          • Vl-portdecl
          • Vl-commentmap
          • Vl-dpiimport
          • Vl-ansi-portdecl
          • Vl-package
          • Vl-paramdecl
          • Vl-dpiexport
          • Vl-class
          • Vl-sort-blockitems-aux
          • Vl-plainarglist->exprs
          • Vl-taskdecllist->names
          • Expressions-and-datatypes
          • Vl-fundecllist->names
          • Vl-udp
          • Vl-port
          • Vl-genelement
          • Vl-clkdecl
          • Vl-parse-temps
          • Vl-bind
          • Vl-namedarg
          • Vl-exprdist
          • Vl-clkassign
          • Vl-range
          • Vl-propport
          • Vl-typedef
          • Vl-gatedelay
          • Vl-dimension
          • Vl-sequence
          • Vl-clkskew
          • Vl-program
          • Vl-gatestrength
          • Vl-property
          • Vl-config
          • Vl-always
          • Vl-import
          • Vl-repeateventcontrol
          • Vl-timeliteral
          • Vl-initial
          • Vl-eventcontrol
          • Vl-final
          • Vl-udpsymbol-p
          • Vl-maybe-clkskew
          • Vl-function-specialization
          • Vl-alias
          • Vl-maybe-nettypename
          • Vl-maybe-gatedelay
          • Vl-letdecl
          • Vl-direction-p
          • Vl-modelement
          • Vl-maybe-timeprecisiondecl
          • Vl-maybe-scopeid
          • Vl-maybe-gatestrength
          • Vl-maybe-direction
          • Vl-maybe-delayoreventcontrol
          • Vl-gclkdecl
          • Vl-fwdtypedef
          • Vl-maybe-udpsymbol-p
          • Vl-maybe-timeunitdecl
          • Vl-maybe-timeliteral
          • Vl-maybe-parse-temps
          • Vl-maybe-cstrength
          • Vl-arguments
          • Vl-maybe-module
          • Vl-maybe-design
          • Vl-covergroup
          • Vl-udpline
          • Vl-timeunitdecl
          • Vl-genvar
          • Vl-defaultdisable
          • Vl-context1
          • Vl-timeprecisiondecl
          • Vl-sort-blockitems
          • Vl-elabtask
          • Vl-udpedge
          • Vl-delaycontrol
          • Vl-context
          • Vl-ctxelement
          • Vl-ctxelement->loc
          • Vl-modelement->loc
          • Statements
          • Vl-blockitem
          • Vl-vardecllist
          • Vl-interface->ifports
          • Vl-syntaxversion
          • Vl-nettypename-p
          • Vl-module->ifports
          • Vl-lifetime-p
          • Vl-paramdecllist
          • Vl-modelementlist->genelements
          • Vl-importlist
          • Vl-typedeflist
          • Vl-gatetype-p
          • Vl-cstrength-p
          • Vl-port->name
          • Vl-genelement->loc
          • Vl-delayoreventcontrol
          • Vl-udpentry-p
          • Vl-portdecllist
          • Vl-elabtask->loc
          • Property-expressions
          • Vl-taskdecllist
          • Vl-port->loc
          • Vl-fundecllist
          • Vl-sequencelist
          • Vl-propertylist
          • Vl-portlist
            • Vl-portlist-fix
            • Vl-portlist-p
              • Vl-portlist-p-basics
              • Vl-portlist->names
              • Vl-collect-interface-ports
              • Vl-collect-regular-ports
                • Vl-collect-regular-ports-exec
            • Vl-portlist-equiv
          • Vl-dpiimportlist
          • Vl-dpiexportlist
          • Vl-classlist
          • Vl-arguments->args
          • Vl-alwaystype-p
          • Vl-modinstlist
          • Vl-importpart-p
          • Vl-importpart-fix
          • Vl-bindlist
          • Vl-initiallist
          • Vl-genvarlist
          • Vl-gclkdecllist
          • Vl-function-specialization-map
          • Vl-finallist
          • Vl-elabtasklist
          • Vl-defaultdisablelist
          • Vl-clkdecllist
          • Vl-cassertionlist
          • Vl-blockstmt-p
          • Vl-assignlist
          • Vl-assertionlist
          • Vl-alwayslist
          • Vl-aliaslist
          • Vl-udptable
          • Vl-udplist
          • Vl-udpentrylist
          • Vl-propportlist
          • Vl-programlist
          • Vl-packagelist
          • Vl-namedarglist
          • Vl-modulelist
          • Vl-modportlist
          • Vl-modport-portlist
          • Vl-letdecllist
          • Vl-interfacelist
          • Vl-gateinstlist
          • Vl-fwdtypedeflist
          • Vl-covergrouplist
          • Vl-configlist
          • Vl-clkassignlist
          • Vl-blockitemlist
          • Vl-ansi-portdecllist
          • Vl-regularportlist
          • Vl-paramdecllist-list
          • Vl-modelementlist
          • Vl-interfaceportlist
          • Vl-casekey-p
          • Sv::maybe-4veclist
        • Loader
        • Warnings
        • Getting-started
        • Utilities
        • Printer
        • Kit
        • Mlib
        • Transforms
      • X86isa
      • Svl
      • Rtl
    • Software-verification
    • Math
    • Testing-utilities
  • Vl-portlist-p

Vl-collect-regular-ports

Filter a vl-portlist-p to collect only the regular ports.

Signature
(vl-collect-regular-ports x) → ifports
Arguments
x — Guard (vl-portlist-p x).
Returns
ifports — Type (and (vl-portlist-p ifports) (vl-regularportlist-p ifports)).

Definitions and Theorems

Function: vl-collect-regular-ports

(defun vl-collect-regular-ports (x)
 (declare (xargs :guard (vl-portlist-p x)))
 (let ((__function__ 'vl-collect-regular-ports))
  (declare (ignorable __function__))
  (mbe
      :logic
      (b* (((when (atom x)) nil)
           (x1 (vl-port-fix (car x)))
           ((when (eq (tag x1) :vl-regularport))
            (cons x1 (vl-collect-regular-ports (cdr x)))))
        (vl-collect-regular-ports (cdr x)))
      :exec
      (if (atom x)
          nil
        (with-local-nrev (vl-collect-regular-ports-exec x nrev))))))

Theorem: return-type-of-vl-collect-regular-ports

(defthm return-type-of-vl-collect-regular-ports
  (b* ((ifports (vl-collect-regular-ports x)))
    (and (vl-portlist-p ifports)
         (vl-regularportlist-p ifports)))
  :rule-classes :rewrite)

Theorem: vl-collect-regular-ports-exec-removal

(defthm vl-collect-regular-ports-exec-removal
  (equal (vl-collect-regular-ports-exec x nrev)
         (append nrev (vl-collect-regular-ports x))))

Theorem: vl-collect-regular-ports-when-atom

(defthm vl-collect-regular-ports-when-atom
  (implies (atom x)
           (equal (vl-collect-regular-ports x)
                  nil)))

Theorem: vl-collect-regular-ports-of-cons

(defthm vl-collect-regular-ports-of-cons
  (equal (vl-collect-regular-ports (cons a x))
         (if (eq (tag (vl-port-fix a))
                 :vl-regularport)
             (cons (vl-port-fix a)
                   (vl-collect-regular-ports x))
           (vl-collect-regular-ports x))))

Theorem: vl-collect-regular-ports-of-vl-portlist-fix-x

(defthm vl-collect-regular-ports-of-vl-portlist-fix-x
  (equal (vl-collect-regular-ports (vl-portlist-fix x))
         (vl-collect-regular-ports x)))

Theorem: vl-collect-regular-ports-vl-portlist-equiv-congruence-on-x

(defthm vl-collect-regular-ports-vl-portlist-equiv-congruence-on-x
  (implies (vl-portlist-equiv x x-equiv)
           (equal (vl-collect-regular-ports x)
                  (vl-collect-regular-ports x-equiv)))
  :rule-classes :congruence)

Subtopics

Vl-collect-regular-ports-exec