diff options
author | Julien Forest <julien.forest@ensiie.fr> | 2014-12-11 21:13:14 +0100 |
---|---|---|
committer | Julien Forest <julien.forest@ensiie.fr> | 2014-12-11 21:13:44 +0100 |
commit | dbe6df0d591bc6ac843360a3998f947d56298d4f (patch) | |
tree | d81188d103a4b4cc921f8767dbc695ba8a450239 /plugins/funind/glob_term_to_relation.ml | |
parent | cf90fc69d609c1208036faa1a8b8945f975d2cef (diff) |
handling Functional Scheme for required but not imported modules
Diffstat (limited to 'plugins/funind/glob_term_to_relation.ml')
-rw-r--r-- | plugins/funind/glob_term_to_relation.ml | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/plugins/funind/glob_term_to_relation.ml b/plugins/funind/glob_term_to_relation.ml index 5cbe32d59..a2577e2b0 100644 --- a/plugins/funind/glob_term_to_relation.ml +++ b/plugins/funind/glob_term_to_relation.ml @@ -1233,11 +1233,12 @@ let rec rebuild_return_type rt = let do_build_inductive - funnames (funsargs: (Name.t * glob_constr * bool) list list) - returned_types - (rtl:glob_constr list) = + mp_dp + funnames (funsargs: (Name.t * glob_constr * bool) list list) + returned_types + (rtl:glob_constr list) = let _time1 = System.get_time () in -(* Pp.msgnl (prlist_with_sep fnl Printer.pr_glob_constr rtl); *) + (* Pp.msgnl (prlist_with_sep fnl Printer.pr_glob_constr rtl); *) let funnames_as_set = List.fold_right Id.Set.add funnames Id.Set.empty in let funnames = Array.of_list funnames in let funsargs = Array.of_list funsargs in @@ -1254,7 +1255,17 @@ let do_build_inductive let env = Array.fold_right (fun id env -> - Environ.push_named (id,None,Typing.type_of env Evd.empty (Constrintern.global_reference id)) env + let c = + match mp_dp with + | None -> (Constrintern.global_reference id) + | Some(mp,dp) -> mkConst (make_con mp dp (Label.of_id id)) + in + Environ.push_named (id,None, + try + Typing.type_of env Evd.empty c + with Not_found -> + raise (UserError("do_build_inductive", str "Cannot handle partial fixpoint")) + ) env ) funnames (Global.env ()) @@ -1450,9 +1461,9 @@ let do_build_inductive -let build_inductive funnames funsargs returned_types rtl = +let build_inductive mp_dp funnames funsargs returned_types rtl = try - do_build_inductive funnames funsargs returned_types rtl + do_build_inductive mp_dp funnames funsargs returned_types rtl with e when Errors.noncritical e -> raise (Building_graph e) |