Function:
(defun cancel-parity-lits (x neg) (declare (xargs :guard (and (lit-listp x) (bitp neg)))) (let ((__function__ 'cancel-parity-lits)) (declare (ignorable __function__)) (b* (((when (or (atom x) (atom (cdr x)))) (mv (lbfix neg) (lit-list-fix x))) (lit1 (lit-fix (car x))) ((when (eql lit1 1)) (cancel-parity-lits (cdr x) (b-not neg))) ((when (eql lit1 0)) (cancel-parity-lits (cdr x) neg)) (lit2 (lit-fix (cadr x))) ((when (eql lit1 lit2)) (cancel-parity-lits (cddr x) neg)) ((when (eql lit1 (lit-negate lit2))) (cancel-parity-lits (cddr x) (b-not neg))) ((mv neg rest) (cancel-parity-lits (cdr x) neg))) (mv neg (cons lit1 rest)))))
Theorem:
(defthm bitp-of-cancel-parity-lits.negate (b* (((mv ?negate ?new-x) (cancel-parity-lits x neg))) (bitp negate)) :rule-classes :type-prescription)
Theorem:
(defthm lit-listp-of-cancel-parity-lits.new-x (b* (((mv ?negate ?new-x) (cancel-parity-lits x neg))) (lit-listp new-x)) :rule-classes :rewrite)
Theorem:
(defthm aignet-eval-parity-of-cancel-parity-lits (b* (((mv ?negate ?new-x) (cancel-parity-lits x neg))) (equal (aignet-eval-parity new-x invals regvals aignet) (b-xor (b-xor neg negate) (aignet-eval-parity x invals regvals aignet)))))
Theorem:
(defthm aignet-lit-listp-of-cancel-parity-lits (b* (((mv ?negate ?new-x) (cancel-parity-lits x neg))) (implies (aignet-lit-listp x aignet) (aignet-lit-listp new-x aignet))))
Theorem:
(defthm cancel-parity-lits-of-lit-list-fix-x (equal (cancel-parity-lits (lit-list-fix x) neg) (cancel-parity-lits x neg)))
Theorem:
(defthm cancel-parity-lits-lit-list-equiv-congruence-on-x (implies (satlink::lit-list-equiv x x-equiv) (equal (cancel-parity-lits x neg) (cancel-parity-lits x-equiv neg))) :rule-classes :congruence)
Theorem:
(defthm cancel-parity-lits-of-bfix-neg (equal (cancel-parity-lits x (bfix neg)) (cancel-parity-lits x neg)))
Theorem:
(defthm cancel-parity-lits-bit-equiv-congruence-on-neg (implies (bit-equiv neg neg-equiv) (equal (cancel-parity-lits x neg) (cancel-parity-lits x neg-equiv))) :rule-classes :congruence)