Necessary condition for parsed trees to be Unicode escapes.
This is used to constrain the result of
the declaratively defined parser for Unicode escapes.
The parser maps a list of Unicode characters to
a list of
Since, as mentioned above, the input of the parser is the string at the leaves of the trees (as stated in subsequent predicates), this predicate only takes a list of trees as argument: the Unicode character list can be derived from the list of trees.
Note that we do not need to use uniescapep here, because the implicit grammar constraint, namely that the string at the leaves of the tree is the parser input, captures most of uniescapep, except for the requirement on preceding backslashes.
Theorem:
(defthm even-backslashes-tree-constraints-p-necc (implies (even-backslashes-tree-constraints-p trees) (implies (and (integer-range-p 0 (len trees) i) (unicode-input-character-tree-is-escape-p (nth i trees))) (even-backslashes-before-p (len (abnf::tree-list->string (take i trees))) (abnf::tree-list->string trees)))))
Theorem:
(defthm booleanp-of-even-backslashes-tree-constraints-p (b* ((yes/no (even-backslashes-tree-constraints-p trees))) (booleanp yes/no)) :rule-classes :rewrite)