Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions CLIFlags/Helpers/Fibonacci.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ methods {
function fibonacci(uint32) external returns (uint32) envfree;
}

rule fibonacciMonotonicallyIncreasing {
rule fibonacciMonotonicallyIncreasing() {
uint32 i1;
uint32 i2;

assert i2 > i1 => fibonacci(i2) >= fibonacci(i1);
}

rule fifthFibonacciElementIsFive {
rule fifthFibonacciElementIsFive() {
assert fibonacci(5) == 5;
}
3 changes: 1 addition & 2 deletions CLIFlags/Helpers/auto_dispatcher/AutoDispatcherExample.spec
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ using E as e;
rule r(uint n) {
env environ;
uint ret = foo(environ, n);

Comment thread
pickx marked this conversation as resolved.
assert currentContract.i == d || currentContract.i == e, "optimistic dispatching should promise this";
assert currentContract.i == d => ret == n;
assert currentContract.i == e => ret == n + 1;
}
}
2 changes: 1 addition & 1 deletion CVLByExample/AddressFunctionCall/AddressCall.spec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using A as a;
using B as b;

rule AddressCall {
rule AddressCall() {
env e;
address x;
assert x.foo(e) >= 1 && x.foo(e) <= 2;
Expand Down
8 changes: 4 additions & 4 deletions CVLByExample/ConfInheritance/MainSpec.spec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

methods {
function currentBid() external returns uint256 envfree;
function currentBid() external returns (uint256) envfree;
}

/// @title Basic rules ////////////////////////////////////////////////////
Expand All @@ -20,7 +20,7 @@ methods {
rule bidIncreasesAssets() {
env e;
require(e.msg.sender != currentContract);
require(e.msg.value > currentBid() );
require(e.msg.value > currentBid());
uint256 balanceBefore = nativeBalances[currentContract];
bid(e);
assert nativeBalances[currentContract] > balanceBefore;
Expand All @@ -37,8 +37,8 @@ rule bidSuccessfullyExpectVacuous() {
env e;
uint256 balanceBefore = nativeBalances[currentContract];
require(e.msg.sender != currentContract);
require(e.msg.value > 0 && e.msg.value > balanceBefore);
require (balanceBefore > 0);
require(e.msg.value > 0 && e.msg.value > balanceBefore);
require(balanceBefore > 0);
bid(e);
assert nativeBalances[currentContract] >= balanceBefore;
}
8 changes: 5 additions & 3 deletions CVLByExample/ContractAlias/ContractAlias.spec
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import "Imported.spec";

methods { function A.Always1() internal returns (uint) => ALWAYS(2);}
methods {
function A.Always1() internal returns (uint) => ALWAYS(2);
}

rule verifySummaryOnAlias(){
rule verifySummaryOnAlias() {
env e;
assert 2 == Always1(e);
}
}
2 changes: 1 addition & 1 deletion CVLByExample/ContractAlias/Imported.spec
Original file line number Diff line number Diff line change
@@ -1 +1 @@
using ContractA as A;
using ContractA as A;
Loading