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