Function:
(defun env-mismatch (truth env1 env2 numvars) (declare (xargs :guard (and (integerp truth) (natp env1) (natp env2) (natp numvars)))) (let ((__function__ 'env-mismatch)) (declare (ignorable __function__)) (env-mismatch-aux 0 truth env1 env2 numvars)))
Theorem:
(defthm natp-of-env-mismatch (b* ((var (env-mismatch truth env1 env2 numvars))) (natp var)) :rule-classes :type-prescription)
Theorem:
(defthm env-mismatch-bound (b* ((?var (env-mismatch truth env1 env2 numvars))) (implies (posp numvars) (< var numvars))) :rule-classes (:rewrite :linear))
Theorem:
(defthm env-mismatch-when-mismatch (b* ((?var (env-mismatch truth env1 env2 numvars))) (implies (and (depends-on m truth numvars) (xor (env-lookup m env1) (env-lookup m env2)) (< (nfix m) (nfix numvars))) (and (depends-on var truth numvars) (iff (env-lookup var env1) (not (env-lookup var env2))) (< var (nfix numvars)) (implies (natp numvars) (< var numvars))))))
Theorem:
(defthm env-mismatch-when-eval-mismatch (b* ((?var (env-mismatch truth env1 env2 numvars))) (implies (and (not (equal (truth-eval truth env1 numvars) (truth-eval truth env2 numvars)))) (and (depends-on var truth numvars) (iff (env-lookup var env1) (not (env-lookup var env2))) (< var (nfix numvars)) (implies (natp numvars) (< var numvars))))))
Theorem:
(defthm env-mismatch-of-ifix-truth (equal (env-mismatch (ifix truth) env1 env2 numvars) (env-mismatch truth env1 env2 numvars)))
Theorem:
(defthm env-mismatch-int-equiv-congruence-on-truth (implies (int-equiv truth truth-equiv) (equal (env-mismatch truth env1 env2 numvars) (env-mismatch truth-equiv env1 env2 numvars))) :rule-classes :congruence)
Theorem:
(defthm env-mismatch-of-nfix-env1 (equal (env-mismatch truth (nfix env1) env2 numvars) (env-mismatch truth env1 env2 numvars)))
Theorem:
(defthm env-mismatch-nat-equiv-congruence-on-env1 (implies (nat-equiv env1 env1-equiv) (equal (env-mismatch truth env1 env2 numvars) (env-mismatch truth env1-equiv env2 numvars))) :rule-classes :congruence)
Theorem:
(defthm env-mismatch-of-nfix-env2 (equal (env-mismatch truth env1 (nfix env2) numvars) (env-mismatch truth env1 env2 numvars)))
Theorem:
(defthm env-mismatch-nat-equiv-congruence-on-env2 (implies (nat-equiv env2 env2-equiv) (equal (env-mismatch truth env1 env2 numvars) (env-mismatch truth env1 env2-equiv numvars))) :rule-classes :congruence)
Theorem:
(defthm env-mismatch-of-nfix-numvars (equal (env-mismatch truth env1 env2 (nfix numvars)) (env-mismatch truth env1 env2 numvars)))
Theorem:
(defthm env-mismatch-nat-equiv-congruence-on-numvars (implies (nat-equiv numvars numvars-equiv) (equal (env-mismatch truth env1 env2 numvars) (env-mismatch truth env1 env2 numvars-equiv))) :rule-classes :congruence)