Parse a comment or new line.
(parse-cnl input) → (mv error? tree? rest-input)
Function:
(defun parse-cnl (input) (declare (xargs :guard (nat-listp input))) (seq-backtrack input ((tree := (parse-comment input)) (return (make-tree-nonleaf :rulename? *c-nl* :branches (list (list tree))))) ((tree := (parse-crlf input)) (return (make-tree-nonleaf :rulename? *c-nl* :branches (list (list tree)))))))
Theorem:
(defthm maybe-msgp-of-parse-cnl.error? (b* (((mv ?error? ?tree? ?rest-input) (parse-cnl input))) (maybe-msgp error?)) :rule-classes :rewrite)
Theorem:
(defthm return-type-of-parse-cnl.tree? (b* (((mv ?error? ?tree? ?rest-input) (parse-cnl input))) (and (tree-optionp tree?) (implies (not error?) (treep tree?)) (implies error? (not tree?)))) :rule-classes :rewrite)
Theorem:
(defthm nat-listp-of-parse-cnl.rest-input (b* (((mv ?error? ?tree? ?rest-input) (parse-cnl input))) (nat-listp rest-input)) :rule-classes :rewrite)
Theorem:
(defthm len-of-parse-cnl-linear (b* (((mv ?error? ?tree? ?rest-input) (parse-cnl input))) (and (<= (len rest-input) (len input)) (implies (not error?) (< (len rest-input) (len input))))) :rule-classes :linear)
Theorem:
(defthm parse-cnl-of-nat-list-fix-input (equal (parse-cnl (nat-list-fix input)) (parse-cnl input)))
Theorem:
(defthm parse-cnl-nat-list-equiv-congruence-on-input (implies (acl2::nat-list-equiv input input-equiv) (equal (parse-cnl input) (parse-cnl input-equiv))) :rule-classes :congruence)