Skip to content

Commit 7b40372

Browse files
committed
Merge remote-tracking branch 'origin/master' into release
2 parents 5a2777d + 044df58 commit 7b40372

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

booster/library/Booster/Pattern/Implies.hs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ runImplies def mLlvmLibrary mSMTOptions antecedent consequent =
9292
map (pack . renderDefault . pretty' @mods) $
9393
Set.toList freeVarsRminusL
9494
| not (null unsupportedL) || not (null unsupportedR) -> do
95-
Booster.Log.logMessage'
95+
Booster.Log.logMessage
9696
("aborting due to unsupported predicate parts" :: Text)
9797
unless (null unsupportedL) $
9898
Booster.Log.withContext Booster.Log.CtxDetail $
@@ -154,7 +154,8 @@ runImplies def mLlvmLibrary mSMTOptions antecedent consequent =
154154
(externaliseExistTerm existsL patL.term)
155155
(externaliseExistTerm existsR patR.term)
156156
subst
157-
else
157+
else -- FIXME This is incomplete because patL.constraints are not assumed in the check.
158+
158159
ApplyEquations.evaluateConstraints def mLlvmLibrary solver mempty filteredConsequentPreds >>= \case
159160
(Right newPreds, _) ->
160161
if all (== Predicate TrueBool) newPreds
@@ -164,9 +165,7 @@ runImplies def mLlvmLibrary mSMTOptions antecedent consequent =
164165
(externaliseExistTerm existsL patL.term)
165166
(externaliseExistTerm existsR patR.term)
166167
subst
167-
else -- here we conservatively abort
168-
-- an anlternative would be to return valid, putting the unknown constraints into the
169-
-- condition. i.e. the implication holds conditionally, if we can prove that the unknwon constraints are true
168+
else -- here we conservatively abort (incomplete)
170169
pure . Left . RpcError.backendError $ RpcError.Aborted "unknown constraints"
171170
(Left other, _) ->
172171
pure . Left . RpcError.backendError $ RpcError.Aborted (Text.pack . constructorName $ other)

booster/tools/booster/Proxy.hs

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,10 @@ respondEither cfg@ProxyConfig{boosterState} booster kore req = case req of
110110
pure res
111111
Left err -> do
112112
Booster.Log.withContext CtxProxy $
113-
Booster.Log.logMessage' $
114-
Text.pack $
115-
"implies error in booster: " <> fromError err
113+
Booster.Log.logMessage . Text.pack $
114+
"Implies abort in booster: "
115+
<> fromError err
116+
<> ". Falling back to kore."
116117
(koreRes, koreTime) <- Stats.timed $ kore req
117118
logStats ImpliesM (boosterTime + koreTime, koreTime)
118119
pure koreRes
@@ -139,7 +140,7 @@ respondEither cfg@ProxyConfig{boosterState} booster kore req = case req of
139140
case bResult of
140141
Left err -> do
141142
Booster.Log.withContext CtxProxy $
142-
Booster.Log.logMessage' $
143+
Booster.Log.logMessage $
143144
Text.pack $
144145
"get-model error in booster: " <> fromError err
145146
Stats.timed $ kore req
@@ -222,17 +223,20 @@ respondEither cfg@ProxyConfig{boosterState} booster kore req = case req of
222223
fromString other = Text.pack (show other)
223224

224225
Booster.Log.withContext CtxProxy $
225-
Booster.Log.logMessage' $
226-
Text.unwords
227-
["Problem with simplify request: ", Text.pack getErrMsg, "-", boosterError]
226+
Booster.Log.logMessage $
227+
"Problem with booster simplify request: "
228+
<> Text.pack getErrMsg
229+
<> " - "
230+
<> boosterError
231+
<> ". Falling back to kore."
228232
-- NB the timing information for booster execution is lost here.
229233
loggedKore SimplifyM req
230234
_wrong ->
231235
pure . Left $ ErrorObj "Wrong result type" (-32002) $ toJSON _wrong
232236

233237
loggedKore method r = do
234238
Booster.Log.withContext CtxProxy $
235-
Booster.Log.logMessage' $
239+
Booster.Log.logMessage $
236240
Text.pack $
237241
show method <> " (using kore)"
238242
(result, time) <- Stats.timed $ kore r
@@ -584,7 +588,7 @@ respondEither cfg@ProxyConfig{boosterState} booster kore req = case req of
584588

585589
when (length filteredNexts < maybe 0 length nextStates) $
586590
Booster.Log.withContext CtxProxy $
587-
Booster.Log.logMessage'
591+
Booster.Log.logMessage
588592
(Text.pack ("Pruned #Bottom states: " <> show (length nextStates)))
589593

590594
case reason of
@@ -617,7 +621,8 @@ respondEither cfg@ProxyConfig{boosterState} booster kore req = case req of
617621
}
618622
| otherwise = Nothing
619623
Booster.Log.withContext CtxProxy $
620-
Booster.Log.logMessage' ("Continuing after rewriting with rule " <> rewriteRuleId)
624+
Booster.Log.logMessage
625+
("Continuing after rewriting with rule " <> rewriteRuleId)
621626
pure $
622627
Left
623628
( execStateToKoreJson onlyNext

0 commit comments

Comments
 (0)