(vl-consteval-ans &key value width type) → ans
Function:
(defun vl-consteval-ans-fn (value width type) (declare (xargs :guard (and (natp value) (posp width) (vl-exprtype-p type)))) (declare (xargs :guard (unsigned-byte-p width value))) (let ((__function__ 'vl-consteval-ans)) (declare (ignorable __function__)) (b* ((width (lposfix width)) (type (vl-exprtype-fix type)) (guts (make-vl-constint :value value :origwidth width :origtype type)) (ans (make-vl-atom :guts guts :finalwidth width :finaltype type))) ans)))
Theorem:
(defthm vl-expr-p-of-vl-consteval-ans (b* ((ans (vl-consteval-ans-fn value width type))) (vl-expr-p ans)) :rule-classes :rewrite)
Theorem:
(defthm vl-expr-resolved-p-of-vl-consteval-ans (vl-expr-resolved-p (vl-consteval-ans :value value :width width :type type)))
Theorem:
(defthm vl-expr-welltyped-p-of-vl-consteval-ans (vl-expr-welltyped-p (vl-consteval-ans :value value :width width :type type)))
Theorem:
(defthm vl-expr->finalwidth-of-vl-consteval-ans (equal (vl-expr->finalwidth (vl-consteval-ans :value value :width width :type type)) (pos-fix width)))
Theorem:
(defthm vl-expr->finaltype-of-vl-consteval-ans (equal (vl-expr->finaltype (vl-consteval-ans :value value :width width :type type)) (vl-exprtype-fix type)))
Theorem:
(defthm vl-consteval-ans-fn-of-nfix-value (equal (vl-consteval-ans-fn (nfix value) width type) (vl-consteval-ans-fn value width type)))
Theorem:
(defthm vl-consteval-ans-fn-nat-equiv-congruence-on-value (implies (acl2::nat-equiv value value-equiv) (equal (vl-consteval-ans-fn value width type) (vl-consteval-ans-fn value-equiv width type))) :rule-classes :congruence)
Theorem:
(defthm vl-consteval-ans-fn-of-pos-fix-width (equal (vl-consteval-ans-fn value (pos-fix width) type) (vl-consteval-ans-fn value width type)))
Theorem:
(defthm vl-consteval-ans-fn-pos-equiv-congruence-on-width (implies (acl2::pos-equiv width width-equiv) (equal (vl-consteval-ans-fn value width type) (vl-consteval-ans-fn value width-equiv type))) :rule-classes :congruence)
Theorem:
(defthm vl-consteval-ans-fn-of-vl-exprtype-fix-type (equal (vl-consteval-ans-fn value width (vl-exprtype-fix type)) (vl-consteval-ans-fn value width type)))
Theorem:
(defthm vl-consteval-ans-fn-vl-exprtype-equiv-congruence-on-type (implies (vl-exprtype-equiv type type-equiv) (equal (vl-consteval-ans-fn value width type) (vl-consteval-ans-fn value width type-equiv))) :rule-classes :congruence)