New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parametric rules #1415
Comments
The first step of implementing this is modifying the parser so that you can infer that the sort of a variable or production parameter is a sort variable instead of a concrete sort. I can't tell you precisely what this will require, but it may require changes to the grammar generator, parser, and/or sort inferencer. You will have to try and write such a sentence and see where things start to go wrong. |
We would like to write parametric rules thus:
The translation to Kore would not change, except that the corresponding axioms would have a sort parameter,
and that the sort variable would appear in place of the concrete sort. |
I found a few bugs in kompile that are blocking me from solving this. This simple production makes kore-exec complain about missing parameters:
This makes flex to crash. Need to investigate further, but I would like confirmation that this is the behavior we want. Can someone also confirm that returning a parametric sort is not supported by the haskell-backend?
What should we do in kompile then? Is this not yet supported, but should be in the future? Is this available only for hooked symbols? |
The backend supports parametric symbols. I need to see what Kore sentences are generated to say what is wrong here. |
Does this help?
definition.kore:136
|
You can't define constructors in any sort. This would allow you to bypass the restriction against defining constructors in built-in sorts, for example. You need at least one sort constructor in any constructor declaration, e.g.
|
In Kore, parameter names and sort names are syntactically distinct. |
We do not need to worry about parametric sorts or constructors yet. Let's just get parametric function symbols ironed out first. |
K supports parametric productions such as this one from domains.k
There is no corresponding way to write parametric rules for parametric productions, so we have rules such as these:
which restrict the sort parameter to
K
. These equations can only be applied by the Haskell backend when the#then
and#else
expressions are explicitly of sortK
.As a workaround, we can add specific rules for any sort which needs support, for example:
This workaround quickly becomes tedious, though.
The text was updated successfully, but these errors were encountered: