support modulo operation in statements
[pet.git] / tests / conditional_assignment.scop
blobbb02d96e3da44e53ffdf2ebd857fe7757540eb76
1 context: '[N, M] -> {  : N >= 0 and M >= 0 and N <= 2147483647 and M <= 2147483647
2   }'
3 arrays:
4 - context: '[M, N] -> {  : N >= 0 and M >= 0 }'
5   extent: '[N, M] -> { in1[i0, i1] : i0 >= 0 and i1 >= 0 and i0 <= -1 + N and i1 <=
6     -1 + M }'
7   element_type: int
8 - context: '[N] -> {  : N >= 0 }'
9   extent: '[N] -> { in2[i0] : i0 >= 0 and i0 <= -1 + N }'
10   value_bounds: '{ [i0] : i0 >= -1 and i0 <= 1 }'
11   element_type: int
12 - context: '[N] -> {  : N >= 0 }'
13   extent: '[N] -> { A[i0, i1] : i0 >= 0 and i1 >= 0 and i0 <= -1 + N and i1 <= 9 }'
14   element_type: int
15 - context: '[N] -> {  : N >= 0 }'
16   extent: '[N] -> { C[i0] : i0 >= 0 and i0 <= -1 + N }'
17   element_type: int
18 - context: '{  :  }'
19   extent: '{ m[] }'
20   element_type: int
21 statements:
22 - line: 21
23   domain: '[N, M] -> { S_0[i] : i >= 0 and i <= -1 + N }'
24   schedule: '[N] -> { S_0[i] -> [0, i, 0] }'
25   body:
26     type: binary
27     operation: =
28     arguments:
29     - type: access
30       relation: '[N, M] -> { S_0[i] -> m[] }'
31       read: 0
32       write: 1
33     - type: binary
34       operation: +
35       arguments:
36       - type: access
37         relation: '[N, M] -> { S_0[i] -> [i] }'
38         read: 1
39         write: 0
40       - type: access
41         relation: '[N, M] -> { S_0[i] -> [1] }'
42         read: 1
43         write: 0
44 - line: 23
45   domain: '[N, M] -> { S_1[i, j] : j >= 0 and i >= 0 and i <= -1 + N and j <= -1 +
46     M }'
47   schedule: '[M, N] -> { S_1[i, j] -> [0, i, 1, j] }'
48   body:
49     type: binary
50     operation: =
51     arguments:
52     - type: access
53       relation: '[N, M] -> { S_1[i, j] -> m[] }'
54       read: 0
55       write: 1
56     - type: call
57       name: g
58       arguments:
59       - type: call
60         name: h
61         arguments:
62         - type: access
63           relation: '[N, M] -> { S_1[i, j] -> m[] }'
64           read: 1
65           write: 0
66       - type: access
67         relation: '[N, M] -> { S_1[i, j] -> in1[i, j] }'
68         read: 1
69         write: 0
70 - line: 24
71   domain: '[N, M] -> { S_2[i] : i >= 0 and i <= -1 + N }'
72   schedule: '[N] -> { S_2[i] -> [0, i, 2] }'
73   body:
74     type: call
75     name: compute_row
76     arguments:
77     - type: call
78       name: h
79       arguments:
80       - type: access
81         relation: '[N, M] -> { S_2[i] -> m[] }'
82         read: 1
83         write: 0
84     - type: access
85       relation: '[N, M] -> { S_2[i] -> A[i, o1] }'
86       read: 0
87       write: 1
88 - line: 26
89   domain: '[N, M] -> { S_3[] }'
90   schedule: '{ S_3[] -> [1] }'
91   body:
92     type: binary
93     operation: =
94     arguments:
95     - type: access
96       relation: '[N, M] -> { S_3[] -> A[5, 6] }'
97       read: 0
98       write: 1
99     - type: access
100       relation: '[N, M] -> { S_3[] -> [0] }'
101       read: 1
102       write: 0
103 - line: 28
104   domain: '[N, M] -> { S_4[i] : i >= 0 and i <= -1 + N }'
105   schedule: '[N] -> { S_4[i] -> [2, i] }'
106   body:
107     type: binary
108     operation: =
109     arguments:
110     - type: access
111       relation: '[N, M] -> { S_4[i] -> C[i] }'
112       read: 0
113       write: 1
114     - type: ternary
115       arguments:
116       - type: access
117         relation: '[N, M] -> { [S_4[i] -> [i1]] -> [1] : i1 <= -1 + N - i and i1 >=
118           -i; [S_4[-1 + N] -> [1]] -> [0]; [S_4[0] -> [-1]] -> [0] }'
119         read: 1
120         write: 0
121         arguments:
122         - type: access
123           relation: '[N, M] -> { S_4[i] -> in2[i] }'
124           read: 1
125           write: 0
126       - type: call
127         name: f
128         arguments:
129         - type: access
130           relation: '[N, M] -> { [S_4[i] -> [i1]] -> A[i + i1, o1] : i1 <= -1 + N
131             - i and i1 >= -i }'
132           read: 1
133           write: 0
134           arguments:
135           - type: access
136             relation: '[N, M] -> { S_4[i] -> in2[i] }'
137             read: 1
138             write: 0
139       - type: access
140         relation: '[N, M] -> { [S_4[-1 + N] -> [1]] -> [0]; [S_4[0] -> [-1]] -> [0]
141           }'
142         read: 1
143         write: 0
144         arguments:
145         - type: access
146           relation: '[N, M] -> { S_4[i] -> in2[i] }'
147           read: 1
148           write: 0