@@ -10,17 +10,14 @@ module Kore.Internal.Pattern (
1010 syncSort ,
1111 patternSort ,
1212 fromCondition ,
13- fromCondition_ ,
1413 fromTermAndPredicate ,
1514 fromPredicateSorted ,
16- bottom ,
1715 bottomOf ,
1816 isBottom ,
1917 isTop ,
2018 Kore.Internal.Pattern. mapVariables ,
2119 splitTerm ,
2220 toTermLike ,
23- top ,
2421 topOf ,
2522 fromTermLike ,
2623 Kore.Internal.Pattern. freeElementVariables ,
@@ -81,9 +78,7 @@ import Kore.Internal.TermLike (
8178 TermLike ,
8279 mkAnd ,
8380 mkBottom ,
84- mkBottom_ ,
8581 mkTop ,
86- mkTop_ ,
8782 termLikeSort ,
8883 )
8984import qualified Kore.Internal.TermLike as TermLike
@@ -110,11 +105,7 @@ fromTermAndPredicate term predicate =
110105 , predicate
111106 , substitution = mempty
112107 }
113- fromCondition_ ::
114- InternalVariable variable =>
115- Condition variable ->
116- Pattern variable
117- fromCondition_ = (<$) mkTop_
108+
118109fromCondition ::
119110 InternalVariable variable =>
120111 Sort ->
@@ -239,17 +230,6 @@ toTermLike Conditional{term, predicate, substitution} =
239230 predicateTermLike = Predicate. fromPredicate sort predicate'
240231 sort = termLikeSort pattern'
241232
242- {- | 'bottom' is an expanded pattern that has a bottom condition and that
243- should become Bottom when transformed to a ML pattern.
244- -}
245- bottom :: InternalVariable variable => Pattern variable
246- bottom =
247- Conditional
248- { term = mkBottom_
249- , predicate = Predicate. makeFalsePredicate
250- , substitution = mempty
251- }
252-
253233{- | An 'Pattern' where the 'term' is 'Bottom' of the given 'Sort'.
254234
255235The 'predicate' is set to 'makeFalsePredicate'.
@@ -262,17 +242,6 @@ bottomOf resultSort =
262242 , substitution = mempty
263243 }
264244
265- {- | 'top' is an expanded pattern that has a top condition and that
266- should become Top when transformed to a ML pattern.
267- -}
268- top :: InternalVariable variable => Pattern variable
269- top =
270- Conditional
271- { term = mkTop_
272- , predicate = Predicate. makeTruePredicate
273- , substitution = mempty
274- }
275-
276245-- | An 'Pattern' where the 'term' is 'Top' of the given 'Sort'.
277246topOf :: InternalVariable variable => Sort -> Pattern variable
278247topOf resultSort =
@@ -342,7 +311,7 @@ coerceSort
342311 { term =
343312 if isTop term
344313 then mkTop sort
345- else TermLike. forceSort sort term
314+ else TermLike. sameTermLikeSort sort term
346315 , -- Need to override this since a 'ceil' (say) over a predicate is that
347316 -- predicate with a different sort.
348317 predicate = predicate
@@ -410,9 +379,10 @@ substitute subst Conditional{term, predicate, substitution} =
410379
411380fromMultiAnd ::
412381 InternalVariable variable =>
382+ Sort ->
413383 MultiAnd (Pattern variable ) ->
414384 Pattern variable
415- fromMultiAnd patterns =
385+ fromMultiAnd sort patterns =
416386 foldr
417387 ( \ pattern1 ->
418388 pure
@@ -422,4 +392,4 @@ fromMultiAnd patterns =
422392 )
423393 Nothing
424394 patterns
425- & fromMaybe top
395+ & fromMaybe (topOf sort)
0 commit comments