stainless icon indicating copy to clipboard operation
stainless copied to clipboard

introduce `old` outside of post condition

Open samuelchassot opened this issue 6 months ago • 1 comments

It can be implemented a sugar instead of writing a snapshot at the beginning of the body:

def f() = 
  // mutable operations
  assert(old(this).size > this.size)
  // ...

would be transformed into

def f() = 
  @ghost val oldthis = snapshot(this)
  // mutable operations
  assert(oldThis.size > this.size)
  // ...

samuelchassot avatar Aug 05 '24 13:08 samuelchassot