From d49dfa3ac124025413d17c02da9b0486d8c765d5 Mon Sep 17 00:00:00 2001 From: Claudio Sacerdoti Coen Date: Mon, 5 Nov 2007 14:29:47 +0000 Subject: [PATCH] Obj.magic are now generated to extract dependently typed MutCases. --- components/METAS/meta.helm-cic_exportation.src | 2 +- components/cic_exportation/cicExportation.ml | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/components/METAS/meta.helm-cic_exportation.src b/components/METAS/meta.helm-cic_exportation.src index 97124f913..f73bbeb64 100644 --- a/components/METAS/meta.helm-cic_exportation.src +++ b/components/METAS/meta.helm-cic_exportation.src @@ -1,4 +1,4 @@ -requires="helm-cic_proof_checking" +requires="helm-cic_acic" version="0.0.1" archive(byte)="cic_exportation.cma" archive(native)="cic_exportation.cmxa" diff --git a/components/cic_exportation/cicExportation.ml b/components/cic_exportation/cicExportation.ml index 7be9ea3d9..79eab870d 100644 --- a/components/cic_exportation/cicExportation.ml +++ b/components/cic_exportation/cicExportation.ml @@ -229,6 +229,11 @@ let rec pp t context = string_of_int n2 ) | C.MutCase (uri,n1,ty,te,patterns) -> + let needs_obj_magic = + match ty with + Cic.Lambda (_,_,t) -> not (DoubleTypeInference.does_not_occur 1 t) + | _ -> assert false + in let paramsno = match fst(CicEnvironment.get_obj CicUniv.empty_ugraph uri) with C.InductiveDefinition (_,_,paramsno,_) -> paramsno @@ -307,7 +312,11 @@ let rec pp t context = x ^ (if sargs = "" then "" else "(" ^ sargs^ ")"), body in - pattern ^ " -> " ^ body + pattern ^ " -> " ^ + if needs_obj_magic then + "Obj.magic (" ^ body ^ ")" + else + body ) connames_and_argsno_and_patterns)) ^ ")\n")) | C.Fix (no, funs) -> -- 2.39.2