Evaluation semantics of complex.
Function:
(defun eval-complex (x y) (declare (xargs :guard (and (valuep x) (valuep y)))) (let ((__function__ 'eval-complex)) (declare (ignorable __function__)) (b* ((x-rational (if (value-case-rational x) (value-rational->get x) 0)) (y-rational (if (value-case-rational y) (value-rational->get y) 0))) (value-number (complex x-rational y-rational)))))
Theorem:
(defthm valuep-of-eval-complex (b* ((result (eval-complex x y))) (valuep result)) :rule-classes :rewrite)
Theorem:
(defthm eval-complex-of-value-fix-x (equal (eval-complex (value-fix x) y) (eval-complex x y)))
Theorem:
(defthm eval-complex-value-equiv-congruence-on-x (implies (value-equiv x x-equiv) (equal (eval-complex x y) (eval-complex x-equiv y))) :rule-classes :congruence)
Theorem:
(defthm eval-complex-of-value-fix-y (equal (eval-complex x (value-fix y)) (eval-complex x y)))
Theorem:
(defthm eval-complex-value-equiv-congruence-on-y (implies (value-equiv y y-equiv) (equal (eval-complex x y) (eval-complex x y-equiv))) :rule-classes :congruence)