Issue2331.agda 759 B

123456789101112131415161718192021222324252627282930
  1. -- Andreas, 2016-12-09, issue #2331
  2. -- Testcase from Nisse's application
  3. open import Common.Size
  4. data D (i : Size) : Set where
  5. c : (j : Size< i) → D i
  6. postulate
  7. f : (i : Size) → ((j : Size< i) → D j → Set) → Set
  8. module Mutual where
  9. mutual
  10. test : (i : Size) → D i → Set
  11. test i (c j) = f j (helper i j)
  12. helper : (i : Size) (j : Size< i) (k : Size< j) → D k → Set
  13. helper i j k = test k
  14. module Where where
  15. test : (i : Size) → D i → Set
  16. test i (c j) = f j helper
  17. where
  18. helper : (k : Size< j) → D k → Set
  19. helper k = test k
  20. -- While k is an unusable size per se, in combination with the usable size j
  21. -- (which comes from a inductive pattern match)
  22. -- it should be fine to certify termination.