Main routine for splitting high-arity gate instances.
(vl-gateinst-gatesplit x nf warnings) → (mv warnings new-decls new-gateinsts nf)
Function:
(defun vl-gateinst-gatesplit (x nf warnings) (declare (xargs :guard (and (vl-gateinst-p x) (vl-namefactory-p nf) (vl-warninglist-p warnings)))) (let ((__function__ 'vl-gateinst-gatesplit)) (declare (ignorable __function__)) (case (vl-gateinst->type x) ((:vl-not :vl-buf) (b* (((mv warnings new-gateinsts nf) (vl-gatesplit-buf/not x nf warnings))) (mv warnings nil new-gateinsts nf))) ((:vl-and :vl-or :vl-xor) (vl-gatesplit-and/or/xor x nf warnings)) ((:vl-nand :vl-nor :vl-xnor) (vl-gatesplit-nand/nor/xnor x nf warnings)) (otherwise (mv (ok) nil (list x) nf)))))
Theorem:
(defthm vl-warninglist-p-of-vl-gateinst-gatesplit.warnings (b* (((mv ?warnings ?new-decls ?new-gateinsts ?nf) (vl-gateinst-gatesplit x nf warnings))) (vl-warninglist-p warnings)) :rule-classes :rewrite)
Theorem:
(defthm vl-vardecllist-p-of-vl-gateinst-gatesplit.new-decls (implies (and (force (vl-gateinst-p x)) (force (vl-namefactory-p nf)) (force (vl-warninglist-p warnings))) (b* (((mv ?warnings ?new-decls ?new-gateinsts ?nf) (vl-gateinst-gatesplit x nf warnings))) (vl-vardecllist-p new-decls))) :rule-classes :rewrite)
Theorem:
(defthm vl-gateinstlist-p-of-vl-gateinst-gatesplit.new-gateinsts (implies (and (force (vl-gateinst-p x)) (force (vl-namefactory-p nf)) (force (vl-warninglist-p warnings))) (b* (((mv ?warnings ?new-decls ?new-gateinsts ?nf) (vl-gateinst-gatesplit x nf warnings))) (vl-gateinstlist-p new-gateinsts))) :rule-classes :rewrite)
Theorem:
(defthm vl-namefactory-p-of-vl-gateinst-gatesplit.nf (implies (and (force (vl-gateinst-p x)) (force (vl-namefactory-p nf)) (force (vl-warninglist-p warnings))) (b* (((mv ?warnings ?new-decls ?new-gateinsts ?nf) (vl-gateinst-gatesplit x nf warnings))) (vl-namefactory-p nf))) :rule-classes :rewrite)
Theorem:
(defthm vl-gateinst-gatesplit-mvtypes-1 (true-listp (mv-nth 1 (vl-gateinst-gatesplit x nf warnings))) :rule-classes :type-prescription)
Theorem:
(defthm vl-gateinst-gatesplit-mvtypes-2 (true-listp (mv-nth 2 (vl-gateinst-gatesplit x nf warnings))) :rule-classes :type-prescription)