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:
|
2022-12-07 17:37:26 +03:00
|
|
|
definition x equals [$0; $4 + $5; $8 * 0.65]
|
2021-05-26 21:48:44 +03:00
|
|
|
|
|
|
|
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:
|
2022-12-14 17:45:13 +03:00
|
|
|
definition max equals maximum of (m * 2.0) for m among a.x
|
|
|
|
or if collection empty then $0
|
|
|
|
definition min equals minimum of (m + $5) for m among a.x
|
|
|
|
or if collection empty then $20
|
|
|
|
definition y equals sum money of (m + $1) for m among a.x
|
|
|
|
definition z equals number of m among a.x such that m >= $8.95
|
2021-05-26 21:48:44 +03:00
|
|
|
```
|
2022-07-08 17:23:09 +03:00
|
|
|
|
2022-09-23 15:04:13 +03:00
|
|
|
```catala-test-inline
|
|
|
|
$ catala Interpret -s A
|
|
|
|
[RESULT] Computation successful! Results:
|
|
|
|
[RESULT] x = [$0.00; $9.00; $5.20]
|
2022-07-08 17:23:09 +03:00
|
|
|
```
|
|
|
|
|
2022-09-23 15:04:13 +03:00
|
|
|
```catala-test-inline
|
|
|
|
$ catala Interpret -s B
|
|
|
|
[RESULT] Computation successful! Results:
|
|
|
|
[RESULT] max = $18.00
|
|
|
|
[RESULT] min = $5.00
|
|
|
|
[RESULT] y = $17.20
|
|
|
|
[RESULT] z = 1
|
2022-07-08 17:23:09 +03:00
|
|
|
```
|