@@ -476,16 +476,10 @@ solve ctxt env (Bind x (Guess ty val) sc)
476476 | True = do ps <- get
477477 let (uh, uns) = unified ps
478478 case lookup x (notunified ps) of
479− Just tm -> do -- trace ("AVOIDED " ++ show (x, tm, val)) $
480− -- return []
481− unify' ctxt env tm val
479+ Just tm -> unify' ctxt env tm val
482480 _ -> return []
483481 action (\ps -> ps { holes = holes ps \\ [x],
484482 solved = Just (x, val),
485−-- problems = solveInProblems
486−-- x val (problems ps),
487− -- dontunify = dontunify ps \\ [x],
488− -- unified = (uh, uns ++ [(x, val)]),
489483 instances = instances ps \\ [x] })
490484 let tm' = subst x val sc in
491485 return tm'
@@ -739,8 +733,7 @@ keepGiven du (u@(n, _) : us) hs
739733 | n `elem` du = u : keepGiven du us hs
740734keepGiven du (u : us) hs = keepGiven du us hs
741735
742−updateSolved xs x = -- trace ("Updating " ++ show xs ++ " in " ++ show x) $
743− updateSolved' xs x
736+updateSolved xs x = updateSolved' xs x
744737updateSolved' [] x = x
745738updateSolved' xs (Bind n (Hole ty) t)
746739 | Just v <- lookup n xs
@@ -772,8 +765,8 @@ solveInProblems x val ((l, r, env, err) : ps)
772765updateNotunified [] nu = nu
773766updateNotunified ns nu = up nu where
774767 up [] = []
775− up ((n, t) : ns) = let t' = updateSolved ns t in
776− ((n, t') : up ns)
768+ up ((n, t) : nus) = let t' = updateSolved ns t in
769+ ((n, t') : up nus)
777770
778771updateProblems ctxt [] ps inj holes = ([], ps)
779772updateProblems ctxt ns ps inj holes = up ns ps where
@@ -820,12 +813,11 @@ processTactic EndUnify ps
820813 ns' = map (\ (n, t) -> (n, updateSolved ns t)) ns
821814 (ns'', probs') = updateProblems (context ps) ns' (problems ps)
822815 (injective ps) (holes ps)
823− tm' = -- trace ("Updating " ++ show ns_in ++ "\n" ++ show ns'') $ -- ++ " in " ++ show (pterm ps)) $
824− updateSolved ns'' (pterm ps) in
816+ tm' = updateSolved ns'' (pterm ps) in
825817 return (ps { pterm = tm',
826818 unified = (h, []),
827819 problems = probs',
828− notunified = updateNotunified ns (notunified ps),
820+ notunified = updateNotunified ns'' (notunified ps),
829821 holes = holes ps \\ map fst ns'' }, "")
830822processTactic (Reorder n) ps
831823 = do ps' <- execStateT (tactic (Just n) reorder_claims) ps
@@ -850,6 +842,7 @@ processTactic MatchProblems ps
850842 pterm' = updateSolved ns' (pterm ps) in
851843 return (ps { pterm = pterm', solved = Nothing, problems = probs',
852844 previous = Just ps, plog = "",
845+ notunified = updateNotunified ns' (notunified ps),
853846 holes = holes ps \\ (map fst ns') }, plog ps)
854847processTactic t ps
855848 = case holes ps of