Skip to content

Commit b296540

Browse files
authored
Merge branch 'master' into no-simplify-lhs
2 parents 1c6663d + feb64cd commit b296540

40 files changed

+700
-1783
lines changed

kore/CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,26 @@ All notable changes to this project will be documented in this file.
1414

1515
### Fixed
1616

17+
## [0.39.0.0] - 2021-02-04
18+
19+
### Added
20+
21+
- `kore-parser` accepts the `--pattern` argument multiple times. It will
22+
validate all the patterns with a single definition. (#2369)
23+
24+
### Changed
25+
26+
- `kore-exec --version` will report the version number and Git commit, but not
27+
the build date. The build date was never reported correctly anyway. (#2370)
28+
29+
### Fixed
30+
31+
- The priority of equations is respected again. (#2366)
32+
- Terms are still equal if the backend has inferred that one is defined but not
33+
the other. (#2372)
34+
- Uninterpreted functions appearing in the keys of maps and sets are handled
35+
correctly. (#2323)
36+
1737
## [0.38.0.0] - 2021-01-24
1838

1939
### Added

kore/app/exec/Main.hs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,16 @@ import Kore.Log
118118
, SomeEntry (..)
119119
, WithLog
120120
, logEntry
121-
, logWarning
122121
, parseKoreLogOptions
123122
, runKoreLog
124123
, unparseKoreLogOptions
125124
)
126125
import Kore.Log.ErrorException
127126
( errorException
128127
)
128+
import Kore.Log.WarnBoundedModelChecker
129+
( warnBoundedModelChecker
130+
)
129131
import Kore.Log.WarnIfLowProductivity
130132
( warnIfLowProductivity
131133
)
@@ -770,8 +772,8 @@ koreBmc execOptions proveOptions = do
770772
graphSearch
771773
case checkResult of
772774
Bounded.Proved -> return success
773-
Bounded.Unknown -> do
774-
logWarning "The pattern does not terminate within the bound."
775+
Bounded.Unknown claim -> do
776+
warnBoundedModelChecker claim
775777
return success
776778
Bounded.Failed final -> return (failure final)
777779
lift $ renderResult execOptions (unparse final)

kore/kore.cabal

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ cabal-version: 2.2
44
--
55
-- see: https://github.com/sol/hpack
66
--
7-
-- hash: 1eb807e1a58c0a657f51fd08934c8a7e171988a07bcd9e0e4c098055595b6ac4
7+
-- hash: c7335f234ff802f2b2d42c8970fd41a6fa133676b9afa09d411e6222e1120d42
88

99
name: kore
10-
version: 0.38.0.0
10+
version: 0.39.0.0
1111
description: Please see the [README](README.md) file.
1212
category: Language
1313
homepage: https://github.com/kframework/kore#readme
@@ -223,6 +223,7 @@ library
223223
Kore.Log.KoreLogOptions
224224
Kore.Log.Registry
225225
Kore.Log.SQLite
226+
Kore.Log.WarnBoundedModelChecker
226227
Kore.Log.WarnFunctionWithoutEvaluators
227228
Kore.Log.WarnIfLowProductivity
228229
Kore.Log.WarnRetrySolverQuery

kore/package.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: kore
2-
version: 0.38.0.0
2+
version: 0.39.0.0
33
github: "kframework/kore"
44
license: NCSA
55
license-file: LICENSE

kore/src/Debug.hs

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
{-# LANGUAGE UndecidableInstances #-}
2+
13
{- |
24
Copyright : (c) Runtime Verification, 2019
35
License : NCSA
46
57
-}
6-
{-# LANGUAGE Strict #-}
7-
{-# LANGUAGE UndecidableInstances #-}
88

99
module Debug
1010
(
@@ -37,14 +37,6 @@ import Data.Hashable
3737
( Hashed
3838
, unhashed
3939
)
40-
import Data.HashMap.Strict
41-
( HashMap
42-
)
43-
import qualified Data.HashMap.Strict as HashMap
44-
import Data.HashSet
45-
( HashSet
46-
)
47-
import qualified Data.HashSet as HashSet
4840
import Data.Int
4941
import Data.Map.Strict
5042
( Map
@@ -340,21 +332,11 @@ instance (Debug k, Debug a) => Debug (Map.Map k a) where
340332
(parens (precOut >= 10) . Pretty.sep)
341333
["Data.Map.Strict.fromList", debug (Map.toList as)]
342334

343-
instance (Debug k, Debug a) => Debug (HashMap k a) where
344-
debugPrec as precOut =
345-
(parens (precOut >= 10) . Pretty.sep)
346-
["Data.HashMap.Strict.fromList", debug (HashMap.toList as)]
347-
348335
instance Debug a => Debug (Set a) where
349336
debugPrec as precOut =
350337
(parens (precOut >= 10) . Pretty.sep)
351338
["Data.Set.fromList", debug (Set.toList as)]
352339

353-
instance Debug a => Debug (HashSet a) where
354-
debugPrec as precOut =
355-
(parens (precOut >= 10) . Pretty.sep)
356-
["Data.HashSet.fromList", debug (HashSet.toList as)]
357-
358340
instance Debug a => Debug (Seq a) where
359341
debugPrec as precOut =
360342
(parens (precOut >= 10) . Pretty.sep)
@@ -610,16 +592,6 @@ instance
610592
wrapFromList diff' precOut =
611593
parens (precOut >= 10) $ "Data.Map.Strict.fromList" <+> diff' 10
612594

613-
instance
614-
( Debug key, Debug value, Diff key, Diff value )
615-
=> Diff (HashMap key value)
616-
where
617-
diffPrec as bs =
618-
fmap wrapFromList $ diffPrec (HashMap.toList as) (HashMap.toList bs)
619-
where
620-
wrapFromList diff' precOut =
621-
parens (precOut >= 10) $ "Data.HashMap.Strict.fromList" <+> diff' 10
622-
623595
instance (Debug a, Debug b, Diff a, Diff b) => Diff (a, b)
624596

625597
instance (Debug a, Diff a) => Diff (Set a) where
@@ -629,13 +601,6 @@ instance (Debug a, Diff a) => Diff (Set a) where
629601
wrapFromList diff' precOut =
630602
parens (precOut >= 10) $ "Data.Set.fromList" <+> diff' 10
631603

632-
instance (Debug a, Diff a) => Diff (HashSet a) where
633-
diffPrec as bs =
634-
fmap wrapFromList $ diffPrec (HashSet.toList as) (HashSet.toList bs)
635-
where
636-
wrapFromList diff' precOut =
637-
parens (precOut >= 10) $ "Data.HashSet.fromList" <+> diff' 10
638-
639604
instance Diff ExitCode
640605

641606
instance (Debug a, Debug b, Diff a, Diff b) => Diff (Either a b)

kore/src/Kore/ASTVerifier/AttributesVerifier.hs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import Kore.AST.AstWithLocation
4242
( locationFromAst
4343
)
4444
import qualified Kore.Attribute.Parser as Attribute.Parser
45-
import qualified Kore.Attribute.Symbol as Attribute
45+
import qualified Kore.Attribute.Symbol as Attribute.Symbol
4646
import Kore.Error
4747
import Kore.IndexedModule.IndexedModule
4848
import Kore.IndexedModule.Resolvers
@@ -149,7 +149,7 @@ verifyNoHookAttribute attributes = do
149149

150150
verifyNoHookedSupersort
151151
:: MonadError (Error VerifyError) error
152-
=> IndexedModule Verified.Pattern Attribute.Symbol attrs
152+
=> IndexedModule Verified.Pattern Attribute.Symbol.Symbol attrs
153153
-> Attribute.Axiom SymbolOrAlias VariableName
154154
-> [Subsort.Subsort]
155155
-> error ()
@@ -176,7 +176,7 @@ verifyNoHookedSupersort indexedModule axiom subsorts = do
176176
verifyAxiomAttributes
177177
:: forall error attrs
178178
. MonadError (Error VerifyError) error
179-
=> IndexedModule Verified.Pattern Attribute.Symbol attrs
179+
=> IndexedModule Verified.Pattern Attribute.Symbol.Symbol attrs
180180
-> Attribute.Axiom SymbolOrAlias VariableName
181181
-> error (Attribute.Axiom Internal.Symbol.Symbol VariableName)
182182
verifyAxiomAttributes indexedModule axiom = do
@@ -214,15 +214,15 @@ verifyAxiomAttributes indexedModule axiom = do
214214
verifySymbolAttributes
215215
:: forall error a
216216
. MonadError (Error VerifyError) error
217-
=> IndexedModule Verified.Pattern Attribute.Symbol a
218-
-> Attribute.Symbol
219-
-> error Attribute.Symbol
217+
=> IndexedModule Verified.Pattern Attribute.Symbol.Symbol a
218+
-> Attribute.Symbol.Symbol
219+
-> error Attribute.Symbol.Symbol
220220
verifySymbolAttributes _ attrs = return attrs
221221

222222
verifySortAttributes
223223
:: forall error a
224224
. MonadError (Error VerifyError) error
225-
=> IndexedModule Verified.Pattern Attribute.Symbol a
226-
-> Attribute.Symbol
227-
-> error Attribute.Symbol
225+
=> IndexedModule Verified.Pattern Attribute.Symbol.Symbol a
226+
-> Attribute.Symbol.Symbol
227+
-> error Attribute.Symbol.Symbol
228228
verifySortAttributes _ attrs = return attrs

kore/src/Kore/ASTVerifier/DefinitionVerifier.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import Kore.ASTVerifier.ModuleVerifier
4444
import Kore.ASTVerifier.Verifier
4545
import qualified Kore.Attribute.Axiom as Attribute
4646
import Kore.Attribute.Parser as Attribute.Parser
47-
import qualified Kore.Attribute.Symbol as Attribute
47+
import qualified Kore.Attribute.Symbol as Attribute.Symbol
4848
import qualified Kore.Builtin as Builtin
4949
import Kore.Error
5050
import Kore.IndexedModule.IndexedModule
@@ -91,7 +91,7 @@ verifyAndIndexDefinition
9191
-> ParsedDefinition
9292
-> Either
9393
(Error VerifyError)
94-
(Map.Map ModuleName (VerifiedModule Attribute.Symbol))
94+
(Map.Map ModuleName (VerifiedModule Attribute.Symbol.Symbol))
9595
verifyAndIndexDefinition builtinVerifiers definition = do
9696
(indexedModules, _defaultNames) <-
9797
verifyAndIndexDefinitionWithBase
@@ -127,7 +127,7 @@ verifyAndIndexDefinitionWithBase
127127
implicitModule
128128
:: ImplicitIndexedModule
129129
Verified.Pattern
130-
Attribute.Symbol
130+
Attribute.Symbol.Symbol
131131
(Attribute.Axiom Internal.Symbol.Symbol VariableName)
132132
implicitModule = ImplicitIndexedModule implicitIndexedModule
133133
parsedModules = modulesByName (definitionModules definition)

kore/src/Kore/Attribute/Symbol.hs

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ import Kore.Attribute.Parser
8383
import Kore.Attribute.Smthook
8484
import Kore.Attribute.Smtlib
8585
import Kore.Attribute.SortInjection
86+
import Kore.Attribute.SourceLocation
8687
import Kore.Attribute.Symbol.Anywhere
8788
import Kore.Attribute.Symbol.Klabel
8889
import Kore.Attribute.Symbol.Memo
@@ -119,6 +120,8 @@ data Symbol =
119120
, klabel :: !Klabel
120121
, symbolKywd :: !SymbolKywd
121122
, noEvaluators :: !NoEvaluators
123+
, sourceLocation :: !SourceLocation
124+
-- ^ Location in the original (source) file.
122125
}
123126
deriving (Eq, Ord, Show)
124127
deriving (GHC.Generic)
@@ -145,6 +148,7 @@ instance ParseAttributes Symbol where
145148
>=> typed @Klabel (parseAttribute attr)
146149
>=> typed @SymbolKywd (parseAttribute attr)
147150
>=> typed @NoEvaluators (parseAttribute attr)
151+
>=> typed @SourceLocation (parseAttribute attr)
148152

149153
instance From Symbol Attributes where
150154
from =
@@ -162,26 +166,28 @@ instance From Symbol Attributes where
162166
, from . klabel
163167
, from . symbolKywd
164168
, from . noEvaluators
169+
, from . sourceLocation
165170
]
166171

167172
type StepperAttributes = Symbol
168173

169174
defaultSymbolAttributes :: Symbol
170175
defaultSymbolAttributes =
171176
Symbol
172-
{ function = def
173-
, functional = def
174-
, constructor = def
175-
, injective = def
176-
, sortInjection = def
177-
, anywhere = def
178-
, hook = def
179-
, smtlib = def
180-
, smthook = def
181-
, memo = def
182-
, klabel = def
183-
, symbolKywd = def
184-
, noEvaluators = def
177+
{ function = def
178+
, functional = def
179+
, constructor = def
180+
, injective = def
181+
, sortInjection = def
182+
, anywhere = def
183+
, hook = def
184+
, smtlib = def
185+
, smthook = def
186+
, memo = def
187+
, klabel = def
188+
, symbolKywd = def
189+
, noEvaluators = def
190+
, sourceLocation = def
185191
}
186192

187193
-- | See also: 'defaultSymbolAttributes'

kore/src/Kore/Attribute/Symbol/Klabel.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import qualified GHC.Generics as GHC
1919

2020
import Kore.Attribute.Parser as Parser
2121
import Kore.Debug
22+
import Pretty
2223

2324
-- | @Klabel@ represents the @klabel@ attribute for symbols.
2425
newtype Klabel = Klabel { getKlabel :: Maybe Text }
@@ -31,6 +32,10 @@ newtype Klabel = Klabel { getKlabel :: Maybe Text }
3132
instance Default Klabel where
3233
def = Klabel Nothing
3334

35+
instance Pretty Klabel where
36+
pretty (Klabel (Just text)) = pretty text
37+
pretty (Klabel Nothing) = "<no label>"
38+
3439
-- | Kore identifier representing the @klabel@ attribute symbol.
3540
klabelId :: Id
3641
klabelId = "klabel"

0 commit comments

Comments
 (0)