@@ -476,16 +476,10 @@ solve ctxt env (Bind x (Guess ty val) sc)
476 | True = do ps <- get
476 | True = do ps <- get
477 let (uh, uns) = unified ps
477 let (uh, uns) = unified ps
478 case lookup x (notunified ps) of
478 case lookup x (notunified ps) of
479− Just tm -> do -- trace ("AVOIDED " ++ show (x, tm, val)) $
481− unify' ctxt env tm val
479+ Just tm -> unify' ctxt env tm val
482 _ -> return []
480 _ -> return []
483 action (\ps -> ps { holes = holes ps \\ [x],
481 action (\ps -> ps { holes = holes ps \\ [x],
484 solved = Just (x, val),
482 solved = Just (x, val),
485−-- problems = solveInProblems
486−-- x val (problems ps),
487− -- dontunify = dontunify ps \\ [x],
488− -- unified = (uh, uns ++ [(x, val)]),
489 instances = instances ps \\ [x] })
483 instances = instances ps \\ [x] })
490 let tm' = subst x val sc in
484 let tm' = subst x val sc in
491 return tm'
485 return tm'
@@ -739,8 +733,7 @@ keepGiven du (u@(n, _) : us) hs
739 | n `elem` du = u : keepGiven du us hs
733 | n `elem` du = u : keepGiven du us hs
740keepGiven du (u : us) hs = keepGiven du us hs
734keepGiven du (u : us) hs = keepGiven du us hs
742−updateSolved xs x = -- trace ("Updating " ++ show xs ++ " in " ++ show x) $
743− updateSolved' xs x
736+updateSolved xs x = updateSolved' xs x
744updateSolved' [] x = x
737updateSolved' [] x = x
745updateSolved' xs (Bind n (Hole ty) t)
738updateSolved' xs (Bind n (Hole ty) t)
746 | Just v <- lookup n xs
739 | Just v <- lookup n xs
@@ -772,8 +765,8 @@ solveInProblems x val ((l, r, env, err) : ps)
772updateNotunified [] nu = nu
765updateNotunified [] nu = nu
773updateNotunified ns nu = up nu where
766updateNotunified ns nu = up nu where
774 up [] = []
767 up [] = []
775− up ((n, t) : ns) = let t' = updateSolved ns t in
768+ up ((n, t) : nus) = let t' = updateSolved ns t in
776− ((n, t') : up ns)
769+ ((n, t') : up nus)
778updateProblems ctxt [] ps inj holes = ([], ps)
771updateProblems ctxt [] ps inj holes = ([], ps)
779updateProblems ctxt ns ps inj holes = up ns ps where
772updateProblems ctxt ns ps inj holes = up ns ps where
@@ -820,12 +813,11 @@ processTactic EndUnify ps
820 ns' = map (\ (n, t) -> (n, updateSolved ns t)) ns
813 ns' = map (\ (n, t) -> (n, updateSolved ns t)) ns
821 (ns'', probs') = updateProblems (context ps) ns' (problems ps)
814 (ns'', probs') = updateProblems (context ps) ns' (problems ps)
822 (injective ps) (holes ps)
815 (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
825 return (ps { pterm = tm',
817 return (ps { pterm = tm',
826 unified = (h, []),
818 unified = (h, []),
827 problems = probs',
819 problems = probs',
828− notunified = updateNotunified ns (notunified ps),
820+ notunified = updateNotunified ns'' (notunified ps),
829 holes = holes ps \\ map fst ns'' }, "")
821 holes = holes ps \\ map fst ns'' }, "")
830processTactic (Reorder n) ps
822processTactic (Reorder n) ps
831 = do ps' <- execStateT (tactic (Just n) reorder_claims) ps
823 = do ps' <- execStateT (tactic (Just n) reorder_claims) ps
@@ -850,6 +842,7 @@ processTactic MatchProblems ps
850 pterm' = updateSolved ns' (pterm ps) in
842 pterm' = updateSolved ns' (pterm ps) in
851 return (ps { pterm = pterm', solved = Nothing, problems = probs',
843 return (ps { pterm = pterm', solved = Nothing, problems = probs',
852 previous = Just ps, plog = "",
844 previous = Just ps, plog = "",
845+ notunified = updateNotunified ns' (notunified ps),
853 holes = holes ps \\ (map fst ns') }, plog ps)
846 holes = holes ps \\ (map fst ns') }, plog ps)
854processTactic t ps
847processTactic t ps
855 = case holes ps of
848 = case holes ps of