Function:
(defun svstack-lookup (k stack) (declare (xargs :guard (and (svar-p k) (svstack-p stack)))) (let ((__function__ 'svstack-lookup)) (declare (ignorable __function__)) (if (atom stack) nil (or (svex-fastlookup k (car stack)) (svstack-lookup k (cdr stack))))))
Theorem:
(defthm return-type-of-svstack-lookup (b* ((value? (svstack-lookup k stack))) (iff (svex-p value?) value?)) :rule-classes :rewrite)
Theorem:
(defthm svstack-lookup-in-terms-of-svex-alist (b* ((?value? (svstack-lookup k stack))) (equal value? (svex-lookup k (svstack-to-svex-alist stack)))))
Theorem:
(defthm svstack-lookup-of-svar-fix-k (equal (svstack-lookup (svar-fix k) stack) (svstack-lookup k stack)))
Theorem:
(defthm svstack-lookup-svar-equiv-congruence-on-k (implies (svar-equiv k k-equiv) (equal (svstack-lookup k stack) (svstack-lookup k-equiv stack))) :rule-classes :congruence)
Theorem:
(defthm svstack-lookup-of-svstack-fix-stack (equal (svstack-lookup k (svstack-fix stack)) (svstack-lookup k stack)))
Theorem:
(defthm svstack-lookup-svstack-equiv-congruence-on-stack (implies (svstack-equiv stack stack-equiv) (equal (svstack-lookup k stack) (svstack-lookup k stack-equiv))) :rule-classes :congruence)