You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> import Data.Vect
> total
> Dec1 : {A : Type} -> (P : A -> Type) -> Type
> Dec1 {A} P = (a : A) -> Dec (P a)
> total
> filter : {A : Type} ->
> {P : A -> Type} ->
> Dec1 P ->
> Vect n A ->
> (m : Nat ** Vect m A)
> filter d1P Nil = (Z ** Nil)
> filter d1P (a :: as) with (filter d1P as)
> | (_ ** tail) with (d1P a)
> | (Yes p) = (_ ** a :: tail)
> | (No contra) = (_ ** tail)
> total
> filterLemma : {A : Type} ->
> {P : A -> Type} ->
> (d1P : Dec1 P) ->
> (a : A) ->
> (as : Vect n A) ->
> Elem a as ->
> (p : P a) ->
> Elem a (getProof (filter d1P as))
> filterLemma d1P a Nil Here p impossible
type checks fine although |filterLemma| is obviously not total. Is this the expected behavior ? Is the totality checker too permissive ?
The text was updated successfully, but these errors were encountered:
The problem is that it has guessed which "Nil" is meant and picked the wrong one. This is similar to an issue I was discussing with @david-christiansen recently - when there's only impossible cases given, it doesn't disambiguate names properly.
(This is more a note to myself about how to go about fixing it at some point...)
The program
type checks fine although |filterLemma| is obviously not total. Is this the expected behavior ? Is the totality checker too permissive ?
The text was updated successfully, but these errors were encountered: