Abstract an
(abs-integer-literal tree) → lit
Function:
(defun abs-integer-literal (tree) (declare (xargs :guard (abnf::treep tree))) (let ((__function__ 'abs-integer-literal)) (declare (ignorable __function__)) (b* (((okf tree) (abnf::check-tree-nonleaf-1-1 tree "integer-literal")) ((okf rulename?) (abnf::check-tree-nonleaf? tree))) (cond ((equal rulename? "unsigned-literal") (abs-unsigned-literal tree)) ((equal rulename? "signed-literal") (abs-signed-literal tree)) (t (reserrf (list :found-subtree (abnf::tree-info-for-error tree))))))))
Theorem:
(defthm literal-resultp-of-abs-integer-literal (b* ((lit (abs-integer-literal tree))) (literal-resultp lit)) :rule-classes :rewrite)
Theorem:
(defthm abs-integer-literal-of-tree-fix-tree (equal (abs-integer-literal (abnf::tree-fix tree)) (abs-integer-literal tree)))
Theorem:
(defthm abs-integer-literal-tree-equiv-congruence-on-tree (implies (abnf::tree-equiv tree tree-equiv) (equal (abs-integer-literal tree) (abs-integer-literal tree-equiv))) :rule-classes :congruence)