Handler for
(vl-process-undef loc echars defines activep) → (mv successp new-defines remainder)
We assume that an
Function:
(defun vl-process-undef (loc echars defines activep) (declare (xargs :guard (and (vl-location-p loc) (vl-echarlist-p echars) (vl-defines-p defines) (booleanp activep)))) (let ((__function__ 'vl-process-undef)) (declare (ignorable __function__)) (b* ((defines (vl-defines-fix defines)) ((mv & remainder) (vl-read-while-whitespace echars)) ((mv name & remainder) (vl-read-identifier remainder)) ((when (not name)) (mv (cw "Preprocessor error (~s0): found an `undef without a name.~%" (vl-location-string loc)) defines echars)) ((when (vl-is-compiler-directive-p name)) (mv (cw "Preprocessor error (~s0): refusing to permit `undef ~s1.~%" (vl-location-string loc) name) defines echars)) ((when (not activep)) (mv t defines remainder)) (lookup (vl-find-define name defines)) (- (if (not lookup) (cw "Preprocessor warning (~s0): found `undef ~s1, but ~s1 is ~ not defined.~%" (vl-location-string loc) name) (cw "Undefining ~s0.~%" name))) (defines (vl-delete-define name defines) )) (mv t defines remainder))))
Theorem:
(defthm vl-defines-p-of-vl-process-undef.new-defines (b* (((mv ?successp ?new-defines ?remainder) (vl-process-undef loc echars defines activep))) (vl-defines-p new-defines)) :rule-classes :rewrite)
Theorem:
(defthm vl-echarlist-p-of-vl-process-undef.remainder (implies (force (vl-echarlist-p echars)) (b* (((mv ?successp ?new-defines ?remainder) (vl-process-undef loc echars defines activep))) (vl-echarlist-p remainder))) :rule-classes :rewrite)
Theorem:
(defthm true-listp-of-vl-process-undef-remainder (equal (true-listp (mv-nth 2 (vl-process-undef loc echars defines activep))) (true-listp echars)))
Theorem:
(defthm acl2-count-of-vl-process-undef (<= (acl2-count (mv-nth 2 (vl-process-undef loc echars defines activep))) (acl2-count echars)) :rule-classes ((:rewrite) (:linear)))
Theorem:
(defthm acl2-count-of-vl-process-undef-strong (implies (mv-nth 0 (vl-process-undef loc echars defines activep)) (< (acl2-count (mv-nth 2 (vl-process-undef loc echars defines activep))) (acl2-count echars))) :rule-classes ((:rewrite) (:linear)))