@@ -55,6 +55,7 @@ import Data.Reflection (
5555 Given ,
5656 )
5757import qualified Data.Reflection as Reflection
58+ import Data.Text (Text )
5859import qualified GHC.Generics as GHC
5960import qualified Generics.SOP as SOP
6061import qualified Kore.Attribute.Pattern.Simplified as Attribute (
@@ -103,6 +104,9 @@ import Kore.Internal.TermLike (
103104 pattern InternalSet_ ,
104105 )
105106import qualified Kore.Internal.TermLike as TermLike
107+ import Kore.Log.DebugUnifyBottom (
108+ debugUnifyBottomAndReturnBottom ,
109+ )
106110import Kore.Rewriting.RewritingVariable (
107111 RewritingVariableName ,
108112 )
@@ -114,17 +118,13 @@ import Kore.Syntax.Variable
114118import Kore.Unification.Unify (
115119 MonadUnify ,
116120 )
117- import qualified Kore.Unification.Unify as Monad.Unify
118121import Kore.Unparser (
119122 unparse ,
120123 unparseToString ,
121124 )
122125import qualified Kore.Unparser as Unparser
123126import Logic
124127import Prelude.Kore
125- import Pretty (
126- Doc ,
127- )
128128import qualified Pretty
129129
130130-- | Any @TermWrapper@ may be inside of an 'InternalAc'.
@@ -762,7 +762,7 @@ unifyEqualsNormalized
762762 case toNormalized patt of
763763 Bottom ->
764764 lift $
765- Monad.Unify. explainAndReturnBottom
765+ debugUnifyBottomAndReturnBottom
766766 " Duplicated elements in normalization."
767767 first
768768 second
@@ -863,9 +863,9 @@ unifyEqualsNormalizedAc
863863 (\ key count result -> replicate count key ++ result)
864864 []
865865
866- bottomWithExplanation :: Doc () -> unifier a
866+ bottomWithExplanation :: Text -> unifier a
867867 bottomWithExplanation explanation =
868- Monad.Unify. explainAndReturnBottom explanation first second
868+ debugUnifyBottomAndReturnBottom explanation first second
869869
870870 unifyEqualsElementLists' =
871871 unifyEqualsElementLists
@@ -1040,7 +1040,7 @@ buildResultFromUnifiers ::
10401040 , InternalVariable variable
10411041 , TermWrapper normalized
10421042 ) =>
1043- (forall result . Doc () -> unifier result ) ->
1043+ (forall result . Text -> unifier result ) ->
10441044 [(Key , Value normalized (TermLike variable ))] ->
10451045 [(TermLike variable , Value normalized (TermLike variable ))] ->
10461046 [TermLike variable ] ->
@@ -1131,7 +1131,7 @@ buildResultFromUnifiers
11311131
11321132addAllDisjoint ::
11331133 (Monad unifier , Ord a , Hashable a ) =>
1134- (forall result . Doc () -> unifier result ) ->
1134+ (forall result . Text -> unifier result ) ->
11351135 HashMap a b ->
11361136 [(a , b )] ->
11371137 unifier (HashMap a b )
@@ -1241,7 +1241,7 @@ unifyEqualsElementLists
12411241 --
12421242 -- Since the two lists have different counts, their structures can
12431243 -- never unify.
1244- Monad.Unify. explainAndReturnBottom
1244+ debugUnifyBottomAndReturnBottom
12451245 " Cannot unify ac structures with different sizes."
12461246 first
12471247 second
@@ -1294,7 +1294,7 @@ unifyEqualsElementLists
12941294 -- The second structure does not include an opaque term, so all the
12951295 -- elements in the first structure must be matched by elements in the second
12961296 -- one. Since we don't have enough, we return bottom.
1297- Monad.Unify. explainAndReturnBottom
1297+ debugUnifyBottomAndReturnBottom
12981298 " Cannot unify ac structures with different sizes."
12991299 first
13001300 second
@@ -1312,7 +1312,7 @@ unifyEqualsElementLists
13121312
13131313 case elementListAsInternal tools (termLikeSort first) remainder2Terms of
13141314 Nothing ->
1315- Monad.Unify. explainAndReturnBottom
1315+ debugUnifyBottomAndReturnBottom
13161316 " Duplicated element in unification results"
13171317 first
13181318 second
@@ -1348,7 +1348,7 @@ unifyOpaqueVariable ::
13481348 , InternalVariable variable
13491349 ) =>
13501350 SmtMetadataTools Attribute. Symbol ->
1351- (forall a . Doc () -> unifier a ) ->
1351+ (forall a . Text -> unifier a ) ->
13521352 -- | unifier function
13531353 (TermLike variable -> TermLike variable -> unifier (Pattern variable )) ->
13541354 TermLike. ElementVariable variable ->
0 commit comments