Fix RecursiveEvaluator not erasing types (Stainless #1135)#160
Fix RecursiveEvaluator not erasing types (Stainless #1135)#160gsps wants to merge 1 commit intoscala-2.13from
Conversation
|
I thought about this a bit more and now I'm wondering if we're not at risk of breaking choose (and forall) evaluation by erasing type parameters in function invocations. Maybe the rule should rather be that values have their types erased? Actually I remember thinking at some point that we need to change the evaluation of |
|
What's the deal with https://github.com/epfl-lara/inox/blob/master/src/main/scala/inox/evaluators/RecursiveEvaluator.scala#L525 anyways? It seems that lookup is contextual on the Is |
|
Huh, well I don't know what
Well, ideally you'd want chooses to depend only on values. But since there's no way to really erase types in Inox, we unfortunately have type-dependent chooses (e.g. But that's only the story for chooses which exist in the model. Erasing types is fine for those, however, we also support evaluating chooses which don't exist in the model: If we erase types, then we won't be able to take dependent types into account when evaluating such chooses. For example, in the following program you would want to call to def get[T](): T = choose((x: T) => true)
get[{x: Int => x > 0}]() |
Fixes Inox-side issue of Stainless issue 1135 (epfl-lara/stainless#1135). While issues on the Inox side weren't directly observed, we should really be operating on fully-erased values, so that expressions such as
Set[Int](1) == Set[{ x: Object | (T(x)): @unchecked }](1)evaluate totrue.@samarion I didn't make any changes to
Lambdaso far. Should we adaptnormalizeLambdato erase parameter types?