Skip to content

Commit c397213

Browse files
Redo everything (#1940)
1 parent 85a62be commit c397213

File tree

6 files changed

+46
-46
lines changed

6 files changed

+46
-46
lines changed

kore/src/Kore/Log/WarnBottomTotalFunction.hs renamed to kore/src/Kore/Log/ErrorBottomTotalFunction.hs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ License : NCSA
44
55
-}
66

7-
module Kore.Log.WarnBottomTotalFunction
8-
( WarnBottomTotalFunction (..)
9-
, warnBottomTotalFunction
7+
module Kore.Log.ErrorBottomTotalFunction
8+
( ErrorBottomTotalFunction (..)
9+
, errorBottomTotalFunction
1010
) where
1111

1212
import Prelude.Kore
@@ -29,35 +29,35 @@ import qualified Pretty
2929
import Log
3030
import qualified SQL
3131

32-
newtype WarnBottomTotalFunction =
33-
WarnBottomTotalFunction
32+
newtype ErrorBottomTotalFunction =
33+
ErrorBottomTotalFunction
3434
{ term :: TermLike VariableName
3535
}
3636
deriving (Show)
3737
deriving (GHC.Generic)
3838

39-
instance SOP.Generic WarnBottomTotalFunction
39+
instance SOP.Generic ErrorBottomTotalFunction
4040

41-
instance SOP.HasDatatypeInfo WarnBottomTotalFunction
41+
instance SOP.HasDatatypeInfo ErrorBottomTotalFunction
4242

43-
instance Pretty WarnBottomTotalFunction where
44-
pretty WarnBottomTotalFunction { term } =
43+
instance Pretty ErrorBottomTotalFunction where
44+
pretty ErrorBottomTotalFunction { term } =
4545
Pretty.vsep
4646
[ "Evaluating total function"
4747
, Pretty.indent 4 (unparse term)
4848
, "has resulted in \\bottom."
4949
]
5050

51-
instance Entry WarnBottomTotalFunction where
52-
entrySeverity _ = Warning
53-
helpDoc _ = "warn when a total function is undefined"
51+
instance Entry ErrorBottomTotalFunction where
52+
entrySeverity _ = Error
53+
helpDoc _ = "errors raised when a total function is undefined"
5454

55-
instance SQL.Table WarnBottomTotalFunction
55+
instance SQL.Table ErrorBottomTotalFunction
5656

57-
warnBottomTotalFunction
57+
errorBottomTotalFunction
5858
:: MonadLog logger
5959
=> InternalVariable variable
6060
=> TermLike variable
6161
-> logger ()
62-
warnBottomTotalFunction (mapVariables (pure toVariableName) -> term) =
63-
logEntry WarnBottomTotalFunction { term }
62+
errorBottomTotalFunction (mapVariables (pure toVariableName) -> term) =
63+
logEntry ErrorBottomTotalFunction { term }

kore/src/Kore/Log/Registry.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ import Kore.Log.DebugSubstitutionSimplifier
6262
import Kore.Log.DebugUnification
6363
( DebugUnification
6464
)
65+
import Kore.Log.ErrorBottomTotalFunction
66+
( ErrorBottomTotalFunction
67+
)
6568
import Kore.Log.ErrorException
6669
( ErrorException
6770
)
@@ -77,9 +80,6 @@ import Kore.Log.InfoAttemptUnification
7780
import Kore.Log.InfoReachability
7881
( InfoReachability
7982
)
80-
import Kore.Log.WarnBottomTotalFunction
81-
( WarnBottomTotalFunction
82-
)
8383
import Kore.Log.WarnDecidePredicateUnknown
8484
( WarnDecidePredicateUnknown
8585
)
@@ -131,7 +131,7 @@ entryHelpDocs :: [Pretty.Doc ()]
131131
, mk $ Proxy @DebugProofState
132132
, mk $ Proxy @DebugAppliedRewriteRules
133133
, mk $ Proxy @DebugSubstitutionSimplifier
134-
, mk $ Proxy @WarnBottomTotalFunction
134+
, mk $ Proxy @ErrorBottomTotalFunction
135135
, mk $ Proxy @WarnDecidePredicateUnknown
136136
, mk $ Proxy @WarnFunctionWithoutEvaluators
137137
, mk $ Proxy @WarnSymbolSMTRepresentation

kore/src/Kore/Log/SQLite.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ import Kore.Log.DebugEvaluateCondition
3535
import Kore.Log.DebugSubstitutionSimplifier
3636
( DebugSubstitutionSimplifier
3737
)
38-
import Kore.Log.WarnBottomTotalFunction
39-
( WarnBottomTotalFunction
38+
import Kore.Log.ErrorBottomTotalFunction
39+
( ErrorBottomTotalFunction
4040
)
4141
import Kore.Log.WarnFunctionWithoutEvaluators
4242
( WarnFunctionWithoutEvaluators
@@ -127,7 +127,7 @@ foldMapEntries mapEntry =
127127
mconcat
128128
[ mapEntry (Proxy @DebugEvaluateCondition)
129129
, mapEntry (Proxy @DebugSubstitutionSimplifier)
130-
, mapEntry (Proxy @WarnBottomTotalFunction)
130+
, mapEntry (Proxy @ErrorBottomTotalFunction)
131131
, mapEntry (Proxy @WarnFunctionWithoutEvaluators)
132132
, mapEntry (Proxy @WarnSymbolSMTRepresentation)
133133
]

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ import qualified Kore.Internal.SideCondition.SideCondition as SideCondition
4747
)
4848
import qualified Kore.Internal.Symbol as Symbol
4949
import Kore.Internal.TermLike as TermLike
50-
import Kore.Log.WarnBottomTotalFunction
51-
( warnBottomTotalFunction
50+
import Kore.Log.ErrorBottomTotalFunction
51+
( errorBottomTotalFunction
5252
)
5353
import qualified Kore.Profiler.Profile as Profile
5454
( axiomBranching
@@ -109,7 +109,7 @@ evaluateApplication
109109
& lift
110110
Foldable.for_ canMemoize (recordOrPattern results)
111111
when (Symbol.isFunctional symbol && isBottom results) $
112-
lift $ warnBottomTotalFunction termLike
112+
lift $ errorBottomTotalFunction termLike
113113
return results
114114
where
115115
finishT :: ExceptT r simplifier r -> simplifier r
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module Test.Kore.Log.ErrorBottomTotalFunction
2+
( test_instance_Table_ErrorBottomTotalFunction
3+
) where
4+
5+
import Prelude.Kore ()
6+
7+
import Test.Tasty
8+
9+
import Kore.Log.ErrorBottomTotalFunction
10+
11+
import qualified Test.Kore.Step.MockSymbols as Mock
12+
import Test.SQL
13+
14+
test_instance_Table_ErrorBottomTotalFunction :: TestTree
15+
test_instance_Table_ErrorBottomTotalFunction =
16+
testTable @ErrorBottomTotalFunction [warn1, warn2]
17+
18+
warn1, warn2 :: ErrorBottomTotalFunction
19+
warn1 = ErrorBottomTotalFunction Mock.a
20+
warn2 = ErrorBottomTotalFunction Mock.b

kore/test/Test/Kore/Log/WarnBottomTotalFunction.hs

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)