File: for_example.pml

package info (click to toggle)
spin 6.5.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 2,512 kB
  • sloc: ansic: 39,876; yacc: 1,021; makefile: 58; sh: 8
file content (28 lines) | stat: -rwxr-xr-x 307 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
typedef m {
	bool b;
	int i;
	chan c;
}

init {
	m foo;
	chan x = [8] of { m };
	int i;

	foo.b = true;
	foo.i = 12;
	foo.c = x;
	x!foo;

	foo.b = false;
	foo.i = 10;
	foo.c = 0;
	x!foo; x!foo;

	i = 1;
	for (foo in x) {
		printf("%d: %d %d %d (len(x)=%d)\n",
			i, foo.b, foo.i, foo.c, len(x));
		i++
	}
}