Lift atc-get-var-check-innermost to lists.
(atc-get-vars-check-innermost vars inscope) → (mv info?-list innermostp-list)
This is used when we encounter an mv-let in code generation. We need to ensure that all the variables are in scope, and we need to know which ones are in the innermost scope. This function returns that information.
Function:
(defun atc-get-vars-check-innermost (vars inscope) (declare (xargs :guard (and (symbol-listp vars) (atc-symbol-varinfo-alist-listp inscope)))) (let ((__function__ 'atc-get-vars-check-innermost)) (declare (ignorable __function__)) (b* (((when (endp vars)) (mv nil nil)) ((mv info? innermostp) (atc-get-var-check-innermost (car vars) inscope)) ((mv info?-list innermostp-list) (atc-get-vars-check-innermost (cdr vars) inscope))) (mv (cons info? info?-list) (cons innermostp innermostp-list)))))
Theorem:
(defthm atc-var-info-option-listp-of-atc-get-vars-check-innermost.info?-list (b* (((mv ?info?-list ?innermostp-list) (atc-get-vars-check-innermost vars inscope))) (atc-var-info-option-listp info?-list)) :rule-classes :rewrite)
Theorem:
(defthm boolean-listp-of-atc-get-vars-check-innermost.innermostp-list (b* (((mv ?info?-list ?innermostp-list) (atc-get-vars-check-innermost vars inscope))) (boolean-listp innermostp-list)) :rule-classes :rewrite)
Theorem:
(defthm len-of-atc-get-vars-check-innermost.info?-list (b* (((mv ?info?-list ?innermostp-list) (atc-get-vars-check-innermost vars inscope))) (equal (len info?-list) (len vars))))
Theorem:
(defthm len-of-atc-get-vars-check-innermost.innermostp-list (b* (((mv ?info?-list ?innermostp-list) (atc-get-vars-check-innermost vars inscope))) (equal (len innermostp-list) (len vars))))