@@ -388,7 +388,7 @@ elab info pattern tm = do elab' tm
388 elab' Placeholder = do (h : hs) <- get_holes
388 elab' Placeholder = do (h : hs) <- get_holes
389 movelast h
389 movelast h
390 elab' (PMetavar n) = do attack; defer n; solve
390 elab' (PMetavar n) = do attack; defer n; solve
391− elab' (PProof ts) = do mapM_ runTac ts
391+ elab' (PProof ts) = do mapM_ (runTac True) ts
392 elab' (PElabError e) = fail e
392 elab' (PElabError e) = fail e
393 elab' x = fail $ "Not implemented " ++ show x
393 elab' x = fail $ "Not implemented " ++ show x
@@ -422,26 +422,28 @@ collectDeferred t = return t
423-- Running tactics directly
423-- Running tactics directly
425−runTac :: PTactic -> Elab ()
425+runTac :: Bool -> PTactic -> Elab ()
426+runTac autoSolve = runT where
426−runTac (Intro xs) = mapM_ (\x -> do attack; intro x) xs
427+ runT (Intro xs) = mapM_ (\x -> do attack; intro x) xs
427−runTac (Exact tm) = do elab toplevel False tm
428+ runT (Exact tm) = do elab toplevel False tm
428− solveAll
429+ when autoSolve solveAll
429−runTac (Refine fn imps) = do ns <- apply (Var fn) imps
430+ runT (Refine fn imps) = do ns <- apply (Var fn) imps
430− solveAll
431+ when autoSolve solveAll
431−runTac (Rewrite tm) -- to elaborate tm, let bind it, then rewrite by that
432+ runT (Rewrite tm) -- to elaborate tm, let bind it, then rewrite by that
432− = do attack; -- (h:_) <- get_holes
433+ = do attack; -- (h:_) <- get_holes
433− tyn <- unique_hole (MN 0 "rty")
434+ tyn <- unique_hole (MN 0 "rty")
434− -- start_unify h
435+ -- start_unify h
435− claim tyn (RSet 0)
436+ claim tyn (RSet 0)
436− valn <- unique_hole (MN 0 "rval")
437+ valn <- unique_hole (MN 0 "rval")
437− claim valn (Var tyn)
438+ claim valn (Var tyn)
438− letn <- unique_hole (MN 0 "rewrite_rule")
439+ letn <- unique_hole (MN 0 "rewrite_rule")
439− letbind letn (Var tyn) (Var valn)
440+ letbind letn (Var tyn) (Var valn)
440− focus valn
441+ focus valn
441− elab toplevel False tm
442+ elab toplevel False tm
442− rewrite (Var letn)
443+ rewrite (Var letn)
444+ when autoSolve solveAll
443−runTac (Focus n) = focus n
445+ runT (Focus n) = focus n
444−runTac Solve = solve
446+ runT Solve = solve
445−runTac x = fail $ "Not implemented " ++ show x
447+ runT x = fail $ "Not implemented " ++ show x
447solveAll = try (do solve; solveAll) (return ())
449solveAll = try (do solve; solveAll) (return ())