-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
Short description
The possibility to add annotations to (e.g.) rules and constraints.
Problem description.
Alternative uses of a specification can require manipulation of/search through a specification. Currently, there are no ways to annotate (e.g.) rules and constraints properly.
Describe the solution you'd like
Syntax to annotation rules/constraints; e.g.
@[Fallback()]
subtype(_, _) :- @[AlwaysFail()] false.
These annotations should be preserved at specification loading time:
Rule rule = StatixTerms.rule().match(ruleTerm /* <- from compiled spec */);
List<ITerm> ruleAnnotations = rule.getAnnotations();
Map<IConstraint, ITem> bodyAnnotations = rule.body().getAllAnnotations(); /* <- get all annotations of sub-constraints */
Open Questions
More careful analysis of what members can require annotations must be made:
- sorts
- constructors
- constructor arguments
- particular terms
- labels
- ...
Additional context
Would have been useful for reference synthesis.