In addition, enums also support the `export_as` attribute (same as structs).
### Refinement generation
Instead of refining an enum with an existing Coq type, RefinedRust can also generate a new Coq type corresponding to the Rust enum declaration.
For this, the `rr::refine_as` attribute can be used used, which takes the desired Coq name of the definition as its argument.
For instance:
```
#[rr::refine_as("option")]
enum option<T> {
None,
Some(T),
}
```
## Static attributes
RefinedRust supports `static` (but currently not `static mut`) variables.
They can be used as if they were behind a shared reference with `static` lifetime.
...
...
@@ -146,6 +159,23 @@ using the `initialized π "name" r` predicate, where `r` is the assumed refineme
To specify the name that is used to refer to the variable here, `static` variables can be annotated with a `rr::name` attribute:
-`#[rr::name("my_static_int")]` indicates that the name `my_static_int` should be used to refer to the static in specifications.
## Trait attributes
Traits can have additional "specification attributes" which are instantiated by impls.
The generic specification of trait methods can mention these specification attributes in order to be parameterizable over implementations.
To specify an attribute, trait declarations can be annotated with a `rr::exists` attribute:
-`#[rr::exists("Done" : "{rt_of Self} → Prop")]` indicates that an attribute `Done` of the given Coq type should be declared, using the escape sequences explained below.
For further specifications in the trait declaration (e.g. for the specification of the trait's methods), the name `Done` will be in scope, enclosed with braces (e.g. `{Done}`).
The attribute declarations can depend on each other in the definition order, e.g. it would be valid to specify: