Closed msaaltink closed 5 years ago
The prove
command runs seemingly forever even with the offline_smtlib2
proof tactic. I'm testing with a profiling build now.
Ah, I should have noticed this earlier. The problem is entirely because of the use of [0 ..]
in is_new
, which (at type [32]
) is shorthand for [0 .. 4294967295]
. Replacing it with [0 ...]
fixes everything.
Cryptol has multiple representations for vector types, and heuristics for choosing which one to use; saw-script is less sophisticated in this regard. As a result saw-script actually builds a vector with 2^32 elements in it, just like you asked for.
I really think we should remove the [x..]
construct from Cryptol altogether. Using it invariably leads to nasty surprises. And if you really want a list with 2^32 elements, you can always just write [0 .. 4294967295]
, so we don't lose any expressiveness.
I agree about the [x..]
construct. I think that I intended to write [0...]
here, but when I write without referring to the manual I sometimes mix these two forms up. I don't see a lot of value in omitting the upper bound in the ..
form.
Is there anything still to address in this issue?
I don't think so. Closing.
Here's a simple function to see if an array element appears at an earlier place:
I've rendered this into Cryptol in two different ways, which Cryptol can show give the same answer so long as the index is less than the length of the list. SAW cannot do that proof:
That just grinds away with z3, too, although z3 seems to exhaust memory while yices does not.
There is something else going on:
For n = 1,2,3,4 the proof using
is_new'
is fairly fast. For n=5, it really locks up my machine, although changing yices to z3 lets me get n=5. But z3 struggles with n=10.Even for n=1, the proof using
{{is_new}}
just churns.