Evaluate a BFR under an appropriate BDD/AIG environment.
(bfr-eval x env &optional (logicman 'logicman)) → bool
Boolean function objects in FGL may be
The
Function:
(defun bfr-eval-fn (x env logicman) (declare (xargs :stobjs (logicman))) (declare (xargs :guard (lbfr-p x))) (let ((__function__ 'bfr-eval)) (declare (ignorable __function__)) (b* ((bfrstate (logicman->bfrstate))) (bfrstate-case :bdd (acl2::eval-bdd (bfr-fix x) env) :aig (acl2::aig-eval (bfr-fix x) env) :aignet (mbe :logic (non-exec (bit->bool (aignet::lit-eval (bfr->aignet-lit x) (alist-to-bitarr (aignet::num-ins (logicman->aignet logicman)) env nil) nil (logicman->aignet logicman)))) :exec (b* ((x (bfr->aignet-lit x)) ((acl2::local-stobjs aignet::invals aignet::regvals) (mv ans aignet::invals aignet::regvals))) (stobj-let ((aignet (logicman->aignet logicman))) (ans aignet::invals aignet::regvals) (b* ((aignet::invals (alist-to-bitarr (aignet::num-ins aignet) env aignet::invals)) (aignet::regvals (alist-to-bitarr (aignet::num-regs aignet) nil aignet::regvals))) (mv (bit->bool (aignet::lit-eval x aignet::invals aignet::regvals aignet)) aignet::invals aignet::regvals)) (mv ans aignet::invals aignet::regvals))))))))
Theorem:
(defthm bfr-eval-consts (and (equal (bfr-eval t env) t) (equal (bfr-eval nil env) nil)))
Theorem:
(defthm bfr-eval-of-bfr-fix (b* ((bfrstate (logicman->bfrstate logicman))) (equal (bfr-eval (bfr-fix x) env) (bfr-eval x env))))
Theorem:
(defthm bfr-eval-of-logicman-extension (implies (and (bind-logicman-extension new old) (lbfr-p x old)) (equal (bfr-eval x env new) (bfr-eval x env old))))