Semantics equivalence of BFRs, i.e., equal evaluation under every possible environment.
This is a universal equivalence, introduced using ACL2::def-universal-equiv.
Function:
(defun bfr-equiv (x y) (declare (xargs :non-executable t)) (declare (xargs :guard t)) (prog2$ (acl2::throw-nonexec-error 'bfr-equiv (list x y)) (let ((env (bfr-equiv-witness x y))) (and (equal (bfr-eval x env) (bfr-eval y env))))))
Theorem:
(defthm bfr-equiv-necc (implies (not (and (equal (bfr-eval x env) (bfr-eval y env)))) (not (bfr-equiv x y))))
Theorem:
(defthm bfr-equiv-is-an-equivalence (and (booleanp (bfr-equiv x y)) (bfr-equiv x x) (implies (bfr-equiv x y) (bfr-equiv y x)) (implies (and (bfr-equiv x y) (bfr-equiv y z)) (bfr-equiv x z))) :rule-classes (:equivalence))