Debian Codegraph @

proofs/clenv.mli

raw symbols SCIP
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 (** This file defines clausenv, which is a deprecated way to handle open terms
12 in the proof engine. This API is legacy. *)
13
14 open Constr
15 open Environ
16 open Evd
17 open EConstr
18 open Unification
19 open Tactypes
20
21 (** {6 The Type of Constructions clausale environments.} *)
22
23 type clausenv
24
25 val clenv_evd : clausenv -> Evd.evar_map
26 val clenv_meta_list : clausenv -> Meta.t
27
28 (* Ad-hoc primitives *)
29 val update_clenv_evd : clausenv -> evar_map -> Meta.t -> clausenv
30 val clenv_strip_proj_params : clausenv -> clausenv
31 val clenv_refresh : env -> evar_map -> UnivGen.sort_context_set option -> clausenv -> clausenv
32 val clenv_arguments : clausenv -> metavariable list
33
34 (** subject of clenv (instantiated) *)
35 val clenv_value : clausenv -> constr
36
37 (** type of clenv (instantiated) *)
38 val clenv_type : clausenv -> types
39
40 val mk_clenv_from : env -> evar_map -> EConstr.constr * EConstr.types -> clausenv
41 val mk_clenv_from_n : env -> evar_map -> int -> EConstr.constr * EConstr.types -> clausenv
42
43 (** {6 linking of clenvs } *)
44
45 val clenv_instantiate : ?flags:unify_flags -> ?submetas:(metavariable list * Unification.Meta.t) ->
46 metavariable -> clausenv -> (constr * types) -> clausenv
47
48 (** {6 Bindings } *)
49
50 (** bindings where the key is the position in the template of the
51 clenv (dependent or not). Positions can be negative meaning to
52 start from the rightmost argument of the template. *)
53 val clenv_independent : clausenv -> metavariable list
54 val clenv_missing : clausenv -> Names.Name.t list * int
55
56 (** start with a clenv to refine with a given term with bindings *)
57
58 (** the arity of the lemma is fixed
59 the optional int tells how many prods of the lemma have to be used
60 use all of them if None *)
61 val make_clenv_binding_apply :
62 env -> evar_map -> int option -> EConstr.constr * EConstr.constr -> constr bindings ->
63 clausenv
64
65 val make_clenv_binding :
66 env -> evar_map -> EConstr.constr * EConstr.constr -> constr bindings -> clausenv
67
68 (** if the clause is a product, add an extra meta for this product *)
69 val clenv_push_prod : clausenv -> (metavariable * bool * clausenv) option
70
71 (** {6 Clenv tactics} *)
72
73 val unify : ?flags:unify_flags -> cv_pb:Conversion.conv_pb -> constr -> unit Proofview.tactic
74 val res_pf : ?with_evars:bool -> ?with_classes:bool -> ?flags:unify_flags -> clausenv -> unit Proofview.tactic
75 val case_pf : ?with_evars:bool ->
76 dep:bool -> (constr * types) -> unit Proofview.tactic
77
78 val clenv_pose_dependent_evars : ?with_evars:bool -> clausenv -> clausenv
79
80 val replace_clenv_metas : env -> evar_map -> clausenv -> evar_map * (EConstr.constr -> EConstr.constr)
81
82 exception ClenvCannotUnify of env * evar_map * clausenv * econstr * econstr * Pretype_errors.unification_error option
83
84 (** {6 Pretty-print (debug only) } *)
85 val pr_clenv : clausenv -> Pp.t
86
87 module Internal :
88 sig
89
90 (** The legacy refiner. Do not use. *)
91 val refiner : clausenv -> unit Proofview.tactic
92 [@@ocaml.deprecated]
93
94 end