Skip to content

Commit 1f61e5a

Browse files
MirceaSrv-jenkins
andauthored
Revert PRs related to InternalAc, Unit, Element & Concat symbols changes (#2463)
* Revert "Removes sort checks for Map and Set during internalization (#2440)" This reverts commit 4195d94. * Revert "Use unit and element symbol attributes" This reverts commit abf0292. * Materialize Nix expressions * removed issue-2095 tests Co-authored-by: MirceaS <[email protected]> Co-authored-by: rv-jenkins <[email protected]>
1 parent a4e55b2 commit 1f61e5a

File tree

92 files changed

+48335
-48446
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+48335
-48446
lines changed

kore/kore.cabal

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

99
name: kore
1010
version: 0.41.0.0
@@ -70,9 +70,7 @@ library
7070
Kore.Attribute.Axiom.Symbolic
7171
Kore.Attribute.Axiom.Unit
7272
Kore.Attribute.Comm
73-
Kore.Attribute.Concat
7473
Kore.Attribute.Constructor
75-
Kore.Attribute.Element
7674
Kore.Attribute.Function
7775
Kore.Attribute.Functional
7876
Kore.Attribute.Hook
@@ -103,9 +101,12 @@ library
103101
Kore.Attribute.Smtlib.Smthook
104102
Kore.Attribute.Smtlib.Smtlib
105103
Kore.Attribute.Sort
104+
Kore.Attribute.Sort.Concat
106105
Kore.Attribute.Sort.Constructors
107106
Kore.Attribute.Sort.ConstructorsBuilder
107+
Kore.Attribute.Sort.Element
108108
Kore.Attribute.Sort.HasDomainValues
109+
Kore.Attribute.Sort.Unit
109110
Kore.Attribute.SortInjection
110111
Kore.Attribute.Source
111112
Kore.Attribute.SourceLocation
@@ -119,7 +120,6 @@ library
119120
Kore.Attribute.Synthetic
120121
Kore.Attribute.Trusted
121122
Kore.Attribute.UniqueId
122-
Kore.Attribute.Unit
123123
Kore.BugReport
124124
Kore.Builtin
125125
Kore.Builtin.AssocComm.AssocComm
@@ -915,6 +915,7 @@ test-suite kore-test
915915
Test.Kore.Attribute.Smtlib
916916
Test.Kore.Attribute.Sort.ConstructorsBuilder
917917
Test.Kore.Attribute.Sort.HasDomainValues
918+
Test.Kore.Attribute.Sort.Unit
918919
Test.Kore.Attribute.SortInjection
919920
Test.Kore.Attribute.Subsort
920921
Test.Kore.Attribute.Symbol
@@ -925,7 +926,6 @@ test-suite kore-test
925926
Test.Kore.Attribute.Symbol.SymbolKywd
926927
Test.Kore.Attribute.Trusted
927928
Test.Kore.Attribute.UniqueId
928-
Test.Kore.Attribute.Unit
929929
Test.Kore.BugReport
930930
Test.Kore.Builtin
931931
Test.Kore.Builtin.AssocComm.CeilSimplifier

kore/src/Kore/Attribute/Concat.hs

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

kore/src/Kore/Attribute/Element.hs

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

kore/src/Kore/Attribute/Sort.hs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,29 @@ import Prelude.Kore hiding
1818
import qualified Control.Monad as Monad
1919
import Data.Generics.Product
2020

21-
import Kore.Attribute.Concat
22-
import Kore.Attribute.Element
2321
import Kore.Attribute.Hook
2422
import Kore.Attribute.Parser hiding
2523
( Sort
2624
)
2725
import Kore.Attribute.Smtlib.Smtlib
26+
import Kore.Attribute.Sort.Concat
27+
import Kore.Attribute.Sort.Element
2828
import Kore.Attribute.Sort.HasDomainValues
2929
( HasDomainValues
3030
)
31-
import Kore.Attribute.Unit
31+
import Kore.Attribute.Sort.Unit
3232

3333
data Sort =
3434
Sort
3535
{ hook :: !Hook
3636
-- ^ The builtin sort hooked to the sort.
3737
, smtlib :: !Smtlib
3838
-- ^ The user-defined translation of the sort for SMT.
39-
, unit :: !(Unit SymbolOrAlias)
39+
, unit :: !Unit
4040
-- ^ The unit symbol associated with the sort.
41-
, element :: !(Element SymbolOrAlias)
41+
, element :: !Element
4242
-- ^ The element symbol associated with the sort.
43-
, concat :: !(Concat SymbolOrAlias)
43+
, concat :: !Concat
4444
-- ^ The concat symbol associated with the sort.
4545
, hasDomainValues :: !HasDomainValues
4646
-- ^ whether the sort has domain values
@@ -68,9 +68,9 @@ instance ParseAttributes Sort where
6868
parseAttribute attr =
6969
typed @Hook (parseAttribute attr)
7070
Monad.>=> typed @Smtlib (parseAttribute attr)
71-
Monad.>=> typed @(Unit SymbolOrAlias) (parseAttribute attr)
72-
Monad.>=> typed @(Element SymbolOrAlias) (parseAttribute attr)
73-
Monad.>=> typed @(Concat SymbolOrAlias) (parseAttribute attr)
71+
Monad.>=> typed @Unit (parseAttribute attr)
72+
Monad.>=> typed @Element (parseAttribute attr)
73+
Monad.>=> typed @Concat (parseAttribute attr)
7474
Monad.>=> typed @HasDomainValues (parseAttribute attr)
7575

7676
instance From Sort Attributes where
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{-|
2+
Module : Kore.Attribute.Sort.Concat
3+
Description : Concat sort attribute
4+
Copyright : (c) Runtime Verification, 2019
5+
License : NCSA
6+
Maintainer : [email protected]
7+
8+
-}
9+
module Kore.Attribute.Sort.Concat
10+
( Concat (..)
11+
, concatId, concatSymbol, concatAttribute
12+
) where
13+
14+
import Prelude.Kore
15+
16+
import Data.Default
17+
18+
import Kore.Attribute.Parser
19+
20+
-- | @Concat@ represents the @concat@ attribute for sorts.
21+
newtype Concat = Concat { getConcat :: Maybe SymbolOrAlias }
22+
deriving (Generic, Eq, Ord, Show)
23+
24+
instance Semigroup Concat where
25+
(<>) a@(Concat (Just _)) _ = a
26+
(<>) _ b = b
27+
28+
instance Monoid Concat where
29+
mempty = Concat { getConcat = Nothing }
30+
31+
instance Default Concat where
32+
def = mempty
33+
34+
instance NFData Concat
35+
36+
instance ParseAttributes Concat where
37+
parseAttribute = withApplication' parseApplication
38+
where
39+
parseApplication params args Concat { getConcat }
40+
| Just _ <- getConcat = failDuplicate'
41+
| otherwise = do
42+
getZeroParams params
43+
arg <- getOneArgument args
44+
symbol <- getSymbolOrAlias arg
45+
return Concat { getConcat = Just symbol }
46+
withApplication' = withApplication concatId
47+
failDuplicate' = failDuplicate concatId
48+
49+
instance From Concat Attributes where
50+
from =
51+
maybe def toAttribute . getConcat
52+
where
53+
toAttribute = from @AttributePattern . concatAttribute
54+
55+
-- | Kore identifier representing the @concat@ attribute symbol.
56+
concatId :: Id
57+
concatId = "concat"
58+
59+
-- | Kore symbol representing the @concat@ attribute.
60+
concatSymbol :: SymbolOrAlias
61+
concatSymbol =
62+
SymbolOrAlias
63+
{ symbolOrAliasConstructor = concatId
64+
, symbolOrAliasParams = []
65+
}
66+
67+
-- | Kore pattern representing the @concat@ attribute.
68+
concatAttribute :: SymbolOrAlias -> AttributePattern
69+
concatAttribute symbol =
70+
attributePattern concatSymbol [attributePattern_ symbol]

0 commit comments

Comments
 (0)