(***********************************************************************) (* v * The Coq Proof Assistant / The Coq Development Team *) (* mSGNL [< 'sTR "No goal" >] | Some g -> mSGNL [<'sTR ("Goal:"); 'fNL; Proof_trees.pr_goal (Tacmach.sig_it g) >] (* Prints the commands *) let help () = mSGNL [< 'sTR "Commands: =Continue, h=Help, s=Skip, x=Exit" >] (* Prints the state and waits for an instruction *) let debug_prompt goalopt tac_ast = db_pr_goal goalopt; mSG [< 'sTR "Going to execute:"; 'fNL; (gentacpr tac_ast); 'fNL >]; (* 'sTR "Commands: =Continue, s=Skip, x=Exit" >];*) (* mSG [< 'sTR "Going to execute:"; 'fNL; (gentacpr tac_ast); 'fNL; 'fNL; 'sTR "----=Continue----s=Skip----x=Exit----" >];*) let rec prompt () = mSG [<'fNL; 'sTR "TcDebug > " >]; flush stdout; let inst = read_line () in (* mSGNL [<>];*) match inst with | "" -> DebugOn | "s" -> DebugOff | "x" -> Exit | "h" -> begin help (); prompt () end | _ -> prompt () in prompt () (* Prints a constr *) let db_constr debug env c = if debug = DebugOn then mSGNL [< 'sTR "Evaluated term --> "; prterm_env env c >] (* Prints a matched hypothesis *) let db_matched_hyp debug env (id,c) = if debug = DebugOn then mSGNL [< 'sTR "Matched hypothesis --> "; 'sTR (id^": "); prterm_env env c >] (* Prints the matched conclusion *) let db_matched_concl debug env c = if debug = DebugOn then mSGNL [< 'sTR "Matched goal --> "; prterm_env env c >]