x_digit | z_digit | 0 | 1
Function:
(defun vl-binary-digit-p$inline (x) (declare (type character x)) (and (mbt (characterp x)) (or (eql x #\0) (eql x #\1) (vl-x-digit-p x) (vl-z-digit-p x))))
Function:
(defun vl-binary-digit-echar-p$inline (x) (declare (xargs :guard (vl-echar-p x))) (vl-binary-digit-p (vl-echar->char x)))
Function:
(defun vl-binary-digit-list-p (x) (declare (xargs :guard (character-listp x))) (let ((__function__ 'vl-binary-digit-list-p)) (declare (ignorable __function__)) (if (consp x) (and (vl-binary-digit-p (car x)) (vl-binary-digit-list-p (cdr x))) t)))
Theorem:
(defthm vl-binary-digit-list-p-of-cons (equal (vl-binary-digit-list-p (cons acl2::a acl2::x)) (and (vl-binary-digit-p acl2::a) (vl-binary-digit-list-p acl2::x))) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-binary-digit-list-p-of-cdr-when-vl-binary-digit-list-p (implies (vl-binary-digit-list-p (double-rewrite acl2::x)) (vl-binary-digit-list-p (cdr acl2::x))) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-binary-digit-list-p-when-not-consp (implies (not (consp acl2::x)) (vl-binary-digit-list-p acl2::x)) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-binary-digit-p-of-car-when-vl-binary-digit-list-p (implies (vl-binary-digit-list-p acl2::x) (iff (vl-binary-digit-p (car acl2::x)) (or (consp acl2::x) (vl-binary-digit-p nil)))) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-binary-digit-list-p-of-append (equal (vl-binary-digit-list-p (append acl2::a acl2::b)) (and (vl-binary-digit-list-p acl2::a) (vl-binary-digit-list-p acl2::b))) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-binary-digit-list-p-of-list-fix (equal (vl-binary-digit-list-p (list-fix acl2::x)) (vl-binary-digit-list-p acl2::x)) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-binary-digit-list-p-of-sfix (iff (vl-binary-digit-list-p (sfix acl2::x)) (or (vl-binary-digit-list-p acl2::x) (not (setp acl2::x)))) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-binary-digit-list-p-of-insert (iff (vl-binary-digit-list-p (insert acl2::a acl2::x)) (and (vl-binary-digit-list-p (sfix acl2::x)) (vl-binary-digit-p acl2::a))) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-binary-digit-list-p-of-delete (implies (vl-binary-digit-list-p acl2::x) (vl-binary-digit-list-p (delete acl2::k acl2::x))) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-binary-digit-list-p-of-mergesort (iff (vl-binary-digit-list-p (mergesort acl2::x)) (vl-binary-digit-list-p (list-fix acl2::x))) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-binary-digit-list-p-of-union (iff (vl-binary-digit-list-p (union acl2::x acl2::y)) (and (vl-binary-digit-list-p (sfix acl2::x)) (vl-binary-digit-list-p (sfix acl2::y)))) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-binary-digit-list-p-of-intersect-1 (implies (vl-binary-digit-list-p acl2::x) (vl-binary-digit-list-p (intersect acl2::x acl2::y))) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-binary-digit-list-p-of-intersect-2 (implies (vl-binary-digit-list-p acl2::y) (vl-binary-digit-list-p (intersect acl2::x acl2::y))) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-binary-digit-list-p-of-difference (implies (vl-binary-digit-list-p acl2::x) (vl-binary-digit-list-p (difference acl2::x acl2::y))) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-binary-digit-list-p-of-duplicated-members (implies (vl-binary-digit-list-p acl2::x) (vl-binary-digit-list-p (duplicated-members acl2::x))) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-binary-digit-list-p-of-rev (equal (vl-binary-digit-list-p (rev acl2::x)) (vl-binary-digit-list-p (list-fix acl2::x))) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-binary-digit-list-p-of-rcons (iff (vl-binary-digit-list-p (acl2::rcons acl2::a acl2::x)) (and (vl-binary-digit-p acl2::a) (vl-binary-digit-list-p (list-fix acl2::x)))) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-binary-digit-p-when-member-equal-of-vl-binary-digit-list-p (and (implies (and (member-equal acl2::a acl2::x) (vl-binary-digit-list-p acl2::x)) (vl-binary-digit-p acl2::a)) (implies (and (vl-binary-digit-list-p acl2::x) (member-equal acl2::a acl2::x)) (vl-binary-digit-p acl2::a))) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-binary-digit-list-p-when-subsetp-equal (and (implies (and (subsetp-equal acl2::x acl2::y) (vl-binary-digit-list-p acl2::y)) (vl-binary-digit-list-p acl2::x)) (implies (and (vl-binary-digit-list-p acl2::y) (subsetp-equal acl2::x acl2::y)) (vl-binary-digit-list-p acl2::x))) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-binary-digit-list-p-set-equiv-congruence (implies (set-equiv acl2::x acl2::y) (equal (vl-binary-digit-list-p acl2::x) (vl-binary-digit-list-p acl2::y))) :rule-classes :congruence)
Theorem:
(defthm vl-binary-digit-list-p-of-set-difference-equal (implies (vl-binary-digit-list-p acl2::x) (vl-binary-digit-list-p (set-difference-equal acl2::x acl2::y))) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-binary-digit-list-p-of-intersection-equal-1 (implies (vl-binary-digit-list-p (double-rewrite acl2::x)) (vl-binary-digit-list-p (intersection-equal acl2::x acl2::y))) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-binary-digit-list-p-of-intersection-equal-2 (implies (vl-binary-digit-list-p (double-rewrite acl2::y)) (vl-binary-digit-list-p (intersection-equal acl2::x acl2::y))) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-binary-digit-list-p-of-union-equal (equal (vl-binary-digit-list-p (union-equal acl2::x acl2::y)) (and (vl-binary-digit-list-p (list-fix acl2::x)) (vl-binary-digit-list-p (double-rewrite acl2::y)))) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-binary-digit-list-p-of-take (implies (vl-binary-digit-list-p (double-rewrite acl2::x)) (iff (vl-binary-digit-list-p (take acl2::n acl2::x)) (or (vl-binary-digit-p nil) (<= (nfix acl2::n) (len acl2::x))))) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-binary-digit-list-p-of-repeat (iff (vl-binary-digit-list-p (repeat acl2::n acl2::x)) (or (vl-binary-digit-p acl2::x) (zp acl2::n))) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-binary-digit-p-of-nth-when-vl-binary-digit-list-p (implies (and (vl-binary-digit-list-p acl2::x) (< (nfix acl2::n) (len acl2::x))) (vl-binary-digit-p (nth acl2::n acl2::x))) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-binary-digit-list-p-of-update-nth (implies (vl-binary-digit-list-p (double-rewrite acl2::x)) (iff (vl-binary-digit-list-p (update-nth acl2::n acl2::y acl2::x)) (and (vl-binary-digit-p acl2::y) (or (<= (nfix acl2::n) (len acl2::x)) (vl-binary-digit-p nil))))) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-binary-digit-list-p-of-butlast (implies (vl-binary-digit-list-p (double-rewrite acl2::x)) (vl-binary-digit-list-p (butlast acl2::x acl2::n))) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-binary-digit-list-p-of-nthcdr (implies (vl-binary-digit-list-p (double-rewrite acl2::x)) (vl-binary-digit-list-p (nthcdr acl2::n acl2::x))) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-binary-digit-list-p-of-last (implies (vl-binary-digit-list-p (double-rewrite acl2::x)) (vl-binary-digit-list-p (last acl2::x))) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-binary-digit-list-p-of-remove (implies (vl-binary-digit-list-p acl2::x) (vl-binary-digit-list-p (remove acl2::a acl2::x))) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-binary-digit-list-p-of-revappend (equal (vl-binary-digit-list-p (revappend acl2::x acl2::y)) (and (vl-binary-digit-list-p (list-fix acl2::x)) (vl-binary-digit-list-p acl2::y))) :rule-classes ((:rewrite)))
Function:
(defun vl-read-while-binary-digit-impl (echars acc) (declare (xargs :guard (vl-echarlist-p echars))) (cond ((atom echars) (mv acc echars)) ((vl-binary-digit-p (vl-echar->char (car echars))) (vl-read-while-binary-digit-impl (cdr echars) (cons (car echars) acc))) (t (mv acc echars))))
Function:
(defun vl-read-while-binary-digit$inline (echars) (declare (xargs :guard (vl-echarlist-p echars))) (mbe :logic (cond ((atom echars) (mv nil echars)) ((vl-binary-digit-p (vl-echar->char (car echars))) (mv-let (prefix remainder) (vl-read-while-binary-digit (cdr echars)) (mv (cons (car echars) prefix) remainder))) (t (mv nil echars))) :exec (mv-let (prefix-rev remainder) (vl-read-while-binary-digit-impl echars nil) (mv (reverse prefix-rev) remainder))))
Theorem:
(defthm prefix-of-vl-read-while-binary-digit (and (true-listp (mv-nth 0 (vl-read-while-binary-digit echars))) (implies (force (vl-echarlist-p echars)) (vl-echarlist-p (mv-nth 0 (vl-read-while-binary-digit echars))))) :rule-classes ((:rewrite) (:type-prescription :corollary (true-listp (mv-nth 0 (vl-read-while-binary-digit echars))))))
Theorem:
(defthm remainder-of-vl-read-while-binary-digit (and (equal (true-listp (mv-nth 1 (vl-read-while-binary-digit echars))) (true-listp echars)) (implies (vl-echarlist-p echars) (vl-echarlist-p (mv-nth 1 (vl-read-while-binary-digit echars))))) :rule-classes ((:rewrite) (:type-prescription :corollary (implies (true-listp echars) (true-listp (mv-nth 1 (vl-read-while-binary-digit echars)))))))
Theorem:
(defthm prefix-of-vl-read-while-binary-digit-when-vl-binary-digit-p (implies (vl-binary-digit-p (vl-echar->char (car echars))) (iff (mv-nth 0 (vl-read-while-binary-digit echars)) (consp echars))))
Theorem:
(defthm vl-read-while-binary-digit-sound (vl-binary-digit-list-p (vl-echarlist->chars (mv-nth 0 (vl-read-while-binary-digit echars)))))
Theorem:
(defthm vl-read-while-binary-digit-complete (equal (vl-binary-digit-p (vl-echar->char (car (mv-nth 1 (vl-read-while-binary-digit echars))))) (if (consp (mv-nth 1 (vl-read-while-binary-digit echars))) nil (vl-binary-digit-p (vl-echar->char nil)))))
Theorem:
(defthm append-of-vl-read-while-binary-digit (equal (append (mv-nth 0 (vl-read-while-binary-digit echars)) (mv-nth 1 (vl-read-while-binary-digit echars))) echars))
Theorem:
(defthm no-change-loser-of-vl-read-while-binary-digit (implies (not (mv-nth 0 (vl-read-while-binary-digit echars))) (equal (mv-nth 1 (vl-read-while-binary-digit echars)) echars)))
Theorem:
(defthm acl2-count-of-vl-read-while-binary-digit-weak (<= (acl2-count (mv-nth 1 (vl-read-while-binary-digit echars))) (acl2-count echars)) :rule-classes ((:rewrite) (:linear)))
Theorem:
(defthm acl2-count-of-vl-read-while-binary-digit-strong (implies (mv-nth 0 (vl-read-while-binary-digit echars)) (< (acl2-count (mv-nth 1 (vl-read-while-binary-digit echars))) (acl2-count echars))) :rule-classes ((:rewrite) (:linear)))