Prove rules about a term yielding values in natp.
Use the macro
Usage:
(defthm-natp <theorem-name> :hyp <hypotheses> :concl <conclusion> :hints <usual ACL2 hints for the main theorem>) :gen-rewrite <t or nil> ;; Make main theorem a :rewrite rule :gen-type <t or nil> ;; Generate :type-prescription corollary :gen-linear <t or nil> ;; Generate :linear corollary :hyp-t <hypotheses for the :type-prescription corollary> :hyp-l <hypotheses for the :linear corollary> :hints-t <usual ACL2 hints for the :type-prescription corollary> :hints-l <usual ACL2 hints for the :linear corollary> :otf-flg <t or nil>)
The above form produces a theorem of the following form
(if both
(defthm <theorem-name> (implies <hypotheses> (natp <conclusion>)) :hints <usual ACL2 hints> :otf-flg <t or nil> :rule-classes (:rewrite (:type-prescription :corollary (implies <hypotheses> (natp <conclusion>)) :hints <usual ACL2 hints for the :type-prescription corollary>) (:linear :corollary (implies <hypotheses> (<= 0 <conclusion>)) :hints <usual ACL2 hints for the :linear corollary>)))
If
Also see the related macros defthm-unsigned-byte-p and defthm-signed-byte-p.