Derive a pointer type for each type qualifier and attribute specifier list.
(make-pointers-to pointers type) → new-type
This takes the list of lists of type qualifiers and attribute specifiers from a declarator or abstract declarator, and creates the corresponding (possibly pointer) type.
Since our approximate type system does not incorporate type qualifiers,
each cons of the
Function:
(defun make-pointers-to (pointers type) (declare (xargs :guard (and (typequal/attribspec-list-listp pointers) (typep type)))) (if (endp pointers) (type-fix type) (make-type-pointer :to (make-pointers-to (rest pointers) type))))
Theorem:
(defthm typep-of-make-pointers-to (b* ((new-type (make-pointers-to pointers type))) (typep new-type)) :rule-classes :rewrite)
Theorem:
(defthm make-pointers-to-of-typequal/attribspec-list-list-fix-pointers (equal (make-pointers-to (typequal/attribspec-list-list-fix pointers) type) (make-pointers-to pointers type)))
Theorem:
(defthm make-pointers-to-typequal/attribspec-list-list-equiv-congruence-on-pointers (implies (typequal/attribspec-list-list-equiv pointers pointers-equiv) (equal (make-pointers-to pointers type) (make-pointers-to pointers-equiv type))) :rule-classes :congruence)
Theorem:
(defthm make-pointers-to-of-type-fix-type (equal (make-pointers-to pointers (type-fix type)) (make-pointers-to pointers type)))
Theorem:
(defthm make-pointers-to-type-equiv-congruence-on-type (implies (type-equiv type type-equiv) (equal (make-pointers-to pointers type) (make-pointers-to pointers type-equiv))) :rule-classes :congruence)