Parse a comment.
(parse-comment input) → (mv error? tree? rest-input)
Function:
(defun parse-comment (input) (declare (xargs :guard (nat-listp input))) (seq input (tree-semicolon := (parse-ichar #\; input)) (trees-text := (parse-*wsp/vchar input)) (tree-crlf := (parse-crlf input)) (return (make-tree-nonleaf :rulename? *comment* :branches (list (list tree-semicolon) trees-text (list tree-crlf))))))
Theorem:
(defthm maybe-msgp-of-parse-comment.error? (b* (((mv ?error? ?tree? ?rest-input) (parse-comment input))) (maybe-msgp error?)) :rule-classes :rewrite)
Theorem:
(defthm return-type-of-parse-comment.tree? (b* (((mv ?error? ?tree? ?rest-input) (parse-comment input))) (and (tree-optionp tree?) (implies (not error?) (treep tree?)) (implies error? (not tree?)))) :rule-classes :rewrite)
Theorem:
(defthm nat-listp-of-parse-comment.rest-input (b* (((mv ?error? ?tree? ?rest-input) (parse-comment input))) (nat-listp rest-input)) :rule-classes :rewrite)
Theorem:
(defthm len-of-parse-comment-linear (b* (((mv ?error? ?tree? ?rest-input) (parse-comment input))) (and (<= (len rest-input) (len input)) (implies (not error?) (< (len rest-input) (len input))))) :rule-classes :linear)
Theorem:
(defthm parse-comment-of-nat-list-fix-input (equal (parse-comment (nat-list-fix input)) (parse-comment input)))
Theorem:
(defthm parse-comment-nat-list-equiv-congruence-on-input (implies (acl2::nat-list-equiv input input-equiv) (equal (parse-comment input) (parse-comment input-equiv))) :rule-classes :congruence)