Dangerous-Agda2.agda 609 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. module Dangerous where
  2. data N : Set where
  3. zero : N
  4. suc : N -> N
  5. data B : Set where
  6. true : B
  7. false : B
  8. data False : Set where
  9. data True : Set where
  10. tt : True
  11. F : B -> Set
  12. F true = N
  13. F false = B
  14. G : (x:B) -> F x -> Set
  15. G false _ = N
  16. G true zero = B
  17. G true (suc n) = N
  18. (==) : B -> B -> Set
  19. true == true = True
  20. false == false = True
  21. _ == _ = False
  22. data Equal (x,y:B) : Set where
  23. equal : x == y -> Equal x y
  24. refl : (x:B) -> Equal x x
  25. refl true = equal tt
  26. refl false = equal tt
  27. postulate
  28. f : (x:B) -> (y : F x) -> G x y -> Equal x true -> N
  29. h : N
  30. h = f _ false zero (refl true)