-
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
Duplicate comm simplification rules #2754
Conversation
Failing with this message. Coming from the java backend: https://github.com/runtimeverification/k/blob/master/java-backend/src/main/java/org/kframework/backend/java/kil/Definition.java#L176
|
Hack the Java backend to remove the |
public K genCommRule(K body, Module m) { | ||
return new RewriteAwareTransformer(true) { | ||
@Override | ||
public K apply(KApply k) { | ||
if (k.klabel().name().equals("#withConfig")) { | ||
super.apply(k); | ||
return k; | ||
} | ||
if ((isRHS() && !isLHS()) || k.klabel() instanceof KVariable || !m.attributesFor().contains(k.klabel())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this only swapping at the top-most position of the LHS, or at every position with a comm
symbol? We should only swap at the top-most position.
For example, if we have:
rule { 1 +Int 2 #Equals 3 } => #Top [comm, simplification]
It should generate rule:
rule { 3 #Equals 1 +Int 2 } => #Top
But not rule:
rule { 3 #Equals 2 +Int 1 } => #Top
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this could be added as a test somehow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd definitely like to see tests for this.
Not working because comm is interpreted by the haskell backend
Try to remove the |
I need to test it to see what happens if I add |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks fine. Adding the commutativity axioms to the kore definition shouldn't affect anything though since both backends appear to be ignoring them.
Please add an issue to identify what's going on with the backend, so we can get that fixed too. The backends should not have to have the |
Fixes: #2587