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

Partially revert the implication endpoint #3862

Merged
merged 5 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
368 changes: 184 additions & 184 deletions booster/test/rpc-integration/test-foundry-bug-report/response-006.json

Large diffs are not rendered by default.

11,778 changes: 5,889 additions & 5,889 deletions booster/test/rpc-integration/test-foundry-bug-report/response-008.json

Large diffs are not rendered by default.

11,778 changes: 5,889 additions & 5,889 deletions booster/test/rpc-integration/test-foundry-bug-report/response-010.json

Large diffs are not rendered by default.

11,828 changes: 5,914 additions & 5,914 deletions booster/test/rpc-integration/test-foundry-bug-report/response-012.json

Large diffs are not rendered by default.

11,828 changes: 5,914 additions & 5,914 deletions booster/test/rpc-integration/test-foundry-bug-report/response-014.json

Large diffs are not rendered by default.

20,996 changes: 10,893 additions & 10,103 deletions booster/test/rpc-integration/test-foundry-bug-report/response-016.json

Large diffs are not rendered by default.

31 changes: 18 additions & 13 deletions booster/tools/booster/Proxy.hs
Original file line number Diff line number Diff line change
Expand Up @@ -104,19 +104,24 @@ respondEither cfg@ProxyConfig{statsVar, boosterState} booster kore req = case re
fromMaybe (error $ "Module " <> show m <> " not found") $
Map.lookup m bState.definitions
handleExecute logSettings def start execReq
Implies{} -> do
-- try the booster end-point first
(boosterResult, boosterTime) <- Stats.timed $ booster req
case boosterResult of
res@Right{} -> do
logStats ImpliesM (boosterTime, 0)
pure res
Left err -> do
Log.logWarnNS "proxy" . Text.pack $
"implies error in booster: " <> fromError err
(koreRes, koreTime) <- Stats.timed $ kore req
logStats ImpliesM (boosterTime + koreTime, koreTime)
pure koreRes
Implies ImpliesRequest{assumeDefined}
| fromMaybe False assumeDefined -> do
-- try the booster end-point first
(boosterResult, boosterTime) <- Stats.timed $ booster req
case boosterResult of
res@Right{} -> do
logStats ImpliesM (boosterTime, 0)
pure res
Left err -> do
Log.logWarnNS "proxy" . Text.pack $
"implies error in booster: " <> fromError err
(koreRes, koreTime) <- Stats.timed $ kore req
logStats ImpliesM (boosterTime + koreTime, koreTime)
pure koreRes
| otherwise -> do
(koreRes, koreTime) <- Stats.timed $ kore req
logStats ImpliesM (koreTime, koreTime)
pure koreRes
Simplify simplifyReq ->
liftIO (getTime Monotonic) >>= handleSimplify simplifyReq . Just
AddModule _ -> do
Expand Down
7 changes: 5 additions & 2 deletions docs/2022-07-18-JSON-RPC-Server-API.md
Original file line number Diff line number Diff line change
Expand Up @@ -338,12 +338,15 @@ Not all backends support logging processing time, and some won't have the differ
"antecedent": {"format": "KORE", "version": 1, "term": {}},
"consequent": {"format": "KORE", "version": 1, "term": {}},
"module": "MODULE-NAME",
"log-timing": true
"log-timing": true,
"assume-defined": false
}
}
```

Optional parameters: `module` (main module name), `log-timing`
Optional parameters: `module` (main module name), `log-timing`, `assume-defined`.

The `assume-defined` flag defaults to `false`. When set to `true`, the server uses the new simplified implication check in booster, which makes the assumption that the antecedent and consequent are bot defined, i.e. don't simplify to `#Bottom`.

### Error Response:

Expand Down
1 change: 1 addition & 0 deletions kore-rpc-types/src/Kore/JsonRpc/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ data ImpliesRequest = ImpliesRequest
{ antecedent :: !KoreJson
, consequent :: !KoreJson
, _module :: !(Maybe Text)
, assumeDefined :: !(Maybe Bool)
, logSuccessfulSimplifications :: !(Maybe Bool)
, logFailedSimplifications :: !(Maybe Bool)
, logTiming :: !(Maybe Bool)
Expand Down
Loading