aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfilliatr2001-04-02 11:55:41 +0000
committerfilliatr2001-04-02 11:55:41 +0000
commitcfee4ed97d3e960ce8e1243afea6ab13b3168d35 (patch)
treec8fd078c047680c1dffeca6b1172f8b42d6a6add
parentae74036f181f9482d7d7027e12b29f79802a476d (diff)
inductifs vides
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@1513 85f007b7-540e-0410-9357-904b9bb8a0f7
-rw-r--r--contrib/extraction/BUGS21
-rw-r--r--contrib/extraction/TODO4
-rw-r--r--contrib/extraction/ocaml.ml19
3 files changed, 15 insertions, 29 deletions
diff --git a/contrib/extraction/BUGS b/contrib/extraction/BUGS
index 3c3345da7f..8b13789179 100644
--- a/contrib/extraction/BUGS
+++ b/contrib/extraction/BUGS
@@ -1,22 +1 @@
-======================================================================
-
-Coq < Extraction Module Specif.
-Anomaly: Failure "nth". Please report.
-
-======================================================================
-
-Coq < Extraction Module Datatypes.
-
-donne le code suivant :
-
-type coq_Empty_set =
-
-let coq_Empty_set_ind =
- prop
-
-let coq_Empty_set_rec = function
-
-let coq_Empty_set_rect = function
-
-======================================================================
diff --git a/contrib/extraction/TODO b/contrib/extraction/TODO
index 376f522516..3bef008046 100644
--- a/contrib/extraction/TODO
+++ b/contrib/extraction/TODO
@@ -1,5 +1,5 @@
- 1. Inductifs vides
-
2. Inductifs singletons
+ 3. Axiomes
+
diff --git a/contrib/extraction/ocaml.ml b/contrib/extraction/ocaml.ml
index cdbf108500..560c757a6d 100644
--- a/contrib/extraction/ocaml.ml
+++ b/contrib/extraction/ocaml.ml
@@ -227,7 +227,10 @@ and pp_pat env pv =
end;
'sTR " ->"; 'sPC; pp_expr par env' [] t >]
in
- [< prvect_with_sep (fun () -> [< 'fNL; 'sTR "| " >]) pp_one_pat pv >]
+ if pv = [||] then
+ [< 'sTR "_ -> assert false (* empty inductive *)" >]
+ else
+ [< prvect_with_sep (fun () -> [< 'fNL; 'sTR "| " >]) pp_one_pat pv >]
(*s names of the functions ([ids]) are already pushed in [env],
and passed here just for convenience. *)
@@ -292,13 +295,17 @@ let pp_one_inductive (pl,name,cl) =
prlist_with_sep
(fun () -> [< 'sPC ; 'sTR "* " >]) pp_type l >] >]
in
- [< pp_parameters pl; P.pp_global name; 'sTR " ="; 'fNL;
- v 0 [< 'sTR " ";
- prlist_with_sep (fun () -> [< 'fNL; 'sTR " | " >])
- (fun c -> hOV 2 (pp_constructor c)) cl >] >]
+ [< pp_parameters pl; P.pp_global name; 'sTR " =";
+ if cl = [] then
+ [< 'sTR " unit (* empty inductive *)" >]
+ else
+ [< 'fNL;
+ v 0 [< 'sTR " ";
+ prlist_with_sep (fun () -> [< 'fNL; 'sTR " | " >])
+ (fun c -> hOV 2 (pp_constructor c)) cl >] >] >]
let pp_inductive il =
- [< 'sTR "type " ;
+ [< 'sTR "type ";
prlist_with_sep
(fun () -> [< 'fNL; 'sTR "and " >])
(fun i -> pp_one_inductive i)