Function:
(defun truth-eval (truth env numvars) (declare (xargs :guard (and (integerp truth) (natp env) (natp numvars)))) (declare (xargs :guard (unsigned-byte-p numvars env))) (let ((__function__ 'truth-eval)) (declare (ignorable __function__)) (b* ((env (mbe :logic (loghead (nfix numvars) (nfix env)) :exec env))) (logbitp env truth))))
Theorem:
(defthm truth-eval-of-lognot (equal (truth-eval (lognot truth) env numvars) (not (truth-eval truth env numvars))))
Theorem:
(defthm truth-eval-of-logand (equal (truth-eval (logand x y) env numvars) (and (truth-eval x env numvars) (truth-eval y env numvars))))
Theorem:
(defthm truth-eval-of-logior (equal (truth-eval (logior x y) env numvars) (or (truth-eval x env numvars) (truth-eval y env numvars))))
Theorem:
(defthm truth-eval-of-logxor (equal (truth-eval (logxor x y) env numvars) (xor (truth-eval x env numvars) (truth-eval y env numvars))))
Theorem:
(defthm truth-eval-of-consts (and (equal (truth-eval 0 env numvars) nil) (equal (truth-eval -1 env numvars) t)))
Theorem:
(defthm truth-eval-of-ifix-truth (equal (truth-eval (ifix truth) env numvars) (truth-eval truth env numvars)))
Theorem:
(defthm truth-eval-int-equiv-congruence-on-truth (implies (int-equiv truth truth-equiv) (equal (truth-eval truth env numvars) (truth-eval truth-equiv env numvars))) :rule-classes :congruence)
Theorem:
(defthm truth-eval-of-nfix-env (equal (truth-eval truth (nfix env) numvars) (truth-eval truth env numvars)))
Theorem:
(defthm truth-eval-nat-equiv-congruence-on-env (implies (nat-equiv env env-equiv) (equal (truth-eval truth env numvars) (truth-eval truth env-equiv numvars))) :rule-classes :congruence)
Theorem:
(defthm truth-eval-of-nfix-numvars (equal (truth-eval truth env (nfix numvars)) (truth-eval truth env numvars)))
Theorem:
(defthm truth-eval-nat-equiv-congruence-on-numvars (implies (nat-equiv numvars numvars-equiv) (equal (truth-eval truth env numvars) (truth-eval truth env numvars-equiv))) :rule-classes :congruence)