| 1 | (************************************************************************) |
| 2 | (* * The Rocq Prover / The Rocq Development Team *) |
| 3 | (* v * Copyright INRIA, CNRS and contributors *) |
| 4 | (* <O___,, * (see version control and CREDITS file for authors & dates) *) |
| 5 | (* \VV/ **************************************************************) |
| 6 | (* // * This file is distributed under the terms of the *) |
| 7 | (* * GNU Lesser General Public License Version 2.1 *) |
| 8 | (* * (see LICENSE file for the text of the license) *) |
| 9 | (************************************************************************) |
| 10 | |
| 11 | open Environ |
| 12 | open Names |
| 13 | open Tacexpr |
| 14 | open EConstr |
| 15 | open Evd |
| 16 | |
| 17 | (** TODO: Move those definitions somewhere sensible *) |
| 18 | |
| 19 | val ltac_trace_info : ltac_stack Exninfo.t |
| 20 | |
| 21 | (** This module intends to be a beginning of debugger for tactic expressions. |
| 22 | Currently, it is quite simple and we can hope to have, in the future, a more |
| 23 | complete panel of commands dedicated to a proof assistant framework *) |
| 24 | |
| 25 | (** Debug information *) |
| 26 | type debug_info = |
| 27 | | DebugOn of int |
| 28 | | DebugOff |
| 29 | |
| 30 | (** Prints the state and waits *) |
| 31 | val debug_prompt : |
| 32 | int -> glob_tactic_expr -> (debug_info -> 'a Proofview.tactic) -> |
| 33 | Geninterp.Val.t Id.Map.t -> Tacexpr.ltac_trace option -> 'a Proofview.tactic |
| 34 | |
| 35 | (** Initializes debugger *) |
| 36 | val db_initialize : bool -> unit Proofview.NonLogical.t |
| 37 | |
| 38 | (** Prints a constr *) |
| 39 | val db_constr : debug_info -> env -> evar_map -> constr -> unit Proofview.NonLogical.t |
| 40 | |
| 41 | (** An exception handler *) |
| 42 | val explain_logic_error: exn -> Pp.t |
| 43 | |
| 44 | (** For use in the Ltac debugger: some exception that are usually |
| 45 | consider anomalies are acceptable because they are caught later in |
| 46 | the process that is being debugged. One should not require |
| 47 | from users that they report these anomalies. *) |
| 48 | val explain_logic_error_no_anomaly : exn -> Pp.t |
| 49 | |
| 50 | (** Check for/process idtac breakpoint *) |
| 51 | val db_breakpoint : debug_info -> |
| 52 | lident message_token list -> unit Proofview.NonLogical.t |
| 53 | |
| 54 | (** Prints a message only if debugger stops at the next step *) |
| 55 | val defer_output : (unit -> Pp.t) -> unit Proofview.NonLogical.t |
| 56 | |
| 57 | (** Push a trace chunk (multiple frames) onto the trace chunk stack *) |
| 58 | val push_chunk : ltac_trace -> unit |
| 59 | |
| 60 | (** Pop a trace chunk (multiple frames) from the trace chunk stack *) |
| 61 | val pop_chunk : unit -> unit |