Basic well-formedness constraints for the AIG network.
(aignet-nodes-ok aignet) → *
We require that:
Function:
(defun aignet-nodes-ok (aignet) (declare (xargs :guard (node-listp aignet))) (let ((__function__ 'aignet-nodes-ok)) (declare (ignorable __function__)) (if (endp aignet) t (and (aignet-case (node->type (car aignet)) (node->regp (car aignet)) :ci t :po (aignet-litp (co-node->fanin (car aignet)) (cdr aignet)) :nxst (and (aignet-litp (co-node->fanin (car aignet)) (cdr aignet)) (< (nxst-node->reg (car aignet)) (stype-count :reg (cdr aignet)))) :gate (let ((f0 (gate-node->fanin0 (car aignet))) (f1 (gate-node->fanin1 (car aignet)))) (and (aignet-litp f0 (cdr aignet)) (aignet-litp f1 (cdr aignet)))) :otherwise nil) (aignet-nodes-ok (cdr aignet))))))
Theorem:
(defthm aignet-nodes-ok-of-node-list-fix-aignet (equal (aignet-nodes-ok (node-list-fix aignet)) (aignet-nodes-ok aignet)))
Theorem:
(defthm aignet-nodes-ok-node-list-equiv-congruence-on-aignet (implies (node-list-equiv aignet aignet-equiv) (equal (aignet-nodes-ok aignet) (aignet-nodes-ok aignet-equiv))) :rule-classes :congruence)
Theorem:
(defthm proper-node-list-when-aignet-nodes-ok (implies (and (aignet-nodes-ok aignet) (node-listp aignet)) (proper-node-listp aignet)))
Theorem:
(defthm co-fanin-ordered-when-aignet-nodes-ok (implies (and (aignet-nodes-ok aignet) (equal (node->type (car (lookup-id id aignet))) (out-type))) (< (lit-id (co-node->fanin (car (lookup-id id aignet)))) (nfix id))) :rule-classes (:rewrite (:linear :trigger-terms ((lit-id (co-node->fanin (car (lookup-id id aignet))))))))
Theorem:
(defthm nxst-reg-ordered-when-aignet-nodes-ok (implies (and (aignet-nodes-ok aignet) (equal (node->type (car (lookup-id id aignet))) (out-type)) (equal (node->regp (car (lookup-id id aignet))) 1)) (< (nxst-node->reg (car (lookup-id id aignet))) (stype-count :reg (lookup-id id aignet)))) :rule-classes (:rewrite (:linear :trigger-terms ((nxst-node->reg (car (lookup-id id aignet)))))))
Theorem:
(defthm gate-fanin0-ordered-when-aignet-nodes-ok (implies (and (aignet-nodes-ok aignet) (equal (node->type (car (lookup-id id aignet))) (gate-type))) (< (lit-id (gate-node->fanin0 (car (lookup-id id aignet)))) (nfix id))) :rule-classes (:rewrite (:linear :trigger-terms ((lit-id (gate-node->fanin0 (car (lookup-id id aignet))))))))
Theorem:
(defthm gate-fanin1-ordered-when-aignet-nodes-ok (implies (and (aignet-nodes-ok aignet) (equal (node->type (car (lookup-id id aignet))) (gate-type))) (< (lit-id (gate-node->fanin1 (car (lookup-id id aignet)))) (nfix id))) :rule-classes (:rewrite (:linear :trigger-terms ((lit-id (gate-node->fanin1 (car (lookup-id id aignet))))))))
Theorem:
(defthm co-fanin-aignet-litp-when-aignet-nodes-ok (implies (and (aignet-nodes-ok aignet) (equal (node->type (car (lookup-id id aignet))) (out-type)) (aignet-extension-p aignet2 (cdr (lookup-id id aignet)))) (aignet-litp (co-node->fanin (car (lookup-id id aignet))) aignet2)))
Theorem:
(defthm gate-fanin0-aignet-litp-when-aignet-nodes-ok (implies (and (aignet-nodes-ok aignet) (equal (node->type (car (lookup-id id aignet))) (gate-type)) (aignet-extension-p aignet2 (cdr (lookup-id id aignet)))) (aignet-litp (gate-node->fanin0 (car (lookup-id id aignet))) aignet2)))
Theorem:
(defthm gate-fanin1-aignet-litp-when-aignet-nodes-ok (implies (and (aignet-nodes-ok aignet) (equal (node->type (car (lookup-id id aignet))) (gate-type)) (aignet-extension-p aignet2 (cdr (lookup-id id aignet)))) (aignet-litp (gate-node->fanin1 (car (lookup-id id aignet))) aignet2)))
Theorem:
(defthm aignet-nodes-ok-of-extension (implies (and (aignet-extension-p y x) (aignet-nodes-ok y)) (aignet-nodes-ok x)))
Theorem:
(defthm aignet-nodes-ok-of-suffix-inverse (implies (and (aignet-extension-bind-inverse :orig x :new y) (aignet-nodes-ok y)) (aignet-nodes-ok x)))