Assign random values to the register nodes of an AIG in an s32v
(s32v-randomize-regs n s32v aignet state) → (mv new-s32v new-state)
Function:
(defun s32v-randomize-regs (n s32v aignet state) (declare (xargs :stobjs (s32v aignet state))) (declare (xargs :guard (natp n))) (declare (xargs :guard (and (<= n (num-regs aignet)) (<= (num-fanins aignet) (s32v-nrows s32v))))) (let ((__function__ 's32v-randomize-regs)) (declare (ignorable __function__)) (if (mbe :logic (zp (- (num-regs aignet) (nfix n))) :exec (eql n (num-regs aignet))) (mv s32v state) (b* (((mv s32v state) (s32v-randomize (regnum->id n aignet) s32v state))) (s32v-randomize-regs (1+ (lnfix n)) s32v aignet state)))))
Theorem:
(defthm ncols-of-s32v-randomize-regs (b* (((mv ?new-s32v ?new-state) (s32v-randomize-regs n s32v aignet state))) (equal (stobjs::2darr->ncols new-s32v) (stobjs::2darr->ncols s32v))))
Theorem:
(defthm nrows-of-s32v-randomize-regs (b* (((mv ?new-s32v ?new-state) (s32v-randomize-regs n s32v aignet state))) (implies (< (fanin-count aignet) (len (stobjs::2darr->rows s32v))) (equal (len (stobjs::2darr->rows new-s32v)) (len (stobjs::2darr->rows s32v))))))
Theorem:
(defthm w-state-of-s32v-randomize-regs (equal (w (mv-nth 1 (s32v-randomize-regs n s32v aignet state))) (w state)))
Theorem:
(defthm s32v-randomize-regs-of-nfix-n (equal (s32v-randomize-regs (nfix n) s32v aignet state) (s32v-randomize-regs n s32v aignet state)))
Theorem:
(defthm s32v-randomize-regs-nat-equiv-congruence-on-n (implies (nat-equiv n n-equiv) (equal (s32v-randomize-regs n s32v aignet state) (s32v-randomize-regs n-equiv s32v aignet state))) :rule-classes :congruence)