Basic constructor macro for vl-constint structures.
(make-vl-constint [:origwidth <origwidth>] [:value <value>] [:origtype <origtype>] [:wasunsized <wasunsized>])
This is the usual way to construct vl-constint structures. It simply conses together a structure with the specified fields.
This macro generates a new vl-constint structure from scratch. See also change-vl-constint, which can "change" an existing structure, instead.
This is an ordinary
Macro:
(defmacro make-vl-constint (&rest args) (std::make-aggregate 'vl-constint args '((:origwidth) (:value) (:origtype) (:wasunsized)) 'make-vl-constint nil))
Function:
(defun vl-constint (origwidth value origtype wasunsized) (declare (xargs :guard (and (posp origwidth) (natp value) (vl-exprtype-p origtype) (booleanp wasunsized)))) (declare (xargs :guard (< value (expt 2 origwidth)))) (let ((__function__ 'vl-constint)) (declare (ignorable __function__)) (b* ((origwidth (mbe :logic (pos-fix origwidth) :exec origwidth)) (value (mbe :logic (nfix value) :exec value)) (origtype (mbe :logic (vl-exprtype-fix origtype) :exec origtype)) (wasunsized (mbe :logic (acl2::bool-fix wasunsized) :exec wasunsized))) (let ((value (mbe :logic (acl2::loghead (pos-fix origwidth) value) :exec value))) (hons :vl-constint (std::prod-hons (std::prod-hons origwidth value) (std::prod-hons origtype wasunsized)))))))