Generate a term that is an omap::update nest for the formals of a function.
(atc-gen-omap-update-formals typed-formals) → (mv term init-formals)
This is used in the generated theorem that describes the initial scope for a function execution. It has the form
(omap::update (ident <string>) <symbol> (omap::update ... nil) ...)
where
However, formals that represent external objects are skipped. This is because in C these are not function parameters.
We also return the list of the
Function:
(defun atc-gen-omap-update-formals (typed-formals) (declare (xargs :guard (atc-symbol-varinfo-alistp typed-formals))) (let ((__function__ 'atc-gen-omap-update-formals)) (declare (ignorable __function__)) (b* (((when (endp typed-formals)) (mv nil nil)) ((cons var info) (car typed-formals)) ((mv omap-rest init-formals-rest) (atc-gen-omap-update-formals (cdr typed-formals))) (type (atc-var-info->type info)) (externalp (atc-var-info->externalp info)) (var/varptr (if (or (type-case type :pointer) (type-case type :array)) (add-suffix-to-fn var "-PTR") var))) (if externalp (mv omap-rest init-formals-rest) (mv (cons 'omap::update (cons (cons 'ident (cons (symbol-name var) 'nil)) (cons var/varptr (cons omap-rest 'nil)))) (cons var/varptr init-formals-rest))))))
Theorem:
(defthm symbol-listp-of-atc-gen-omap-update-formals.init-formals (implies (atc-symbol-varinfo-alistp typed-formals) (b* (((mv ?term ?init-formals) (atc-gen-omap-update-formals typed-formals))) (symbol-listp init-formals))) :rule-classes :rewrite)