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