Find the theorem with a given name in a list of top-level constructs.
(get-theorem name tops) → thm?
We return
Function:
(defun get-theorem (name tops) (declare (xargs :guard (and (identifierp name) (toplevel-listp tops)))) (let ((__function__ 'get-theorem)) (declare (ignorable __function__)) (b* (((when (endp tops)) nil) (top (car tops))) (toplevel-case top :type (get-theorem name (cdr tops)) :types (get-theorem name (cdr tops)) :function (get-theorem name (cdr tops)) :functions (get-theorem name (cdr tops)) :specification (get-theorem name (cdr tops)) :theorem (if (identifier-equiv name (theorem->name top.get)) top.get (get-theorem name (cdr tops))) :transform (get-theorem name (cdr tops))))))
Theorem:
(defthm maybe-theoremp-of-get-theorem (b* ((thm? (get-theorem name tops))) (maybe-theoremp thm?)) :rule-classes :rewrite)
Theorem:
(defthm get-theorem-of-identifier-fix-name (equal (get-theorem (identifier-fix name) tops) (get-theorem name tops)))
Theorem:
(defthm get-theorem-identifier-equiv-congruence-on-name (implies (identifier-equiv name name-equiv) (equal (get-theorem name tops) (get-theorem name-equiv tops))) :rule-classes :congruence)
Theorem:
(defthm get-theorem-of-toplevel-list-fix-tops (equal (get-theorem name (toplevel-list-fix tops)) (get-theorem name tops)))
Theorem:
(defthm get-theorem-toplevel-list-equiv-congruence-on-tops (implies (toplevel-list-equiv tops tops-equiv) (equal (get-theorem name tops) (get-theorem name tops-equiv))) :rule-classes :congruence)