Skip to content

Instantly share code, notes, and snippets.

@csgordon
Created September 9, 2013 18:47
Show Gist options
  • Save csgordon/6499819 to your computer and use it in GitHub Desktop.
Save csgordon/6499819 to your computer and use it in GitHub Desktop.
Definition that isn't strictly positive according to Agda or Coq, but is accepted by Idris (:total ElimT says ElimT is total, which requires not using non-SP types)
data T : Type -> Type where
c1 : T Nat
c2 : T (T Nat)
ElimT : (A : Type) -> T A -> A
ElimT _ c1 = 3
ElimT _ c2 = c1
@csgordon
Copy link
Author

csgordon commented Sep 9, 2013

Agda and Coq reject this as non-strictly-positive due to the use of T as an index to itself in the type of c2. Totality checking says ElimT is total, which the manual says requires it not to use non-SP types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment