Evaluation semantics of coerce.
Theorem:
(defthm verify-guards-lemma (implies (character-listp x) (good-valuep x)))
Function:
(defun eval-coerce (x y) (declare (xargs :guard (and (valuep x) (valuep y)))) (let ((__function__ 'eval-coerce)) (declare (ignorable __function__)) (cond ((value-equiv y (value-symbol (lift-symbol 'list))) (if (value-case x :string) (lift-value (coerce (value-string->get x) 'list)) (value-nil))) (t (value-string (coerce (make-character-list (lower-value x)) 'string))))))
Theorem:
(defthm valuep-of-eval-coerce (b* ((result (eval-coerce x y))) (valuep result)) :rule-classes :rewrite)
Theorem:
(defthm eval-coerce-of-value-fix-x (equal (eval-coerce (value-fix x) y) (eval-coerce x y)))
Theorem:
(defthm eval-coerce-value-equiv-congruence-on-x (implies (value-equiv x x-equiv) (equal (eval-coerce x y) (eval-coerce x-equiv y))) :rule-classes :congruence)
Theorem:
(defthm eval-coerce-of-value-fix-y (equal (eval-coerce x (value-fix y)) (eval-coerce x y)))
Theorem:
(defthm eval-coerce-value-equiv-congruence-on-y (implies (value-equiv y y-equiv) (equal (eval-coerce x y) (eval-coerce x y-equiv))) :rule-classes :congruence)