Case macro for the different kinds of jexpr-rank 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 jexpr-rank structure, or to split into cases based on its type.
In its short form,
(jexpr-rank-case x :expression)
is essentially just a safer alternative to writing:
(equal (jexpr-rank-kind x) :expression)
Why is using jexpr-rank-case safer? When we directly inspect the
kind with
In its longer form,
(jexpr-rank-case x :expression ... :assignment ... :conditional ... :conditional-or ... :conditional-and ... :inclusive-or ... :exclusive-or ... :and ... :equality ... :relational ... :shift ... :additive ... :multiplicative ... :unary ... :postfix ... :primary ...)
It is also possible to consolidate ``uninteresting'' cases using
For convenience, the case macro automatically binds the fields of