(************************************************************************) (* v * The Coq Proof Assistant / The Coq Development Team *) (* Goal.goal list * (Goal.goal list * Goal.goal list) list * Goal.goal list * Goal.goal list * Evd.evar_map (* Generic records structured like the return type of proof *) type 'a pre_goals = { fg_goals : 'a list; (** List of the focussed goals *) bg_goals : ('a list * 'a list) list; (** Zipper representing the unfocussed background goals *) shelved_goals : 'a list; (** List of the goals on the shelf. *) given_up_goals : 'a list; (** List of the goals that have been given up *) } val map_structured_proof : proof -> (Evd.evar_map -> Goal.goal -> 'a) -> ('a pre_goals) (*** General proof functions ***) val start : Evd.evar_map -> (Environ.env * Term.types) list -> proof val dependent_start : Proofview.telescope -> proof val initial_goals : proof -> (Term.constr * Term.types) list (* Returns [true] if the considered proof is completed, that is if no goal remain to be considered (this does not require that all evars have been solved). *) val is_done : proof -> bool (* Returns the list of partial proofs to initial goals. *) val partial_proof : proof -> Term.constr list (* Returns the proofs (with their type) of the initial goals. Raises [UnfinishedProof] is some goals remain to be considered. Raises [HasShelvedGoals] if some goals are left on the shelf. Raises [HasGivenUpGoals] if some goals have been given up. Raises [HasUnresolvedEvar] if some evars have been left undefined. *) exception UnfinishedProof exception HasShelvedGoals exception HasGivenUpGoals exception HasUnresolvedEvar val return : proof -> Evd.evar_map (*** Focusing actions ***) (* ['a focus_kind] is the type used by focusing and unfocusing commands to synchronise. Focusing and unfocusing commands use a particular ['a focus_kind], and if they don't match, the unfocusing command will fail. When focusing with an ['a focus_kind], an information of type ['a] is stored at the focusing point. An example use is the "induction" tactic of the declarative mode where sub-tactics must be aware of the current induction argument. *) type 'a focus_kind val new_focus_kind : unit -> 'a focus_kind (* To be authorized to unfocus one must meet the condition prescribed by the action which focused. Conditions always carry a focus kind, and inherit their type parameter from it.*) type 'a focus_condition (* [no_cond] only checks that the unfocusing command uses the right [focus_kind]. If [loose_end] (default [false]) is [true], then if the [focus_kind] doesn't match, then unfocusing can occur, provided it unfocuses an earlier focus. For instance bullets can be unfocused in the following situation [{- solve_goal. }] because they use a loose-end condition. *) val no_cond : ?loose_end:bool -> 'a focus_kind -> 'a focus_condition (* [done_cond] checks that the unfocusing command uses the right [focus_kind] and that the focused proofview is complete. If [loose_end] (default [false]) is [true], then if the [focus_kind] doesn't match, then unfocusing can occur, provided it unfocuses an earlier focus. For instance bullets can be unfocused in the following situation [{ - solve_goal. }] because they use a loose-end condition. *) val done_cond : ?loose_end:bool -> 'a focus_kind -> 'a focus_condition (* focus command (focuses on the [i]th subgoal) *) (* spiwack: there could also, easily be a focus-on-a-range tactic, is there a need for it? *) val focus : 'a focus_condition -> 'a -> int -> proof -> proof exception FullyUnfocused exception CannotUnfocusThisWay (* This is raised when trying to focus on non-existing subgoals. It is handled by an error message but one may need to catched it and settle a better error message in some case (suggesting a better bullet for example), see proof_global.ml function Bullet.pop and Bullet.push. *) exception NoSuchGoals of int * int (* Unfocusing command. Raises [FullyUnfocused] if the proof is not focused. Raises [CannotUnfocusThisWay] if the proof the unfocusing condition is not met. *) val unfocus : 'a focus_kind -> proof -> unit -> proof (* [unfocused p] returns [true] when [p] is fully unfocused. *) val unfocused : proof -> bool (* [get_at_focus k] gets the information stored at the closest focus point of kind [k]. Raises [NoSuchFocus] if there is no focus point of kind [k]. *) exception NoSuchFocus val get_at_focus : 'a focus_kind -> proof -> 'a (* [is_last_focus k] check if the most recent focus is of kind [k] *) val is_last_focus : 'a focus_kind -> proof -> bool (* returns [true] if there is no goal under focus. *) val no_focused_goal : proof -> bool (*** Tactics ***) (* the returned boolean signal whether an unsafe tactic has been used. In which case it is [false]. *) val run_tactic : Environ.env -> unit Proofview.tactic -> proof -> proof*bool val maximal_unfocus : 'a focus_kind -> proof -> proof (*** Commands ***) val in_proof : proof -> (Evd.evar_map -> 'a) -> 'a (* Remove all the goals from the shelf and adds them at the end of the focused goals. *) val unshelve : proof -> proof (*** Compatibility layer with <=v8.2 ***) module V82 : sig val subgoals : proof -> Goal.goal list Evd.sigma (* All the subgoals of the proof, including those which are not focused. *) val background_subgoals : proof -> Goal.goal list Evd.sigma val top_goal : proof -> Goal.goal Evd.sigma (* returns the existential variable used to start the proof *) val top_evars : proof -> Evd.evar list (* Turns the unresolved evars into goals. Raises [UnfinishedProof] if there are still unsolved goals. *) val grab_evars : proof -> proof (* Implements the Existential command *) val instantiate_evar : int -> Constrexpr.constr_expr -> proof -> proof end