Closed jad-hamza closed 6 years ago
Currently Inox doesn't support & | ^
on Boolean
, but it should. I'll add support for that as well in epfl-lara/inox#26.
Hmm, I'm not sure we actually need these within Inox. The operators are easy to encode using let bindings, &&
and ||
. In general, I'd prefer Inox to stay as simple as possible and handle such encoding / extraction issues within Stainless itself.
The issue I see with mapping it to &&
and ||
is that those don't have the same semantics (short-circuit doesn't apply on &
and |
). As for ^
, we could use !=
but it wouldn't have the same operator precedence. Wouldn't that create more issues in the long term? (The way I planned to modify inox was limited to BV*
operators.)
If you use
val a = b1
val b = b2
a && b
you get the same semantics as &
(and similar encodings for the other ones).
About operator precedence, I don't mean we should not support these operators in the frontend (namely Stainless), but I don't think they are required in the solving backend (namely Inox). Operator precedence isn't really an issue in Inox since we aren't going to be parsing anything.
If you meant that you would only be adding support for these within the Stainless PR linked to https://github.com/epfl-lara/inox/pull/26, then I completely agree :)
I now see your point. Patch will be available through stainless only.
Support for this is included in #33.
The original example is now emitting this exception:
[Internal] java.util.NoSuchElementException: key not found: class stainless.extraction.imperative.Trees$BoolBitwiseAnd
The
&
operator produces a crash with an exception