-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable preserving-definedness atrribute for rules discovered during c…
…eil analysis (#426) Closes #424. This is a fix for the ceil analysis introduced in #402. We successfully infer definedness, but don't currently mark the rules as preserving definedness correctly. The added integration tests makes sure that a rule that contains a partial function on the RHS (discovered to be preserving definedness during the ceil analysis) will apply during execution. --------- Co-authored-by: Jost Berthold <jost.berthold@runtimeverification.com> Co-authored-by: rv-jenkins <admin@runtimeverification.com>
- Loading branch information
1 parent
9b87f1e
commit ad46990
Showing
6 changed files
with
188 additions
and
2 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
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
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,9 @@ | ||
module COMPUTE-CEIL | ||
imports INT | ||
imports ID-SYNTAX | ||
|
||
syntax Foo ::= g ( Int ) | ||
|
||
rule g ( N:Int ) => N %Int 5 | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
echo "kompiling compute-ceil.k" | ||
kompile --backend haskell compute-ceil.k | ||
cp compute-ceil-kompiled/definition.kore compute-ceil.kore | ||
rm -r compute-ceil-kompiled | ||
kompile --llvm-kompile-type c -o compute-ceil-library compute-ceil.k | ||
cp compute-ceil-library/interpreter.* ./compute-ceil.dylib | ||
rm -r compute-ceil-library |
84 changes: 84 additions & 0 deletions
84
test/rpc-integration/test-compute-ceil/response-evaluate-g.booster-dev
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,84 @@ | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 1, | ||
"result": { | ||
"reason": "aborted", | ||
"depth": 1, | ||
"state": { | ||
"term": { | ||
"format": "KORE", | ||
"version": 1, | ||
"term": { | ||
"tag": "App", | ||
"name": "Lbl'-LT-'generatedTop'-GT-'", | ||
"sorts": [], | ||
"args": [ | ||
{ | ||
"tag": "App", | ||
"name": "Lbl'-LT-'k'-GT-'", | ||
"sorts": [], | ||
"args": [ | ||
{ | ||
"tag": "App", | ||
"name": "kseq", | ||
"sorts": [], | ||
"args": [ | ||
{ | ||
"tag": "App", | ||
"name": "inj", | ||
"sorts": [ | ||
{ | ||
"tag": "SortApp", | ||
"name": "SortInt", | ||
"args": [] | ||
}, | ||
{ | ||
"tag": "SortApp", | ||
"name": "SortKItem", | ||
"args": [] | ||
} | ||
], | ||
"args": [ | ||
{ | ||
"tag": "DV", | ||
"sort": { | ||
"tag": "SortApp", | ||
"name": "SortInt", | ||
"args": [] | ||
}, | ||
"value": "2" | ||
} | ||
] | ||
}, | ||
{ | ||
"tag": "App", | ||
"name": "dotk", | ||
"sorts": [], | ||
"args": [] | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"tag": "App", | ||
"name": "Lbl'-LT-'generatedCounter'-GT-'", | ||
"sorts": [], | ||
"args": [ | ||
{ | ||
"tag": "DV", | ||
"sort": { | ||
"tag": "SortApp", | ||
"name": "SortInt", | ||
"args": [] | ||
}, | ||
"value": "0" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} |
81 changes: 81 additions & 0 deletions
81
test/rpc-integration/test-compute-ceil/state-evaluate-g.execute
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,81 @@ | ||
{ | ||
"format": "KORE", | ||
"version": 1, | ||
"term": { | ||
"tag": "App", | ||
"name": "Lbl'-LT-'generatedTop'-GT-'", | ||
"sorts": [], | ||
"args": [ | ||
{ | ||
"tag": "App", | ||
"name": "Lbl'-LT-'k'-GT-'", | ||
"sorts": [], | ||
"args": [ | ||
{ | ||
"tag": "App", | ||
"name": "kseq", | ||
"sorts": [], | ||
"args": [ | ||
{ | ||
"tag": "App", | ||
"name": "inj", | ||
"sorts": [ | ||
{ | ||
"tag": "SortApp", | ||
"name": "SortFoo", | ||
"args": [] | ||
}, | ||
{ | ||
"tag": "SortApp", | ||
"name": "SortKItem", | ||
"args": [] | ||
} | ||
], | ||
"args": [ | ||
{ | ||
"tag": "App", | ||
"name": "Lblg'LParUndsRParUnds'COMPUTE-CEIL'Unds'Foo'Unds'Int", | ||
"sorts": [], | ||
"args": [ | ||
{ | ||
"tag": "DV", | ||
"sort": { | ||
"tag": "SortApp", | ||
"name": "SortInt", | ||
"args": [] | ||
}, | ||
"value": "12" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"tag": "App", | ||
"name": "dotk", | ||
"sorts": [], | ||
"args": [] | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"tag": "App", | ||
"name": "Lbl'-LT-'generatedCounter'-GT-'", | ||
"sorts": [], | ||
"args": [ | ||
{ | ||
"tag": "DV", | ||
"sort": { | ||
"tag": "SortApp", | ||
"name": "SortInt", | ||
"args": [] | ||
}, | ||
"value": "0" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} |