Skip to content

Commit 225a63d

Browse files
committed
[GRN] Add StringLiteral to Key
1 parent 06f4b40 commit 225a63d

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

kore/src/Kore/Internal/Key.hs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ import Kore.Syntax.Application
5757
import Kore.Syntax.DomainValue
5858
( DomainValue (..)
5959
)
60+
import Kore.Syntax.StringLiteral
6061
import Kore.Syntax.Variable
6162
( Concrete
6263
)
@@ -157,6 +158,7 @@ data KeyF child
157158
| InternalMapF !(InternalMap Key child)
158159
| InternalSetF !(InternalSet Key child)
159160
| InternalStringF !(Const InternalString child)
161+
| StringLiteralF !(Const StringLiteral child)
160162
deriving (Eq, Ord, Show)
161163
deriving (Foldable, Functor, Traversable)
162164
deriving (GHC.Generic)
@@ -184,6 +186,7 @@ instance Synthetic Sort KeyF where
184186
InternalMapF internalMap -> synthetic internalMap
185187
InternalSetF internalSet -> synthetic internalSet
186188
InternalStringF internalString -> synthetic internalString
189+
StringLiteralF stringLiteral -> synthetic stringLiteral
187190

188191
instance Synthetic Functional KeyF where
189192
synthetic = \case
@@ -197,6 +200,8 @@ instance Synthetic Functional KeyF where
197200
InternalMapF internalMap -> synthetic internalMap
198201
InternalSetF internalSet -> synthetic internalSet
199202
InternalStringF internalString -> synthetic internalString
203+
StringLiteralF stringLiteral -> synthetic stringLiteral
204+
200205

201206
instance Synthetic Function KeyF where
202207
synthetic = \case
@@ -210,6 +215,8 @@ instance Synthetic Function KeyF where
210215
InternalMapF internalMap -> synthetic internalMap
211216
InternalSetF internalSet -> synthetic internalSet
212217
InternalStringF internalString -> synthetic internalString
218+
StringLiteralF stringLiteral -> synthetic stringLiteral
219+
213220

214221
instance Synthetic Defined KeyF where
215222
synthetic = \case
@@ -223,6 +230,7 @@ instance Synthetic Defined KeyF where
223230
InternalMapF internalMap -> synthetic internalMap
224231
InternalSetF internalSet -> synthetic internalSet
225232
InternalStringF internalString -> synthetic internalString
233+
StringLiteralF stringLiteral -> synthetic stringLiteral
226234

227235
instance Synthetic ConstructorLike KeyF where
228236
synthetic = \case
@@ -236,6 +244,7 @@ instance Synthetic ConstructorLike KeyF where
236244
InternalMapF internalMap -> synthetic internalMap
237245
InternalSetF internalSet -> synthetic internalSet
238246
InternalStringF internalString -> synthetic internalString
247+
StringLiteralF stringLiteral -> synthetic stringLiteral
239248

240249
instance Synthetic Simplified KeyF where
241250
synthetic = \case
@@ -249,6 +258,7 @@ instance Synthetic Simplified KeyF where
249258
InternalMapF internalMap -> synthetic internalMap
250259
InternalSetF internalSet -> synthetic internalSet
251260
InternalStringF internalString -> synthetic internalString
261+
StringLiteralF stringLiteral -> synthetic stringLiteral
252262

253263
instance From InternalBool (KeyF child) where
254264
from = InternalBoolF . Const

kore/src/Kore/Internal/TermLike/TermLike.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,7 @@ instance From (KeyF child) (TermLikeF variable child) where
516516
from (Key.InternalMapF internalMap) = InternalMapF internalMap
517517
from (Key.InternalListF internalList) = InternalListF internalList
518518
from (Key.InternalBytesF internalBytes) = InternalBytesF internalBytes
519+
from (Key.StringLiteralF stringLiteral) = StringLiteralF stringLiteral
519520
{-# INLINE from #-}
520521

521522
{- | @TermLike@ is a term-like Kore pattern.
@@ -746,6 +747,8 @@ retractKey =
746747
sequence (Key.InternalMapF internalMap)
747748
InternalSetF internalSet ->
748749
sequence (Key.InternalSetF internalSet)
750+
StringLiteralF stringLiteral ->
751+
sequence (Key.StringLiteralF stringLiteral)
749752
_ -> empty
750753
pure (Recursive.embed (attrs' :< keyF))
751754

0 commit comments

Comments
 (0)