Assumes that x was just a plain variable, so it inherits all its info from the previous port.
(vl-ansi-portdecl-to-regularport-from-previous-regularport x prev prev-var warnings) → (mv warnings port portdecl vardecl)
Function:
(defun vl-ansi-portdecl-to-regularport-from-previous-regularport (x prev prev-var warnings) (declare (xargs :guard (and (vl-ansi-portdecl-p x) (vl-portdecl-p prev) (vl-vardecl-p prev-var) (vl-warninglist-p warnings)))) (let ((__function__ 'vl-ansi-portdecl-to-regularport-from-previous-regularport)) (declare (ignorable __function__)) (b* (((vl-ansi-portdecl x) (vl-ansi-portdecl-fix x)) ((vl-portdecl prev)) ((vl-vardecl prev-var))) (mv (ok) (make-vl-regularport :name x.name :expr (vl-idexpr x.name) :loc x.loc) (list (change-vl-portdecl prev :name x.name :loc x.loc :atts x.atts :dir prev.dir :nettype prev.nettype :type prev.type)) (list (change-vl-vardecl prev-var :name x.name :loc x.loc :type prev.type :nettype prev.nettype :varp prev-var.varp :atts (if x.atts (hons '("VL_ANSI_PORT_VARDECL") x.atts) (hons-copy '(("VL_ANSI_PORT_VARDECL")))) :initval nil :constp nil :lifetime nil :vectoredp nil :scalaredp nil :delay nil :cstrength nil))))))
Theorem:
(defthm vl-warninglist-p-of-vl-ansi-portdecl-to-regularport-from-previous-regularport.warnings (b* (((mv ?warnings ?port ?portdecl ?vardecl) (vl-ansi-portdecl-to-regularport-from-previous-regularport x prev prev-var warnings))) (vl-warninglist-p warnings)) :rule-classes :rewrite)
Theorem:
(defthm vl-regularport-p-of-vl-ansi-portdecl-to-regularport-from-previous-regularport.port (b* (((mv ?warnings ?port ?portdecl ?vardecl) (vl-ansi-portdecl-to-regularport-from-previous-regularport x prev prev-var warnings))) (vl-regularport-p port)) :rule-classes :rewrite)
Theorem:
(defthm return-type-of-vl-ansi-portdecl-to-regularport-from-previous-regularport.portdecl (b* (((mv ?warnings ?port ?portdecl ?vardecl) (vl-ansi-portdecl-to-regularport-from-previous-regularport x prev prev-var warnings))) (and (vl-portdecllist-p portdecl) (equal (len portdecl) 1))) :rule-classes :rewrite)
Theorem:
(defthm return-type-of-vl-ansi-portdecl-to-regularport-from-previous-regularport.vardecl (b* (((mv ?warnings ?port ?portdecl ?vardecl) (vl-ansi-portdecl-to-regularport-from-previous-regularport x prev prev-var warnings))) (and (vl-vardecllist-p vardecl) (equal (len vardecl) 1))) :rule-classes :rewrite)
Theorem:
(defthm vl-ansi-portdecl-to-regularport-from-previous-regularport-of-vl-ansi-portdecl-fix-x (equal (vl-ansi-portdecl-to-regularport-from-previous-regularport (vl-ansi-portdecl-fix x) prev prev-var warnings) (vl-ansi-portdecl-to-regularport-from-previous-regularport x prev prev-var warnings)))
Theorem:
(defthm vl-ansi-portdecl-to-regularport-from-previous-regularport-vl-ansi-portdecl-equiv-congruence-on-x (implies (vl-ansi-portdecl-equiv x x-equiv) (equal (vl-ansi-portdecl-to-regularport-from-previous-regularport x prev prev-var warnings) (vl-ansi-portdecl-to-regularport-from-previous-regularport x-equiv prev prev-var warnings))) :rule-classes :congruence)
Theorem:
(defthm vl-ansi-portdecl-to-regularport-from-previous-regularport-of-vl-portdecl-fix-prev (equal (vl-ansi-portdecl-to-regularport-from-previous-regularport x (vl-portdecl-fix prev) prev-var warnings) (vl-ansi-portdecl-to-regularport-from-previous-regularport x prev prev-var warnings)))
Theorem:
(defthm vl-ansi-portdecl-to-regularport-from-previous-regularport-vl-portdecl-equiv-congruence-on-prev (implies (vl-portdecl-equiv prev prev-equiv) (equal (vl-ansi-portdecl-to-regularport-from-previous-regularport x prev prev-var warnings) (vl-ansi-portdecl-to-regularport-from-previous-regularport x prev-equiv prev-var warnings))) :rule-classes :congruence)
Theorem:
(defthm vl-ansi-portdecl-to-regularport-from-previous-regularport-of-vl-vardecl-fix-prev-var (equal (vl-ansi-portdecl-to-regularport-from-previous-regularport x prev (vl-vardecl-fix prev-var) warnings) (vl-ansi-portdecl-to-regularport-from-previous-regularport x prev prev-var warnings)))
Theorem:
(defthm vl-ansi-portdecl-to-regularport-from-previous-regularport-vl-vardecl-equiv-congruence-on-prev-var (implies (vl-vardecl-equiv prev-var prev-var-equiv) (equal (vl-ansi-portdecl-to-regularport-from-previous-regularport x prev prev-var warnings) (vl-ansi-portdecl-to-regularport-from-previous-regularport x prev prev-var-equiv warnings))) :rule-classes :congruence)
Theorem:
(defthm vl-ansi-portdecl-to-regularport-from-previous-regularport-of-vl-warninglist-fix-warnings (equal (vl-ansi-portdecl-to-regularport-from-previous-regularport x prev prev-var (vl-warninglist-fix warnings)) (vl-ansi-portdecl-to-regularport-from-previous-regularport x prev prev-var warnings)))
Theorem:
(defthm vl-ansi-portdecl-to-regularport-from-previous-regularport-vl-warninglist-equiv-congruence-on-warnings (implies (vl-warninglist-equiv warnings warnings-equiv) (equal (vl-ansi-portdecl-to-regularport-from-previous-regularport x prev prev-var warnings) (vl-ansi-portdecl-to-regularport-from-previous-regularport x prev prev-var warnings-equiv))) :rule-classes :congruence)