Helper function for creating lists of port declarations.
(vl-occform-mkports prefix i n &key dir width (loc '*vl-fakeloc*)) → (mv exprs ports portdecls vardecls)
Function:
(defun vl-occform-mkports-fn (prefix i n dir width loc) (declare (xargs :guard (and (stringp prefix) (natp i) (natp n) (vl-direction-p dir) (posp width) (vl-location-p loc)))) (declare (xargs :guard (<= i n))) (let ((__function__ 'vl-occform-mkports)) (declare (ignorable __function__)) (b* (((when (mbe :logic (zp (- (lnfix n) (lnfix i))) :exec (eql i n))) (mv nil nil nil nil)) (name1 (hons-copy (cat prefix (natstr i)))) ((mv expr1 port1 portdecl1 vardecl1) (vl-occform-mkport name1 dir width)) ((mv exprs2 ports2 portdecls2 vardecls2) (vl-occform-mkports prefix (+ 1 (lnfix i)) n :dir dir :width width :loc loc))) (mv (cons expr1 exprs2) (cons port1 ports2) (cons portdecl1 portdecls2) (cons vardecl1 vardecls2)))))
Theorem:
(defthm vl-exprlist-p-of-vl-occform-mkports.exprs (b* (((mv ?exprs ?ports ?portdecls ?vardecls) (vl-occform-mkports-fn prefix i n dir width loc))) (vl-exprlist-p exprs)) :rule-classes :rewrite)
Theorem:
(defthm vl-portlist-p-of-vl-occform-mkports.ports (b* (((mv ?exprs ?ports ?portdecls ?vardecls) (vl-occform-mkports-fn prefix i n dir width loc))) (vl-portlist-p ports)) :rule-classes :rewrite)
Theorem:
(defthm vl-portdecllist-p-of-vl-occform-mkports.portdecls (b* (((mv ?exprs ?ports ?portdecls ?vardecls) (vl-occform-mkports-fn prefix i n dir width loc))) (vl-portdecllist-p portdecls)) :rule-classes :rewrite)
Theorem:
(defthm vl-vardecllist-p-of-vl-occform-mkports.vardecls (b* (((mv ?exprs ?ports ?portdecls ?vardecls) (vl-occform-mkports-fn prefix i n dir width loc))) (vl-vardecllist-p vardecls)) :rule-classes :rewrite)
Theorem:
(defthm vl-occform-mkports-fn-mvtypes-0 (true-listp (mv-nth 0 (vl-occform-mkports-fn prefix i n dir width loc))) :rule-classes :type-prescription)
Theorem:
(defthm vl-occform-mkports-fn-mvtypes-1 (true-listp (mv-nth 1 (vl-occform-mkports-fn prefix i n dir width loc))) :rule-classes :type-prescription)
Theorem:
(defthm vl-occform-mkports-fn-mvtypes-2 (true-listp (mv-nth 2 (vl-occform-mkports-fn prefix i n dir width loc))) :rule-classes :type-prescription)
Theorem:
(defthm vl-occform-mkports-fn-mvtypes-3 (true-listp (mv-nth 3 (vl-occform-mkports-fn prefix i n dir width loc))) :rule-classes :type-prescription)
Theorem:
(defthm len-of-vl-occform-mkports (b* (((mv exprs ports portdecls vardecls) (vl-occform-mkports prefix i n :dir dir :width width :loc loc)) (len (nfix (- (nfix n) (nfix i))))) (and (equal (len exprs) len) (equal (len ports) len) (equal (len portdecls) len) (equal (len vardecls) len))))
Theorem:
(defthm vl-occform-mkports-under-iff (b* (((mv exprs ports portdecls vardecls) (vl-occform-mkports prefix i n :dir dir :width width :loc loc)) (len (- (nfix n) (nfix i)))) (and (iff exprs (posp len)) (iff ports (posp len)) (iff portdecls (posp len)) (iff vardecls (posp len)))))
Theorem:
(defthm vl-occform-mkports-fn-of-str-fix-prefix (equal (vl-occform-mkports-fn (str-fix prefix) i n dir width loc) (vl-occform-mkports-fn prefix i n dir width loc)))
Theorem:
(defthm vl-occform-mkports-fn-streqv-congruence-on-prefix (implies (streqv prefix prefix-equiv) (equal (vl-occform-mkports-fn prefix i n dir width loc) (vl-occform-mkports-fn prefix-equiv i n dir width loc))) :rule-classes :congruence)
Theorem:
(defthm vl-occform-mkports-fn-of-nfix-i (equal (vl-occform-mkports-fn prefix (nfix i) n dir width loc) (vl-occform-mkports-fn prefix i n dir width loc)))
Theorem:
(defthm vl-occform-mkports-fn-nat-equiv-congruence-on-i (implies (acl2::nat-equiv i i-equiv) (equal (vl-occform-mkports-fn prefix i n dir width loc) (vl-occform-mkports-fn prefix i-equiv n dir width loc))) :rule-classes :congruence)
Theorem:
(defthm vl-occform-mkports-fn-of-nfix-n (equal (vl-occform-mkports-fn prefix i (nfix n) dir width loc) (vl-occform-mkports-fn prefix i n dir width loc)))
Theorem:
(defthm vl-occform-mkports-fn-nat-equiv-congruence-on-n (implies (acl2::nat-equiv n n-equiv) (equal (vl-occform-mkports-fn prefix i n dir width loc) (vl-occform-mkports-fn prefix i n-equiv dir width loc))) :rule-classes :congruence)
Theorem:
(defthm vl-occform-mkports-fn-of-vl-direction-fix-dir (equal (vl-occform-mkports-fn prefix i n (vl-direction-fix dir) width loc) (vl-occform-mkports-fn prefix i n dir width loc)))
Theorem:
(defthm vl-occform-mkports-fn-vl-direction-equiv-congruence-on-dir (implies (vl-direction-equiv dir dir-equiv) (equal (vl-occform-mkports-fn prefix i n dir width loc) (vl-occform-mkports-fn prefix i n dir-equiv width loc))) :rule-classes :congruence)
Theorem:
(defthm vl-occform-mkports-fn-of-pos-fix-width (equal (vl-occform-mkports-fn prefix i n dir (pos-fix width) loc) (vl-occform-mkports-fn prefix i n dir width loc)))
Theorem:
(defthm vl-occform-mkports-fn-pos-equiv-congruence-on-width (implies (acl2::pos-equiv width width-equiv) (equal (vl-occform-mkports-fn prefix i n dir width loc) (vl-occform-mkports-fn prefix i n dir width-equiv loc))) :rule-classes :congruence)
Theorem:
(defthm vl-occform-mkports-fn-of-vl-location-fix-loc (equal (vl-occform-mkports-fn prefix i n dir width (vl-location-fix loc)) (vl-occform-mkports-fn prefix i n dir width loc)))
Theorem:
(defthm vl-occform-mkports-fn-vl-location-equiv-congruence-on-loc (implies (vl-location-equiv loc loc-equiv) (equal (vl-occform-mkports-fn prefix i n dir width loc) (vl-occform-mkports-fn prefix i n dir width loc-equiv))) :rule-classes :congruence)