(cst-letter-conc? abnf::cst) → number
Function:
(defun cst-letter-conc? (abnf::cst) (declare (xargs :guard (abnf::treep abnf::cst))) (declare (xargs :guard (cst-matchp abnf::cst "letter"))) (let ((__function__ 'cst-letter-conc?)) (declare (ignorable __function__)) (cond ((equal (abnf::tree-nonleaf->rulename? (nth 0 (nth 0 (abnf::tree-nonleaf->branches abnf::cst)))) (abnf::rulename "uppercase-letter")) 1) ((equal (abnf::tree-nonleaf->rulename? (nth 0 (nth 0 (abnf::tree-nonleaf->branches abnf::cst)))) (abnf::rulename "lowercase-letter")) 2) (t (prog2$ (impossible) 1)))))
Theorem:
(defthm posp-of-cst-letter-conc? (b* ((number (cst-letter-conc? abnf::cst))) (posp number)) :rule-classes :rewrite)
Theorem:
(defthm cst-letter-conc?-possibilities (b* ((number (cst-letter-conc? abnf::cst))) (or (equal number 1) (equal number 2))) :rule-classes ((:forward-chaining :trigger-terms ((cst-letter-conc? abnf::cst)))))
Theorem:
(defthm cst-letter-conc?-of-tree-fix-cst (equal (cst-letter-conc? (abnf::tree-fix abnf::cst)) (cst-letter-conc? abnf::cst)))
Theorem:
(defthm cst-letter-conc?-tree-equiv-congruence-on-cst (implies (abnf::tree-equiv abnf::cst cst-equiv) (equal (cst-letter-conc? abnf::cst) (cst-letter-conc? cst-equiv))) :rule-classes :congruence)
Theorem:
(defthm cst-letter-conc?-1-iff-match-conc (implies (cst-matchp abnf::cst "letter") (iff (equal (cst-letter-conc? abnf::cst) 1) (cst-list-list-conc-matchp (abnf::tree-nonleaf->branches abnf::cst) "uppercase-letter"))))
Theorem:
(defthm cst-letter-conc?-2-iff-match-conc (implies (cst-matchp abnf::cst "letter") (iff (equal (cst-letter-conc? abnf::cst) 2) (cst-list-list-conc-matchp (abnf::tree-nonleaf->branches abnf::cst) "lowercase-letter"))))