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