Parse a PFCS
(parse-system input) → (mv tree next-token rest-input)
This is the top-level function that organizes a list of tokens
into a PFCS
Since
Function:
(defun parse-system (input) (declare (xargs :guard (abnf::tree-listp input))) (let ((__function__ 'parse-system)) (declare (ignorable __function__)) (b* (((mv token input) (parse-token input)) ((pok trees1) (parse-*-definition token input)) ((pok trees2) (parse-*-constraint token input))) (mv (abnf::make-tree-nonleaf :rulename? (abnf::rulename "system") :branches (list trees1 trees2)) token input))))
Theorem:
(defthm tree-resultp-of-parse-system.tree (b* (((mv ?tree ?next-token ?rest-input) (parse-system input))) (abnf::tree-resultp tree)) :rule-classes :rewrite)
Theorem:
(defthm tree-optionp-of-parse-system.next-token (b* (((mv ?tree ?next-token ?rest-input) (parse-system input))) (abnf::tree-optionp next-token)) :rule-classes :rewrite)
Theorem:
(defthm tree-listp-of-parse-system.rest-input (b* (((mv ?tree ?next-token ?rest-input) (parse-system input))) (abnf::tree-listp rest-input)) :rule-classes :rewrite)
Theorem:
(defthm parse-system-of-tree-list-fix-input (equal (parse-system (abnf::tree-list-fix input)) (parse-system input)))
Theorem:
(defthm parse-system-tree-list-equiv-congruence-on-input (implies (abnf::tree-list-equiv input input-equiv) (equal (parse-system input) (parse-system input-equiv))) :rule-classes :congruence)