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