Some typical ways to induct when proving theorems about logical operations.
Function:
(defun logcdr-induction-1 (i) (declare (xargs :guard (integerp i))) (cond ((zip i) t) ((equal i -1) t) (t (logcdr-induction-1 (logcdr i)))))
Function:
(defun logcdr-induction-2 (i j) (declare (xargs :guard (and (integerp i) (integerp j)))) (cond ((zip i) t) ((zip j) t) ((equal i -1) t) ((equal j -1) t) (t (logcdr-induction-2 (logcdr i) (logcdr j)))))
Function:
(defun logcdr-induction-3 (i j k) (declare (xargs :guard (and (integerp i) (integerp j) (integerp k)))) (cond ((zip i) t) ((equal i -1) t) (t (logcdr-induction-3 (logcdr i) (logcdr j) (logcdr k)))))
Function:
(defun sub1-logcdr-induction-1 (size i) "The elaborate base case is for the benefit of UNSIGNED-BYTE-P, which has no guards." (cond ((or (not (integerp size)) (< size 0) (not (integerp i))) t) ((equal size 0) t) (t (sub1-logcdr-induction-1 (1- size) (logcdr i)))))
Function:
(defun sub1-logcdr-induction-2 (size i j) "The elaborate base case is for the benefit of UNSIGNED-BYTE-P, which has no guards." (cond ((or (not (integerp size)) (< size 0) (not (integerp i)) (not (integerp j))) t) ((equal size 0) t) (t (sub1-logcdr-induction-2 (1- size) (logcdr i) (logcdr j)))))
Function:
(defun sub1-logcdr-induction-2-w/carry (size i j c) "The elaborate base case is for the benefit of SIGNED-BYTE-P, which has no guards." (cond ((or (not (integerp size)) (<= size 0) (not (integerp i)) (not (integerp j)) (not (bitp c))) t) ((equal size 1) t) (t (sub1-logcdr-induction-2-w/carry (1- size) (logcdr i) (logcdr j) (b-and c (logcar i))))))
Function:
(defun sub1-logcdr-induction-3 (size i j k) "The elaborate base case is for the benefit of SIGNED-BYTE-P, which has no guards." (cond ((or (not (integerp size)) (<= size 0) (not (integerp i)) (not (integerp j)) (not (integerp k))) t) ((equal size 1) t) (t (sub1-logcdr-induction-3 (1- size) (logcdr i) (logcdr j) (logcdr k)))))