test-suite/complexity/guard_return_predicate.v
raw| 1 | (* Testk that we don't unfold unnecessarily in guard condition the |
| 2 | body of a return predicate *) |
| 3 | (* Expected time < 1.00s *) |
| 4 | |
| 5 | Fixpoint slow n : Type -> Type := |
| 6 | match n with |
| 7 | | 0 => fun A => A |
| 8 | | S k => fun A => slow k (slow k A) |
| 9 | end. |
| 10 | |
| 11 | Parameter y : unit. |
| 12 | Parameter h : slow 100 nat -> nat. |
| 13 | |
| 14 | Timeout 5 Time Fixpoint F (g:nat->slow 100 nat) n : nat := |
| 15 | match n with |
| 16 | | 0 => 0 |
| 17 | | S k => (fun x => h (match y return slow 100 nat with tt => g (F g x) end)) k |
| 18 | end. |