Skip to content

Commit e5a921f

Browse files
Add pyk implication tests to the rpc integration test suite (#3997)
This is the first step in bringing the booster implication endpoint in line with kore. Most of the `.booster-dev` responses will eventually be the same/equivalent to the kore responses.
1 parent be64ead commit e5a921f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+97685
-2
lines changed

booster/library/Booster/JsonRpc.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ respond stateVar request =
495495
(Right newPreds, _) ->
496496
if all (== Pattern.Predicate TrueBool) newPreds
497497
then implies (sortOfPattern substPatL) req.antecedent.term req.consequent.term subst
498-
else pure . Left . RpcError.backendError $ RpcError.Aborted "unknown constrains"
498+
else pure . Left . RpcError.backendError $ RpcError.Aborted "unknown constraints"
499499
(Left other, _) ->
500500
pure . Left . RpcError.backendError $ RpcError.Aborted (Text.pack . constructorName $ other)
501501

booster/test/rpc-integration/resources/implies-issue-3941.kore

Lines changed: 73985 additions & 0 deletions
Large diffs are not rendered by default.

booster/test/rpc-integration/resources/implies.kore

Lines changed: 2685 additions & 0 deletions
Large diffs are not rendered by default.

booster/test/rpc-integration/resources/implies2.kore

Lines changed: 5381 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"jsonrpc": "2.0",
3+
"id": 61298,
4+
"error": {
5+
"code": 4,
6+
"data": {
7+
"error": "match remainder: Map:update(VarS:SortMap{}, \"0\", \"0\") == Map:update(\n VarS:SortMap{},\n \"0\",\n chop(_)_WORD_Int_Int(_+Int_(lookup(VarS:SortMap{}, \"0\"), \"1\"))\n), \"\\NUL\\NUL\\NUL\\NUL\\NUL\\NUL\\NUL\\NUL\\NUL\\NUL\\NUL\\NUL\\NUL\\NUL\\NUL\\NUL...truncated\" == buf(\n \"32\",\n chop(_)_WORD_Int_Int(_+Int_(lookup(VarS:SortMap{}, \"0\"), \"1\"))\n)"
8+
},
9+
"message": "Implication check error"
10+
}
11+
}

booster/test/rpc-integration/test-implies-issue-3941/response-001.json

Lines changed: 7065 additions & 0 deletions
Large diffs are not rendered by default.

booster/test/rpc-integration/test-implies-issue-3941/state-001.send

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"jsonrpc":"2.0","id":"4420705104-001","result":{"valid":false,"implication":{"format":"KORE","version":1,"term":{"tag":"Implies","sort":{"tag":"SortApp","name":"SortInt","args":[]},"first":{"tag":"DV","sort":{"tag":"SortApp","name":"SortInt","args":[]},"value":"0"},"second":{"tag":"DV","sort":{"tag":"SortApp","name":"SortInt","args":[]},"value":"1"}}}}}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"jsonrpc": "2.0",
3+
"id": "4420703856-001",
4+
"error": {
5+
"code": 2,
6+
"data": [
7+
{
8+
"term": {
9+
"format": "KORE",
10+
"version": 1,
11+
"term": {
12+
"tag": "Top",
13+
"sort": {
14+
"tag": "SortApp",
15+
"name": "SortInt",
16+
"args": []
17+
}
18+
}
19+
},
20+
"error": "Pattern must contain at least one term"
21+
}
22+
],
23+
"message": "Could not verify pattern"
24+
}
25+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"jsonrpc":"2.0","id":"4420703856-001","result":{"valid":true,"implication":{"format":"KORE","version":1,"term":{"tag":"Implies","sort":{"tag":"SortApp","name":"SortInt","args":[]},"first":{"tag":"DV","sort":{"tag":"SortApp","name":"SortInt","args":[]},"value":"0"},"second":{"tag":"Top","sort":{"tag":"SortApp","name":"SortInt","args":[]}}}},"condition":{"substitution":{"format":"KORE","version":1,"term":{"tag":"Top","sort":{"tag":"SortApp","name":"SortInt","args":[]}}},"predicate":{"format":"KORE","version":1,"term":{"tag":"Top","sort":{"tag":"SortApp","name":"SortInt","args":[]}}}}}}

0 commit comments

Comments
 (0)