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