Convert a regular declaration into an omap of identifiers to parameter declarations.
(declon-to-ident-param-declon-map declon) → map
The resulting parameter declarations represent the same variables, with the same types and qualifiers. The keys to the omap are the identifiers bound by each parameter declaration.
A declaration which introduces multiple variables is converted to an omap
of equal length to the number of identifiers. For instance, the
declaration
Only variable declarations are converted. Static assertions result in
This is used by split-fn to track declared variables and to create parameters for the newly generated function (with the subset of declared variables which are used).
Function:
(defun declon-to-ident-param-declon-map0 (declspecs initdeclors) (declare (xargs :guard (and (decl-spec-listp declspecs) (init-declor-listp initdeclors)))) (b* (((when (endp initdeclors)) nil) ((init-declor initdeclor) (first initdeclors)) (ident (declor->ident initdeclor.declor))) (omap::update ident (make-param-declon :specs declspecs :declor (make-param-declor-nonabstract :declor initdeclor.declor :info nil) :attribs nil) (declon-to-ident-param-declon-map0 declspecs (rest initdeclors)))))
Theorem:
(defthm ident-param-declon-mapp-of-declon-to-ident-param-declon-map0 (b* ((map (declon-to-ident-param-declon-map0 declspecs initdeclors))) (ident-param-declon-mapp map)) :rule-classes :rewrite)
Function:
(defun declon-to-ident-param-declon-map (declon) (declare (xargs :guard (declonp declon))) (declon-case declon :declon (declon-to-ident-param-declon-map0 declon.specs declon.declors) :statassert nil))
Theorem:
(defthm ident-param-declon-mapp-of-declon-to-ident-param-declon-map (b* ((map (declon-to-ident-param-declon-map declon))) (ident-param-declon-mapp map)) :rule-classes :rewrite)