Function:
(defun permute-var-down (m n truth numvars) (declare (xargs :guard (and (natp m) (natp n) (integerp truth) (natp numvars)))) (declare (xargs :guard (and (<= m n) (< n numvars)))) (let ((__function__ 'permute-var-down)) (declare (ignorable __function__)) (b* (((when (mbe :logic (zp (- (nfix n) (nfix m))) :exec (eql n m))) (truth-norm truth numvars)) (next (1+ (lnfix m))) (truth (permute-var-down next n truth numvars))) (swap-vars next m truth numvars))))
Theorem:
(defthm natp-of-permute-var-down (b* ((perm-truth (permute-var-down m n truth numvars))) (natp perm-truth)) :rule-classes :type-prescription)
Theorem:
(defthm eval-of-permute-var-down-with-env-move-var-down (b* ((?perm-truth (permute-var-down m n truth numvars))) (implies (and (<= (nfix m) (nfix n)) (< (nfix n) (nfix numvars))) (equal (truth-eval perm-truth (env-move-var-down m n env) numvars) (truth-eval truth env numvars)))))
Theorem:
(defthm eval-of-permute-var-down (b* ((?perm-truth (permute-var-down m n truth numvars))) (implies (and (<= (nfix m) (nfix n)) (< (nfix n) (nfix numvars))) (equal (truth-eval perm-truth env numvars) (truth-eval truth (env-move-var-up m n env) numvars)))))
Theorem:
(defthm size-of-permute-var-down (b* ((?perm-truth (permute-var-down m n truth numvars))) (implies (and (< (nfix n) (nfix numvars)) (natp size) (<= (ash 1 numvars) size)) (unsigned-byte-p size perm-truth))))
Theorem:
(defthm permute-var-down-of-truth-norm (equal (permute-var-down m n (truth-norm truth numvars) numvars) (permute-var-down m n truth numvars)))
Theorem:
(defthm permute-var-down-of-nfix-m (equal (permute-var-down (nfix m) n truth numvars) (permute-var-down m n truth numvars)))
Theorem:
(defthm permute-var-down-nat-equiv-congruence-on-m (implies (nat-equiv m m-equiv) (equal (permute-var-down m n truth numvars) (permute-var-down m-equiv n truth numvars))) :rule-classes :congruence)
Theorem:
(defthm permute-var-down-of-nfix-n (equal (permute-var-down m (nfix n) truth numvars) (permute-var-down m n truth numvars)))
Theorem:
(defthm permute-var-down-nat-equiv-congruence-on-n (implies (nat-equiv n n-equiv) (equal (permute-var-down m n truth numvars) (permute-var-down m n-equiv truth numvars))) :rule-classes :congruence)
Theorem:
(defthm permute-var-down-of-ifix-truth (equal (permute-var-down m n (ifix truth) numvars) (permute-var-down m n truth numvars)))
Theorem:
(defthm permute-var-down-int-equiv-congruence-on-truth (implies (int-equiv truth truth-equiv) (equal (permute-var-down m n truth numvars) (permute-var-down m n truth-equiv numvars))) :rule-classes :congruence)
Theorem:
(defthm permute-var-down-of-nfix-numvars (equal (permute-var-down m n truth (nfix numvars)) (permute-var-down m n truth numvars)))
Theorem:
(defthm permute-var-down-nat-equiv-congruence-on-numvars (implies (nat-equiv numvars numvars-equiv) (equal (permute-var-down m n truth numvars) (permute-var-down m n truth numvars-equiv))) :rule-classes :congruence)