| 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 | (** Legacy proof engine. Do not use in newly written code. *) |
| 12 | |
| 13 | open Names |
| 14 | open Evd |
| 15 | |
| 16 | (** [check] respectively means:\\ |
| 17 | [Intro]: check that the name does not exist\\ |
| 18 | [Intro_after]: check that the name does not exist and that variables in |
| 19 | its type does not escape their scope\\ |
| 20 | [Intro_replacing]: check that the name does not exist and that |
| 21 | variables in its type does not escape their scope\\ |
| 22 | [Convert_hyp]: |
| 23 | check that the name exist and that its type is convertible\\ |
| 24 | *) |
| 25 | |
| 26 | (** {6 Refiner errors. } *) |
| 27 | |
| 28 | type refiner_error = |
| 29 | |
| 30 | (*i Errors raised by the refiner i*) |
| 31 | | UnresolvedBindings of Name.t list |
| 32 | | CannotApply of EConstr.t * EConstr.t |
| 33 | | NonLinearProof of EConstr.t |
| 34 | |
| 35 | (*i Errors raised by the tactics i*) |
| 36 | | IntroNeedsProduct |
| 37 | | NoSuchHyp of Id.t |
| 38 | |
| 39 | exception RefinerError of Environ.env * evar_map * refiner_error |
| 40 | |
| 41 | val error_no_such_hypothesis : Environ.env -> evar_map -> Id.t -> 'a |
| 42 | |
| 43 | (** Move destination for hypothesis. *) |
| 44 | type 'id move_location = |
| 45 | | MoveAfter of 'id (** Move to the position directly _after_ a hypothesis. *) |
| 46 | | MoveBefore of 'id (** Move to the position directly _before_ a hypothesis. *) |
| 47 | | MoveFirst (** Move to the first position in the context. *) |
| 48 | | MoveLast (** Move to the last position in the context. This is the default used by [intro]. *) |
| 49 | |
| 50 | (** Print a [move_location]. *) |
| 51 | val pr_move_location : |
| 52 | ('a -> Pp.t) -> 'a move_location -> Pp.t |
| 53 | |
| 54 | val convert_hyp : check:bool -> reorder:bool -> Environ.env -> evar_map -> |
| 55 | EConstr.named_declaration -> Environ.named_context_val |
| 56 | |
| 57 | type cannot_move_hyp |
| 58 | exception CannotMoveHyp of cannot_move_hyp |
| 59 | |
| 60 | val move_hyp_in_named_context : Environ.env -> Evd.evar_map -> Id.t -> Id.t move_location -> |
| 61 | Environ.named_context_val -> Environ.named_context_val |
| 62 | |
| 63 | val insert_decl_in_named_context : Environ.env -> Evd.evar_map -> |
| 64 | EConstr.named_declaration -> Id.t move_location -> |
| 65 | Environ.named_context_val -> Environ.named_context_val |