(vl-enumname-declarations x nextval basetype atts loc) → (mv warnings params new-nextval)
Function:
(defun vl-enumname-declarations (x nextval basetype atts loc) (declare (xargs :guard (and (vl-enumitem-p x) (vl-expr-p nextval) (vl-datatype-p basetype) (vl-atts-p atts) (vl-location-p loc)))) (let ((__function__ 'vl-enumname-declarations)) (declare (ignorable __function__)) (b* (((vl-enumitem x)) (nextval (vl-expr-fix nextval)) (warnings nil) (val (or x.value nextval)) ((unless x.range) (b* ((decl (make-vl-paramdecl :name x.name :localp t :type (make-vl-explicitvalueparam :type basetype :default val) :atts atts :loc loc)) (nextval (make-vl-binary :op :vl-binary-plus :left (vl-idexpr x.name) :right (vl-make-index 1)))) (mv (ok) (list decl) nextval))) ((unless (vl-range-resolved-p x.range)) (mv (warn :type :vl-enum-declarations-fail :msg "Non-constant range on enum item ~s0" :args (list x.name)) nil nextval)) ((vl-range x.range)) ((mv decls nextval) (vl-enumname-range-declarations x.name (vl-resolved->val x.range.msb) (vl-resolved->val x.range.lsb) val basetype atts loc))) (mv (ok) decls nextval))))
Theorem:
(defthm vl-warninglist-p-of-vl-enumname-declarations.warnings (b* (((mv ?warnings ?params ?new-nextval) (vl-enumname-declarations x nextval basetype atts loc))) (vl-warninglist-p warnings)) :rule-classes :rewrite)
Theorem:
(defthm vl-paramdecllist-p-of-vl-enumname-declarations.params (b* (((mv ?warnings ?params ?new-nextval) (vl-enumname-declarations x nextval basetype atts loc))) (vl-paramdecllist-p params)) :rule-classes :rewrite)
Theorem:
(defthm vl-expr-p-of-vl-enumname-declarations.new-nextval (b* (((mv ?warnings ?params ?new-nextval) (vl-enumname-declarations x nextval basetype atts loc))) (vl-expr-p new-nextval)) :rule-classes :rewrite)
Theorem:
(defthm vl-enumname-declarations-of-vl-enumitem-fix-x (equal (vl-enumname-declarations (vl-enumitem-fix x) nextval basetype atts loc) (vl-enumname-declarations x nextval basetype atts loc)))
Theorem:
(defthm vl-enumname-declarations-vl-enumitem-equiv-congruence-on-x (implies (vl-enumitem-equiv x x-equiv) (equal (vl-enumname-declarations x nextval basetype atts loc) (vl-enumname-declarations x-equiv nextval basetype atts loc))) :rule-classes :congruence)
Theorem:
(defthm vl-enumname-declarations-of-vl-expr-fix-nextval (equal (vl-enumname-declarations x (vl-expr-fix nextval) basetype atts loc) (vl-enumname-declarations x nextval basetype atts loc)))
Theorem:
(defthm vl-enumname-declarations-vl-expr-equiv-congruence-on-nextval (implies (vl-expr-equiv nextval nextval-equiv) (equal (vl-enumname-declarations x nextval basetype atts loc) (vl-enumname-declarations x nextval-equiv basetype atts loc))) :rule-classes :congruence)
Theorem:
(defthm vl-enumname-declarations-of-vl-datatype-fix-basetype (equal (vl-enumname-declarations x nextval (vl-datatype-fix basetype) atts loc) (vl-enumname-declarations x nextval basetype atts loc)))
Theorem:
(defthm vl-enumname-declarations-vl-datatype-equiv-congruence-on-basetype (implies (vl-datatype-equiv basetype basetype-equiv) (equal (vl-enumname-declarations x nextval basetype atts loc) (vl-enumname-declarations x nextval basetype-equiv atts loc))) :rule-classes :congruence)
Theorem:
(defthm vl-enumname-declarations-of-vl-atts-fix-atts (equal (vl-enumname-declarations x nextval basetype (vl-atts-fix atts) loc) (vl-enumname-declarations x nextval basetype atts loc)))
Theorem:
(defthm vl-enumname-declarations-vl-atts-equiv-congruence-on-atts (implies (vl-atts-equiv atts atts-equiv) (equal (vl-enumname-declarations x nextval basetype atts loc) (vl-enumname-declarations x nextval basetype atts-equiv loc))) :rule-classes :congruence)
Theorem:
(defthm vl-enumname-declarations-of-vl-location-fix-loc (equal (vl-enumname-declarations x nextval basetype atts (vl-location-fix loc)) (vl-enumname-declarations x nextval basetype atts loc)))
Theorem:
(defthm vl-enumname-declarations-vl-location-equiv-congruence-on-loc (implies (vl-location-equiv loc loc-equiv) (equal (vl-enumname-declarations x nextval basetype atts loc) (vl-enumname-declarations x nextval basetype atts loc-equiv))) :rule-classes :congruence)