data Even: Nat -> Type where
EvenZ: Even Z
EvenS: Even n -> Even (n + 2)
total
lemma1: Even Z
lemma1 = EvenZ
-- total
-- lemma2: Even Z
-- lemma2 impossible -- Idris says 'lemma2 is a valid case' and I agree with you
total
lemma3: Even 2
lemma3 = EvenS EvenZ
total
lemma4: Even 2 -> Void
lemma4 x impossible -- what does it work?
total
lemma5: Even 1 -> Void
lemma5 x impossible
I wrote some proofs on Even
.
lemma1
, lemma2
and lemma3
are ok, but lemma4
looks strange to me.
AFAIK, both lemma3
and lemma4
can not be provable at the same time.
I expected impossible
keyword in lemma4 not to work and expected Idris to show me some error messages about the wrong usage of impossible
.
Is impossible
an unsafe keyword that can be used to assert to type checker?