Case macro for the different kinds of statement 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 statement structure, or to split into cases based on its type.
In its short form,
(statement-case x :block)
is essentially just a safer alternative to writing:
(equal (statement-kind x) :block)
Why is using statement-case safer? When we directly inspect the
kind with
In its longer form,
(statement-case x :block ... :variable-single ... :variable-multi ... :assign-single ... :assign-multi ... :funcall ... :if ... :for ... :switch ... :leave ... :break ... :continue ... :fundef ...)
It is also possible to consolidate ``uninteresting'' cases using
For convenience, the case macro automatically binds the fields of