Macros - lgwagner/SpeAR GitHub Wiki
Macros are used to define shorthand expressions that can be reused for frequently used expressions. For example, often one might want to compare a variable against the value of the variable from the previous time step. Referencing a previous value in SpeAR requires the use of the previous [expression] with initial value [expression] construct. This construct can be somewhat tedious to manage in several places at once. Macros allow us to define it in once place and reuse it as many times as needed.
Macros are defined by a unique ID, a data type, and an expression that defines its value.
The following example shows how one might use a macro to reference a previous expression in a specification. The left version of the spec uses the previous expression inline in requirement r0 while the version on the right declares it as a macro and references the macro in requirement r0.