Try to override a parameter with a new datatype.
(vl-override-parameter-with-type decl datatype warnings ctx) → (mv okp warnings new-type)
Function:
(defun vl-override-parameter-with-type (decl datatype warnings ctx) (declare (xargs :guard (and (vl-paramdecl-p decl) (vl-datatype-p datatype) (vl-warninglist-p warnings) (vl-context-p ctx)))) (let ((__function__ 'vl-override-parameter-with-type)) (declare (ignorable __function__)) (b* ((decl (vl-paramdecl-fix decl)) (datatype (vl-datatype-fix datatype)) (ctx (vl-context-fix ctx)) ((vl-paramdecl decl) decl) ((unless (eq (vl-paramtype-kind decl.type) :vl-typeparam)) (vl-unparam-debug "~a0: trying to override value parameter ~a1 with datatype ~a2.~%" ctx decl datatype) (mv nil (fatal :type :vl-bad-instance :msg "~a0: can't override parameter ~s1 with datatype ~a2: ~ ~s1 is a value parameter, not a type parameter." :args (list ctx decl.name datatype)) datatype))) (vl-unparam-debug "~a0: parameter ~a1 becomes ~a2.~%" ctx decl datatype) (mv t (ok) datatype))))
Theorem:
(defthm booleanp-of-vl-override-parameter-with-type.okp (b* (((mv ?okp ?warnings ?new-type) (vl-override-parameter-with-type decl datatype warnings ctx))) (booleanp okp)) :rule-classes :type-prescription)
Theorem:
(defthm vl-warninglist-p-of-vl-override-parameter-with-type.warnings (b* (((mv ?okp ?warnings ?new-type) (vl-override-parameter-with-type decl datatype warnings ctx))) (vl-warninglist-p warnings)) :rule-classes :rewrite)
Theorem:
(defthm vl-datatype-p-of-vl-override-parameter-with-type.new-type (b* (((mv ?okp ?warnings ?new-type) (vl-override-parameter-with-type decl datatype warnings ctx))) (vl-datatype-p new-type)) :rule-classes :rewrite)
Theorem:
(defthm vl-override-parameter-with-type-of-vl-paramdecl-fix-decl (equal (vl-override-parameter-with-type (vl-paramdecl-fix decl) datatype warnings ctx) (vl-override-parameter-with-type decl datatype warnings ctx)))
Theorem:
(defthm vl-override-parameter-with-type-vl-paramdecl-equiv-congruence-on-decl (implies (vl-paramdecl-equiv decl decl-equiv) (equal (vl-override-parameter-with-type decl datatype warnings ctx) (vl-override-parameter-with-type decl-equiv datatype warnings ctx))) :rule-classes :congruence)
Theorem:
(defthm vl-override-parameter-with-type-of-vl-datatype-fix-datatype (equal (vl-override-parameter-with-type decl (vl-datatype-fix datatype) warnings ctx) (vl-override-parameter-with-type decl datatype warnings ctx)))
Theorem:
(defthm vl-override-parameter-with-type-vl-datatype-equiv-congruence-on-datatype (implies (vl-datatype-equiv datatype datatype-equiv) (equal (vl-override-parameter-with-type decl datatype warnings ctx) (vl-override-parameter-with-type decl datatype-equiv warnings ctx))) :rule-classes :congruence)
Theorem:
(defthm vl-override-parameter-with-type-of-vl-warninglist-fix-warnings (equal (vl-override-parameter-with-type decl datatype (vl-warninglist-fix warnings) ctx) (vl-override-parameter-with-type decl datatype warnings ctx)))
Theorem:
(defthm vl-override-parameter-with-type-vl-warninglist-equiv-congruence-on-warnings (implies (vl-warninglist-equiv warnings warnings-equiv) (equal (vl-override-parameter-with-type decl datatype warnings ctx) (vl-override-parameter-with-type decl datatype warnings-equiv ctx))) :rule-classes :congruence)
Theorem:
(defthm vl-override-parameter-with-type-of-vl-context-fix-ctx (equal (vl-override-parameter-with-type decl datatype warnings (vl-context-fix ctx)) (vl-override-parameter-with-type decl datatype warnings ctx)))
Theorem:
(defthm vl-override-parameter-with-type-vl-context-equiv-congruence-on-ctx (implies (vl-context-equiv ctx ctx-equiv) (equal (vl-override-parameter-with-type decl datatype warnings ctx) (vl-override-parameter-with-type decl datatype warnings ctx-equiv))) :rule-classes :congruence)