@@ -72,9 +72,7 @@ import Language.Haskell.Liquid.UX.Config
7272 patternFlag ,
7373 higherOrderFlag , warnOnTermHoles )
7474import qualified GHC.Data.Strict as Strict
75- import Debug.Trace (traceM )
76- import Data.Generics (gshow )
77- import qualified Text.Printf as Text
75+
7876
7977--------------------------------------------------------------------------------
8078-- | Constraint Generation: Toplevel -------------------------------------------
@@ -112,8 +110,6 @@ emitConsolidatedHoleWarnings :: CG ()
112110emitConsolidatedHoleWarnings = do
113111 holes <- gets hsHoles
114112 holeExprs <- gets hsHolesExprs
115- mapAnfs <- gets hsANFHoles
116- let mapAnfs' = M. fromList $ map (\ (k, (v, _)) -> (F. symbol k, F. symbol v)) $ M. toList mapAnfs
117113
118114 let mergedHoles
119115 = [(h
@@ -125,25 +121,9 @@ emitConsolidatedHoleWarnings = do
125121
126122 forM_ mergedHoles $ \ (h, holeInfo, anfs) -> do
127123 let γ = snd . info $ holeInfo
128- let anfs' = map (\ (v, x, t) -> (F. symbol v, x, prettifySpecType t mapAnfs' )) anfs
124+ let anfs' = map (\ (v, x, t) -> (F. symbol v, x, t )) anfs
129125 addWarning $ ErrHole (hloc holeInfo) " hole found" (reLocal $ renv γ) (F. symbol h) (htype holeInfo) anfs'
130126
131- where
132- prettifySpecType :: SpecType -> M. HashMap F. Symbol F. Symbol -> SpecType
133- prettifySpecType t anfs = mapReft undoANF' t
134- where
135- undoANF' :: RReft -> RReft
136- undoANF' (MkUReft (F. Reft (v, e)) p) =
137- MkUReft (F. Reft (v, undoANFExpr anfs e)) p
138- undoANFExpr :: M. HashMap F. Symbol F. Symbol -> F. Expr -> F. Expr
139- undoANFExpr anfMap expr =
140- F. mapExpr substAnf expr
141- where
142- substAnf e@ (F. EVar x) =
143- case M. lookup x anfMap of
144- Just e' -> undoANFExpr anfMap (F. EVar e')
145- Nothing -> e
146- substAnf e = e
147127
148128--------------------------------------------------------------------------------
149129-- | Ensure that the instance type is a subtype of the class type --------------
@@ -268,7 +248,6 @@ consCB _ γ (NonRec x e)
268248 let isItHole = detectTypedHole e
269249 case isItHole of
270250 Just (srcSpan, var) -> do
271- traceM $ Text. printf " HOLE DETECTED LET %s: %s: %s" (show x) (show var) (show srcSpan)
272251 linkANFToHole x (var, RealSrcSpan srcSpan Strict. Nothing )
273252 _ -> return ()
274253grepDictionary :: CoreExpr -> Maybe (Var , [Type ])
@@ -388,7 +367,6 @@ isVarHole x = isHoleStr (F.symbolString (F.symbol x))
388367cconsE :: CGEnv -> CoreExpr -> SpecType -> CG ()
389368--------------------------------------------------------------------------------
390369cconsE g e t = do
391- _ <- traceM $ Text. printf " cconsE:\n expr = %s\n GSHOW = %s \n exprType = %s\n lqType = %s\n " (showpp e) (gshow e) (showpp (exprType e)) (showpp t)
392370 checkANFHoleInExpr e t
393371 cconsE' g e t
394372
@@ -468,7 +446,6 @@ cconsE' γ e t
468446 let isItHole = detectTypedHole e
469447 case isItHole of
470448 Just (srcSpan, x) -> do
471- traceM $ Text. printf " HOLE DETECTED CHECKING: %s" (show x)
472449 addHole (RealSrcSpan srcSpan Strict. Nothing ) x t γ
473450 _ -> return ()
474451
@@ -602,10 +579,8 @@ consE γ e'@(App _ _) =
602579 synthesizeWithHole = do
603580 let isItHole = detectTypedHole e'
604581 t <- consEApp γ e'
605- traceM $ Text. printf " SYNTHESIZING EXPRESSION: %s\n TYPE: [ %s ]\n " (showpp e') (show t)
606582 _ <- case isItHole of
607583 Just (srcSpan, x) -> do
608- traceM $ Text. printf " HOLE DETECTED SYNTHESIS: %s" (show x)
609584 addHole (RealSrcSpan srcSpan Strict. Nothing ) x t γ
610585 _ -> return ()
611586 return t
0 commit comments