Semantics of character value notations.
(tree-match-char-val-p tree char-val) → yes/no
A tree matches a character value notation iff the tree is a leaf consisting of a list of natural numbers that match the corresponding characters, case-sensitively or case-insensitively (depending on the kind of character value notation).
Function:
(defun tree-match-char-val-p (tree char-val) (declare (xargs :guard (and (treep tree) (char-val-p char-val)))) (and (tree-case tree :leafterm) (let ((nats (tree-leafterm->get tree))) (char-val-case char-val :sensitive (nats-match-sensitive-chars-p nats (explode char-val.get)) :insensitive (nats-match-insensitive-chars-p nats (explode char-val.get))))))
Theorem:
(defthm booleanp-of-tree-match-char-val-p (b* ((yes/no (tree-match-char-val-p tree char-val))) (booleanp yes/no)) :rule-classes :rewrite)
Theorem:
(defthm tree-match-char-val-p-of-tree-fix-tree (equal (tree-match-char-val-p (tree-fix tree) char-val) (tree-match-char-val-p tree char-val)))
Theorem:
(defthm tree-match-char-val-p-tree-equiv-congruence-on-tree (implies (tree-equiv tree tree-equiv) (equal (tree-match-char-val-p tree char-val) (tree-match-char-val-p tree-equiv char-val))) :rule-classes :congruence)
Theorem:
(defthm tree-match-char-val-p-of-char-val-fix-char-val (equal (tree-match-char-val-p tree (char-val-fix char-val)) (tree-match-char-val-p tree char-val)))
Theorem:
(defthm tree-match-char-val-p-char-val-equiv-congruence-on-char-val (implies (char-val-equiv char-val char-val-equiv) (equal (tree-match-char-val-p tree char-val) (tree-match-char-val-p tree char-val-equiv))) :rule-classes :congruence)