Records the level of each node in aignet-levels, where combinational inputs and constants have level 0 and a node has level n+1 if its children have maximum level n.
(aignet-record-levels aignet aignet-levels) → new-aignet-levels
Does not record a level value for combinational outputs. Look up the level of its fanin node instead.
Function:
(defun aignet-record-levels (aignet aignet-levels) (declare (xargs :stobjs (aignet aignet-levels))) (declare (xargs :guard t)) (let ((__function__ 'aignet-record-levels)) (declare (ignorable __function__)) (b* ((aignet-levels (resize-u32 (num-fanins aignet) aignet-levels))) (aignet-record-levels-aux 0 aignet aignet-levels))))
Theorem:
(defthm return-type-of-aignet-record-levels (b* ((new-aignet-levels (aignet-record-levels aignet aignet-levels))) (< (fanin-count aignet) (len new-aignet-levels))) :rule-classes :linear)
Theorem:
(defthm aignet-levels-correct-of-aignet-record-levels (aignet-levels-correct-up-to (+ 1 (fanin-count aignet)) aignet (aignet-record-levels aignet aignet-levels)))
Theorem:
(defthm len-of-aignet-record-levels (b* ((?new-aignet-levels (aignet-record-levels aignet aignet-levels))) (equal (len new-aignet-levels) (num-fanins aignet))))