Create the assignments for a single AIG.
(aig2c-main x seen tempmap config code) → (mv new-code seen)
Function:
(defun aig2c-main (x seen tempmap config code) (declare (xargs :guard (and (string-listp (alist-vals tempmap)) (aig2c-config-p config) (character-listp code)))) (let ((__function__ 'aig2c-main)) (declare (ignorable __function__)) (b* ((name (cdr (hons-get x tempmap))) ((unless name) (raise "AIG node isn't bound!") (mv code seen)) ((when (atom x)) (mv code seen)) ((when (hons-get x seen)) (mv code seen)) (seen (hons-acons x t seen)) ((mv code seen) (aig2c-main (car x) seen tempmap config code)) ((mv code seen) (if (cdr x) (aig2c-main (cdr x) seen tempmap config code) (mv code seen))) (code (list* #\Space #\Space code)) (code (str::revappend-chars (aig2c-config->type config) code)) (code (cons #\Space code)) (code (str::revappend-chars name code)) (code (list* #\Space #\= #\Space code)) (car-name (cdr (hons-get (car x) tempmap))) ((unless car-name) (raise "AIG node for CAR isn't bound!") (mv code seen)) ((unless (cdr x)) (b* ((code (str::revappend-chars (aig2c-config->op-not config) code)) (code (str::revappend-chars car-name code)) (code (list* #\Newline #\; code))) (mv code seen))) (cdr-name (cdr (hons-get (cdr x) tempmap))) ((unless cdr-name) (raise "AIG node for CDR isn't bound!") (mv code seen)) (code (str::revappend-chars car-name code)) (code (cons #\Space code)) (code (str::revappend-chars (aig2c-config->op-and config) code)) (code (cons #\Space code)) (code (str::revappend-chars cdr-name code)) (code (list* #\Newline #\; code))) (mv code seen))))
Theorem:
(defthm character-listp-of-aig2c-main.new-code (implies (force (character-listp code)) (b* (((mv ?new-code ?seen) (aig2c-main x seen tempmap config code))) (character-listp new-code))) :rule-classes :rewrite)