A
(abstract-bit tree) → bit
Function:
(defun abstract-bit (tree) (declare (xargs :guard (treep tree))) (b* (((fun (fail)) (prog2$ (abstract-fail) 0)) ((unless (tree-case tree :nonleaf)) (fail)) (treess (tree-nonleaf->branches tree)) ((unless (consp treess)) (fail)) (trees (car treess)) ((unless (consp trees)) (fail)) (subtree (car trees)) (nat (abstract-terminal subtree))) (if (eql nat (char-code #\0)) 0 1)))
Theorem:
(defthm return-type-of-abstract-bit (b* ((bit (abstract-bit tree))) (integer-range-p 0 2 bit)) :rule-classes :rewrite)
Theorem:
(defthm natp-of-abstract-bit (b* ((bit (abstract-bit tree))) (natp bit)) :rule-classes :type-prescription)
Theorem:
(defthm abstract-bit-linear (b* ((bit (abstract-bit tree))) (< bit 2)) :rule-classes :linear)