From 6b649aba925b6f7462da07599fe67ebb12a3460e Mon Sep 17 00:00:00 2001 From: Samuel Mimram Date: Wed, 28 Jul 2004 21:54:47 +0000 Subject: Imported Upstream version 8.0pl1 --- test-suite/success/Inductive.v | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 test-suite/success/Inductive.v (limited to 'test-suite/success/Inductive.v') diff --git a/test-suite/success/Inductive.v b/test-suite/success/Inductive.v new file mode 100644 index 00000000..87431a75 --- /dev/null +++ b/test-suite/success/Inductive.v @@ -0,0 +1,34 @@ +(* Check local definitions in context of inductive types *) +Inductive A [C,D:Prop; E:=C; F:=D; x,y:E->F] : E -> Set := + I : (z:E)(A C D x y z). + +Check + [C,D:Prop; E:=C; F:=D; x,y:(E ->F); + P:((c:C)(A C D x y c) ->Type); + f:((z:C)(P z (I C D x y z))); + y0:C; a:(A C D x y y0)] + <[y1:C; a0:(A C D x y y1)](P y1 a0)>Cases a of (I x0) => (f x0) end. + +Record B [C,D:Set; E:=C; F:=D; x,y:E->F] : Set := { p : C; q : E }. + +Check + [C,D:Set; E:=C; F:=D; x,y:(E ->F); + P:((B C D x y) ->Type); + f:((p0,q0:C)(P (Build_B C D x y p0 q0))); + b:(B C D x y)] + <[b0:(B C D x y)](P b0)>Cases b of (Build_B x0 x1) => (f x0 x1) end. + +(* Check implicit parameters of inductive types (submitted by Pierre + Casteran and also implicit in #338) *) + +Set Implicit Arguments. + +CoInductive LList [A:Set] : Set := + | LNil : (LList A) + | LCons : A -> (LList A) -> (LList A). + +Implicits LNil [1]. + +Inductive Finite [A:Set] : (LList A) -> Prop := + | Finite_LNil : (Finite LNil) + | Finite_LCons : (a:A) (l:(LList A)) (Finite l) -> (Finite (LCons a l)). -- cgit v1.2.3