-
Notifications
You must be signed in to change notification settings - Fork 153
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
Check that attributes are placed correctly on modules vs sentences #3481
Comments
Here's a list of BuiltIn attributes found for each Sentence type that had attributes on them when running
|
Here are Internal attributes (minus Source/Location, which appear on all of them).
|
Don't worry about checking internal attributes; if they're used incorrectly it's a bug, we don't need to explicitly check for that. Okay, here's what I have:
This does not precisely agree with the data you have above; I definitely note you mentioned some attributes are being used some places that I wouldn't expect them to be used. I'd like us to start with this data set and report what individual problems we have and decide on a case by case basis whether to change the implementation or the k definition. Btw, the ones I marked as ??? appear, to the best of my knowledge, to either be dead code or ought to be replaced with groups or rule labels. It might be worth trying to eliminate them entirely as a precursor PR. |
Here are the observed attributes and sentence types that don't belong together based on @dwightguth's list
|
Public can be on a production; that's my error. So can stream. I believe that cellCollection being on sorts might be right also; my memory of that attribute is probably incorrect. Which means it probably doesn't belong on productions. The rest of these definitely seem like suspicious combinations. How did you measure whether a rule or context has an attribute? Some rules and contexts inherit the attributes of a production during compilation, but that doesn't mean that that attribute can be written by a user or that it means anything. Are you sure you collected data from before the compilation pipeline? |
Bear in mind that mlOp, noThread, and topcell are definitely placed on definitions in practice, but they still should probably be removed from existence. noThread is specific to the ocaml backend that no longer exists and has no meaning; topcell was created with a purpose and never used for that purpose; mlOp should probably be a group. |
I placed it at the end of the pipeline, thinking we want to check attributes added by the transformations. Here's an updated table from just before the kore backend pipeline:
I'm including cellCollection since there's still some uncertainty there.
So I just want to make sure I understand the intent here clearly. These checks are meant for attributes written by the user in K definitions only? I guess that makes more sense. I was thinking that checking attributes generated by the pipeline could aid developers as well, but admittedly that would make a lot of extra work here for probably only a marginal gain. |
The left/right attributes should forbid any values, but currently they are being re-used to pass values to the backends. Some new internal attributes should be made to serve the purpose that left/right are being used for. Here's where left/right are being made with values: k/kernel/src/main/java/org/kframework/backend/kore/ModuleToKORE.java Lines 1606 to 1607 in a863a1e
This was introduced by #1287 Since this change will not be straightforward (It will require changes to the llvm-backend), I'm going to merge my PR #3579 with values for those attributes left as optional, and it can be addressed in a separate set of PRs. |
Makes progress on #3481 --------- Co-authored-by: rv-jenkins <admin@runtimeverification.com>
Dwight was suggesting that
|
for #3481 This creates internal left/right attributes that allow parameters which get passed down to the backends. --------- Co-authored-by: rv-jenkins <admin@runtimeverification.com>
I've found a breakage in the c-semantics with these new changes.
I can open a PR to add Context and ContextAlias to
|
I tried to address these but obviously this slipped through. Anything that might apply to top-level rewrite rules that might apply to a heating or cooling rule needs to be applicable to contexts and context aliases. Go ahead and update the PR. I don't think we need to make these into warnings though; it should be fairly quick to address any further breakages we find. It might not be a bad idea to test more semantics proactively though. |
More work for #3481 Co-authored-by: rv-jenkins <admin@runtimeverification.com>
I think this is done. |
We could consider splitting the attributes into
<modules> | <rule> | <syntax> ...
Some of them can be in multiple categories.
We could also check if attributes require a value or are allowed to have values. This right now is handled by the step which uses the attribute.
The text was updated successfully, but these errors were encountered: