Skip to content

Commit a45859f

Browse files
authored
Revert "Stop execution on ErrorBottomTotalFunction (#2088)" (#2111)
This reverts commit 9c3511c.
1 parent 5edf6cc commit a45859f

File tree

6 files changed

+9
-46
lines changed

6 files changed

+9
-46
lines changed

kore/src/Kore/Log/ErrorBottomTotalFunction.hs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ module Kore.Log.ErrorBottomTotalFunction
1111

1212
import Prelude.Kore
1313

14-
import Control.Monad.Catch
15-
( Exception (..)
16-
, MonadThrow
17-
, throwM
18-
)
1914
import qualified Generics.SOP as SOP
2015
import qualified GHC.Generics as GHC
2116

@@ -50,21 +45,16 @@ instance Pretty ErrorBottomTotalFunction where
5045
, "has resulted in \\bottom."
5146
]
5247

53-
instance Exception ErrorBottomTotalFunction where
54-
toException = toException . SomeEntry
55-
fromException exn =
56-
fromException exn >>= \entry -> fromEntry entry
57-
5848
instance Entry ErrorBottomTotalFunction where
5949
entrySeverity _ = Error
6050
helpDoc _ = "errors raised when a total function is undefined"
6151

6252
instance SQL.Table ErrorBottomTotalFunction
6353

6454
errorBottomTotalFunction
65-
:: MonadThrow logger
55+
:: MonadLog logger
6656
=> InternalVariable variable
6757
=> TermLike variable
6858
-> logger ()
6959
errorBottomTotalFunction (mapVariables (pure toVariableName) -> term) =
70-
throwM ErrorBottomTotalFunction { term }
60+
logEntry ErrorBottomTotalFunction { term }

kore/src/Kore/Step/Function/Evaluator.hs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ import Control.Error
2121
, maybeT
2222
, throwE
2323
)
24-
import Control.Monad.Catch
25-
( MonadThrow
26-
)
2724
import qualified Data.Foldable as Foldable
2825

2926
import qualified Kore.Attribute.Pattern.Simplified as Attribute.Simplified
@@ -74,7 +71,6 @@ evaluateApplication
7471
:: forall variable simplifier
7572
. ( InternalVariable variable
7673
, MonadSimplify simplifier
77-
, MonadThrow simplifier
7874
)
7975
=> SideCondition variable
8076
-- ^ The predicate from the configuration

kore/src/Kore/Step/Simplification/Application.hs

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ module Kore.Step.Simplification.Application
1414

1515
import Prelude.Kore
1616

17-
import Control.Monad.Catch
18-
( MonadThrow
19-
)
20-
2117
import qualified Kore.Internal.Conditional as Conditional
2218
import qualified Kore.Internal.MultiOr as MultiOr
2319
( fullCrossProduct
@@ -62,10 +58,7 @@ predicates ans substitutions, applying functions on the Application(terms),
6258
then merging everything into an Pattern.
6359
-}
6460
simplify
65-
:: ( InternalVariable variable
66-
, MonadSimplify simplifier
67-
, MonadThrow simplifier
68-
)
61+
:: (InternalVariable variable, MonadSimplify simplifier)
6962
=> SideCondition variable
7063
-> Application Symbol (OrPattern variable)
7164
-> simplifier (OrPattern variable)
@@ -87,10 +80,7 @@ simplify sideCondition application = do
8780
childrenCrossProduct = MultiOr.fullCrossProduct children
8881

8982
makeAndEvaluateApplications
90-
:: ( InternalVariable variable
91-
, MonadSimplify simplifier
92-
, MonadThrow simplifier
93-
)
83+
:: (InternalVariable variable, MonadSimplify simplifier)
9484
=> SideCondition variable
9585
-> Symbol
9686
-> [Pattern variable]
@@ -99,10 +89,7 @@ makeAndEvaluateApplications =
9989
makeAndEvaluateSymbolApplications
10090

10191
makeAndEvaluateSymbolApplications
102-
:: ( InternalVariable variable
103-
, MonadSimplify simplifier
104-
, MonadThrow simplifier
105-
)
92+
:: (InternalVariable variable, MonadSimplify simplifier)
10693
=> SideCondition variable
10794
-> Symbol
10895
-> [Pattern variable]
@@ -118,10 +105,7 @@ makeAndEvaluateSymbolApplications sideCondition symbol children = do
118105
return (MultiOr.mergeAll orResults)
119106

120107
evaluateApplicationFunction
121-
:: ( InternalVariable variable
122-
, MonadSimplify simplifier
123-
, MonadThrow simplifier
124-
)
108+
:: (InternalVariable variable, MonadSimplify simplifier)
125109
=> SideCondition variable
126110
-- ^ The predicate from the configuration
127111
-> ExpandedApplication variable

kore/src/Kore/Step/Simplification/TermLike.hs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ module Kore.Step.Simplification.TermLike
1010
import Prelude.Kore
1111

1212
import qualified Control.Lens.Combinators as Lens
13-
import Control.Monad.Catch
14-
( MonadThrow
15-
)
1613
import Data.Functor.Const
1714
import qualified Data.Functor.Foldable as Recursive
1815

@@ -170,7 +167,6 @@ simplify
170167
. HasCallStack
171168
=> InternalVariable variable
172169
=> MonadSimplify simplifier
173-
=> MonadThrow simplifier
174170
=> SideCondition variable
175171
-> TermLike variable
176172
-> simplifier (OrPattern variable)

kore/test/Test/Kore/Builtin/Definition.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ elementMapSymbol =
437437

438438
concatMapSymbol :: Internal.Symbol
439439
concatMapSymbol =
440-
binarySymbol "concatMap" mapSort & hook "MAP.concat" & function
440+
binarySymbol "concatMap" mapSort & hook "MAP.concat" & functional
441441

442442
inKeysMapSymbol :: Internal.Symbol
443443
inKeysMapSymbol =
@@ -596,7 +596,7 @@ elementSet x = mkApplySymbol elementSetSymbol [x]
596596

597597
concatSetSymbol :: Internal.Symbol
598598
concatSetSymbol =
599-
binarySymbol "concatSet" setSort & hook "SET.concat" & function
599+
binarySymbol "concatSet" setSort & hook "SET.concat" & functional
600600

601601
concatSet
602602
:: TermLike VariableName

kore/test/Test/Kore/Step/Simplification/TermLike.hs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ import Test.Tasty.HUnit
1010
import Control.Monad
1111
( void
1212
)
13-
import Control.Monad.Catch
14-
( MonadThrow
15-
)
1613

1714
import Kore.Internal.OrPattern
1815
( OrPattern
@@ -48,7 +45,7 @@ simplifyEvaluated original =
4845

4946
newtype TestSimplifier a = TestSimplifier { getTestSimplifier :: Simplifier a }
5047
deriving (Functor, Applicative, Monad)
51-
deriving (MonadLog, MonadSMT, MonadThrow)
48+
deriving (MonadLog, MonadSMT)
5249

5350
instance MonadSimplify TestSimplifier where
5451
askMetadataTools = TestSimplifier askMetadataTools

0 commit comments

Comments
 (0)