-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Take result attributes directly from the production when resolving co…
…ntexts (#4685) 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 --------- Co-authored-by: Tamás Tóth <tothtamas28@users.noreply.github.com>
- Loading branch information
1 parent
c15d153
commit 307e256
Showing
5 changed files
with
37 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
thing(a, b) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<k> | ||
.K | ||
</k> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
DEF=test | ||
EXT=test | ||
TESTDIR=. | ||
KOMPILE_FLAGS+=--syntax-module TEST | ||
|
||
include ../../../include/kframework/ktest.mak |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
module TEST | ||
imports BOOL | ||
|
||
syntax KResult | ||
|
||
syntax Stuff ::= "a" | "b" | "c" | ||
syntax KItem ::= thing(Stuff, Stuff) [seqstrict, result(MyResult)] | ||
|
||
rule thing(c, c) => .K | ||
|
||
rule b => c | ||
rule a => c | ||
|
||
syntax Bool ::= isMyResult(K) [function, total, symbol(isMyResult)] | ||
rule isMyResult(_) => false [owise] | ||
rule isMyResult(c) => true | ||
endmodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters