| 1 | open Names |
| 2 | open Declarations |
| 3 | open EConstr |
| 4 | open Evd |
| 5 | open Environ |
| 6 | open Entries |
| 7 | open LibBinding |
| 8 | open State |
| 9 | |
| 10 | (** {6 Strictly Positive Uniform Parameters } *) |
| 11 | |
| 12 | (** Computes which uniform parameters are strictly positive in a mutual inductive body *) |
| 13 | val compute_params_rec_strpos : env -> MutInd.t -> mutual_inductive_body -> bool list |
| 14 | |
| 15 | (** {6 Lookup All Predicate and its Theorem } *) |
| 16 | |
| 17 | (** Compute the default positivity of the uniform parameters, and generates the |
| 18 | suffix for naming the all predicate, and its predicate, as well as the key |
| 19 | for registering. |
| 20 | If a positivity specification is given by users [bool list option], it is |
| 21 | checked to be included in the default one, and the suffix are modified accordingly. *) |
| 22 | val compute_positive_uparams_and_suffix : env -> MutInd.t -> mutual_inductive_body -> |
| 23 | Id.t list option -> bool list * (string * string) * (string * string) |
| 24 | |
| 25 | (** Lookup the partial [all] predicate and its theorem for [ind_nested] for [args_are_nested]. |
| 26 | If they are not found, lookup the general [all] predicate and its theorem. |
| 27 | Returns if the partial [all] was found, and the global references. |
| 28 | Raise a warning if none is found. *) |
| 29 | val lookup_all_theorem : inductive -> inductive -> bool list -> (bool * GlobRef.t * GlobRef.t) option |
| 30 | |
| 31 | (** {6 Instantiate the All Predicate and its Theorem } *) |
| 32 | |
| 33 | (** Make the [all] predicate for a fresh instance and using [Typing.checked_appvect], given: |
| 34 | - whether the [all] predicate is the partial one, or the general one [partial_nesting:bool] |
| 35 | - the positivity of each uniform parameter [bool list] |
| 36 | - the instantiation of the uniform parameter of the inductive type [constr array] |
| 37 | - the instation of the fresh predicate [constr option array], using [fun ... => True] |
| 38 | if the values are none, and [all] is the general predicate |
| 39 | - the instantiation of the non-uniform parameters and indices |
| 40 | - the argument to apply it to |
| 41 | *) |
| 42 | val make_all_predicate : partial_nesting:bool -> GlobRef.t -> bool list -> constr array -> |
| 43 | constr option array -> constr array -> constr -> constr State.t |
| 44 | |
| 45 | (** Make the theorem for the [all] predicate for a fresh instance and using [Typing.checked_appvect], given: |
| 46 | - whether the [all] predicate is the partial one, or the general one [partial_nesting:bool] |
| 47 | - the positivity of each uniform parameter [bool list] |
| 48 | - the instantiation of the uniform parameter of the inductive type [constr array] |
| 49 | - the instation of the fresh predicate and the proofs they hold [constr option array], |
| 50 | using [fun ... => True] and [fun _ => I] if the values are none, and [all] is the general predicate |
| 51 | - the instantiation of the non-uniform parameters and indices |
| 52 | - the argument to apply it to |
| 53 | *) |
| 54 | val make_all_theorem : partial_nesting:bool -> GlobRef.t -> bool list -> constr array -> constr option array -> |
| 55 | constr option array -> constr array -> constr -> constr State.t |
| 56 | |
| 57 | (** {6 View for Arguments } *) |
| 58 | |
| 59 | type head_argument = |
| 60 | | ArgIsSPUparam of int * constr array |
| 61 | (** constant context, position of the uniform parameter, args *) |
| 62 | | ArgIsInd of int * constr array * constr array |
| 63 | (** constant context, position of the one_inductive body, inst_nuparams inst_indices *) |
| 64 | | ArgIsNested of MutInd.t * int * mutual_inductive_body * bool list |
| 65 | * one_inductive_body * constr array * constr array |
| 66 | (** constant context, ind_nested, mutual and one body, strictly positivity of its uniform parameters, |
| 67 | instantiation uniform paramerters, and of both non_uniform parameters and indices *) |
| 68 | | ArgIsCst |
| 69 | |
| 70 | (** View to decompose arguments as [forall locs, X] where [X] is further decomposed |
| 71 | as a uniform parameter, the inductive, a nested argument or a constant. *) |
| 72 | type argument = rel_context * head_argument |
| 73 | |
| 74 | (** Decompose the argument in [it_Prod_or_LetIn local, X] where [X] is a uniform parameter, Ind, nested or a constant *) |
| 75 | val view_argument : MutInd.t -> mutual_inductive_body -> access_key list -> |
| 76 | bool list -> constr -> argument State.t |
| 77 | |
| 78 | (** {6 Generate All Predicate } *) |
| 79 | |
| 80 | val generate_all_predicate : env -> evar_map -> MutInd.t -> einstance -> |
| 81 | mutual_inductive_body -> bool list -> string -> UState.t * mutual_inductive_entry |
| 82 | |
| 83 | (** {6 Generate the Theorem for the All Predicate } *) |
| 84 | |
| 85 | val generate_all_theorem : env -> evar_map -> MutInd.t -> MutInd.t -> int -> einstance -> |
| 86 | mutual_inductive_body -> bool list -> evar_map * constr |