epfl-lara / stainless

Verification framework and tool for higher-order Scala programs
https://epfl-lara.github.io/stainless/
Apache License 2.0
357 stars 52 forks source link

Stainless doesn't finish on polymorphic recursive data types #1363

Open pgimalac opened 1 year ago

pgimalac commented 1 year ago

Hello, As discussed, on the following code using polymorphic recursive data type stainless never finishes (nor prints errors or anything).

https://github.com/jacobprudhomme/finger-tree/tree/stainless-bug

Thanks.

mario-bucev commented 1 year ago

Not very useful to know but seems to be related to isInductive and isWellformed definitions. Will look into it!

vkuncak commented 1 year ago

It is useful to know, @mario-bucev ; some things are more useful to users, some to developers. But those sets of people overlap. For now, we will need to check more carefully permitted inductive data types.

vkuncak commented 1 year ago

We should reject cleanly and upfront unsupported data types.

vkuncak commented 1 year ago

Here is a more precise link to where polymorphic recursion happens: https://github.com/jacobprudhomme/finger-tree/blob/stainless-bug/src/main/scala/fingertree/FingerTree.scala#L18