Check if an ABNF tree has a given rule name or no rule name as root and a list of three lists of subtrees, returning those lists of subtrees if successful.
(check-tree-nonleaf-3 tree rulename?) → sub
Function:
(defun check-tree-nonleaf-3 (tree rulename?) (declare (xargs :guard (and (abnf::treep tree) (maybe-stringp rulename?)))) (let ((__function__ 'check-tree-nonleaf-3)) (declare (ignorable __function__)) (b* (((okf treess) (check-tree-nonleaf tree rulename?))) (check-tree-list-list-3 treess))))
Theorem:
(defthm tree-list-tuple3-resultp-of-check-tree-nonleaf-3 (b* ((sub (check-tree-nonleaf-3 tree rulename?))) (abnf::tree-list-tuple3-resultp sub)) :rule-classes :rewrite)
Theorem:
(defthm tree-count-of-check-tree-nonleaf-3 (b* ((?sub (check-tree-nonleaf-3 tree rulename?))) (implies (not (reserrp sub)) (and (< (abnf::tree-list-count (abnf::tree-list-tuple3->1st sub)) (abnf::tree-count tree)) (< (abnf::tree-list-count (abnf::tree-list-tuple3->2nd sub)) (abnf::tree-count tree)) (< (abnf::tree-list-count (abnf::tree-list-tuple3->3rd sub)) (abnf::tree-count tree))))) :rule-classes :linear)
Theorem:
(defthm check-tree-nonleaf-3-of-tree-fix-tree (equal (check-tree-nonleaf-3 (abnf::tree-fix tree) rulename?) (check-tree-nonleaf-3 tree rulename?)))
Theorem:
(defthm check-tree-nonleaf-3-tree-equiv-congruence-on-tree (implies (abnf::tree-equiv tree tree-equiv) (equal (check-tree-nonleaf-3 tree rulename?) (check-tree-nonleaf-3 tree-equiv rulename?))) :rule-classes :congruence)
Theorem:
(defthm check-tree-nonleaf-3-of-maybe-string-fix-rulename? (equal (check-tree-nonleaf-3 tree (maybe-string-fix rulename?)) (check-tree-nonleaf-3 tree rulename?)))
Theorem:
(defthm check-tree-nonleaf-3-maybe-string-equiv-congruence-on-rulename? (implies (acl2::maybe-string-equiv rulename? rulename?-equiv) (equal (check-tree-nonleaf-3 tree rulename?) (check-tree-nonleaf-3 tree rulename?-equiv))) :rule-classes :congruence)