Check if a term is a (translated) call of a unary lambda expression.
(check-unary-lambda-call term) → (mv yes/no formal body arg)
This is a specialization of check-nary-lambda-call that returns a single formal and a single argument instead of two singleton lists.
Function:
(defun check-unary-lambda-call (term) (declare (xargs :guard (pseudo-termp term))) (let ((__function__ 'check-unary-lambda-call)) (declare (ignorable __function__)) (b* (((mv yes/no formals body args) (check-nary-lambda-call term 1)) ((unless yes/no) (mv nil nil nil nil))) (mv t (car formals) body (car args)))))
Theorem:
(defthm booleanp-of-check-unary-lambda-call.yes/no (b* (((mv ?yes/no ?formal ?body ?arg) (check-unary-lambda-call term))) (booleanp yes/no)) :rule-classes :rewrite)
Theorem:
(defthm symbolp-of-check-unary-lambda-call.formal (implies (and (pseudo-termp term)) (b* (((mv ?yes/no ?formal ?body ?arg) (check-unary-lambda-call term))) (symbolp formal))) :rule-classes :rewrite)
Theorem:
(defthm pseudo-termp-of-check-unary-lambda-call.body (implies (and (pseudo-termp term)) (b* (((mv ?yes/no ?formal ?body ?arg) (check-unary-lambda-call term))) (pseudo-termp body))) :rule-classes :rewrite)
Theorem:
(defthm pseudo-termp-of-check-unary-lambda-call.arg (implies (and (pseudo-termp term)) (b* (((mv ?yes/no ?formal ?body ?arg) (check-unary-lambda-call term))) (pseudo-termp arg))) :rule-classes :rewrite)
Theorem:
(defthm acl2-count-of-check-unary-lambda-call.body (b* (((mv ?yes/no ?formal ?body ?arg) (check-unary-lambda-call term))) (implies yes/no (< (acl2-count body) (acl2-count term)))) :rule-classes :linear)
Theorem:
(defthm acl2-count-of-check-unary-lambda-call.arg (b* (((mv ?yes/no ?formal ?body ?arg) (check-unary-lambda-call term))) (implies yes/no (< (acl2-count arg) (acl2-count term)))) :rule-classes :linear)