Check if a binary operator is pure.
All the binary operators except (simple and compound) assignments are pure.
Function:
(defun binop-purep (op) (declare (xargs :guard (binopp op))) (let ((__function__ 'binop-purep)) (declare (ignorable __function__)) (and (member-eq (binop-kind op) (list :mul :div :rem :add :sub :shl :shr :lt :gt :le :ge :eq :ne :bitand :bitxor :bitior :logand :logor)) t)))
Theorem:
(defthm booleanp-of-binop-purep (b* ((yes/no (binop-purep op))) (booleanp yes/no)) :rule-classes :rewrite)
Theorem:
(defthm binop-purep-of-binop-fix-op (equal (binop-purep (binop-fix op)) (binop-purep op)))
Theorem:
(defthm binop-purep-binop-equiv-congruence-on-op (implies (binop-equiv op op-equiv) (equal (binop-purep op) (binop-purep op-equiv))) :rule-classes :congruence)