(vl-maybe-usertype-resolve x) → new-x
Function:
(defun vl-maybe-usertype-resolve (x) (declare (xargs :guard (vl-datatype-p x))) (declare (xargs :guard (vl-datatype-resolved-p x))) (let ((__function__ 'vl-maybe-usertype-resolve)) (declare (ignorable __function__)) (b* ((x (vl-datatype-fix x)) ((when (or (consp (vl-datatype->pdims x)) (consp (vl-datatype->udims x)))) x)) (vl-datatype-case x :vl-usertype (if x.res (vl-maybe-usertype-resolve x.res) x) :otherwise x))))
Theorem:
(defthm vl-datatype-p-of-vl-maybe-usertype-resolve (b* ((new-x (vl-maybe-usertype-resolve x))) (vl-datatype-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm vl-datatype-count-of-vl-maybe-usertype-resolve (b* ((?new-x (vl-maybe-usertype-resolve x))) (<= (vl-datatype-count new-x) (vl-datatype-count x))) :rule-classes :linear)
Theorem:
(defthm vl-datatype-resolved-p-of-vl-maybe-usertype-resolve (b* ((?new-x (vl-maybe-usertype-resolve x))) (implies (vl-datatype-resolved-p x) (vl-datatype-resolved-p new-x))))
Theorem:
(defthm not-usertype-of-vl-maybe-usertype-resolve (b* ((?new-x (vl-maybe-usertype-resolve x))) (implies (and (not (consp (vl-datatype->pdims new-x))) (not (consp (vl-datatype->udims new-x))) (vl-datatype-resolved-p x)) (not (equal (vl-datatype-kind new-x) :vl-usertype)))) :rule-classes ((:forward-chaining :trigger-terms ((vl-datatype-kind (vl-maybe-usertype-resolve x))))))
Theorem:
(defthm vl-maybe-usertype-resolve-of-vl-datatype-fix-x (equal (vl-maybe-usertype-resolve (vl-datatype-fix x)) (vl-maybe-usertype-resolve x)))
Theorem:
(defthm vl-maybe-usertype-resolve-vl-datatype-equiv-congruence-on-x (implies (vl-datatype-equiv x x-equiv) (equal (vl-maybe-usertype-resolve x) (vl-maybe-usertype-resolve x-equiv))) :rule-classes :congruence)