(bfr-logbitp-n2v place digit n) → bit
Function:
(defun bfr-logbitp-n2v (place digit n) (declare (xargs :guard (and (posp place) (true-listp digit) (true-listp n)))) (let ((__function__ 'bfr-logbitp-n2v)) (declare (ignorable __function__)) (b* (((mv first & end) (first/rest/end n)) (place (lposfix place)) ((when (or (atom digit) end)) first)) (bfr-ite (car digit) (bfr-logbitp-n2v (* 2 place) (cdr digit) (bfr-logtail-ns place n)) (bfr-logbitp-n2v (* 2 place) (cdr digit) n)))))
Theorem:
(defthm bfr-logbitp-n2v-correct (b* ((bit (bfr-logbitp-n2v place digit n))) (and (equal (bfr-eval bit env) (logbitp (* (pos-fix place) (bfr-list->u digit env)) (bfr-list->s n env))))))
Theorem:
(defthm bfr-logbitp-n2v-deps (b* ((bit (bfr-logbitp-n2v place digit n))) (implies (and (not (pbfr-list-depends-on varname param digit)) (not (pbfr-list-depends-on varname param n))) (and (not (pbfr-depends-on varname param bit))))))