Look up the next-state node that corresponds to particular register node.
(lookup-reg->nxst reg aignet) → nxst-lit
Note: This is different from the other lookups: it's by ID of the corresponding RO node, not IO number. I think the asymmetry is worth it though.
Function:
(defun lookup-reg->nxst (reg aignet) (declare (xargs :guard (and (natp reg) (node-listp aignet)))) (let ((__function__ 'lookup-reg->nxst)) (declare (ignorable __function__)) (cond ((endp aignet) 0) ((and (equal (stype (car aignet)) (nxst-stype)) (b* ((ro (nxst-node->reg (car aignet)))) (and (nat-equiv reg ro) (< ro (stype-count :reg aignet))))) (aignet-lit-fix (nxst-node->fanin (car aignet)) aignet)) ((and (equal (stype (car aignet)) (reg-stype)) (nat-equiv (stype-count :reg (cdr aignet)) reg)) (make-lit (fanin-count aignet) 0)) (t (lookup-reg->nxst reg (cdr aignet))))))
Theorem:
(defthm litp-of-lookup-reg->nxst (b* ((nxst-lit (lookup-reg->nxst reg aignet))) (litp nxst-lit)) :rule-classes :type-prescription)
Theorem:
(defthm aignet-litp-of-lookup-reg->nxst (aignet-litp (lookup-reg->nxst reg aignet) aignet))
Theorem:
(defthm lookup-reg->nxst-of-nfix-reg (equal (lookup-reg->nxst (nfix reg) aignet) (lookup-reg->nxst reg aignet)))
Theorem:
(defthm lookup-reg->nxst-nat-equiv-congruence-on-reg (implies (nat-equiv reg reg-equiv) (equal (lookup-reg->nxst reg aignet) (lookup-reg->nxst reg-equiv aignet))) :rule-classes :congruence)
Theorem:
(defthm lookup-reg->nxst-of-node-list-fix-aignet (equal (lookup-reg->nxst reg (node-list-fix aignet)) (lookup-reg->nxst reg aignet)))
Theorem:
(defthm lookup-reg->nxst-node-list-equiv-congruence-on-aignet (implies (node-list-equiv aignet aignet-equiv) (equal (lookup-reg->nxst reg aignet) (lookup-reg->nxst reg aignet-equiv))) :rule-classes :congruence)
Theorem:
(defthm lookup-reg->nxst-id-bound (<= (lit->var (lookup-reg->nxst n aignet)) (fanin-count aignet)) :rule-classes :linear)
Theorem:
(defthm lookup-reg->nxst-out-of-bounds (implies (<= (stype-count :reg aignet) (nfix n)) (equal (lookup-reg->nxst n aignet) 0)))