-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
structure array fixes, plus nested structure fixes
- Loading branch information
Showing
10 changed files
with
382 additions
and
175 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
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,22 @@ | ||
deftype struct (bool x, y; int w) { } | ||
|
||
defproc test() | ||
{ | ||
struct s[100]; | ||
int i; | ||
bool qrst; | ||
|
||
chp { | ||
i := 0; | ||
s[0].w := 1; | ||
s[0].x := false; | ||
s[1].x := false; | ||
log ("got ", s[0].x, " ", s[0].w); | ||
log ("got ", s[1].x); | ||
s[i].x := true; | ||
s[0].w := s[0].w + 2; | ||
s[i+1].x := true; qrst := true; | ||
log ("got ", s[0].x, " ", s[0].w); | ||
log ("got ", s[1].x) | ||
} | ||
} |
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,46 @@ | ||
deftype bar(int<3> v_0, v_1, v_2, v_3, v_4, v_5, v_6, v_7, | ||
v_8, v_9, v_10, v_11, v_12, v_13, v_14, v_15, | ||
v_16, v_17, v_18, v_19, v_20, v_21, v_22){} | ||
|
||
deftype foo(bar a){} | ||
|
||
function abc(bar b) : bar | ||
{ | ||
chp { | ||
self.v_0 := b.v_0 ; self.v_1 := b.v_1 ; self.v_2 := b.v_2 ; self.v_3 := b.v_3 ; | ||
self.v_4 := b.v_4 ; self.v_5 := b.v_5 ; self.v_6 := b.v_6 ; self.v_7 := b.v_7 ; | ||
self.v_8 := b.v_8 ; self.v_9 := b.v_9 ; self.v_10 := b.v_10; self.v_11 := b.v_11; | ||
self.v_12 := b.v_12; self.v_13 := b.v_13; self.v_14 := b.v_14; self.v_15 := b.v_15; | ||
self.v_16 := b.v_16; self.v_17 := b.v_17; self.v_18 := b.v_18; self.v_19 := b.v_19; | ||
self.v_20 := b.v_20; self.v_21 := b.v_21; self.v_22 := b.v_22 | ||
} | ||
} | ||
|
||
function baz(foo f) : foo | ||
{ | ||
chp { | ||
self.a := abc(f.a); | ||
[ f.a.v_0 = 0 -> self.a.v_0 := 2 | ||
[]else -> self.a.v_0 := 0 | ||
] | ||
} | ||
} | ||
|
||
defproc test () | ||
{ | ||
|
||
foo x; | ||
foo f; | ||
int i; | ||
|
||
chp { | ||
i := 0; | ||
*[ i < 10 -> | ||
x := baz(f); | ||
log ("got ", x.a.v_0); | ||
f := x; | ||
i := i + 1 | ||
] | ||
} | ||
} | ||
test t; |
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 @@ | ||
WARNING: test<>: substituting chp model (requested prs, not found) |
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,4 @@ | ||
[ 40] <> got 0 1 | ||
[ 40] <> got 0 | ||
[ 80] <> got 1 3 | ||
[ 80] <> got 1 |
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 @@ | ||
WARNING: test<>: substituting chp model (requested prs, not found) |
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,10 @@ | ||
[ 20] <> got 2 | ||
[ 50] <> got 0 | ||
[ 80] <> got 2 | ||
[ 110] <> got 0 | ||
[ 140] <> got 2 | ||
[ 170] <> got 0 | ||
[ 200] <> got 2 | ||
[ 230] <> got 0 | ||
[ 260] <> got 2 | ||
[ 290] <> got 0 |