Crash.epi 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. ------------------------------------------------------------------------------
  2. ( n : Nat !
  3. data (---------! where (------------! ; !-------------!
  4. ! Nat : * ) ! zero : Nat ) ! suc n : Nat )
  5. ------------------------------------------------------------------------------
  6. data (----------! where (--------------! ; (-------------!
  7. ! Bool : * ) ! false : Bool ) ! true : Bool )
  8. ------------------------------------------------------------------------------
  9. ( b : Bool !
  10. let !----------!
  11. ! F b : * )
  12. F b <= case b
  13. { F false => Nat
  14. F true => Bool
  15. }
  16. ------------------------------------------------------------------------------
  17. ( b : Bool !
  18. let !--------------!
  19. ! not b : Bool )
  20. not b <= case b
  21. { not false => true
  22. not true => false
  23. }
  24. ------------------------------------------------------------------------------
  25. ( ( x : F ? ! !
  26. ! !---------------! ; h : F (g zero) !
  27. ! ! g : F (not x) ) !
  28. let !-------------------------------------! ;
  29. ! j g h : Nat )
  30. ------------------------------------------------------------------------------
  31. [There is some magic going on here which prevents the type of!
  32. ![g zero] i.e. [F (not zero)] from being evaluated. ]
  33. ------------------------------------------------------------------------------
  34. ( g : all x : F ? => F (not x) !
  35. let !------------------------------! ;
  36. ! h g : Nat )
  37. ------------------------------------------------------------------------------
  38. [We are not allowed to give a definition to h, since the type isn't!
  39. !guaranteed to be correct. ]
  40. ------------------------------------------------------------------------------