Look up a function argument with a given name in a list of function arguments.
(lookup-funarg name args) → arg
Return the first match, if any.
Return
Function:
(defun lookup-funarg (name args) (declare (xargs :guard (and (identifierp name) (funarg-listp args)))) (let ((__function__ 'lookup-funarg)) (declare (ignorable __function__)) (b* (((when (endp args)) nil) (arg (car args)) ((when (identifier-equiv name (funarg->name arg))) (funarg-fix arg))) (lookup-funarg name (cdr args)))))
Theorem:
(defthm funarg-optionp-of-lookup-funarg (b* ((arg (lookup-funarg name args))) (funarg-optionp arg)) :rule-classes :rewrite)
Theorem:
(defthm lookup-funarg-of-identifier-fix-name (equal (lookup-funarg (identifier-fix name) args) (lookup-funarg name args)))
Theorem:
(defthm lookup-funarg-identifier-equiv-congruence-on-name (implies (identifier-equiv name name-equiv) (equal (lookup-funarg name args) (lookup-funarg name-equiv args))) :rule-classes :congruence)
Theorem:
(defthm lookup-funarg-of-funarg-list-fix-args (equal (lookup-funarg name (funarg-list-fix args)) (lookup-funarg name args)))
Theorem:
(defthm lookup-funarg-funarg-list-equiv-congruence-on-args (implies (funarg-list-equiv args args-equiv) (equal (lookup-funarg name args) (lookup-funarg name args-equiv))) :rule-classes :congruence)