diff options
author | Samuel Mimram <smimram@debian.org> | 2008-07-25 15:12:53 +0200 |
---|---|---|
committer | Samuel Mimram <smimram@debian.org> | 2008-07-25 15:12:53 +0200 |
commit | a0cfa4f118023d35b767a999d5a2ac4b082857b4 (patch) | |
tree | dabcac548e299fee1da464c93b3dba98484f45b1 /test-suite/ideal-features/evars_subst.v | |
parent | 2281410e38ef99d025ea77194585a9bc019fdaa9 (diff) |
Imported Upstream version 8.2~beta3+dfsgupstream/8.2.beta3+dfsg
Diffstat (limited to 'test-suite/ideal-features/evars_subst.v')
-rw-r--r-- | test-suite/ideal-features/evars_subst.v | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/test-suite/ideal-features/evars_subst.v b/test-suite/ideal-features/evars_subst.v new file mode 100644 index 00000000..6f9f86a9 --- /dev/null +++ b/test-suite/ideal-features/evars_subst.v @@ -0,0 +1,53 @@ +(* Bug report #932 *) +(* Expected time < 1.00s *) + +(* Let n be the number of let-in. The complexity comes from the fact + that each implicit arguments of f was in a larger and larger + context. To compute the type of "let _ := f ?Tn 0 in f ?T 0", + "f ?Tn 0" is substituted in the type of "f ?T 0" which is ?T. This + type is an evar instantiated on the n variables denoting the "f ?Ti 0". + One obtain "?T[1;...;n-1;f ?Tn[1;...;n-1] 0]". To compute the + type of "let _ := f ?Tn-1 0 in let _ := f ?Tn 0 in f ?T 0", another + substitution is done leading to + "?T[1;...;n-2;f ?Tn[1;...;n-2] 0;f ?Tn[1;...;n-2;f ?Tn[1;...;n-2] 0] 0]" + and so on. At the end, we get a term of exponential size *) + +(* A way to cut the complexity could have been to remove the dependency in + anonymous variables in evars but this breaks intuitive behaviour + (see Case15.v); another approach could be to substitute lazily + and/or to simultaneously substitute let binders and evars *) + +Variable P : Set -> Set. +Variable f : forall A : Set, A -> P A. + +Time Check + let _ := f _ 0 in + let _ := f _ 0 in + let _ := f _ 0 in + let _ := f _ 0 in + + let _ := f _ 0 in + let _ := f _ 0 in + let _ := f _ 0 in + let _ := f _ 0 in + + let _ := f _ 0 in + let _ := f _ 0 in + let _ := f _ 0 in + let _ := f _ 0 in + let _ := f _ 0 in + + let _ := f _ 0 in + let _ := f _ 0 in + let _ := f _ 0 in + let _ := f _ 0 in + let _ := f _ 0 in + + let _ := f _ 0 in + let _ := f _ 0 in + let _ := f _ 0 in + let _ := f _ 0 in + let _ := f _ 0 in + + f _ 0. + |