Skip to content
This repository has been archived by the owner on May 4, 2024. It is now read-only.

[move prover] add unchecked subtraction #150

Closed
wants to merge 1 commit into from

Conversation

xudon9
Copy link
Contributor

@xudon9 xudon9 commented May 19, 2022

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.)

@wrwg
Copy link
Member

wrwg commented May 22, 2022

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:

/// The following schema describes aborts conditions which we do not want to be propagated to the verification

@wrwg
Copy link
Member

wrwg commented Aug 21, 2022

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

@wrwg wrwg closed this Aug 21, 2022
brson pushed a commit to brson/move that referenced this pull request May 17, 2023
brson pushed a commit to brson/move that referenced this pull request Jul 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants