main
| Line | |
|---|
| 1 | $input int n;
|
|---|
| 2 | $assume(n > 0);
|
|---|
| 3 |
|
|---|
| 4 | typedef struct {
|
|---|
| 5 | int x;
|
|---|
| 6 | float y;
|
|---|
| 7 | } simple_t;
|
|---|
| 8 |
|
|---|
| 9 | typedef struct {
|
|---|
| 10 | int x;
|
|---|
| 11 | float y;
|
|---|
| 12 | simple_t t;
|
|---|
| 13 | union {
|
|---|
| 14 | simple_t t;
|
|---|
| 15 | int x;
|
|---|
| 16 | } u;
|
|---|
| 17 | int ts[10];
|
|---|
| 18 | } complex_t;
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 | int main() {
|
|---|
| 22 | complex_t s3[n] = (complex_t[n])$lambda(int i) (complex_t){.t.y = .9, {.x = 42}};
|
|---|
| 23 |
|
|---|
| 24 | $assert($forall (int i : 0 .. n-1) s3[i].x == 0 && s3[i].y == 0 &&
|
|---|
| 25 | s3[i].t.x == 0 && s3[i].t.y == 0.9 &&
|
|---|
| 26 | s3[i].u.x == 42 && s3[i].u.t.x == 0); //s3[i].u.t is undefined
|
|---|
| 27 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.