Check if the given token has the given rule name as root.
(token-rootp rulename token) → yes/no
Function:
(defun token-rootp (rulename token) (declare (xargs :guard (and (stringp rulename) (abnf::tree-optionp token)))) (let ((__function__ 'token-rootp)) (declare (ignorable __function__)) (abnf-tree-with-root-p (abnf::tree-option-fix token) rulename)))
Theorem:
(defthm booleanp-of-token-rootp (b* ((yes/no (token-rootp rulename token))) (booleanp yes/no)) :rule-classes :rewrite)
Theorem:
(defthm token-nonnil-when-rootp (implies (token-rootp string token) token) :rule-classes :forward-chaining)
Theorem:
(defthm token-rootp-of-str-fix-rulename (equal (token-rootp (str-fix rulename) token) (token-rootp rulename token)))
Theorem:
(defthm token-rootp-streqv-congruence-on-rulename (implies (acl2::streqv rulename rulename-equiv) (equal (token-rootp rulename token) (token-rootp rulename-equiv token))) :rule-classes :congruence)
Theorem:
(defthm token-rootp-of-tree-option-fix-token (equal (token-rootp rulename (abnf::tree-option-fix token)) (token-rootp rulename token)))
Theorem:
(defthm token-rootp-tree-option-equiv-congruence-on-token (implies (abnf::tree-option-equiv token token-equiv) (equal (token-rootp rulename token) (token-rootp rulename token-equiv))) :rule-classes :congruence)