@@ -15,8 +15,9 @@ def subIfEnoughFun : Fun :=
1515 { name := "subIfEnough"
1616 args := ["slot" , "delta" ]
1717 body := letSload "current" (v "slot" )
18- (require
19- (Expr.not (Expr.lt (v "current" ) (v "delta" )))
18+ (requireGte
19+ (v "current" )
20+ (v "delta" )
2021 (Stmt.sstore (v "slot" ) (Expr.sub (v "current" ) (v "delta" ))))
2122 ret := none }
2223
@@ -34,15 +35,15 @@ theorem subIfEnough_meets_specR_ok (s : Store) (slot delta : Nat) :
3435 have hge : s slot >= delta := by exact hreq
3536 have hnot : ¬ s slot < delta := by
3637 exact not_lt_of_ge hge
37- simp [subIfEnoughSpecR, subIfEnoughFun, letSload, require, v, execFun, execStmt, evalExpr ,
38- bindArgs, emptyEnv, updateEnv, updateStore, hnot]
38+ simp [subIfEnoughSpecR, subIfEnoughFun, letSload, requireGte, require, v, execFun, execStmt,
39+ evalExpr, bindArgs, emptyEnv, updateEnv, updateStore, hnot]
3940
4041theorem subIfEnough_meets_specR_reverts (s : Store) (slot delta : Nat) :
4142 (subIfEnoughSpecR slot delta).reverts s ->
4243 execFun subIfEnoughFun [slot, delta] s [] = ExecResult.reverted := by
4344 intro hrev
4445 have hlt : s slot < delta := by exact hrev
45- simp [subIfEnoughSpecR, subIfEnoughFun, letSload, require, v, execFun, execStmt, evalExpr ,
46- bindArgs, emptyEnv, updateEnv, updateStore, hlt]
46+ simp [subIfEnoughSpecR, subIfEnoughFun, letSload, requireGte, require, v, execFun, execStmt,
47+ evalExpr, bindArgs, emptyEnv, updateEnv, updateStore, hlt]
4748
4849end DumbContracts.Examples
0 commit comments