Constructor that produces either a function call or lambda call pseudo-term, depending whether the given function is a function symbol or lambda.
(pseudo-term-call fn args) → term
Function:
(defun pseudo-term-call (fn args) (declare (xargs :guard (and (pseudo-fn-p fn) (pseudo-term-listp args)))) (declare (xargs :guard (pseudo-fn-args-p fn args))) (let ((__function__ 'pseudo-term-call)) (declare (ignorable __function__)) (mbe :logic (if (consp fn) (pseudo-term-lambda (pseudo-lambda->formals fn) (pseudo-lambda->body fn) args) (pseudo-term-fncall fn args)) :exec (cons fn args))))
Theorem:
(defthm pseudo-termp-of-pseudo-term-call (b* ((term (pseudo-term-call fn args))) (pseudo-termp term)) :rule-classes :rewrite)
Theorem:
(defthm kind-of-pseudo-term-call (or (equal (pseudo-term-kind (pseudo-term-call fn args)) :fncall) (equal (pseudo-term-kind (pseudo-term-call fn args)) :lambda)) :rule-classes ((:forward-chaining :trigger-terms ((pseudo-term-kind (pseudo-term-call fn args))))))
Theorem:
(defthm pseudo-term-call->fn-of-pseudo-term-call (equal (pseudo-term-call->fn (pseudo-term-call fn args)) (pseudo-fn-fix fn)))
Theorem:
(defthm pseudo-term-call->args-of-pseudo-term-call (equal (pseudo-term-call->args (pseudo-term-call fn args)) (pseudo-fn-args-fix fn args)))
Theorem:
(defthm pseudo-term-call-when-function (implies (not (consp fn)) (equal (pseudo-term-call fn args) (pseudo-term-fncall fn args))))
Theorem:
(defthm pseudo-term-call-when-lambda (implies (consp fn) (equal (pseudo-term-call fn args) (pseudo-term-lambda (pseudo-lambda->formals fn) (pseudo-lambda->body fn) args))))
Theorem:
(defthm pseudo-term-call-of-accessors (implies (or (equal (pseudo-term-kind x) :lambda) (equal (pseudo-term-kind x) :fncall)) (equal (pseudo-term-call (pseudo-term-call->fn x) (pseudo-term-call->args x)) (pseudo-term-fix x))))
Theorem:
(defthm base-ev-of-pseudo-term-call (implies (syntaxp (not (equal a ''nil))) (equal (base-ev (pseudo-term-call fn args) a) (base-ev (pseudo-term-call fn (kwote-lst (base-ev-list args a))) nil))))
Theorem:
(defthm base-ev-when-pseudo-term-call (implies (and (or (equal (pseudo-term-kind x) :lambda) (equal (pseudo-term-kind x) :fncall)) (syntaxp (not (and (consp x) (eq (car x) 'pseudo-term-call))))) (equal (base-ev x a) (base-ev (pseudo-term-call (pseudo-term-call->fn x) (kwote-lst (base-ev-list (pseudo-term-call->args x) a))) nil))))
Theorem:
(defthm pseudo-term-call-of-pseudo-fn-fix-fn (equal (pseudo-term-call (pseudo-fn-fix fn) args) (pseudo-term-call fn args)))
Theorem:
(defthm pseudo-term-call-pseudo-fn-equiv-congruence-on-fn (implies (pseudo-fn-equiv fn fn-equiv) (equal (pseudo-term-call fn args) (pseudo-term-call fn-equiv args))) :rule-classes :congruence)
Theorem:
(defthm pseudo-term-call-of-pseudo-term-list-fix-args (equal (pseudo-term-call fn (pseudo-term-list-fix args)) (pseudo-term-call fn args)))
Theorem:
(defthm pseudo-term-call-pseudo-term-list-equiv-congruence-on-args (implies (pseudo-term-list-equiv args args-equiv) (equal (pseudo-term-call fn args) (pseudo-term-call fn args-equiv))) :rule-classes :congruence)