diff options
author | Matthieu Sozeau <mattam@mattam.org> | 2018-06-13 22:54:25 +0200 |
---|---|---|
committer | Matthieu Sozeau <mattam@mattam.org> | 2018-06-13 22:54:25 +0200 |
commit | e0a0159d7219a3d7e81f46001dcb2fdf1b466f8f (patch) | |
tree | f38174a5dc18366f21caecf70e9bdfa639ab91c0 /vernac/indschemes.ml | |
parent | c1d690443589a457b18b39b7003ccb762bcf401f (diff) |
[vernac] Add option to force building really mutual induction schemes
Currently, if one of the inductives is non recursive, it defaults to a
case analysis schems taking fewer predicates and methods just for that
inductive. This irregularity prevents doing a combined scheme afterwards
to gather all eliminators into one, as combined scheme expects all the
eliminators to have the same predicates and methods. I have a use case
in building function graphs in Equations where some of the inductives
might not be recursive but I expect many other use cases could exist.
Diffstat (limited to 'vernac/indschemes.ml')
-rw-r--r-- | vernac/indschemes.ml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/vernac/indschemes.ml b/vernac/indschemes.ml index 2deca1e06..e86e10877 100644 --- a/vernac/indschemes.ml +++ b/vernac/indschemes.ml @@ -370,7 +370,7 @@ requested | InductionScheme (x,y,z) -> names "_ind" "_rec" x y z | EqualityScheme x -> l1,((None,smart_global_inductive x)::l2) -let do_mutual_induction_scheme lnamedepindsort = +let do_mutual_induction_scheme ?(force_mutual=false) lnamedepindsort = let lrecnames = List.map (fun ({CAst.v},_,_,_) -> v) lnamedepindsort and env0 = Global.env() in let sigma, lrecspec, _ = @@ -388,7 +388,7 @@ let do_mutual_induction_scheme lnamedepindsort = (evd, (indu,dep,sort) :: l, inst)) lnamedepindsort (Evd.from_env env0,[],None) in - let sigma, listdecl = Indrec.build_mutual_induction_scheme env0 sigma lrecspec in + let sigma, listdecl = Indrec.build_mutual_induction_scheme env0 sigma ~force_mutual lrecspec in let declare decl fi lrecref = let decltype = Retyping.get_type_of env0 sigma (EConstr.of_constr decl) in let decltype = EConstr.to_constr sigma decltype in |