Return the ACL2 rational from its meta representation.
(value-rational->get x) → x-rational
The name of this function is analogous to the accessor value-number->get of the fixtype of values.
Function:
(defun value-rational->get (x) (declare (xargs :guard (and (valuep x) (value-case-rational x)))) (let ((__function__ 'value-rational->get)) (declare (ignorable __function__)) (if (mbt (value-case-rational (value-fix x))) (value-number->get (value-fix x)) 0)))
Theorem:
(defthm rationalp-of-value-rational->get (b* ((x-rational (value-rational->get x))) (rationalp x-rational)) :rule-classes :rewrite)
Theorem:
(defthm value-rational->get-of-value-fix-x (equal (value-rational->get (value-fix x)) (value-rational->get x)))
Theorem:
(defthm value-rational->get-value-equiv-congruence-on-x (implies (value-equiv x x-equiv) (equal (value-rational->get x) (value-rational->get x-equiv))) :rule-classes :congruence)