Recognize valid translated lambda expression, i.e. lambda expressions in valid translated terms.
(lambdap x wrld) → yes/no
This definition mirrors the relevant portion of the definition of termp.
Function:
(defun lambdap (x wrld) (declare (xargs :guard (plist-worldp-with-formals wrld))) (let ((__function__ 'lambdap)) (declare (ignorable __function__)) (and (true-listp x) (= (len x) 3) (eq (first x) 'lambda) (arglistp (second x)) (termp (third x) wrld) (null (set-difference-eq (all-vars (third x)) (second x))))))
Theorem:
(defthm booleanp-of-lambdap (b* ((yes/no (lambdap x wrld))) (booleanp yes/no)) :rule-classes :rewrite)
Theorem:
(defthm lambdap-when-termp (implies (and (termp term wrld) (consp term) (consp (car term))) (lambdap (car term) wrld)))
Theorem:
(defthm termp-when-lambdap (implies (and (lambdap lambd wrld) (term-listp terms wrld) (equal (len terms) (len (lambda-formals lambd)))) (termp (cons lambd terms) wrld)))
Theorem:
(defthm not-lambdap-of-nil (not (lambdap nil wrld)))