(vl-lex-main echars st warnings) → (mv successp token-list warnings)
Function:
(defun vl-lex-main (echars st warnings) (declare (xargs :guard (and (vl-echarlist-p echars) (vl-lexstate-p st) (vl-warninglist-p warnings)))) (let ((__function__ 'vl-lex-main)) (declare (ignorable __function__)) (mbe :logic (b* (((when (atom echars)) (mv t nil (ok))) ((mv first echars warnings) (vl-lex-token echars st warnings)) ((unless first) (mv nil nil warnings)) ((mv successp rest warnings) (vl-lex-main echars st warnings))) (mv successp (cons first rest) warnings)) :exec (with-local-stobj nrev (mv-let (successp tokens warnings nrev) (b* (((mv successp nrev warnings) (vl-lex-main-exec echars nrev st warnings)) ((mv tokens nrev) (nrev-finish nrev))) (mv successp tokens warnings nrev)) (mv successp tokens warnings))))))
Theorem:
(defthm vl-warninglist-p-of-vl-lex-main.warnings (b* (((mv ?successp ?token-list ?warnings) (vl-lex-main echars st warnings))) (vl-warninglist-p warnings)) :rule-classes :rewrite)
Theorem:
(defthm vl-lex-main-exec-redefinition (equal (vl-lex-main-exec echars acc st warnings) (mv-let (successp tokens warnings) (vl-lex-main echars st warnings) (mv successp (append acc tokens) warnings))))
Theorem:
(defthm type-of-vl-lex-main-successp (booleanp (mv-nth 0 (vl-lex-main echars st warnings))) :rule-classes :type-prescription)
Theorem:
(defthm true-listp-of-vl-lex-main-tokens (true-listp (mv-nth 1 (vl-lex-main echars st warnings))) :rule-classes :type-prescription)
Theorem:
(defthm vl-tokenlist-p-of-vl-lex-main (implies (and (force (vl-echarlist-p echars)) (force (vl-lexstate-p st))) (vl-tokenlist-p (mv-nth 1 (vl-lex-main echars st warnings)))))
Theorem:
(defthm vl-tokenlist->etext-of-vl-lex-main (b* (((mv okp tokens ?warnings) (vl-lex-main echars st warnings))) (implies (and okp (force (vl-echarlist-p echars)) (force (true-listp echars)) (force (vl-lexstate-p st))) (equal (vl-tokenlist->etext tokens) echars))))