Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
[SMTChecker] Support array push/pop #8916
Conversation
|
Rebased |
|
This looks good, but as you said: it needs tests. Do you see a better solution for the edge cases where the length overflows? The current behaviour is silently wrap around, right? There probably shouldn't be an overflow warning for that, because it can never really happen in practice... However, what about something like the following:
in practice this assertion should always hold (in CHC), but in your encoding it will break, because you can call Similarly maybe something like:
when calling I just looked at our codegen, in fact it will silently wrap around in those cases... still a bit weird to have such assertions as in the examples break because of that, because in practice there can never be such an overflow... |
|
Well, I think your examples should work just as you described. In practice this would all run out of gas I suppose, but the semantics of the language are exactly as you described, so I think the SMTChecker should do the same (currently implementation). |
I think this assertion should break, for the reasons you described |
|
Ok... I'm just wondering if we didn't get more natural results, if we considered an imaginary |
|
We could also do that, but then we'll report some false negatives for cases where the overflow actually happens... |
|
Ready for review |
|
@chriseth updated |
Fixes #6048
Depends on #8848
array.length < 2^256 - 1before the push (as a real world assumption)length - 1and do not wrap