Skip to content

Commit 4195d94

Browse files
emarzionMirceaS
andauthored
Removes sort checks for Map and Set during internalization (#2440)
* removing sort checks for Map and Set * removing unneeded arg from internalize functions Co-authored-by: Octavian Mircea Sebe <[email protected]>
1 parent 21959d9 commit 4195d94

File tree

3 files changed

+8
-20
lines changed

3 files changed

+8
-20
lines changed

kore/src/Kore/Builtin.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,6 @@ internalize tools =
198198
where
199199
internalize1 =
200200
List.internalize tools
201-
. Map.internalize tools
202-
. Set.internalize tools
201+
. Map.internalize
202+
. Set.internalize
203203
. InternalBytes.internalize

kore/src/Kore/Builtin/Map.hs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ import Data.Text
5252
import Kore.Attribute.Hook
5353
( Hook (..)
5454
)
55-
import qualified Kore.Attribute.Symbol as Attribute
5655
import qualified Kore.Builtin.AssociativeCommutative as Ac
5756
import Kore.Builtin.Attributes
5857
( isConstructorModulo_
@@ -485,18 +484,14 @@ internalize subterms.
485484

486485
internalize
487486
:: InternalVariable variable
488-
=> SmtMetadataTools Attribute.Symbol
489-
-> TermLike variable
487+
=> TermLike variable
490488
-> TermLike variable
491-
internalize tools termLike
492-
| fromMaybe False (isMapSort tools sort')
489+
internalize termLike
493490
-- Ac.toNormalized is greedy about 'normalizing' opaque terms, we should only
494491
-- apply it if we know the term head is a constructor-like symbol.
495-
, App_ symbol _ <- termLike
492+
| App_ symbol _ <- termLike
496493
, isConstructorModulo_ symbol = Ac.toNormalizedInternalMap termLike
497494
| otherwise = termLike
498-
where
499-
sort' = termLikeSort termLike
500495

501496
{- | Simplify the conjunction or equality of two concrete Map domain values.
502497

kore/src/Kore/Builtin/Set.hs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ import qualified Data.Set as Set
5252
import Data.Text
5353
( Text
5454
)
55-
import qualified Kore.Attribute.Symbol as Attribute
56-
( Symbol
57-
)
5855
import qualified Kore.Builtin.AssociativeCommutative as Ac
5956
import Kore.Builtin.Attributes
6057
( isConstructorModulo_
@@ -482,18 +479,14 @@ internalize subterms.
482479
-}
483480
internalize
484481
:: InternalVariable variable
485-
=> SmtMetadataTools Attribute.Symbol
486-
-> TermLike variable
482+
=> TermLike variable
487483
-> TermLike variable
488-
internalize tools termLike
489-
| fromMaybe False (isSetSort tools sort')
484+
internalize termLike
490485
-- Ac.toNormalized is greedy about 'normalizing' opaque terms, we should only
491486
-- apply it if we know the term head is a constructor-like symbol.
492-
, App_ symbol _ <- termLike
487+
| App_ symbol _ <- termLike
493488
, isConstructorModulo_ symbol = Ac.toNormalizedInternalSet termLike
494489
| otherwise = termLike
495-
where
496-
sort' = termLikeSort termLike
497490

498491
{- | Simplify the conjunction or equality of two concrete Set domain values.
499492

0 commit comments

Comments
 (0)