catala/tests/test_array/good/simple.catala_en

51 lines
1.1 KiB
Plaintext

## Article
```catala
declaration scope A:
output x content collection integer
scope A:
definition x equals [0; 4+5; 8*8]
declaration scope B:
a scope A
output v content integer
output w content boolean
output y content boolean
output z content boolean
scope B:
definition v equals number of a.x
definition w equals a.x contains 64
definition y equals exists m among a.x such that m = 9
definition z equals for all m among a.x we have m > 0
```
```catala-test-inline
$ catala Interpret -s A
[RESULT] Computation successful! Results:
[RESULT] x = [ 0; 9; 64 ]
```
```catala-test-inline
$ catala Interpret -s B
[RESULT] Computation successful! Results:
[RESULT] v = 3
[RESULT] w = true
[RESULT] y = true
[RESULT] z = false
```
```catala-test-inline
$ catala Interpret_Lcalc -s A --avoid_exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] x = ESome [ ESome 0; ESome 9; ESome 64 ]
```
```catala-test-inline
$ catala Interpret_Lcalc -s B --avoid_exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] v = ESome 3
[RESULT] w = ESome true
[RESULT] y = ESome true
[RESULT] z = ESome false
```