Coerces a list of bit digits into a natural number.
(bin-digit-chars-value x) → value
For instance,
Function:
(defun bin-digit-chars-value$inline (x) (declare (xargs :guard (bin-digit-char-list*p x))) (let ((acl2::__function__ 'bin-digit-chars-value)) (declare (ignorable acl2::__function__)) (mbe :logic (if (consp x) (+ (ash (bin-digit-char-value (car x)) (1- (len x))) (bin-digit-chars-value (cdr x))) 0) :exec (bin-digit-chars-value1 x 0))))
Theorem:
(defthm natp-of-bin-digit-chars-value (b* ((value (bin-digit-chars-value$inline x))) (natp value)) :rule-classes :type-prescription)
Theorem:
(defthm icharlisteqv-implies-equal-bin-digit-chars-value-1 (implies (icharlisteqv x x-equiv) (equal (bin-digit-chars-value x) (bin-digit-chars-value x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm unsigned-byte-p-of-bin-digit-chars-value (unsigned-byte-p (len x) (bin-digit-chars-value x)))
Theorem:
(defthm bin-digit-chars-value-upper-bound (< (bin-digit-chars-value x) (expt 2 (len x))) :rule-classes ((:rewrite) (:linear)))
Theorem:
(defthm bin-digit-chars-value-upper-bound-free (implies (equal n (len x)) (< (bin-digit-chars-value x) (expt 2 n))))
Theorem:
(defthm bin-digit-chars-value1-removal (equal (bin-digit-chars-value1 x val) (+ (bin-digit-chars-value x) (ash (nfix val) (len x)))))
Theorem:
(defthm bin-digit-chars-value-of-append (equal (bin-digit-chars-value (append x (list a))) (+ (ash (bin-digit-chars-value x) 1) (bin-digit-char-value a))))