-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check store isomorphism after behavoours and examples
- Loading branch information
Showing
7 changed files
with
345 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// contract A | ||
constructor of A | ||
interface constructor(uint z) | ||
|
||
iff | ||
CALLVALUE == 0 | ||
|
||
creates | ||
uint x := z | ||
|
||
|
||
behaviour x of A | ||
interface x() | ||
|
||
iff | ||
CALLVALUE == 0 | ||
|
||
returns | ||
pre(x) | ||
|
||
// contract C | ||
constructor of C | ||
interface constructor() | ||
iff | ||
CALLVALUE == 0 | ||
|
||
creates | ||
A a1 := create A(42) | ||
A a2 := create A(17) | ||
|
||
behaviour change of C | ||
interface change() | ||
|
||
iff | ||
|
||
CALLVALUE == 0 | ||
|
||
storage | ||
a1 => a2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
pragma solidity >=0.8.0; | ||
|
||
contract A { | ||
uint public x; | ||
|
||
constructor (uint z) { | ||
x = z; | ||
} | ||
} | ||
|
||
|
||
contract C { | ||
A a1; | ||
A a2; | ||
|
||
constructor () { | ||
a1 = new A(42); | ||
a2 = new A(17); | ||
} | ||
|
||
function change() public { | ||
a1 = a2; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
// contract A | ||
constructor of A | ||
interface constructor(uint z) | ||
|
||
iff | ||
CALLVALUE == 0 | ||
|
||
creates | ||
uint x := z | ||
|
||
|
||
behaviour x of A | ||
interface x() | ||
|
||
iff | ||
CALLVALUE == 0 | ||
|
||
returns | ||
pre(x) | ||
|
||
behaviour set_x of A | ||
interface set_x(uint z) | ||
|
||
iff | ||
CALLVALUE == 0 | ||
|
||
storage | ||
x => z | ||
|
||
// contract B | ||
constructor of B | ||
interface constructor(uint z) | ||
iff | ||
CALLVALUE == 0 | ||
|
||
creates | ||
uint y := z | ||
A a := create A(0) | ||
|
||
behaviour y of B | ||
interface y() | ||
|
||
iff | ||
CALLVALUE == 0 | ||
|
||
returns | ||
pre(y) | ||
|
||
behaviour a of B | ||
interface a() | ||
|
||
iff | ||
CALLVALUE == 0 | ||
|
||
returns | ||
pre(a) | ||
|
||
|
||
// contract C | ||
constructor of C | ||
interface constructor(address y) | ||
pointers | ||
y |-> B | ||
|
||
iff | ||
CALLVALUE == 0 | ||
|
||
creates | ||
A a := y.a | ||
B b := y | ||
|
||
behaviour change of C | ||
interface change() | ||
|
||
iff | ||
|
||
CALLVALUE == 0 | ||
|
||
storage | ||
a => create A(42) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
pragma solidity >=0.8.0; | ||
|
||
contract A { | ||
uint public x; | ||
|
||
constructor (uint z) { | ||
x = z; | ||
} | ||
|
||
function set_x(uint z) public{ | ||
x = z; | ||
} | ||
} | ||
|
||
contract B { | ||
uint public y; | ||
A public a; | ||
|
||
constructor (uint z) { | ||
y = z; | ||
a = new A(0); | ||
} | ||
} | ||
|
||
contract C { | ||
A a; | ||
B b; | ||
|
||
constructor (address y) { | ||
a = B(y).a(); | ||
b = B(y); | ||
} | ||
|
||
function change() public { | ||
a = new A(42); | ||
} | ||
} |
Oops, something went wrong.