-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assert c.isInstanceOf[Type]
invalid, even though c
is a parameter of type Type
#1214
Comments
This seems like an issue in the interaction between Stainless and Inox. In order to fix the issue, we should probably make sure that the Inox UnrollingSolver calls declare on all free variables in constraints (in assertCnstr). This might also require adding a cache layer for declared variables to avoid generating declaration clauses multiple times. The |
It seems to only affect inner functions: import stainless.lang._
object i1214b {
abstract sealed class Ordinal
case class Nat() extends Ordinal
case class Transfinite(in: Ordinal) extends Ordinal
def free(c: Transfinite): Unit = {
assert(c.isInstanceOf[Transfinite]) // Verifies
}
def bar(): Unit = {
def inner(c: Transfinite): Unit = {
assert(c.isInstanceOf[Transfinite]) // Does not verify
}
}
} Looking at the trees, // Symbols before RefinementLifting
def free$0(c$5: { v$21: Ordinal$0 | v$21 is Transfinite$0 }): Unit = {
assert(c$5.isInstanceOf[{ v$23: Ordinal$0 | v$23 is Transfinite$0 }])
()
}
def bar$0: Unit = {
def inner$0(_$c$3: { v$24: Ordinal$0 | v$24 is Transfinite$0 }): Unit = {
assert(_$c$3.isInstanceOf[{ v$26: Ordinal$0 | v$26 is Transfinite$0 }])
()
}
()
}
// Symbols after RefinementLifting
def free$0(c$5: Ordinal$0): Unit = {
require(c$5 is Transfinite$0)
assert(c$5 is Transfinite$0)
()
}
def bar$0: Unit = {
def inner$0(_$c$3: Ordinal$0): Unit = {
assert(_$c$3 is Transfinite$0)
()
}
()
} |
Stainless version:
Command: (with empty cache)
stainless minimised.scala
Problematic lines:
Content of
minimised.scala
:Ouptut:
(also note the
valid from cache
after having deleted the cache)The text was updated successfully, but these errors were encountered: