move icon indicating copy to clipboard operation
move copied to clipboard

[move prover] add unchecked subtraction

Open xudon9 opened this issue 3 years ago • 1 comments

Motivation

Just like we can ignore addition overflow, it is more convenient to ignore subtraction underflow in some cases.

Have you read the Contributing Guidelines on pull requests?

Yes.

Test Plan

(Share your test plan here. If you changed code, please provide us with clear instructions for verifying that your changes work.)

xudon9 avatar May 19 '22 12:05 xudon9

Can you please explain closer why you want to do this? It is problematic to just change the semantics of the underlying Move program.

If you want to prevent propagating an abort condition to the caller you can also do:

spec some_fun {
   pragma opaque; // Only use the spec at caller side, not the function implementation
   aborts_if [concrete] <condition under which this implementation aborts>;
   aborts_if [abstract] true; // on caller side assume this never aborts
}

There should be some examples of this in the Diem framework specs, e.g. here: https://github.com/move-language/move/blob/8958b40e97a4f94a588e5365fdb90ec18f00d888/language/documentation/examples/diem-framework/move-packages/DPN/sources/DiemConfig.move#L355

wrwg avatar May 22 '22 20:05 wrwg

Closing as we aren't moving forward with this. Feel free to reopen if this is the wrong call.

wrwg avatar Aug 21 '22 01:08 wrwg