mirror of
https://github.com/CatalaLang/catala.git
synced 2024-09-20 00:41:05 +03:00
43 lines
904 B
Plaintext
43 lines
904 B
Plaintext
```catala
|
|
declaration scope Foo:
|
|
input current_date content date
|
|
output x content integer
|
|
|
|
scope Foo:
|
|
assertion current_date >=@ |2020-01-01| and current_date <@ |2022-12-31|
|
|
|
|
definition x under condition
|
|
current_date >=@ |2020-01-01| and current_date <=@ |2020-12-31|
|
|
consequence equals
|
|
1
|
|
|
|
definition x under condition
|
|
current_date >=@ |2021-01-01| and current_date <=@ |2021-12-31|
|
|
consequence equals
|
|
2
|
|
|
|
definition x under condition
|
|
current_date >=@ |2022-01-01| and current_date <@ |2022-12-31|
|
|
consequence equals
|
|
3
|
|
```
|
|
|
|
|
|
|
|
```catala-test-inline
|
|
$ catala Typecheck --check-invariants
|
|
┌─[RESULT]─
|
|
│ All invariant checks passed
|
|
└─
|
|
┌─[RESULT]─
|
|
│ Typechecking successful!
|
|
└─
|
|
```
|
|
|
|
```catala-test-inline
|
|
$ catala Proof --disable-counterexamples
|
|
┌─[RESULT]─
|
|
│ No errors found during the proof mode run.
|
|
└─
|
|
```
|