Case macro for the different kinds of asgop 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 asgop structure, or to split into cases based on its type.
In its short form,
(asgop-case x :asg)
is essentially just a safer alternative to writing:
(equal (asgop-kind x) :asg)
Why is using asgop-case safer? When we directly inspect the
kind with
In its longer form,
(asgop-case x :asg ... :asg-add ... :asg-sub ... :asg-mul ... :asg-div ... :asg-rem ... :asg-pow ... :asg-shl ... :asg-shr ... :asg-bitand ... :asg-bitior ... :asg-bitxor ... :asg-and ... :asg-or ...)
It is also possible to consolidate ``uninteresting'' cases using
For convenience, the case macro automatically binds the fields of