Narrowing conversion from
(long-to-short operand) → result
Function:
(defun long-to-short (operand) (declare (xargs :guard (long-valuep operand))) (b* ((x (long-value->int operand))) (short-value (logext 16 x))))
Theorem:
(defthm short-valuep-of-long-to-short (b* ((result (long-to-short operand))) (short-valuep result)) :rule-classes :rewrite)
Theorem:
(defthm long-to-short-of-long-value-fix-operand (equal (long-to-short (long-value-fix operand)) (long-to-short operand)))
Theorem:
(defthm long-to-short-long-value-equiv-congruence-on-operand (implies (long-value-equiv operand operand-equiv) (equal (long-to-short operand) (long-to-short operand-equiv))) :rule-classes :congruence)