@@ -39,7 +39,6 @@ import Data.Text.Encoding qualified as Text
39
39
import GHC.Records
40
40
import Numeric.Natural
41
41
import Prettyprinter (comma , hsep , punctuate , (<+>) )
42
- import System.Clock (Clock (Monotonic ), diffTimeSpec , getTime , toNanoSecs )
43
42
44
43
import Booster.CLOptions (RewriteOptions (.. ))
45
44
import Booster.Definition.Attributes.Base (UniqueId , getUniqueId , uniqueId )
@@ -111,7 +110,6 @@ respond stateVar request =
111
110
| isJust req. movingAverageStepTimeout ->
112
111
pure $ Left $ RpcError. unsupportedOption (" moving-average-step-timeout" :: String )
113
112
RpcTypes. Execute req -> withModule req. _module $ \ (def, mLlvmLibrary, mSMTOptions, rewriteOpts) -> Booster.Log. withContext CtxExecute $ do
114
- start <- liftIO $ getTime Monotonic
115
113
-- internalise given constrained term
116
114
let internalised = runExcept $ internalisePattern DisallowAlias CheckSubsorts Nothing def req. state. term
117
115
@@ -137,7 +135,6 @@ respond stateVar request =
137
135
(fromMaybe False )
138
136
[ req. logSuccessfulRewrites
139
137
, req. logFailedRewrites
140
- , req. logFallbacks
141
138
]
142
139
-- apply the given substitution before doing anything else
143
140
let substPat =
@@ -174,14 +171,7 @@ respond stateVar request =
174
171
result <-
175
172
performRewrite rewriteConfig substPat
176
173
SMT. finaliseSolver solver
177
- stop <- liftIO $ getTime Monotonic
178
- let duration =
179
- if fromMaybe False req. logTiming
180
- then
181
- Just $
182
- fromIntegral (toNanoSecs (diffTimeSpec stop start)) / 1e9
183
- else Nothing
184
- pure $ execResponse duration req result substitution unsupported
174
+ pure $ execResponse req result substitution unsupported
185
175
RpcTypes. AddModule RpcTypes. AddModuleRequest {_module, nameAsId = nameAsId'} -> Booster.Log. withContext CtxAddModule $ runExceptT $ do
186
176
-- block other request executions while modifying the server state
187
177
state <- liftIO $ takeMVar stateVar
@@ -244,14 +234,8 @@ respond stateVar request =
244
234
" Added a new module. Now in scope: " <> Text. intercalate " , " (Map. keys newDefinitions)
245
235
pure $ RpcTypes. AddModule $ RpcTypes. AddModuleResult moduleHash
246
236
RpcTypes. Simplify req -> withModule req. _module $ \ (def, mLlvmLibrary, mSMTOptions, _) -> Booster.Log. withContext CtxSimplify $ do
247
- start <- liftIO $ getTime Monotonic
248
237
let internalised =
249
238
runExcept $ internaliseTermOrPredicate DisallowAlias CheckSubsorts Nothing def req. state. term
250
- let mkTraces duration
251
- | Just True <- req. logTiming =
252
- Just [ProcessingTime (Just Booster ) duration]
253
- | otherwise =
254
- Nothing
255
239
256
240
solver <- maybe (SMT. noSolver) (SMT. initSolver def) mSMTOptions
257
241
@@ -325,13 +309,10 @@ respond stateVar request =
325
309
(Left something, _) ->
326
310
pure . Left . RpcError. backendError $ RpcError. Aborted $ renderText $ pretty' @ mods something
327
311
SMT. finaliseSolver solver
328
- stop <- liftIO $ getTime Monotonic
329
312
330
- let duration =
331
- fromIntegral (toNanoSecs (diffTimeSpec stop start)) / 1e9
332
- mkSimplifyResponse state =
313
+ let mkSimplifyResponse state =
333
314
RpcTypes. Simplify
334
- RpcTypes. SimplifyResult {state, logs = mkTraces duration }
315
+ RpcTypes. SimplifyResult {state, logs = Nothing }
335
316
pure $ second mkSimplifyResponse result
336
317
RpcTypes. GetModel req -> withModule req. _module $ \ case
337
318
(_, _, Nothing , _) -> do
@@ -615,13 +596,12 @@ execStateToKoreJson RpcTypes.ExecuteState{term = t, substitution, predicate} =
615
596
}
616
597
617
598
execResponse ::
618
- Maybe Double ->
619
599
RpcTypes. ExecuteRequest ->
620
600
(Natural , Seq (RewriteTrace () ), RewriteResult Pattern ) ->
621
601
Map Variable Term ->
622
602
[Syntax. KorePattern ] ->
623
603
Either ErrorObj (RpcTypes. API 'RpcTypes.Res )
624
- execResponse mbDuration req (d, traces, rr) originalSubstitution unsupported = case rr of
604
+ execResponse req (d, traces, rr) originalSubstitution unsupported = case rr of
625
605
RewriteBranch p nexts ->
626
606
Right $
627
607
RpcTypes. Execute
@@ -727,12 +707,9 @@ execResponse mbDuration req (d, traces, rr) originalSubstitution unsupported = c
727
707
(logSuccessfulRewrites, logFailedRewrites)
728
708
)
729
709
traces
730
- timingLog =
731
- fmap (ProcessingTime $ Just Booster ) mbDuration
732
- in case (timingLog, traceLogs) of
733
- (Nothing , [] ) -> Nothing
734
- (Nothing , xs@ (_ : _)) -> Just xs
735
- (Just t, xs) -> Just (t : xs)
710
+ in case traceLogs of
711
+ [] -> Nothing
712
+ xs@ (_ : _) -> Just xs
736
713
737
714
toExecState ::
738
715
Pattern -> Map Variable Term -> [Syntax. KorePattern ] -> Maybe UniqueId -> RpcTypes. ExecuteState
0 commit comments