Skip to content
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

Take result attributes directly from the production when resolving contexts #4685

Merged
merged 3 commits into from
Nov 27, 2024

Conversation

virgil-serbanuta
Copy link
Contributor

@virgil-serbanuta virgil-serbanuta commented Nov 15, 2024

A declaration like
syntax KItem ::= thing(Stuff, Stuff) [seqstrict, result(Evaluated)]
should consider tems that are Evaluated as evaluated. Right now, this happens only for the argument being heated/cooled, while the previous arguments are checked for being KResult. As an example, when heating the second argument above, the heating rule looks something like this:

rule thing(A, B) => B ~> thingFreezer(A) requires isKResult(A) andBool notBool isEvaluated(B)

With this PR, the rule becomes

rule thing(A, B) => B ~> thingFreezer(A) requires isEvaluated(A) andBool notBool isEvaluated(B)

Fixes #4683

Copy link
Contributor

@tothtamas28 tothtamas28 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before merging, please add a description for the PR, as that will become the commit description once it is merged into master.

@@ -119,6 +119,14 @@ private void setAliases(String attribute, Set<ContextAlias> aliases, Production
private static final ContextAlias DEFAULT_ALIAS =
ContextAlias(KVariable("HERE"), BooleanUtils.TRUE, Att.empty());

private static final ContextAlias defaultAliasWithAtts(Att att) {
if (!att.contains(Att.RESULT())) {
return DEFAULT_ALIAS;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If DEFAULT_ALIAS is not referred to elsewhere, consider inlining it here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines 17 to 18


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: consider removing these blank lines.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@virgil-serbanuta
Copy link
Contributor Author

Before merging, please add a description for the PR, as that will become the commit description once it is merged into master.

I hope it looks reasonable now.

@rv-jenkins rv-jenkins merged commit 307e256 into runtimeverification:develop Nov 27, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[K-Bug] Broken condition for heating rules with result
4 participants