Semantics of numeric value notations.
A tree matches a numeric value notation iff one of the following conditions holds:
Function:
(defun tree-match-num-val-p (tree num-val) (declare (xargs :guard (and (treep tree) (num-val-p num-val)))) (and (tree-case tree :leafterm) (let ((nats (tree-leafterm->get tree))) (num-val-case num-val :direct (equal nats num-val.get) :range (and (= (len nats) 1) (<= num-val.min (car nats)) (<= (car nats) num-val.max))))))
Theorem:
(defthm booleanp-of-tree-match-num-val-p (b* ((yes/no (tree-match-num-val-p tree num-val))) (booleanp yes/no)) :rule-classes :rewrite)
Theorem:
(defthm tree-match-num-val-p-of-tree-fix-tree (equal (tree-match-num-val-p (tree-fix tree) num-val) (tree-match-num-val-p tree num-val)))
Theorem:
(defthm tree-match-num-val-p-tree-equiv-congruence-on-tree (implies (tree-equiv tree tree-equiv) (equal (tree-match-num-val-p tree num-val) (tree-match-num-val-p tree-equiv num-val))) :rule-classes :congruence)
Theorem:
(defthm tree-match-num-val-p-of-num-val-fix-num-val (equal (tree-match-num-val-p tree (num-val-fix num-val)) (tree-match-num-val-p tree num-val)))
Theorem:
(defthm tree-match-num-val-p-num-val-equiv-congruence-on-num-val (implies (num-val-equiv num-val num-val-equiv) (equal (tree-match-num-val-p tree num-val) (tree-match-num-val-p tree num-val-equiv))) :rule-classes :congruence)