Case macro for the different kinds of binop structures.
This is an ACL2::fty sum-type case macro, typically introduced by fty::defflexsum or fty::deftagsum. It allows you to safely check the type of a binop structure, or to split into cases based on its type.
In its short form,
(binop-case x :mul)
is essentially just a safer alternative to writing:
(equal (binop-kind x) :mul)
Why is using binop-case safer? When we directly inspect the
kind with
In its longer form,
(binop-case x :mul ... :div ... :rem ... :add ... :sub ... :shl ... :shr ... :lt ... :gt ... :le ... :ge ... :eq ... :ne ... :bitand ... :bitxor ... :bitior ... :logand ... :logor ... :asg ... :asg-mul ... :asg-div ... :asg-rem ... :asg-add ... :asg-sub ... :asg-shl ... :asg-shr ... :asg-and ... :asg-xor ... :asg-ior ...)
It is also possible to consolidate ``uninteresting'' cases using
For convenience, the case macro automatically binds the fields of