Add a ternary clause to the formula
Function:
(defun ipasir-add-ternary (ipasir a b c) (declare (xargs :stobjs (ipasir))) (declare (xargs :guard (and (litp a) (litp b) (litp c)))) (declare (xargs :guard (and (not (eq (ipasir-get-status ipasir) :undef)) (ipasir-empty-new-clause ipasir)))) (let ((__function__ 'ipasir-add-ternary)) (declare (ignorable __function__)) (b* ((ipasir (ipasir-cancel-new-clause ipasir)) (ipasir (ipasir-add-lit ipasir a)) (ipasir (ipasir-add-lit ipasir b)) (ipasir (ipasir-add-lit ipasir c))) (ipasir-finalize-clause ipasir))))
Theorem:
(defthm ipasir-add-ternary-status (b* ((?new-ipasir (ipasir-add-ternary ipasir a b c))) (equal (ipasir$a->status new-ipasir) :input)))
Theorem:
(defthm ipasir-add-ternary-formula (b* ((?new-ipasir (ipasir-add-ternary ipasir a b c))) (equal (ipasir$a->formula new-ipasir) (cons (lit-list-fix (list c b a)) (ipasir$a->formula ipasir)))))
Theorem:
(defthm ipasir-add-ternary-eval-formula (b* ((?new-ipasir (ipasir-add-ternary ipasir a b c))) (equal (eval-formula (ipasir$a->formula new-ipasir) assum) (eval-formula (cons (list c b a) (ipasir$a->formula ipasir)) assum))))
Theorem:
(defthm ipasir-add-ternary-new-clause (b* ((?new-ipasir (ipasir-add-ternary ipasir a b c))) (not (ipasir$a->new-clause new-ipasir))))
Theorem:
(defthm ipasir-add-ternary-assumption (b* ((?new-ipasir (ipasir-add-ternary ipasir a b c))) (equal (ipasir$a->assumption new-ipasir) (ipasir$a->assumption ipasir))))