Add clauses restricting
Function:
(defun ipasir-set-xor (ipasir out in1 in2) (declare (xargs :stobjs (ipasir))) (declare (xargs :guard (and (litp out) (litp in1) (litp in2)))) (declare (xargs :guard (and (not (eq (ipasir-get-status ipasir) :undef)) (ipasir-empty-new-clause ipasir)))) (let ((__function__ 'ipasir-set-xor)) (declare (ignorable __function__)) (b* ((ipasir (ipasir-add-ternary ipasir out (l- in1) in2)) (ipasir (ipasir-add-ternary ipasir (l- out) (l- in1) (l- in2))) (ipasir (ipasir-add-ternary ipasir out in1 (l- in2))) (ipasir (ipasir-add-ternary ipasir (l- out) in1 in2))) ipasir)))
Theorem:
(defthm ipasir-set-xor-status (b* ((?new-ipasir (ipasir-set-xor ipasir out in1 in2))) (equal (ipasir$a->status new-ipasir) :input)))
Theorem:
(defthm ipasir-set-xor-formula (b* ((?new-ipasir (ipasir-set-xor ipasir out in1 in2))) (implies (syntaxp (not (equal ipasir ''nil))) (equal (ipasir$a->formula new-ipasir) (append (ipasir$a->formula (ipasir-set-xor nil out in1 in2)) (ipasir$a->formula ipasir))))))
Theorem:
(defthm ipasir-set-xor-eval-formula (b* ((?new-ipasir (ipasir-set-xor ipasir out in1 in2))) (equal (eval-formula (ipasir$a->formula new-ipasir) env) (b-and (b-eqv (eval-lit out env) (b-xor (eval-lit in1 env) (eval-lit in2 env))) (eval-formula (ipasir$a->formula ipasir) env)))))
Theorem:
(defthm ipasir-set-xor-new-clause (b* ((?new-ipasir (ipasir-set-xor ipasir out in1 in2))) (not (ipasir$a->new-clause new-ipasir))))
Theorem:
(defthm ipasir-set-xor-assumption (b* ((?new-ipasir (ipasir-set-xor ipasir out in1 in2))) (equal (ipasir$a->assumption new-ipasir) (ipasir$a->assumption ipasir))))