An executable version of faig-purebool-p using SAT.
(faig-purebool-check x &key (config 'satlink::*default-config*)) → (mv fail purebool alist)
Function:
(defun faig-purebool-check-fn (x config) (declare (xargs :guard (satlink::config-p config))) (let ((__function__ 'faig-purebool-check)) (declare (ignorable __function__)) (b* ((aig (faig-purebool-aig x)) ((mv status alist) (aig-sat (aig-not aig) :config config)) ((when (eq status :sat)) (mv nil nil alist)) ((when (eq status :unsat)) (mv nil t nil))) (mv t nil nil))))
Theorem:
(defthm booleanp-of-faig-purebool-check.fail (b* (((mv ?fail ?purebool ?alist) (faig-purebool-check-fn x config))) (booleanp fail)) :rule-classes :type-prescription)
Theorem:
(defthm booleanp-of-faig-purebool-check.purebool (b* (((mv ?fail ?purebool ?alist) (faig-purebool-check-fn x config))) (booleanp purebool)) :rule-classes :type-prescription)
Theorem:
(defthm faig-purebool-check-correct (b* (((mv fail purebool ?alist) (faig-purebool-check x :config config))) (implies (not fail) (equal purebool (faig-purebool-p x)))))
Theorem:
(defthm faig-purebool-counterexample-correct (b* (((mv fail ?purebool alist) (faig-purebool-check x :config config))) (implies (and (not fail) (not (faig-purebool-p x))) (and (not (equal (faig-eval x alist) (faig-f))) (not (equal (faig-eval x alist) (faig-t)))))))