@@ -37,6 +37,7 @@ data ProofState = PS { thname :: Name,
3737 previous :: Maybe ProofState, -- for undo
3838 context :: Context,
3939 plog :: String,
40+ unifylog :: Bool,
4041 done :: Bool
4142 }
4243
@@ -81,8 +82,9 @@ data Tactic = Attack
8182-- Some utilites on proof and tactic states
8283
8384instance Show ProofState where
84− show (PS nm [] _ _ tm _ _ _ _ _ _ _ _ _ _ _ _ _) = show nm ++ ": no more goals"
85− show (PS nm (h:hs) _ _ tm _ _ _ _ _ _ _ i _ _ ctxt _ _)
85+ show (PS nm [] _ _ tm _ _ _ _ _ _ _ _ _ _ _ _ _ _)
86+ = show nm ++ ": no more goals"
87+ show (PS nm (h:hs) _ _ tm _ _ _ _ _ _ _ i _ _ ctxt _ _ _)
8688 = let OK g = goal (Just h) tm
8789 wkenv = premises g in
8890 "Other goals: " ++ show hs ++ "\n" ++
@@ -105,12 +107,12 @@ instance Show ProofState where
105107 showG ps b = showEnv ps (binderTy b)
106108
107109instance Pretty ProofState where
108− pretty (PS nm [] _ _ trm _ _ _ _ _ _ _ _ _ _ _ _ _) =
110+ pretty (PS nm [] _ _ trm _ _ _ _ _ _ _ _ _ _ _ _ _ _) =
109111 if size nm > breakingSize then
110112 pretty nm <> colon $$ nest nestingSize (text " no more goals.")
111113 else
112114 pretty nm <> colon <+> text " no more goals."
113− pretty p@(PS nm (h:hs) _ _ tm _ _ _ _ _ _ _ i _ _ ctxt _ _) =
115+ pretty p@(PS nm (h:hs) _ _ tm _ _ _ _ _ _ _ i _ _ ctxt _ _ _) =
114116 let OK g = goal (Just h) tm in
115117 let wkEnv = premises g in
116118 text "Other goals" <+> colon <+> pretty hs $$
@@ -172,13 +174,14 @@ unify' ctxt env topx topy =
172174 let dont = dontunify ps
173175 (u, fails) <- -- trace ("Trying " ++ show (topx, topy)) $
174176 lift $ unify ctxt env topx topy dont (holes ps)
175−-- trace ("Unified " ++ show (topx, topy) ++ " without " ++ show dont ++
176−-- " in " ++ show env ++
177−-- "\n" ++ show u ++ "\n" ++ qshow fails ++ "\nCurrent problems:\n"
178−-- ++ qshow (problems ps) ++ "\n" ++ show (holes ps) ++ "\n"
179−-- -- ++ show (pterm ps)
180−-- ++ "\n----------") $
181− case fails of
177+ traceWhen (unifylog ps)
178+ ("Unified " ++ show (topx, topy) ++ " without " ++ show dont ++
179+ " in " ++ show env ++
180+ "\n" ++ show u ++ "\n" ++ qshow fails ++ "\nCurrent problems:\n"
181+ ++ qshow (problems ps) ++ "\n" ++ show (holes ps) ++ "\n"
182+-- ++ show (pterm ps)
183+ ++ "\n----------") $
184+ case fails of
182185-- [] -> return u
183186 err ->
184187 do ps <- get
@@ -211,7 +214,7 @@ newProof n ctxt ty = let h = holeName 0
211214 (P Bound h ty')) ty [] (h, []) []
212215 Nothing [] []
213216 [] []
214− Nothing ctxt "" False
217+ Nothing ctxt "" False False
215218
216219type TState = ProofState -- [TacticAction])
217220type RunTactic = Context -> Env -> Term -> StateT TState TC Term