Apply an svex function to some 4vec arguments.
(svex-apply fn args) → result
This function captures function application for svex-eval,
using a big case statement on the
SVEX uses a fixed language of known functions with fixed arities. If we are given a known function of proper arity, we execute the corresponding 4vec operation on its arguments.
Function:
(defun svex-apply (fn args) (declare (xargs :guard (and (fnsym-p fn) (4veclist-p args)))) (let ((__function__ 'svex-apply)) (declare (ignorable __function__)) (let* ((fn (mbe :exec fn :logic (fnsym-fix fn))) (args (mbe :logic (4veclist-fix args) :exec args))) (svex-apply-cases fn args))))
Theorem:
(defthm 4vec-p-of-svex-apply (b* ((result (svex-apply fn args))) (4vec-p result)) :rule-classes :rewrite)
Theorem:
(defthm svex-apply-of-fnsym-fix-fn (equal (svex-apply (fnsym-fix fn) args) (svex-apply fn args)))
Theorem:
(defthm svex-apply-fnsym-equiv-congruence-on-fn (implies (fnsym-equiv fn fn-equiv) (equal (svex-apply fn args) (svex-apply fn-equiv args))) :rule-classes :congruence)
Theorem:
(defthm svex-apply-of-4veclist-fix-args (equal (svex-apply fn (4veclist-fix args)) (svex-apply fn args)))
Theorem:
(defthm svex-apply-4veclist-equiv-congruence-on-args (implies (4veclist-equiv args args-equiv) (equal (svex-apply fn args) (svex-apply fn args-equiv))) :rule-classes :congruence)