aboutsummaryrefslogtreecommitdiff
path: root/test-suite
diff options
context:
space:
mode:
authorherbelin2007-08-25 15:44:39 +0000
committerherbelin2007-08-25 15:44:39 +0000
commit6efaa1f45a855418d0bc7c8656e4ed83778903ee (patch)
tree8f6f40e190ea0dda35fa325f2142f747c266887b /test-suite
parent3b316ab662a9877001cc4a497d13969d43f7ba4a (diff)
Extension et documentation de real_clean/evar_define dans evarutil.ml:
l'unification sait maintenant résoudre des équations du genre "?n[...;x:=?m[...;y:=t;...]] = t" lorsque x et y sont uniques vérifiant cette propriété (la solution est alors de poser ?m:=y et ?n:=x); le type de t est aussi pris en compte dans cette situation (ce genre de problème permet de résoudre des cas simples d'unification avec dépendance: cf l'exemple de foldrn dans test-suite/success/Fixpoint.v) git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@10092 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'test-suite')
-rw-r--r--test-suite/success/Fixpoint.v19
1 files changed, 19 insertions, 0 deletions
diff --git a/test-suite/success/Fixpoint.v b/test-suite/success/Fixpoint.v
index 680046da4c..bc9c8a374b 100644
--- a/test-suite/success/Fixpoint.v
+++ b/test-suite/success/Fixpoint.v
@@ -29,3 +29,22 @@ CoFixpoint g (n:nat) (m:=pred n) (l:Stream m) (p:=S n) : Stream p :=
Eval compute in (fun l => match g 2 (Consn 0 6 l) with Consn _ a _ => a end).
+(* Check inference of simple types even in presence of (non ambiguous)
+ dependencies (needs revision ) *)
+
+Section folding.
+
+Inductive vector (A:Type) : nat -> Type :=
+ | Vnil : vector A 0
+ | Vcons : forall (a:A) (n:nat), vector A n -> vector A (S n).
+
+Variables (B C : Set) (g : B -> C -> C) (c : C).
+
+Fixpoint foldrn n bs :=
+ match bs with
+ | Vnil => c
+ | Vcons b _ tl => g b (foldrn _ tl)
+ end.
+
+End folding.
+