Check if a term is a (translated) call of a lambda expression.
(check-lambda-call term) → (mv yes/no formals body args)
If it is, the first result is
See also check-nary-lambda-call.
Function:
(defun check-lambda-call (term) (declare (xargs :guard (pseudo-termp term))) (let ((__function__ 'check-lambda-call)) (declare (ignorable __function__)) (b* (((when (variablep term)) (mv nil nil nil nil)) ((when (fquotep term)) (mv nil nil nil nil)) (fn (ffn-symb term)) ((when (symbolp fn)) (mv nil nil nil nil))) (mv t (lambda-formals fn) (lambda-body fn) (fargs term)))))
Theorem:
(defthm booleanp-of-check-lambda-call.yes/no (b* (((mv ?yes/no ?formals ?body ?args) (check-lambda-call term))) (booleanp yes/no)) :rule-classes :rewrite)
Theorem:
(defthm symbol-listp-of-check-lambda-call.formals (implies (and (pseudo-termp term)) (b* (((mv ?yes/no ?formals ?body ?args) (check-lambda-call term))) (symbol-listp formals))) :rule-classes :rewrite)
Theorem:
(defthm pseudo-termp-of-check-lambda-call.body (implies (and (pseudo-termp term)) (b* (((mv ?yes/no ?formals ?body ?args) (check-lambda-call term))) (pseudo-termp body))) :rule-classes :rewrite)
Theorem:
(defthm pseudo-term-listp-of-check-lambda-call.args (implies (and (pseudo-termp term)) (b* (((mv ?yes/no ?formals ?body ?args) (check-lambda-call term))) (pseudo-term-listp args))) :rule-classes :rewrite)
Theorem:
(defthm len-of-check-lambda-calls.formals-is-args (implies (and (pseudo-termp term)) (b* (((mv ?yes/no ?formals ?body ?args) (check-lambda-call term))) (equal (len formals) (len args)))))
Theorem:
(defthm len-of-check-lambda-calls.args-is-formals (implies (and (pseudo-termp term)) (b* (((mv ?yes/no ?formals ?body ?args) (check-lambda-call term))) (equal (len args) (len formals)))))
Theorem:
(defthm true-listp-of-check-lambda-call.formals (implies (and (pseudo-termp term)) (b* (((mv ?yes/no ?formals ?body ?args) (check-lambda-call term))) (true-listp formals))) :rule-classes :type-prescription)
Theorem:
(defthm true-listp-of-check-lambda-call.args (implies (and (pseudo-termp term)) (b* (((mv ?yes/no ?formals ?body ?args) (check-lambda-call term))) (true-listp args))) :rule-classes :type-prescription)
Theorem:
(defthm acl2-count-of-check-lambda-call.body (b* (((mv ?yes/no ?formals ?body ?args) (check-lambda-call term))) (implies yes/no (< (acl2-count body) (acl2-count term)))) :rule-classes :linear)
Theorem:
(defthm acl2-count-of-check-lambda-call.args (b* (((mv ?yes/no ?formals ?body ?args) (check-lambda-call term))) (implies yes/no (< (acl2-count args) (acl2-count term)))) :rule-classes :linear)