Skip to content

Commit 54fa317

Browse files
committed
Merge branch 'master' into remove-sort-checks
2 parents 52c20f1 + 3243d1e commit 54fa317

File tree

12 files changed

+84
-10
lines changed

12 files changed

+84
-10
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ on:
44
jobs:
55
nix:
66
name: 'Nix'
7-
runs-on: ubuntu-latest
7+
strategy:
8+
matrix:
9+
os: [ubuntu-latest, macos-latest]
10+
runs-on: ${{ matrix.os }}
811
steps:
912
- name: Check out code
1013
uses: actions/[email protected]

kore/CHANGELOG.md

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

1515
### Fixed
1616

17+
## [0.41.0.0] - 2021-03-05
18+
19+
### Changed
20+
21+
- Clauses in the side condition of a configuration are considered when
22+
simplifying applying equations to other clauses in the side condition (#2393).
23+
24+
### Fixed
25+
26+
- Values of the `BYTES.Bytes` sort are unparsed in the correct 8-bit encoding
27+
instead of the base-16 encoding. (#2411)
28+
1729
## [0.40.0.0] - 2021-02-17
1830

1931
### Fixed

kore/kore.cabal

Lines changed: 2 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: 03c98e7a7113ac321409caf3539c3987574f8cb7fa4049e7fb285d8c462de491
7+
-- hash: 2702a5d875e9f185a4aedc5fdcafa951249ccd4ef5edab6f1e96689991c8f13f
88

99
name: kore
10-
version: 0.40.0.0
10+
version: 0.41.0.0
1111
description: Please see the [README](README.md) file.
1212
category: Language
1313
homepage: https://github.com/kframework/kore#readme

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.40.0.0
2+
version: 0.41.0.0
33
github: "kframework/kore"
44
license: NCSA
55
license-file: LICENSE

kore/src/Kore/Internal/Conditional.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ quadratic complexity.
9090
-}
9191
data Conditional variable child =
9292
Conditional
93-
{ term :: child
93+
{ term :: !child
9494
, predicate :: !(Predicate variable)
9595
, substitution :: !(Substitution variable)
9696
}

kore/src/Kore/Reachability/Claim.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import Control.Lens
4040
( Lens'
4141
)
4242
import qualified Control.Lens as Lens
43+
import qualified Control.Monad as Monad
4344
import Control.Monad.Catch
4445
( Exception (..)
4546
, SomeException (..)
@@ -604,6 +605,7 @@ simplify' lensClaimPattern claim = do
604605

605606
simplifyLeftHandSide =
606607
Lens.traverseOf (lensClaimPattern . field @"left") $ \config -> do
608+
Monad.guard (not . isBottom . Conditional.term $ config)
607609
let definedConfig =
608610
Pattern.andCondition (mkDefined <$> config)
609611
$ from $ makeCeilPredicate (Conditional.term config)

kore/src/Kore/Repl.hs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import Prelude.Kore
1616
import Control.Concurrent.MVar
1717
import Control.Exception
1818
( AsyncException (UserInterrupt)
19+
, fromException
1920
)
2021
import qualified Control.Lens as Lens
2122
import Control.Monad
@@ -87,6 +88,9 @@ import Prof
8788
( MonadProf
8889
)
8990

91+
import Kore.Log.ErrorException
92+
( errorException
93+
)
9094
import Kore.Unification.Procedure
9195
( unificationProcedure
9296
)
@@ -276,9 +280,10 @@ runRepl
276280

277281
catchEverything :: a -> m a -> m a
278282
catchEverything a =
279-
Exception.handleAll $ \e -> liftIO $ do
280-
putStrLn "Stepper evaluation errored."
281-
print e
283+
Exception.handleAll $ \e -> do
284+
case fromException e of
285+
Just (Log.SomeEntry entry) -> Log.logEntry entry
286+
Nothing -> errorException e
282287
pure a
283288

284289
replGreeting :: m ()

kore/src/Kore/Step/Axiom/Matcher.hs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ matchOne
176176
matchOne pair =
177177
( matchVariable pair
178178
<|> matchEqualHeads pair
179+
<|> matchAnd pair
179180
<|> matchExists pair
180181
<|> matchForall pair
181182
<|> matchApplication pair
@@ -443,6 +444,15 @@ matchDefined (Pair term1 term2)
443444
| Defined_ def2 <- term2 = push (Pair term1 def2)
444445
| otherwise = empty
445446

447+
matchAnd
448+
:: (MatchingVariable variable, MonadSimplify simplifier)
449+
=> Pair (TermLike variable)
450+
-> MaybeT (MatcherT variable simplifier) ()
451+
matchAnd (Pair term1 term2)
452+
| And_ _ conj1 conj2 <- term1 =
453+
push (Pair conj1 term2) >> push (Pair conj2 term2)
454+
| otherwise = empty
455+
446456
-- * Implementation
447457

448458
type MatchingVariable variable = InternalVariable variable

kore/test/Test/Kore/Reachability/Prove.hs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,21 @@ test_proveClaims =
658658
[ mkTest "OnePath" simpleOnePathClaim
659659
, mkTest "AllPath" simpleAllPathClaim
660660
]
661+
, testGroup "LHS is undefined" $
662+
let mkTest name mkSimpleClaim =
663+
testCase name $ do
664+
let claims = [mkSimpleClaim mkBottom_ Mock.a]
665+
actual <- proveClaims_
666+
Unlimited
667+
Unlimited
668+
[]
669+
claims
670+
[]
671+
assertEqual "Result is \\top" MultiAnd.top actual
672+
in
673+
[ mkTest "OnePath" simpleOnePathClaim
674+
, mkTest "AllPath" simpleAllPathClaim
675+
]
661676
]
662677

663678
simpleAxiom

kore/test/Test/Kore/Step/Axiom/Matcher.hs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ module Test.Kore.Step.Axiom.Matcher
1515
, test_matching_Exists
1616
, test_matching_Forall
1717
, test_matching_Equals
18+
, test_matching_And
1819
, test_matcherOverloading
1920
, match
2021
, MatchResult
@@ -778,6 +779,32 @@ test_matching_Pair =
778779
[(inject xInt, mkElemVar zInt), (inject yInt, mkElemVar zInt)]
779780
]
780781

782+
test_matching_And :: [TestTree]
783+
test_matching_And =
784+
[ matches "and(x, x) matches x"
785+
(mkAnd (mkElemVar xInt) (mkElemVar xInt))
786+
(mkElemVar xInt)
787+
[]
788+
, matches "and(x, y) matches y"
789+
(mkAnd (mkElemVar xInt) (mkElemVar yInt))
790+
(mkElemVar yInt)
791+
[(inject xInt, mkElemVar yInt)]
792+
, matches "and(y, x) matches y"
793+
(mkAnd (mkElemVar yInt) (mkElemVar xInt))
794+
(mkElemVar yInt)
795+
[(inject xInt, mkElemVar yInt)]
796+
, matches "and(x, y) matches z"
797+
(mkAnd (mkElemVar xInt) (mkElemVar yInt))
798+
(mkElemVar zInt)
799+
[(inject xInt, mkElemVar zInt), (inject yInt, mkElemVar zInt)]
800+
, doesn'tMatch "and(x, 1) does not match 2"
801+
(mkAnd (mkElemVar xInt) (mkInt 1))
802+
(mkInt 2)
803+
, doesn'tMatch "and(1, x) does not match 2"
804+
(mkAnd (mkInt 1) (mkElemVar xInt))
805+
(mkInt 2)
806+
]
807+
781808
mkPair
782809
:: TermLike RewritingVariableName
783810
-> TermLike RewritingVariableName

nix/kore.nix.d/kore.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
flags = { release = false; threaded = true; };
1212
package = {
1313
specVersion = "2.2";
14-
identifier = { name = "kore"; version = "0.40.0.0"; };
14+
identifier = { name = "kore"; version = "0.41.0.0"; };
1515
license = "NCSA";
1616
copyright = "2018-2020 Runtime Verification Inc";
1717
maintainer = "[email protected]";

shell.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ in
4747
shellFor {
4848
buildInputs =
4949
[
50-
gnumake yq z3
50+
gnumake z3
5151
hls-renamed
5252
ghcid hlint hpack stylish-haskell
5353
cabal-install stack

0 commit comments

Comments
 (0)