Obtain the information for a variable from the symbol table, and indicate whether the variable is in the innermost scope.
(atc-get-var-check-innermost var inscope) → (mv info? innermostp)
This is used to define atc-get-vars-check-innermost. See that function's documentation for motivation.
Function:
(defun atc-get-var-check-innermost-aux (var inscope innermostp) (declare (xargs :guard (and (symbolp var) (atc-symbol-varinfo-alist-listp inscope) (booleanp innermostp)))) (let ((__function__ 'atc-get-var-check-innermost-aux)) (declare (ignorable __function__)) (b* (((when (endp inscope)) (mv nil nil)) (scope (atc-symbol-varinfo-alist-fix (car inscope))) (type? (cdr (assoc-eq var scope))) ((when type?) (mv type? innermostp))) (atc-get-var-check-innermost-aux var (cdr inscope) nil))))
Theorem:
(defthm atc-var-info-optionp-of-atc-get-var-check-innermost-aux.info? (b* (((mv ?info? ?innermostp) (atc-get-var-check-innermost-aux var inscope innermostp))) (atc-var-info-optionp info?)) :rule-classes :rewrite)
Theorem:
(defthm booleanp-of-atc-get-var-check-innermost-aux.innermostp (implies (booleanp innermostp) (b* (((mv ?info? ?innermostp) (atc-get-var-check-innermost-aux var inscope innermostp))) (booleanp innermostp))) :rule-classes :rewrite)
Function:
(defun atc-get-var-check-innermost (var inscope) (declare (xargs :guard (and (symbolp var) (atc-symbol-varinfo-alist-listp inscope)))) (let ((__function__ 'atc-get-var-check-innermost)) (declare (ignorable __function__)) (atc-get-var-check-innermost-aux var inscope t)))
Theorem:
(defthm atc-var-info-optionp-of-atc-get-var-check-innermost.info? (b* (((mv ?info? ?innermostp) (atc-get-var-check-innermost var inscope))) (atc-var-info-optionp info?)) :rule-classes :rewrite)
Theorem:
(defthm booleanp-of-atc-get-var-check-innermost.innermostp (b* (((mv ?info? ?innermostp) (atc-get-var-check-innermost var inscope))) (booleanp innermostp)) :rule-classes :rewrite)