Validate a declaration specifier.
(valid-decl-spec declspec type? tyspecs storspecs table ienv)
→
(mv erp new-declspec new-type? new-tyspecs
new-storspecs return-types new-table)
For now we ignore type qualifiers, function specifiers, and attributes. We validate alignment specifiers but we do not make any use of them in our currently approximate type system. We handle type specifiers similarly to valid-spec/qual. In addition, we collect all the storage class specifiers encountered as we go through the declaration specifiers.
Theorem:
(defthm type-spec-list-unambp-of-valid-decl-spec (implies (type-spec-list-unambp tyspecs) (b* (((mv acl2::?erp ?new-declspec ?new-type? ?new-tyspecs ?new-storspecs ?return-types ?new-table) (valid-decl-spec declspec type? tyspecs storspecs table ienv))) (type-spec-list-unambp new-tyspecs))))
Theorem:
(defthm not-type-and-type-specs-of-valid-decl-spec (implies (not (and type? tyspecs)) (b* (((mv acl2::?erp ?new-declspec ?new-type? ?new-tyspecs ?new-storspecs ?return-types ?new-table) (valid-decl-spec declspec type? tyspecs storspecs table ienv))) (not (and new-type? new-tyspecs)))))
Theorem:
(defthm not-type-specs-of-valid-decl-spec-when-type (implies (not (and type? tyspecs)) (b* (((mv acl2::?erp ?new-declspec ?new-type? ?new-tyspecs ?new-storspecs ?return-types ?new-table) (valid-decl-spec declspec type? tyspecs storspecs table ienv))) (implies new-type? (not new-tyspecs)))))
Theorem:
(defthm valid-decl-spec.new-storspecs-type-prescription (b* (((mv acl2::?erp ?new-declspec ?new-type? ?new-tyspecs ?new-storspecs ?return-types ?new-table) (valid-decl-spec declspec type? tyspecs storspecs table ienv))) (true-listp new-storspecs)) :rule-classes :type-prescription)