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
I translated the above mutual inductive definition into a type family and can confirm that the totality checker doesn't see the calculate function as total. Tested with Idris Version 0.99-git:6f46ba0e. Incidentally, Coq recognizes the function as total.
It's because of the 'List' - the positivity check in Idris doesn't allow this because it only allows recursive arguments if they are either direct uses of the type, or the return type of a higher order function.
There's no reason not to allow this, it just needs implementing.
Oh, and the other issue is that 'calculate' is used as an argument to a higher order function, and the totality checker can't immediately see that this is valid. This is much harder to do anything about. I don't know how Coq manages to spot that this is okay... I suppose I'll have to read up on how their totality checker works these days.
ahmadsalim
changed the title
Totality checker issue on mutually inductive types
Positivity checker issue when inductive data-type use is in a parameter of another data-type
Mar 5, 2017
ahmadsalim
changed the title
Positivity checker issue when inductive data-type use is in a parameter of another data-type
Totality checker issue when inductive data-type use is in a parameter of another data-type
Oct 23, 2017
Idris totality checker thinks the function
calculate
is not total, however if I change the last line usingfoldl
:Idris assumes
calculate
is total, what's the reason. Could you explain is it a bug or expected behaviour?The text was updated successfully, but these errors were encountered: