2021-05-26 21:48:44 +03:00
|
|
|
## Article
|
|
|
|
|
|
|
|
```catala
|
|
|
|
declaration scope A:
|
2022-02-07 14:04:48 +03:00
|
|
|
output x content collection money
|
2021-05-26 21:48:44 +03:00
|
|
|
|
|
|
|
scope A:
|
|
|
|
definition x equals [$0; $4 +$ $5; $8 *$ 0.65]
|
|
|
|
|
|
|
|
declaration scope B:
|
2022-02-07 14:04:48 +03:00
|
|
|
a scope A
|
|
|
|
output max content money
|
|
|
|
output min content money
|
|
|
|
output y content money
|
|
|
|
output z content integer
|
2021-05-26 21:48:44 +03:00
|
|
|
|
|
|
|
scope B:
|
|
|
|
definition max equals maximum money initial $0 for m in a.x of m *$ 2.0
|
|
|
|
definition min equals minimum money initial $20 for m in a.x of m +$ $5
|
|
|
|
definition y equals sum money for m in a.x of (m +$ $1)
|
|
|
|
definition z equals number for m in a.x of (m >=$ $8.95)
|
|
|
|
```
|
2022-07-08 17:23:09 +03:00
|
|
|
|
|
|
|
```catala-test {id="A.Interpret"}
|
|
|
|
catala Interpret -s A
|
|
|
|
```
|
|
|
|
|
|
|
|
```catala-test {id="B.Interpret"}
|
|
|
|
catala Interpret -s B
|
|
|
|
```
|