[breaking changes] update syntax and CLI (#546)

This commit is contained in:
Louis Gesbert 2023-12-19 16:05:51 +01:00 committed by GitHub
commit 50cb0db890
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
199 changed files with 797 additions and 843 deletions

View File

@ -204,7 +204,7 @@ module Flags = struct
let message_format =
value
& opt (enum message_format_opt) Human
& info ["message_format"]
& info ["message-format"]
~doc:
"Selects the format of error and warning messages emitted by the \
compiler. If set to $(i,human), the messages will be nicely \
@ -241,14 +241,14 @@ module Flags = struct
let disable_warnings =
value
& flag
& info ["disable_warnings"]
& info ["disable-warnings"]
~doc:"Disable all the warnings emitted by the compiler."
let max_prec_digits =
value
& opt int 20
& info
["p"; "max_digits_printed"]
["p"; "max-digits-printed"]
~docv:"NUM"
~doc:
"Maximum number of significant digits printed for decimal results."
@ -340,7 +340,7 @@ module Flags = struct
let check_invariants =
value
& flag
& info ["check_invariants"] ~doc:"Check structural invariants on the AST."
& info ["check-invariants"] ~doc:"Check structural invariants on the AST."
let no_typing =
value
@ -356,7 +356,7 @@ module Flags = struct
let print_only_law =
value
& flag
& info ["print_only_law"]
& info ["print-only-law"]
~doc:
"In literate programming output, skip all code and metadata sections \
and print only the text of the law."
@ -392,13 +392,13 @@ module Flags = struct
let avoid_exceptions =
value
& flag
& info ["avoid_exceptions"]
& info ["avoid-exceptions"]
~doc:"Compiles the default calculus without exceptions."
let closure_conversion =
value
& flag
& info ["closure_conversion"]
& info ["closure-conversion"]
~doc:
"Performs closure conversion on the lambda calculus. Implies \
$(b,--avoid-exceptions)."
@ -407,7 +407,7 @@ module Flags = struct
value
& flag
& info
["disable_counterexamples"]
["disable-counterexamples"]
~doc:
"Disables the search for counterexamples. Useful when you want a \
deterministic output from the Catala compiler, since provers can \

View File

@ -211,7 +211,7 @@ module Passes = struct
raise
(Message.raise_internal_error "Some Dcalc invariants are invalid")
| _ ->
Message.raise_error "--check_invariants cannot be used with --no-typing");
Message.raise_error "--check-invariants cannot be used with --no-typing");
prg, type_ordering
let lcalc
@ -229,12 +229,12 @@ module Passes = struct
in
debug_pass_name "lcalc";
let avoid_exceptions = avoid_exceptions || closure_conversion in
(* --closure_conversion implies --avoid_exceptions *)
(* --closure-conversion implies --avoid-exceptions *)
let prg =
match avoid_exceptions, options.trace, typed with
| true, true, _ ->
Message.raise_error
"Option --avoid_exceptions is not compatible with option --trace"
"Option --avoid-exceptions is not compatible with option --trace"
| true, _, Untyped _ ->
Program.untype
(Lcalc.Compile_without_exceptions.translate_program

View File

@ -162,8 +162,7 @@ let rec typ_gen
(typ ~colors:(List.tl colors))
t2
| TArray t1 ->
Format.fprintf fmt "@[<hov 2>%a@ %a@]" base_type "collection" (typ ~colors)
t1
Format.fprintf fmt "@[<hov 2>%a@ %a@]" base_type "list of" (typ ~colors) t1
| TDefault t1 ->
punctuation fmt "";
typ ~colors fmt t1;

View File

@ -157,9 +157,8 @@ let rec format_typ
")" (format_typ ~colors) t2
| TArray t1 -> (
match Mark.remove (UnionFind.get (UnionFind.find t1)) with
| TAny _ when not Cli.globals.debug ->
Format.pp_print_string fmt "collection"
| _ -> Format.fprintf fmt "@[collection@ %a@]" (format_typ ~colors) t1)
| TAny _ when not Cli.globals.debug -> Format.pp_print_string fmt "list"
| _ -> Format.fprintf fmt "@[list of@ %a@]" (format_typ ~colors) t1)
| TDefault t1 ->
Format.pp_print_as fmt 1 "";
format_typ ~colors fmt t1;

View File

@ -56,8 +56,8 @@ module R = Re.Pcre
#ifndef MR_OF
#define MR_OF MS_OF
#endif
#ifndef MR_COLLECTION
#define MR_COLLECTION MS_COLLECTION
#ifndef MR_LIST
#define MR_LIST MS_LIST
#endif
#ifndef MR_CONTAINS
#define MR_CONTAINS MS_CONTAINS
@ -203,8 +203,8 @@ module R = Re.Pcre
#ifndef MR_IS
#define MR_IS MS_IS
#endif
#ifndef MR_EMPTY
#define MR_EMPTY MS_EMPTY
#ifndef MR_LIST_EMPTY
#define MR_LIST_EMPTY MS_LIST_EMPTY
#endif
#ifndef MR_CARDINAL
#define MR_CARDINAL MS_CARDINAL
@ -266,7 +266,7 @@ let token_list : (string * token) list =
(MS_DECREASING, DECREASING);
(MS_INCREASING, INCREASING);
(MS_OF, OF);
(MS_COLLECTION, COLLECTION);
(MS_LIST, LIST);
(MS_CONTAINS, CONTAINS);
(MS_ENUM, ENUM);
(MS_INTEGER, INTEGER);
@ -315,7 +315,7 @@ let token_list : (string * token) list =
(MS_MAXIMUM, MAXIMUM);
(MS_MINIMUM, MINIMUM);
(MS_IS, IS);
(MS_EMPTY, EMPTY);
(MS_LIST_EMPTY, LIST_EMPTY);
(MS_CARDINAL, CARDINAL);
(MS_YEAR, YEAR);
(MS_MONTH, MONTH);
@ -417,9 +417,9 @@ let rec lex_code (lexbuf : lexbuf) : token =
| MR_OF ->
L.update_acc lexbuf;
OF
| MR_COLLECTION ->
| MR_LIST ->
L.update_acc lexbuf;
COLLECTION
LIST
| MR_CONTAINS ->
L.update_acc lexbuf;
CONTAINS
@ -567,9 +567,9 @@ let rec lex_code (lexbuf : lexbuf) : token =
| MR_IS ->
L.update_acc lexbuf;
IS
| MR_EMPTY ->
| MR_LIST_EMPTY ->
L.update_acc lexbuf;
EMPTY
LIST_EMPTY
| MR_CARDINAL ->
L.update_acc lexbuf;
CARDINAL

View File

@ -28,7 +28,8 @@
#define MS_DECREASING "decreasing"
#define MS_INCREASING "increasing"
#define MS_OF "of"
#define MS_COLLECTION "collection"
#define MS_LIST "list of"
#define MR_LIST "list", space_plus, "of"
#define MS_CONTAINS "contains"
#define MS_ENUM "enumeration"
#define MS_INTEGER "integer"
@ -80,7 +81,8 @@
#define MS_MAXIMUM "maximum"
#define MS_MINIMUM "minimum"
#define MS_IS "is"
#define MS_EMPTY "empty"
#define MS_LIST_EMPTY "list empty"
#define MR_LIST_EMPTY "list", space_plus, "empty"
#define MS_CARDINAL "number"
#define MS_YEAR "year"
#define MS_MONTH "month"

View File

@ -36,7 +36,8 @@
#define MR_DECREASING "d", 0xE9, "croissant"
#define MS_INCREASING "croissant"
#define MS_OF "de"
#define MS_COLLECTION "collection"
#define MS_LIST "liste de"
#define MR_LIST "liste", space_plus, "de"
#define MS_CONTAINS "contient"
#define MS_ENUM "énumération"
#define MR_ENUM 0xE9, "num", 0xE9, "ration"
@ -100,7 +101,8 @@
#define MS_MAXIMUM "maximum"
#define MS_MINIMUM "minimum"
#define MS_IS "est"
#define MS_EMPTY "vide"
#define MS_LIST_EMPTY "liste vide"
#define MR_LIST_EMPTY "liste", space_plus, "vide"
#define MS_CARDINAL "nombre"
#define MS_YEAR "an"
#define MS_MONTH "mois"

View File

@ -30,7 +30,7 @@
#define MS_INCREASING "rosnący"
#define MR_INCREASING "rosn", 0x0105, "cy"
#define MS_OF "z"
#define MS_COLLECTION "kolekcja"
#define MS_LIST "lista"
#define MS_CONTAINS "zawiera"
#define MS_ENUM "enumeracja"
#define MS_INTEGER "całkowita"
@ -93,7 +93,8 @@
#define MS_MAXIMUM "maksimum"
#define MS_MINIMUM "minimum"
#define MS_IS "jest"
#define MS_EMPTY "pusty"
#define MS_LIST_EMPTY "lista pusta"
#define MR_LIST_EMPTY "lista", space_plus, "pusta"
#define MS_CARDINAL "liczba"
#define MS_YEAR "rok"
#define MS_MONTH "miesiąc"

File diff suppressed because it is too large Load Diff

View File

@ -119,7 +119,7 @@ let primitive_typ :=
let typ_data :=
| t = primitive_typ ; <Primitive>
| COLLECTION ; t = addpos(typ_data) ; <Collection>
| LIST ; t = addpos(typ_data) ; <Collection>
let typ == t = typ_data ; <Data>
@ -213,7 +213,7 @@ let naked_expression ==
} %prec apply
| max = minmax ;
OF ; coll = expression ;
OR ; IF ; COLLECTION ; EMPTY ; THEN ;
OR ; IF ; LIST_EMPTY ; THEN ;
default = expression ; {
CollectionOp (AggregateExtremum { max; default }, coll)
} %prec apply
@ -265,7 +265,7 @@ let naked_expression ==
AMONG ; coll = expression ;
SUCH ; THAT ; f = expression ;
IS ; max = minmax ;
OR ; IF ; COLLECTION ; EMPTY ; THEN ; default = expression ; {
OR ; IF ; LIST_EMPTY ; THEN ; default = expression ; {
CollectionOp (AggregateArgExtremum { max; default; f = i, f }, coll)
} %prec top_expr

View File

@ -38,7 +38,7 @@
%token<string * string> MONEY_AMOUNT
%token BEGIN_CODE TEXT
%token COLON ALT DATA
%token OF INTEGER COLLECTION CONTAINS AMONG
%token OF INTEGER LIST CONTAINS AMONG
%token RULE CONDITION DEFINED_AS
%token<Ast.op_kind> LESSER GREATER LESSER_EQUAL GREATER_EQUAL
%token LET EXISTS IN SUCH THAT COMMA
@ -55,6 +55,6 @@
%token BEGIN_METADATA MONEY DECIMAL
%token UNDER_CONDITION CONSEQUENCE LBRACE RBRACE
%token LABEL EXCEPTION LBRACKET RBRACKET SEMICOLON
%token MAXIMUM MINIMUM IS EMPTY
%token MAXIMUM MINIMUM IS LIST_EMPTY
%%

View File

@ -273,7 +273,7 @@
\end{catala}
& \begin{catala}
```catala
collection integer
list of integer
```
\end{catala}
@ -632,7 +632,7 @@
\\
\end{tabular}
\section{Collection operations}
\section{List operations}
\begin{tabular}{@{}p{\cola}>{\slshape}p{\colb}@{}}
\begin{catala}
@ -709,7 +709,7 @@
\begin{catala}
```catala
maximum of coll
or if collection empty then -1
or if list empty then -1
```
\end{catala}
& Extremum
@ -718,7 +718,7 @@
```catala
x among coll
such that (x * x) is minimum
or if collection empty then -1
or if list empty then -1
```
\end{catala}
& Arg-extremum

View File

@ -273,7 +273,7 @@
\end{catala}
& \begin{catala}
```catala
collection entier
liste de entier
```
\end{catala}
@ -631,7 +631,7 @@
\\
\end{tabular}
\section{Opérations sur les collections}
\section{Opérations sur les listes}
\begin{tabular}{@{}p{\cola}>{\slshape}p{\colb}@{}}
\begin{catala}
@ -693,10 +693,10 @@
\\
\begin{catala}
```catala
somme entier coll
somme entier de coll
```
\end{catala}
& Aggrégation
& Agrégation
\\
\begin{catala}
```catala
@ -708,7 +708,7 @@
\begin{catala}
```catala
maximum de coll
ou si collection vide alors -1
ou si liste vide alors -1
```
\end{catala}
& Extremums
@ -717,7 +717,7 @@
```catala
x parmi coll
tel que (x * x) est minimum
ou si collection vide alors -1
ou si liste vide alors -1
```
\end{catala}
& Élément selon extremum

View File

@ -216,9 +216,9 @@ déclaration énumération DateNaissanceTroisièmeOuDernierPlusEnfant:
-- PlusDeTroisEnfants contenu DateDeNaissanceOuMoisDeGrossesse
déclaration structure Ménage:
donnée prestations_reçues contenu collection PrestationReçue
donnée prestations_reçues contenu liste de PrestationReçue
donnée logement contenu Logement
donnée personnes_à_charge contenu collection PersonneÀCharge
donnée personnes_à_charge contenu liste de PersonneÀCharge
donnée nombre_autres_occupants_logement contenu entier
donnée situation_familiale contenu SituationFamiliale
donnée condition_rattaché_foyer_fiscal_parent_ifi contenu booléen
@ -311,7 +311,7 @@ déclaration champ d'application ÉligibilitéAidesPersonnelleLogement:
interne prise_en_compte_personne_à_charge condition
dépend de personne_à_charge contenu PersonneÀCharge
interne personnes_à_charge_prises_en_compte
contenu collection PersonneÀCharge
contenu liste de PersonneÀCharge
contexte date_entrée_vigueur_différée_cch contenu date
interne nombre_personnes_logement contenu entier
@ -330,7 +330,7 @@ déclaration champ d'application ÉligibilitéAidesPersonnelleLogement:
résultat éligibilité condition
résultat nombre_personnes_à_charge_prises_en_compte contenu entier
résultat coefficents_enfants_garde_alternée_pris_en_compte contenu
collection décimal
liste de décimal
résultat condition_2_r823_4 condition
dépend de personne_à_charge contenu PersonneÀCharge
@ -388,7 +388,7 @@ déclaration champ d'application ÉligibilitéAidePersonnaliséeLogement:
résultat éligibilité condition
résultat nombre_personnes_à_charge_prises_en_compte contenu entier
résultat coefficents_enfants_garde_alternée_pris_en_compte contenu
collection décimal
liste de décimal
champ d'application ÉligibilitéAidePersonnaliséeLogement:
@ -437,7 +437,7 @@ déclaration champ d'application ÉligibilitéAllocationLogement:
état l841_2
résultat nombre_personnes_à_charge_prises_en_compte contenu entier
résultat coefficents_enfants_garde_alternée_pris_en_compte contenu
collection décimal
liste de décimal
champ d'application ÉligibilitéAllocationLogement:
# Ici nous instancions le champ d'application d'éligibilité aux prestations
@ -608,9 +608,9 @@ déclaration champ d'application CalculÉquivalenceLoyerMinimale:
entrée condition_2_du_832_25 contenu booléen
entrée n_nombre_parts_d832_25 contenu décimal
interne tranches_revenus_d832_26 contenu collection TrancheRevenu
interne tranches_revenus_d832_26 contenu liste de TrancheRevenu
interne tranches_revenus_d832_26_multipliées contenu
collection TrancheRevenuDécimal
liste de TrancheRevenuDécimal
interne montant_forfaitaire_d832_26 contenu argent
résultat montant contenu argent
@ -1137,7 +1137,7 @@ déclaration champ d'application CalculetteAidesAuLogement:
résultat traitement_aide_finale contenu argent
dépend de aide_finale contenu argent
résultat coefficents_enfants_garde_alternée_pris_en_compte contenu
collection décimal
liste de décimal
champ d'application CalculetteAidesAuLogement:
définition éligibilité_aide_personnalisée_logement.ménage égal à
@ -1205,7 +1205,7 @@ déclaration champ d'application CalculetteAidesAuLogementGardeAlternée:
interne ménage_sans_enfants_garde_alternée contenu Ménage
interne coefficents_enfants_garde_alternée_pris_en_compte contenu
collection décimal
liste de décimal
calculette champ d'application CalculetteAidesAuLogement
calculette_sans_garde_alternée champ d'application CalculetteAidesAuLogement

View File

@ -73,7 +73,7 @@ champ d'application Exemple2:
```
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [29344/29344]
@ -102,7 +102,7 @@ $ catala Interpret -s Exemple1
```
```catala-test-inline
$ catala Interpret_Lcalc -s Exemple1 --avoid_exceptions
$ catala Interpret_Lcalc -s Exemple1 --avoid-exceptions
[RESULT] Computation successful! Results:
[RESULT] montant = 96,48 €
```
@ -114,7 +114,7 @@ $ catala Interpret -s Exemple2
```
```catala-test-inline
$ catala Interpret_lcalc -s Exemple2 --avoid_exceptions
$ catala Interpret_lcalc -s Exemple2 --avoid-exceptions
[RESULT] Computation successful! Results:
[RESULT] montant = 85,00 €
```

View File

@ -126,7 +126,7 @@ champ d'application Exemple4 :
```
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [29687/29687]
@ -149,49 +149,49 @@ Invariant Dcalc__Invariants.invariant_default_no_arrow
```
```catala-test-inline
$ catala Interpret -s Exemple1 --disable_warnings
$ catala Interpret -s Exemple1 --disable-warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 345,73 €
```
```catala-test-inline
$ catala Interpret -s Exemple2 --disable_warnings
$ catala Interpret -s Exemple2 --disable-warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 352,77 €
```
```catala-test-inline
$ catala Interpret_Lcalc -s Exemple1 --avoid_exceptions
$ catala Interpret_Lcalc -s Exemple1 --avoid-exceptions
[RESULT] Computation successful! Results:
[RESULT] montant = 345,73 €
```
```catala-test-inline
$ catala Interpret_Lcalc -s Exemple2 --avoid_exceptions
$ catala Interpret_Lcalc -s Exemple2 --avoid-exceptions
[RESULT] Computation successful! Results:
[RESULT] montant = 352,77 €
```
```catala-test-inline
$ catala Interpret -s Exemple3 --disable_warnings
$ catala Interpret -s Exemple3 --disable-warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 339,70 €
```
```catala-test-inline
$ catala Interpret -s Exemple4 --disable_warnings
$ catala Interpret -s Exemple4 --disable-warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 230,63 €
```
```catala-test-inline
$ catala Interpret_lcalc -s Exemple3 --disable_warnings --avoid_exceptions
$ catala Interpret_lcalc -s Exemple3 --disable-warnings --avoid-exceptions
[RESULT] Computation successful! Results:
[RESULT] montant = 339,70 €
```
```catala-test-inline
$ catala Interpret_lcalc -s Exemple4 --disable_warnings --avoid_exceptions
$ catala Interpret_lcalc -s Exemple4 --disable-warnings --avoid-exceptions
[RESULT] Computation successful! Results:
[RESULT] montant = 230,63 €
```

View File

@ -32,7 +32,7 @@ champ d'application CasTest1:
```
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [29117/29117]
@ -55,12 +55,12 @@ Invariant Dcalc__Invariants.invariant_default_no_arrow
```
```catala-test-inline
$ catala Interpret -s CasTest1 --disable_warnings
$ catala Interpret -s CasTest1 --disable-warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 76,38 €
```
```catala-test-inline
$ catala Interpret_Lcalc -s CasTest1 --avoid_exceptions
$ catala Interpret_Lcalc -s CasTest1 --avoid-exceptions
[RESULT] Computation successful! Results:
[RESULT] montant = 76,38 €
```

View File

@ -148,46 +148,46 @@ champ d'application Exemple4:
```
```catala-test-inline
$ catala Interpret -s Exemple1 --disable_warnings
$ catala Interpret -s Exemple1 --disable-warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 181,91 €
```
```catala-test-inline
$ catala Interpret -s Exemple2 --disable_warnings
$ catala Interpret -s Exemple2 --disable-warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 67,34 €
```
```catala-test-inline
$ catala Interpret -s Exemple3 --disable_warnings
$ catala Interpret -s Exemple3 --disable-warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 181,91 €
```
```catala-test-inline
$ catala Interpret -s Exemple4 --disable_warnings
$ catala Interpret -s Exemple4 --disable-warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 118,59 €
```
```catala-test-inline
$ catala Interpret_Lcalc -s Exemple1 --avoid_exceptions
$ catala Interpret_Lcalc -s Exemple1 --avoid-exceptions
[RESULT] Computation successful! Results:
[RESULT] montant = 181,91 €
```
```catala-test-inline
$ catala Interpret_Lcalc -s Exemple2 --avoid_exceptions
$ catala Interpret_Lcalc -s Exemple2 --avoid-exceptions
[RESULT] Computation successful! Results:
[RESULT] montant = 67,34 €
```
```catala-test-inline
$ catala Interpret_Lcalc -s Exemple3 --avoid_exceptions
$ catala Interpret_Lcalc -s Exemple3 --avoid-exceptions
[RESULT] Computation successful! Results:
[RESULT] montant = 181,91 €
```
```catala-test-inline
$ catala Interpret_Lcalc -s Exemple4 --avoid_exceptions
$ catala Interpret_Lcalc -s Exemple4 --avoid-exceptions
[RESULT] Computation successful! Results:
[RESULT] montant = 118,59 €
```

View File

@ -279,100 +279,100 @@ champ d'application Exemple9:
```
```catala-test-inline
$ catala Interpret -s Exemple1 --disable_warnings
$ catala Interpret -s Exemple1 --disable-warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 0,00 €
```
```catala-test-inline
$ catala Interpret -s Exemple2 --disable_warnings
$ catala Interpret -s Exemple2 --disable-warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 352,77 €
```
```catala-test-inline
$ catala Interpret -s Exemple3 --disable_warnings
$ catala Interpret -s Exemple3 --disable-warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 321,61 €
```
```catala-test-inline
$ catala Interpret -s Exemple4 --disable_warnings
$ catala Interpret -s Exemple4 --disable-warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 0,00 €
```
```catala-test-inline
$ catala Interpret -s Exemple5 --disable_warnings
$ catala Interpret -s Exemple5 --disable-warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 311,56 €
```
```catala-test-inline
$ catala Interpret -s Exemple6 --disable_warnings
$ catala Interpret -s Exemple6 --disable-warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 0,00 €
```
```catala-test-inline
$ catala Interpret -s Exemple7 --disable_warnings
$ catala Interpret -s Exemple7 --disable-warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 153,77 €
```
```catala-test-inline
$ catala Interpret -s Exemple8 --disable_warnings
$ catala Interpret -s Exemple8 --disable-warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 11,06 €
```
```catala-test-inline
$ catala Interpret -s Exemple9 --disable_warnings
$ catala Interpret -s Exemple9 --disable-warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 210,06 €
```
```catala-test-inline
$ catala Interpret_Lcalc -s Exemple1 --avoid_exceptions
$ catala Interpret_Lcalc -s Exemple1 --avoid-exceptions
[RESULT] Computation successful! Results:
[RESULT] montant = 0,00 €
```
```catala-test-inline
$ catala Interpret_Lcalc -s Exemple2 --avoid_exceptions
$ catala Interpret_Lcalc -s Exemple2 --avoid-exceptions
[RESULT] Computation successful! Results:
[RESULT] montant = 352,77 €
```
```catala-test-inline
$ catala Interpret_Lcalc -s Exemple3 --avoid_exceptions
$ catala Interpret_Lcalc -s Exemple3 --avoid-exceptions
[RESULT] Computation successful! Results:
[RESULT] montant = 321,61 €
```
```catala-test-inline
$ catala Interpret_Lcalc -s Exemple4 --avoid_exceptions
$ catala Interpret_Lcalc -s Exemple4 --avoid-exceptions
[RESULT] Computation successful! Results:
[RESULT] montant = 0,00 €
```
```catala-test-inline
$ catala Interpret_Lcalc -s Exemple5 --avoid_exceptions
$ catala Interpret_Lcalc -s Exemple5 --avoid-exceptions
[RESULT] Computation successful! Results:
[RESULT] montant = 311,56 €
```
```catala-test-inline
$ catala Interpret_Lcalc -s Exemple6 --avoid_exceptions
$ catala Interpret_Lcalc -s Exemple6 --avoid-exceptions
[RESULT] Computation successful! Results:
[RESULT] montant = 0,00 €
```
```catala-test-inline
$ catala Interpret_Lcalc -s Exemple7 --avoid_exceptions
$ catala Interpret_Lcalc -s Exemple7 --avoid-exceptions
[RESULT] Computation successful! Results:
[RESULT] montant = 153,77 €
```
```catala-test-inline
$ catala Interpret_Lcalc -s Exemple8 --avoid_exceptions
$ catala Interpret_Lcalc -s Exemple8 --avoid-exceptions
[RESULT] Computation successful! Results:
[RESULT] montant = 11,06 €
```
```catala-test-inline
$ catala Interpret_Lcalc -s Exemple9 --avoid_exceptions
$ catala Interpret_Lcalc -s Exemple9 --avoid-exceptions
[RESULT] Computation successful! Results:
[RESULT] montant = 210,06 €
```

View File

@ -137,56 +137,56 @@ champ d'application CasTest5:
```
```catala-test-inline
$ catala Interpret -s CasTest1 --disable_warnings
$ catala Interpret -s CasTest1 --disable-warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 12,06 €
```
```catala-test-inline
$ catala Interpret -s CasTest2 --disable_warnings
$ catala Interpret -s CasTest2 --disable-warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 23,12 €
```
```catala-test-inline
$ catala Interpret -s CasTest3 --disable_warnings
$ catala Interpret -s CasTest3 --disable-warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 154,78 €
```
```catala-test-inline
$ catala Interpret -s CasTest4 --disable_warnings
$ catala Interpret -s CasTest4 --disable-warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 154,78 €
```
```catala-test-inline
$ catala Interpret -s CasTest5 --disable_warnings
$ catala Interpret -s CasTest5 --disable-warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 129,65 €
```
```catala-test-inline
$ catala Interpret_Lcalc -s CasTest1 --avoid_exceptions
$ catala Interpret_Lcalc -s CasTest1 --avoid-exceptions
[RESULT] Computation successful! Results:
[RESULT] montant = 12,06 €
```
```catala-test-inline
$ catala Interpret_Lcalc -s CasTest2 --avoid_exceptions
$ catala Interpret_Lcalc -s CasTest2 --avoid-exceptions
[RESULT] Computation successful! Results:
[RESULT] montant = 23,12 €
```
```catala-test-inline
$ catala Interpret_Lcalc -s CasTest3 --avoid_exceptions
$ catala Interpret_Lcalc -s CasTest3 --avoid-exceptions
[RESULT] Computation successful! Results:
[RESULT] montant = 154,78 €
```
```catala-test-inline
$ catala Interpret_Lcalc -s CasTest4 --avoid_exceptions
$ catala Interpret_Lcalc -s CasTest4 --avoid-exceptions
[RESULT] Computation successful! Results:
[RESULT] montant = 154,78 €
```
```catala-test-inline
$ catala Interpret_Lcalc -s CasTest5 --avoid_exceptions
$ catala Interpret_Lcalc -s CasTest5 --avoid-exceptions
[RESULT] Computation successful! Results:
[RESULT] montant = 129,65 €
```

View File

@ -162,14 +162,14 @@ $ catala Interpret -s Exemple1
[RESULT] éligibilité = vrai
```
```catala-test-inline
$ catala Interpret_Lcalc -s Exemple1 --avoid_exceptions
$ catala Interpret_Lcalc -s Exemple1 --avoid-exceptions
[RESULT] Computation successful! Results:
[RESULT] montant_versé = 246,23 €
[RESULT] éligibilité = vrai
```
```catala-test-inline
$ catala Interpret_Lcalc -s Exemple1 --avoid_exceptions -O --closure_conversion
$ catala Interpret_Lcalc -s Exemple1 --avoid-exceptions -O --closure-conversion
[RESULT] Computation successful! Results:
[RESULT] montant_versé = 246,23 €
[RESULT] éligibilité = vrai
@ -183,14 +183,14 @@ $ catala Interpret -s Exemple2
```
```catala-test-inline
$ catala Interpret_lcalc -s Exemple2 --avoid_exceptions
$ catala Interpret_lcalc -s Exemple2 --avoid-exceptions
[RESULT] Computation successful! Results:
[RESULT] montant_versé = 230,63 €
[RESULT] éligibilité = vrai
```
```catala-test-inline
$ catala Interpret_lcalc -s Exemple2 -O --avoid_exceptions --closure_conversion
$ catala Interpret_lcalc -s Exemple2 -O --avoid-exceptions --closure-conversion
[RESULT] Computation successful! Results:
[RESULT] montant_versé = 230,63 €
[RESULT] éligibilité = vrai

View File

@ -213,39 +213,39 @@ champ d'application Exemple3 :
```
```catala-test-inline
$ catala Interpret -s Exemple1 --disable_warnings
$ catala Interpret -s Exemple1 --disable-warnings
[RESULT] Computation successful! Results:
[RESULT] éligible = vrai
```
```catala-test-inline
$ catala Interpret_Lcalc -s Exemple1 --avoid_exceptions
$ catala Interpret_Lcalc -s Exemple1 --avoid-exceptions
[RESULT] Computation successful! Results:
[RESULT] éligible = vrai
```
```catala-test-inline
$ catala Interpret -s Exemple2 --disable_warnings
$ catala Interpret -s Exemple2 --disable-warnings
[RESULT] Computation successful! Results:
[RESULT] éligible = AllocationLogementFamiliale ()
```
```catala-test-inline
$ catala Interpret_Lcalc -s Exemple2 --avoid_exceptions
$ catala Interpret_Lcalc -s Exemple2 --avoid-exceptions
[RESULT] Computation successful! Results:
[RESULT] éligible = AllocationLogementFamiliale ()
```
```catala-test-inline
$ catala Interpret -s Exemple3 --disable_warnings
$ catala Interpret -s Exemple3 --disable-warnings
[RESULT] Computation successful! Results:
[RESULT] éligible = AllocationLogementFamiliale ()
```
```catala-test-inline
$ catala Interpret_Lcalc -s Exemple3 --avoid_exceptions
$ catala Interpret_Lcalc -s Exemple3 --avoid-exceptions
[RESULT] Computation successful! Results:
[RESULT] éligible = AllocationLogementFamiliale ()
```

View File

@ -4,7 +4,7 @@
# Ce fichier est uniquement là pour vérifier que les invariants structurels sont bien garanties par les differences phases de compilation.
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [28966/28966]

View File

@ -12,7 +12,7 @@ champ d'application EnfantLePlusÂgé:
définition le_plus_âgé égal à
potentiel_plus_âgé parmi enfants tel que
potentiel_plus_âgé.date_de_naissance est minimum
ou si collection vide alors Enfant {
ou si liste vide alors Enfant {
-- identifiant: -1
-- obligation_scolaire: Pendant
-- rémuneration_mensuelle: 0€
@ -72,8 +72,8 @@ déclaration structure EnfantEntrée:
déclaration champ d'application InterfaceAllocationsFamiliales:
entrée i_date_courante contenu date
entrée i_enfants contenu collection EnfantEntrée
interne enfants_à_charge contenu collection Enfant
entrée i_enfants contenu liste de EnfantEntrée
interne enfants_à_charge contenu liste de Enfant
allocations_familiales champ d'application AllocationsFamiliales
entrée i_ressources_ménage contenu argent
entrée i_résidence contenu Collectivité
@ -137,4 +137,4 @@ champ d'application InterfaceAllocationsFamiliales:
NOTA :
Conformément à l'article 63 de la loi n° 2019-791 du 26 juillet 2019, ces
dispositions entrent en vigueur à la rentrée scolaire 2019.
dispositions entrent en vigueur à la rentrée scolaire 2019.

View File

@ -65,7 +65,7 @@ déclaration champ d'application AllocationFamilialesAvril2008:
résultat âge_minimum_alinéa_1_l521_3 contenu durée
déclaration champ d'application EnfantLePlusÂgé:
entrée enfants contenu collection Enfant
entrée enfants contenu liste de Enfant
résultat le_plus_âgé contenu Enfant
déclaration champ d'application AllocationsFamiliales:
@ -80,9 +80,9 @@ déclaration champ d'application AllocationsFamiliales:
entrée date_courante contenu date
# Variables concernant les enfants du ménage
entrée enfants_à_charge contenu collection Enfant
entrée enfants_à_charge contenu liste de Enfant
interne enfants_à_charge_droit_ouvert_prestation_familiale
contenu collection Enfant
contenu liste de Enfant
interne prise_en_compte contenu PriseEnCompte dépend de enfant contenu Enfant
résultat versement contenu VersementAllocations
dépend de enfant contenu Enfant

View File

@ -4,7 +4,7 @@
# Ce fichier est uniquement là pour vérifier que les invariants structurels sont bien garanties par les differences phases de compilation.
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [3971/3971]

View File

@ -354,127 +354,127 @@ $ catala Typecheck
```
```catala-test-inline
$ catala Interpret -s Test1 --disable_warnings
$ catala Interpret -s Test1 --disable-warnings
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret -s Test2 --disable_warnings
$ catala Interpret -s Test2 --disable-warnings
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret -s Test3 --disable_warnings
$ catala Interpret -s Test3 --disable-warnings
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret -s Test4 --disable_warnings
$ catala Interpret -s Test4 --disable-warnings
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret -s Test5 --disable_warnings
$ catala Interpret -s Test5 --disable-warnings
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret -s Test6 --disable_warnings
$ catala Interpret -s Test6 --disable-warnings
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret -s Test7 --disable_warnings
$ catala Interpret -s Test7 --disable-warnings
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret -s Test8 --disable_warnings
$ catala Interpret -s Test8 --disable-warnings
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret -s Test9 --disable_warnings
$ catala Interpret -s Test9 --disable-warnings
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret -s Test10 --disable_warnings
$ catala Interpret -s Test10 --disable-warnings
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret -s Test11 --disable_warnings
$ catala Interpret -s Test11 --disable-warnings
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret -s Test12 --disable_warnings
$ catala Interpret -s Test12 --disable-warnings
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret -s Test13 --disable_warnings
$ catala Interpret -s Test13 --disable-warnings
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret -s Test13 --disable_warnings
$ catala Interpret -s Test13 --disable-warnings
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret_Lcalc -s Test1 --avoid_exceptions
$ catala Interpret_Lcalc -s Test1 --avoid-exceptions
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret_Lcalc -s Test2 --avoid_exceptions
$ catala Interpret_Lcalc -s Test2 --avoid-exceptions
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret_Lcalc -s Test3 --avoid_exceptions
$ catala Interpret_Lcalc -s Test3 --avoid-exceptions
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret_Lcalc -s Test4 --avoid_exceptions
$ catala Interpret_Lcalc -s Test4 --avoid-exceptions
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret_Lcalc -s Test5 --avoid_exceptions
$ catala Interpret_Lcalc -s Test5 --avoid-exceptions
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret_Lcalc -s Test6 --avoid_exceptions
$ catala Interpret_Lcalc -s Test6 --avoid-exceptions
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret_Lcalc -s Test7 --avoid_exceptions
$ catala Interpret_Lcalc -s Test7 --avoid-exceptions
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret_Lcalc -s Test8 --avoid_exceptions
$ catala Interpret_Lcalc -s Test8 --avoid-exceptions
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret_Lcalc -s Test9 --avoid_exceptions
$ catala Interpret_Lcalc -s Test9 --avoid-exceptions
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret_Lcalc -s Test10 --avoid_exceptions
$ catala Interpret_Lcalc -s Test10 --avoid-exceptions
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret_Lcalc -s Test11 --avoid_exceptions
$ catala Interpret_Lcalc -s Test11 --avoid-exceptions
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret_Lcalc -s Test12 --avoid_exceptions
$ catala Interpret_Lcalc -s Test12 --avoid-exceptions
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret_Lcalc -s Test13 --avoid_exceptions
$ catala Interpret_Lcalc -s Test13 --avoid-exceptions
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret_Lcalc -s Test13 --avoid_exceptions
$ catala Interpret_Lcalc -s Test13 --avoid-exceptions
[RESULT] Computation successful!
```

View File

@ -61,10 +61,10 @@ champ d'application Test1:
```
```catala-test-inline
$ catala Interpret -s Test1 --disable_warnings
$ catala Interpret -s Test1 --disable-warnings
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret_Lcalc -s Test1 --avoid_exceptions
$ catala Interpret_Lcalc -s Test1 --avoid-exceptions
[RESULT] Computation successful!
```

View File

@ -31,14 +31,14 @@ déclaration structure BienUsufruitRenteViagère:
déclaration champ d'application RéserveHéréditaire:
résultat quotité_réserve_héréditaire contenu décimal
entrée enfants contenu collection Enfant
entrée enfants contenu liste de Enfant
interne enfant_pris_en_compte_réserve_héréditaire contenu booléen
dépend de enfant contenu Enfant
interne enfants_réserve_héréditaire contenu collection Enfant
interne enfants_réserve_héréditaire contenu liste de Enfant
entrée conjoint_survivant_non_divorcé condition
entrée patrimoine_total contenu argent
entrée biens_usufruit_rente_viagère contenu collection BienUsufruitRenteViagère
entrée biens_usufruit_rente_viagère contenu liste de BienUsufruitRenteViagère
résultat patrimoine_assiette_réserve_héréditaire contenu argent
résultat montant_réserve_héréditaire contenu argent
```

View File

@ -23,11 +23,11 @@ zakres Test_A7_U1_P1_PPb:
```
```catala-test-inline
$ catala Interpret -s Test_A7_U1_P1_PPa --disable_warnings
$ catala Interpret -s Test_A7_U1_P1_PPa --disable-warnings
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret -s Test_A7_U1_P1_PPb --disable_warnings
$ catala Interpret -s Test_A7_U1_P1_PPb --disable-warnings
[RESULT] Computation successful!
```

View File

@ -23,11 +23,11 @@ zakres Test_A7_U1_P2_PPb:
```
```catala-test-inline
$ catala Interpret -s Test_A7_U1_P2_PPa --disable_warnings
$ catala Interpret -s Test_A7_U1_P2_PPa --disable-warnings
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret -s Test_A7_U1_P2_PPb --disable_warnings
$ catala Interpret -s Test_A7_U1_P2_PPb --disable-warnings
[RESULT] Computation successful!
```

View File

@ -12,6 +12,6 @@ zakres Test_A7_U1_P3:
asercja sprzedaż.podatek = 1 PLN
```
```catala-test-inline
$ catala Interpret -s Test_A7_U1_P3 --disable_warnings
$ catala Interpret -s Test_A7_U1_P3 --disable-warnings
[RESULT] Computation successful!
```

View File

@ -12,6 +12,6 @@ zakres Test_A7_U1_P4:
asercja sprzedaż.podatek = 1 PLN
```
```catala-test-inline
$ catala Interpret -s Test_A7_U1_P4 --disable_warnings
$ catala Interpret -s Test_A7_U1_P4 --disable-warnings
[RESULT] Computation successful!
```

View File

@ -12,6 +12,6 @@ zakres Test_A7_U1_P7:
asercja sprzedaż.podatek = 1 PLN
```
```catala-test-inline
$ catala Interpret -s Test_A7_U1_P7 --disable_warnings
$ catala Interpret -s Test_A7_U1_P7 --disable-warnings
[RESULT] Computation successful!
```

View File

@ -12,6 +12,6 @@ zakres Test_A7_U1_P9:
asercja sprzedaż.podatek = 5 PLN
```
```catala-test-inline
$ catala Interpret -s Test_A7_U1_P9 --disable_warnings
$ catala Interpret -s Test_A7_U1_P9 --disable-warnings
[RESULT] Computation successful!
```

View File

@ -53,6 +53,6 @@ champ d'application Test1:
```
```catala-test-inline
$ catala Interpret -s Test1 --disable_warnings
$ catala Interpret -s Test1 --disable-warnings
[RESULT] Computation successful!
```

View File

@ -29,11 +29,11 @@ scope UnitTest2:
```
```catala-test-inline
$ catala Interpret -s UnitTest1 --disable_warnings
$ catala Interpret -s UnitTest1 --disable-warnings
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret -s UnitTest2 --disable_warnings
$ catala Interpret -s UnitTest2 --disable-warnings
[RESULT] Computation successful!
```

View File

@ -819,20 +819,20 @@ scope DateValues:
(value1 - |1999-12-31|) + 45 day # 367 + 45 days (2000 is bissextile)
```
### Collections
### Listes
Often, Catala programs need to speak about a collection of data because the law
talks about the number of children, the maximum of a list, etc. Catala features
first-class support for collections, which are basically fixed-size lists.
first-class support for lists.
You can create a list, filter its elements but also aggregate over its contents
to compute all sorts of values.
```catala
declaration scope CollectionValues:
internal value1 content collection integer
declaration scope ListValues:
internal value1 content list of integer
internal value2 content integer
scope CollectionValues:
scope ListValues:
definition value1 equals [45;-6;3;4;0;2155]
definition value2 equals sum integer of (i * i) for i among value1
# sum of squares

View File

@ -29,11 +29,11 @@ champ d'application TestUnitaire2:
```
```catala-test-inline
$ catala Interpret -s TestUnitaire1 --disable_warnings
$ catala Interpret -s TestUnitaire1 --disable-warnings
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret -s TestUnitaire2 --disable_warnings
$ catala Interpret -s TestUnitaire2 --disable-warnings
[RESULT] Computation successful!
```

View File

@ -863,18 +863,17 @@ champ d'application ValeursDate:
### Collections
Souvent, les programmes Catala ont besoin de parler de collection de données
parce que la loi parle du nombre denfants, du maximum dune liste, etc.
Catala propose un support de première classe pour les collections, qui ne sont
finalement que des listes de taille fixe. Vous pouvez créer une liste, filtrer
ses éléments, mais aussi agréger son contenu pour calculer toutes sortes de
valeurs.
parce que la loi parle du nombre denfants, du maximum dune liste, etc. Catala
propose un support de première classe pour les listes. Vous pouvez créer une
liste, filtrer ses éléments, mais aussi agréger son contenu pour calculer toutes
sortes de valeurs.
```catala
déclaration champ d'application ValeursDeCollection:
interne valeur1 contenu collection entier
déclaration champ d'application ValeursDeListe:
interne valeur1 contenu liste de entier
interne valeur2 contenu entier
champ d'application ValeursDeCollection:
champ d'application ValeursDeListe:
définition valeur1 égal à [45;-6;3;4;0;2155]
définition valeur2 égal à somme entier de (i * i) pour i parmi valeur1
# somme de carré

View File

@ -6,9 +6,9 @@ declaration structure Period:
data end content date
declaration scope PeriodMerge:
context periods1 content collection Period
context periods2 content collection Period
output output_periods content collection Period
context periods1 content list of Period
context periods2 content list of Period
output output_periods content list of Period
scope PeriodMerge:
# Placeholders, overwritten by caller
@ -34,13 +34,13 @@ declaration scope Section121SinglePerson:
output requirements_ownership_met condition
output requirements_usage_met condition
input date_of_sale_or_exchange content date
input property_ownage content collection Period
input property_ownage content list of Period
# Invariant: the periods in the collection are disjoint
input property_usage_as_principal_residence
content collection Period
content list of Period
# Invariant: the periods in the collection are disjoint
internal aggregate_periods_from_last_five_years content duration
depends on periods content collection Period
depends on periods content list of Period
context output gain_cap content money
input gain_from_sale_or_exchange_of_property content money
output income_excluded_from_gross_income_uncapped content money
@ -49,9 +49,9 @@ declaration scope Section121SinglePerson:
input other_section_121a_sale content OtherSection121aSale
declaration structure PersonalData:
data property_ownage content collection Period
data property_ownage content list of Period
data property_usage_as_principal_residence
content collection Period
content list of Period
data other_section_121a_sale content OtherSection121aSale
declaration structure JointReturn:

View File

@ -146,31 +146,31 @@ scope Test6:
```
```catala-test-inline
$ catala Interpret -s Test1 --disable_warnings
$ catala Interpret -s Test1 --disable-warnings
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret -s Test2 --disable_warnings
$ catala Interpret -s Test2 --disable-warnings
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret -s Test3 --disable_warnings
$ catala Interpret -s Test3 --disable-warnings
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret -s Test4 --disable_warnings
$ catala Interpret -s Test4 --disable-warnings
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret -s Test5 --disable_warnings
$ catala Interpret -s Test5 --disable-warnings
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret -s Test6 --disable_warnings
$ catala Interpret -s Test6 --disable-warnings
[RESULT] Computation successful!
```

View File

@ -22,7 +22,7 @@
(define-generic-mode 'catala-mode-fr
'("#")
'("contexte" "entrée" "résultat" "interne"
"champ d'application" "si et seulement si" "dépend de" "déclaration" "inclus" "collection" "contenu" "optionnel" "structure" "énumération" "contexte" "entrée" "résultat" "interne" "règle" "sous condition" "condition" "donnée" "conséquence" "rempli" "égal à" "assertion" "définition" "état" "étiquette" "exception" "soit")
"champ d'application" "si et seulement si" "dépend de" "déclaration" "inclus" "liste de" "contenu" "optionnel" "structure" "énumération" "contexte" "entrée" "résultat" "interne" "règle" "sous condition" "condition" "donnée" "conséquence" "rempli" "égal à" "assertion" "définition" "état" "étiquette" "exception" "soit" "liste vide")
'(("\\<\\(selon\\|sous\s+forme\\|fixé\\|par\\|décroissante\\|croissante\\|varie\\|avec\\|on\s+a\\|soit\\|dans\\|tel\s+que\\|existe\\|pour\\|tout\\|de\\|si\\|alors\\|sinon\\|initial\\)\\>" . font-lock-builtin-face)
("\\<\\(vrai\\|faux\\)\\>" . font-lock-constant-face)
("\\<\\([0-9][0-9 ]*\\(,[0-9]*\\|\\)\\)\\>" . font-lock-constant-face)
@ -41,7 +41,7 @@
(define-generic-mode 'catala-mode-en
'("#")
'("context" "input" "output" "internal"
"scope" "depends on" "declaration" "includes" "collection" "content" "optional" "structure" "enumeration" "context" "input" "output" "internal" "rule" "under condition" "condition" "data" "consequence" "fulfilled" "equals" "assertion" "definition" "state" "label" "exception" "let")
"scope" "depends on" "declaration" "includes" "list of" "content" "optional" "structure" "enumeration" "context" "input" "output" "internal" "rule" "under condition" "condition" "data" "consequence" "fulfilled" "equals" "assertion" "definition" "state" "label" "exception" "let" "list empty")
'(("\\<\\(match\\|with\s+pattern\\|fixed\\|by\\|decreasing\\|increasing\\|varies\\|with\\|we\s+have\\|let\\|in\\|such\s+that\\|exists\\|for\\|all\\|of\\|if\\|then\\|else\\|initial\\)\\>" . font-lock-builtin-face)
("|[0-9]\\+-[0-9]\\+-[0-9]\\+|" . font-lock-constant-face)
("\\<\\(true\\|false\\)\\>" . font-lock-constant-face)

View File

@ -75,7 +75,7 @@ ace.define(
{
token: "keyword.other",
regex:
"\\b(scope|depends\\s+on|declaration|includes|collection|content|optional|structure|enumeration|context|input|output|internal|rule|under\\s+condition|condition|data|consequence|fulfilled|equals|assertion|definition|state|label|exception|anything)\\b",
"\\b(scope|depends\\s+on|declaration|includes|list\\s+of|content|optional|structure|enumeration|context|input|output|internal|rule|under\\s+condition|condition|data|consequence|fulfilled|equals|assertion|definition|state|label|exception|anything|list\\s+empty)\\b",
},
{
token: "constant.numeric",

View File

@ -125,7 +125,7 @@
'name' : 'keyword.control.catala_en'
}
{
'match' : '\\b(scope|depends\\s+on|declaration|includes|collection|content|optional|structure|enumeration|context|input|output|internal|rule|under\\s+condition|condition|data|consequence|fulfilled|equals|assertion|definition|state|label|exception|anything)\\b'
'match' : '\\b(scope|depends\\s+on|declaration|includes|list\\s+of|content|optional|structure|enumeration|context|input|output|internal|rule|under\\s+condition|condition|data|consequence|fulfilled|equals|assertion|definition|state|label|exception|anything|list\\+empty)\\b'
'name' : 'keyword.other.catala_en'
}
{

View File

@ -221,7 +221,7 @@ code : context {
}
: pattern {
regex \= \b(contains|number|sum|such\s+that|exists|for|all|of|if|then|else|is|empty|among|maximum|minimum|round)\b
regex \= \b(contains|number|sum|such\s+that|exists|for|all|of|if|then|else|is|empty|among|maximum|minimum|round|list\s+empty)\b
styles [] = .keyword_rule ;
}
@ -253,7 +253,7 @@ code : context {
}
: pattern {
regex \= \b(structure|enumeration|collection|integer|boolean|date|duration|money|text|decimal)\b
regex \= \b(structure|enumeration|list\s+of|integer|boolean|date|duration|money|text|decimal)\b
styles [] = .primitive;
}

View File

@ -27,13 +27,13 @@ class CustomLexer(RegexLexer):
(u'(\\s*\\#.*$)', bygroups(Comment.Single)),
(u'(context|input|output|internal)(\\s*)(|output)(\\s+)([a-z\xe9\xe8\xe0\xe2\xf9\xee\xea\u0153\xe7][a-z\xe9\xe8\xe0\xe2\xf9\xee\xea\u0153\xe7A-Z\xc9\xc8\xc0\xc2\xd9\xce\xca\u0152\xc70-9_\\\']*)', bygroups(Keyword.Declaration, String, Keyword.Declaration, String, Name.Variable)),
(u'\\b(match|with\\s+pattern|fixed|by|decreasing|increasing|varies|with|we\\s+have|let|in|scope|depends\\s+on|declaration|includes|content|rule|under\\s+condition|condition|data|consequence|fulfilled|equals|assertion|definition|state|label|exception)\\b', bygroups(Keyword.Reserved)),
(u'\\b(contains|number|sum|such\\s+that|exists|for|all|of|if|then|else|is|empty|among|maximum|minimum|round)\\b', bygroups(Keyword.Declaration)),
(u'\\b(contains|number|sum|such\\s+that|exists|for|all|of|if|then|else|is|list\\s+empty|among|maximum|minimum|round)\\b', bygroups(Keyword.Declaration)),
(u'(\\|[0-9]+\\-[0-9]+\\-[0-9]+\\|)', bygroups(Number.Integer)),
(u'\\b(true|false)\\b', bygroups(Keyword.Constant)),
(u'\\b([0-9]+(,[0-9]*|))\\b', bygroups(Number.Integer)),
(u'(\\-\\-|\\;|\\.|\\,|\\:|\\(|\\)|\\[|\\]|\\{|\\})', bygroups(Operator)),
(u'(\\-\\>|\\+\\.|\\+\\@|\\+\\^|\\+\\$|\\+|\\-\\.|\\-\\@|\\-\\^|\\-\\$|\\-|\\*\\.|\\*\\@|\\*\\^|\\*\\$|\\*|/\\.|/\\@|/\\$|/|\\!|>\\.|>=\\.|<=\\.|<\\.|>\\@|>=\\@|<=\\@|<\\@|>\\$|>=\\$|<=\\$|<\\$|>\\^|>=\\^|<=\\^|<\\^|>|>=|<=|<|=|not|or|xor|and|\\$|\u20ac|%|year|month|day)', bygroups(Operator)),
(u'\\b(structure|enumeration|collection|integer|boolean|date|duration|money|text|decimal)\\b', bygroups(Keyword.Type)),
(u'\\b(structure|enumeration|list\\s+of|integer|boolean|date|duration|money|text|decimal)\\b', bygroups(Keyword.Type)),
(u'\\b([A-Z\xc9\xc8\xc0\xc2\xd9\xce\xca\u0152\xc7][a-z\xe9\xe8\xe0\xe2\xf9\xee\xea\u0153\xe7A-Z\xc9\xc8\xc0\xc2\xd9\xce\xca\u0152\xc70-9_\\\']*)(\\.)([a-z\xe9\xe8\xe0\xe2\xf9\xee\xea\u0153\xe7][a-z\xe9\xe8\xe0\xe2\xf9\xee\xea\u0153\xe7A-Z\xc9\xc8\xc0\xc2\xd9\xce\xca\u0152\xc70-9_\\\']*)\\b', bygroups(Name.Class, Operator, Name.Variable)),
(u'\\b([a-z\xe9\xe8\xe0\xe2\xf9\xee\xea\u0153\xe7][a-z\xe9\xe8\xe0\xe2\xf9\xee\xea\u0153\xe7A-Z\xc9\xc8\xc0\xc2\xd9\xce\xca\u0152\xc70-9_\\\']*)(\\.)([a-z\xe9\xe8\xe0\xe2\xf9\xee\xea\u0153\xe7][a-z\xe9\xe8\xe0\xe2\xf9\xee\xea\u0153\xe7A-Z\xc9\xc8\xc0\xc2\xd9\xce\xca\u0152\xc70-9_\\\'\\.]*)\\b', bygroups(Name.Variable, Operator, String)),
(u'\\b([a-z\xe9\xe8\xe0\xe2\xf9\xee\xea\u0153\xe7][a-z\xe9\xe8\xe0\xe2\xf9\xee\xea\u0153\xe7A-Z\xc9\xc8\xc0\xc2\xd9\xce\xca\u0152\xc70-9_\\\']*)\\b', bygroups(Name.Variable)),

View File

@ -22,7 +22,7 @@ syn match Include "^\s*>\s*Include:.*$"
syn match sc_id_def contained "\<\([a-zéèàâùîôêœç][a-zéèàâùîôêœçA-ZÉÈÀÂÙÎÔÊŒÇ0-9_\']*\)\>"
syn match cc_id contained "\<\([A-ZÉÈÀÂÙÎÔÊŒÇ][a-zéèàâùîôêœçA-ZÉÈÀÂÙÎÔÊŒÇ0-9_\']*\)\>"
syn match Keyword contained "\<\(scope\|depends\s\+on\|declaration\|includes\|collection\|content\|optional\|structure\|enumeration\|context\|rule\|under\s\+condition\|condition\|data\|consequence\|fulfilled\|equals\|assertion\|definition\|state\|label\|exception\|anything\)\>"
syn match Keyword contained "\<\(scope\|depends\s\+on\|declaration\|includes\|list\s\+of\|content\|optional\|structure\|enumeration\|context\|rule\|under\s\+condition\|condition\|data\|consequence\|fulfilled\|equals\|assertion\|definition\|state\|label\|exception\|anything\)\>"
syn match Statement contained "\<\(match\|with\s\+pattern\|fixed\|by\|decreasing\|increasing\|varies\|with\|we\s\+have\|let\|in\|such\s\+that\|exists\|for\|all\|of\|if\|then\|else\|initial\)\>"
syn keyword Conditional contained if then else
syn match Comment contained "#.*$"

View File

@ -200,7 +200,7 @@
</dict>
<dict>
<key>match</key>
<string>\b(scope|depends\s+on|declaration|includes|collection|content|optional|structure|enumeration|context|input|output|internal|rule|under\s+condition|condition|data|consequence|fulfilled|equals|assertion|definition|state|label|exception|anything)\b</string>
<string>\b(scope|depends\s+on|declaration|includes|list\s+of|content|optional|structure|enumeration|context|input|output|internal|rule|under\s+condition|condition|data|consequence|fulfilled|equals|assertion|definition|state|label|exception|anything)\b</string>
<key>name</key>
<string>keyword.other.catala_en</string>
</dict>

View File

@ -75,7 +75,7 @@ ace.define(
{
token: "keyword.other",
regex:
"\\b(champ\\s+d'application|si\\s+et\\s+seulement\\s+si|d\u00e9pend\\s+de|d\u00e9claration|inclus|collection|contenu|optionnel|structure|\u00e9num\u00e9ration|contexte|entr\u00e9e|r\u00e9sultat|interne|r\u00e8gle|sous\\s+condition|condition|donn\u00e9e|cons\u00e9quence|rempli|\u00e9gal\\s+\u00e0|assertion|d\u00e9finition|\u00e9tat|\u00e9tiquette|exception|n'importe\\s+quel)\\b",
"\\b(champ\\s+d'application|si\\s+et\\s+seulement\\s+si|d\u00e9pend\\s+de|d\u00e9claration|inclus|liste\\s+de|contenu|optionnel|structure|\u00e9num\u00e9ration|contexte|entr\u00e9e|r\u00e9sultat|interne|r\u00e8gle|sous\\s+condition|condition|donn\u00e9e|cons\u00e9quence|rempli|\u00e9gal\\s+\u00e0|assertion|d\u00e9finition|\u00e9tat|\u00e9tiquette|exception|n'importe\\s+quel)\\b",
},
{
token: "constant.numeric",

View File

@ -125,7 +125,7 @@
'name' : 'keyword.control.catala_fr'
}
{
'match' : '\\b(champ\\s+d\'application|si\\s+et\\s+seulement\\s+si|dépend\\s+de|déclaration|inclus|collection|contenu|optionnel|structure|énumération|contexte|entrée|r\\x{00e9}sultat|interne|règle|sous\\s+condition|condition|donnée|conséquence|rempli|égal\\s+à|assertion|définition|état|étiquette|exception|n\'importe\\s+quel)\\b'
'match' : '\\b(champ\\s+d\'application|si\\s+et\\s+seulement\\s+si|dépend\\s+de|déclaration|inclus|liste\\s+de|contenu|optionnel|structure|énumération|contexte|entrée|r\\x{00e9}sultat|interne|règle|sous\\s+condition|condition|donnée|conséquence|rempli|égal\\s+à|assertion|définition|état|étiquette|exception|n\'importe\\s+quel)\\b'
'name' : 'keyword.other.catala_fr'
}
{

View File

@ -221,7 +221,7 @@ code : context {
}
: pattern {
regex \= \b(contient|nombre|somme|tel\s+que|existe|pour|tout|de|si|alors|sinon|est|vide|parmi|maximum|minimum|arrondi)\b
regex \= \b(contient|nombre|somme|tel\s+que|existe|pour|tout|de|si|alors|sinon|est|liste\s+vide|parmi|maximum|minimum|arrondi)\b
styles [] = .keyword_rule ;
}
@ -253,7 +253,7 @@ code : context {
}
: pattern {
regex \= \b(structure|énumération|collection|entier|booléen|date|durée|argent|texte|décimal|décret|loi|nombre|somme)\b
regex \= \b(structure|énumération|liste\s+de|entier|booléen|date|durée|argent|texte|décimal|décret|loi|nombre|somme)\b
styles [] = .primitive;
}

View File

@ -27,14 +27,14 @@ class CustomLexer(RegexLexer):
(u'(\\s*\\#.*$)', bygroups(Comment.Single)),
(u'(contexte|entr\xe9e|r\xe9sultat|interne)(\\s*)(|r\xe9sultat)(\\s+)([a-z\xe9\xe8\xe0\xe2\xf9\xee\xf4\xea\u0153\xe7][a-z\xe9\xe8\xe0\xe2\xf9\xee\xf4\xea\u0153\xe7A-Z\xc9\xc8\xc0\xc2\xd9\xce\xd4\xca\u0152\xc70-9_\\\']*)', bygroups(Keyword.Declaration, String, Keyword.Declaration, String, Name.Variable)),
(u'\\b(selon|sous\\s+forme|fix\xe9|par|d\xe9croissante|croissante|varie|avec|on\\s+a|soit|dans|champ\\s+d\'application|d\xe9pend\\s+de|d\xe9claration|inclusion|contenu|r\xe8gle|sous\\s+condition|condition|donn\xe9e|cons\xe9quence|rempli|\xe9gal\\s+\xe0|assertion|d\xe9finition|\xe9tat|\xe9tiquette|exception)\\b', bygroups(Keyword.Reserved)),
(u'\\b(contient|nombre|somme|tel\\s+que|existe|pour|tout|de|si|alors|sinon|est|vide|parmi|maximum|minimum|arrondi)\\b', bygroups(Keyword.Declaration)),
(u'\\b(contient|nombre|somme|tel\\s+que|existe|pour|tout|de|si|alors|sinon|est|liste\\s+vide|parmi|maximum|minimum|arrondi)\\b', bygroups(Keyword.Declaration)),
(u'(\\|[0-9]+\\-[0-9]+\\-[0-9]+\\|)', bygroups(Number.Integer)),
(u'\\b(vrai|faux)\\b', bygroups(Keyword.Constant)),
(u'\\b([0-9]+(,[0-9]*|))\\b', bygroups(Number.Integer)),
(u'(\\-\\-|\\;|\\.|\\,|\\:|\\(|\\)|\\[|\\]|\\{|\\})', bygroups(Operator)),
(u'(\\-\\>|\\+\\.|\\+\\@|\\+\\^|\\+\u20ac|\\+|\\-\\.|\\-\\@|\\-\\^|\\-\u20ac|\\-|\\*\\.|\\*\\@|\\*\\^|\\*\u20ac|\\*|/\\.|/\\@|/\u20ac|/|\\!|>\\.|>=\\.|<=\\.|<\\.|>\\@|>=\\@|<=\\@|<\\@|>\u20ac|>=\u20ac|<=\u20ac|<\u20ac|>\\^|>=\\^|<=\\^|<\\^|>|>=|<=|<|=|\u20ac|%)', bygroups(Operator)),
(u'\\b(non|ou\\s+bien|ou|et|an|mois|jour)\\b', bygroups(Operator)),
(u'\\b(structure|\xe9num\xe9ration|collection|entier|bool\xe9en|date|dur\xe9e|argent|texte|d\xe9cimal|d\xe9cret|loi|nombre|somme)\\b', bygroups(Keyword.Type)),
(u'\\b(structure|\xe9num\xe9ration|liste\\s+de|entier|bool\xe9en|date|dur\xe9e|argent|texte|d\xe9cimal|d\xe9cret|loi|nombre|somme)\\b', bygroups(Keyword.Type)),
(u'\\b([A-Z\xc9\xc8\xc0\xc2\xd9\xce\xd4\xca\u0152\xc7][a-z\xe9\xe8\xe0\xe2\xf9\xee\xf4\xea\u0153\xe7A-Z\xc9\xc8\xc0\xc2\xd9\xce\xd4\xca\u0152\xc70-9_\\\']*)(\\.)([a-z\xe9\xe8\xe0\xe2\xf9\xee\xf4\xea\u0153\xe7][a-z\xe9\xe8\xe0\xe2\xf9\xee\xf4\xea\u0153\xe7A-Z\xc9\xc8\xc0\xc2\xd9\xce\xd4\xca\u0152\xc70-9_\\\']*)\\b', bygroups(Name.Class, Operator, Name.Variable)),
(u'\\b([a-z\xe9\xe8\xe0\xe2\xf9\xee\xf4\xea\u0153\xe7][a-z\xe9\xe8\xe0\xe2\xf9\xee\xf4\xea\u0153\xe7A-Z\xc9\xc8\xc0\xc2\xd9\xce\xd4\xca\u0152\xc70-9_\\\']*)(\\.)([a-z\xe9\xe8\xe0\xe2\xf9\xee\xf4\xea\u0153\xe7][a-z\xe9\xe8\xe0\xe2\xf9\xee\xf4\xea\u0153\xe7A-Z\xc9\xc8\xc0\xc2\xd9\xce\xd4\xca\u0152\xc70-9_\\\'\\.]*)\\b', bygroups(Name.Variable, Operator, String)),
(u'\\b([a-z\xe9\xe8\xe0\xe2\xf9\xee\xf4\xea\u0153\xe7][a-z\xe9\xe8\xe0\xe2\xf9\xee\xf4\xea\u0153\xe7A-Z\xc9\xc8\xc0\xc2\xd9\xce\xd4\xca\u0152\xc70-9_\\\']*)\\b', bygroups(Name.Variable)),

View File

@ -23,7 +23,7 @@ syn match Include "^\s*>\s*Inclusion:.*$"
syn match sc_id_def contained "\<\([a-zéèàâùîôêœç][a-zéèàâùîôêœçA-ZÉÈÀÂÙÎÔÊŒÇ0-9_\']*\)\>"
syn match cc_id contained "\<\([A-ZÉÈÀÂÙÎÔÊŒÇ][a-zéèàâùîôêœçA-ZÉÈÀÂÙÎÔÊŒÇ0-9_\']*\)\>"
syn match Keyword contained "\<\(contexte\|entrée\|résultat\|interne\|champ\s\+d'application\|collection\|structure\|donnée\|énumération\|définition\|déclaration\|si\s\+et\s\+seulement\s\+si\|dépend\s\+de\|inclus\|contenu\|optionnel\|règle\|sous\s\+condition\|condition\|conséquence\|rempli\|égal\s\+à\|assertion\|état\|étiquette\|exception\|n'importe\s\+quel\)\>"
syn match Keyword contained "\<\(contexte\|entrée\|résultat\|interne\|champ\s\+d'application\|liste\s\+de\|structure\|donnée\|énumération\|définition\|déclaration\|si\s\+et\s\+seulement\s\+si\|dépend\s\+de\|inclus\|contenu\|optionnel\|règle\|sous\s\+condition\|condition\|conséquence\|rempli\|égal\s\+à\|assertion\|état\|étiquette\|exception\|n'importe\s\+quel\)\>"
syn match Statement contained "\<\(selon\|sous\s\+forme\|fixé\|par\|décroissante\|croissante\|varie\|avec\|on\s\+a\|soit\|dans\|tel\s\+que\|existe\|pour\|tout\|de\|initial\)\>"
syn keyword Conditional contained si alors sinon
syn match Comment contained "#.*$"

View File

@ -200,7 +200,7 @@
</dict>
<dict>
<key>match</key>
<string>\b(champ\s+d&apos;application|si\s+et\s+seulement\s+si|dépend\s+de|déclaration|inclus|collection|contenu|optionnel|structure|énumération|contexte|entrée|résultat|interne|règle|sous\s+condition|condition|donnée|conséquence|rempli|égal\s+à|assertion|définition|état|étiquette|exception|n'importe\s+quel)\b</string>
<string>\b(champ\s+d&apos;application|si\s+et\s+seulement\s+si|dépend\s+de|déclaration|inclus|liste\s+de|contenu|optionnel|structure|énumération|contexte|entrée|résultat|interne|règle|sous\s+condition|condition|donnée|conséquence|rempli|égal\s+à|assertion|définition|état|étiquette|exception|n'importe\s+quel)\b</string>
<key>name</key>
<string>keyword.other.catala_fr</string>
</dict>

View File

@ -67,7 +67,7 @@
<keyword>上下文</keyword>
<!--COLLECTION-->
<keyword>collection</keyword>
<keyword>list\s+of</keyword>
<!--CONTAINS-->
<keyword>contains</keyword>

View File

@ -15,7 +15,7 @@ scope A:
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [75/75]
@ -46,7 +46,7 @@ $ catala Interpret -s A
[RESULT] z = 390.0
```
```catala-test-inline
$ catala Interpret_Lcalc -s A --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s A --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] w = 0
[RESULT] x = 4

View File

@ -9,7 +9,7 @@ scope A:
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [16/16]

View File

@ -2,7 +2,7 @@
```catala
declaration scope A:
context list content collection integer
context list content list of integer
context list_high_count content integer
scope A:
@ -23,10 +23,10 @@ money
└─ Article
Type integer coming from expression:
┌─⯈ tests/test_array/bad/fold_error.catala_en:5.35-5.42:
┌─⯈ tests/test_array/bad/fold_error.catala_en:5.32-5.39:
└─┐
5 │ context list content collection integer
‾‾‾‾‾‾‾
5 │ context list content list of integer
│ ‾‾‾‾‾‾‾
└─ Article
Type money coming from expression:

View File

@ -2,7 +2,7 @@
```catala
declaration scope A:
output x content collection money
output x content list of money
scope A:
definition x equals [$0; $4 + $5; $8 * 0.65]
@ -16,9 +16,9 @@ declaration scope B:
scope B:
definition max equals maximum of (m * 2.0) for m among a.x
or if collection empty then $0
or if list empty then $0
definition min equals minimum of (m + $5) for m among a.x
or if collection empty then $20
or if list 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
```
@ -26,7 +26,7 @@ scope B:
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [121/121]
@ -63,12 +63,12 @@ $ catala Interpret -s B
[RESULT] z = 1
```
```catala-test-inline
$ catala Interpret_Lcalc -s A --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s A --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] x = [$0.00; $9.00; $5.20]
```
```catala-test-inline
$ catala Interpret_Lcalc -s B --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s B --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] max = $18.00
[RESULT] min = $5.00

View File

@ -6,7 +6,7 @@ declaration structure S:
data income content money
declaration scope A:
context output x content collection S
context output x content list of S
scope A:
definition x equals [
@ -23,16 +23,16 @@ declaration scope B:
scope B:
definition argmax equals
(m among a.x such that m.income * 2.0 is maximum
or if collection empty then S { -- id: -1 --income: $0 })
or if list empty then S { -- id: -1 --income: $0 })
definition argmin equals
(m among a.x such that m.income + $5 is minimum
or if collection empty then S { -- id: -1 --income: $20 })
or if list empty then S { -- id: -1 --income: $20 })
```
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [115/115]
@ -72,7 +72,7 @@ $ catala Interpret -s B
[RESULT] argmin = S { -- id: 0 -- income: $0.00 }
```
```catala-test-inline
$ catala Interpret_Lcalc -s A --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s A --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT]
x =
@ -82,7 +82,7 @@ x =
]
```
```catala-test-inline
$ catala Interpret_Lcalc -s B --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s B --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] argmax = S { -- id: 1 -- income: $9.00 }
[RESULT] argmin = S { -- id: 0 -- income: $0.00 }

View File

@ -21,20 +21,20 @@ scope S:
assertion (number of i among [1; 2; 3] such that i >= 2) = 2
# Extremum
assertion maximum of [1; 2; 3] or if collection empty then 10 = 3
assertion maximum of (decimal of i) for i among [1; 2; 3] or if collection empty then 10. = 3.
assertion maximum of [1; 2; 3] or if list empty then 10 = 3
assertion maximum of (decimal of i) for i among [1; 2; 3] or if list empty then 10. = 3.
# Arg extremum
assertion (i among [1; 2; 3]
such that decimal of ((2 - i) * (2 - i)) is minimum
or if collection empty then 42)
or if list empty then 42)
= 2
```
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [225/225]

View File

@ -1,9 +1,9 @@
## Unit testing for collection concatenation.
## Unit testing for list of concatenation.
```catala
declaration scope A:
output x content collection integer
output y content collection integer
output x content list of integer
output y content list of integer
scope A:
definition x equals [0; 1; 2] ++ [3; 4; 5; 6]
@ -13,7 +13,7 @@ scope A:
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [39/39]
@ -42,7 +42,7 @@ $ catala Interpret -s A
[RESULT] y = [0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10]
```
```catala-test-inline
$ catala Interpret_Lcalc -s A --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s A --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] x = [0; 1; 2; 3; 4; 5; 6]
[RESULT] y = [0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10]

View File

@ -2,14 +2,14 @@
```catala
declaration scope A:
output x content collection money
output x content list of money
scope A:
definition x equals [$0; $4 + $5; $8 * 0.65]
declaration scope B:
a scope A
output y content collection money
output y content list of money
scope B:
definition y equals m among a.x such that m >= $4.95
@ -19,7 +19,7 @@ scope B:
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [41/41]
@ -48,7 +48,7 @@ $ catala Interpret -s A
```
```catala-test-inline
$ catala Interpret_Lcalc -s A --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s A --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] x = [$0.00; $9.00; $5.20]
```
@ -62,7 +62,7 @@ $ catala Interpret -s B
```
```catala-test-inline
$ catala Interpret_Lcalc -s B --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s B --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] y = [$9.00; $5.20]
```

View File

@ -2,15 +2,15 @@
```catala
declaration scope A:
output x content collection money
output x content list of money
scope A:
definition x equals [$0; $4 + $5; $8 * 0.65]
declaration scope B:
a scope A
output y content collection money
output z content collection boolean
output y content list of money
output z content list of boolean
scope B:
definition y equals m among a.x such that m >= $4.95
@ -20,7 +20,7 @@ scope B:
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [57/57]
@ -55,12 +55,12 @@ $ catala Interpret -s B
[RESULT] z = [false; true; true]
```
```catala-test-inline
$ catala Interpret_Lcalc -s A --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s A --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] x = [$0.00; $9.00; $5.20]
```
```catala-test-inline
$ catala Interpret_Lcalc -s B --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s B --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] y = [$9.00; $5.20]
[RESULT] z = [false; true; true]

View File

@ -6,7 +6,7 @@ declaration structure S:
data income content money
declaration scope A:
context output x content collection S
context output x content list of S
scope A:
definition x equals [
@ -23,16 +23,16 @@ declaration scope B:
scope B:
definition argmax equals
(m among a.x such that m.income * 2.0 is maximum
or if collection empty then S { -- id: -1 --income: $0 })
or if list empty then S { -- id: -1 --income: $0 })
definition argmin equals
(m among a.x such that m.income + $5 is minimum
or if collection empty then S { -- id: -1 --income: $20 })
or if list empty then S { -- id: -1 --income: $20 })
```
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [115/115]
@ -72,7 +72,7 @@ $ catala Interpret -s B
[RESULT] argmin = S { -- id: 0 -- income: $0.00 }
```
```catala-test-inline
$ catala Interpret_Lcalc -s A --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s A --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT]
x =
@ -82,7 +82,7 @@ x =
]
```
```catala-test-inline
$ catala Interpret_Lcalc -s B --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s B --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] argmax = S { -- id: 1 -- income: $9.00 }
[RESULT] argmin = S { -- id: 0 -- income: $0.00 }

View File

@ -2,8 +2,8 @@
```catala
declaration scope B:
output x content collection money
output z content collection boolean
output x content list of money
output z content list of boolean
scope B:
definition x equals [$4; $8 ]
@ -13,7 +13,7 @@ scope B:
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [28/28]
@ -43,7 +43,7 @@ $ catala Interpret -s B
```
```catala-test-inline
$ catala Interpret_Lcalc -s B --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s B --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] x = [$4.00; $8.00]
[RESULT] z = [false; true]

View File

@ -2,7 +2,7 @@
```catala
declaration scope A:
output x content collection integer
output x content list of integer
scope A:
definition x equals [0; 4+5; 8*8]
@ -24,7 +24,7 @@ scope B:
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [96/96]
@ -61,12 +61,12 @@ $ catala Interpret -s B
[RESULT] z = false
```
```catala-test-inline
$ catala Interpret_Lcalc -s A --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s A --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] x = [0; 9; 64]
```
```catala-test-inline
$ catala Interpret_Lcalc -s B --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s B --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] v = 3
[RESULT] w = true

View File

@ -2,7 +2,7 @@
```catala
declaration scope A:
output x content collection integer
output x content list of integer
output w content boolean
scope A:
@ -13,7 +13,7 @@ scope A:
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [39/39]
@ -43,7 +43,7 @@ $ catala Interpret -s A
```
```catala-test-inline
$ catala Interpret_Lcalc -s A --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s A --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] w = false
[RESULT] x = [0; 9; 64]

View File

@ -2,7 +2,7 @@
```catala
declaration scope A:
output x content collection integer
output x content list of integer
scope A:
definition x equals [0; 4; 8]
@ -11,7 +11,7 @@ scope A:
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [13/13]
@ -40,7 +40,7 @@ $ catala Interpret -s A
```
```catala-test-inline
$ catala Interpret_Lcalc -s A --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s A --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] x = [0; 4; 8]
```

View File

@ -14,7 +14,7 @@ scope TestBool:
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [47/47]
@ -80,7 +80,7 @@ let scope TestBool (foo: ⟨bool⟩|context|output) (bar: ⟨integer⟩|context|
error_empty ⟨ ⟨bar >= 0 ⊢ ⟨true⟩⟩, ⟨bar < 0 ⊢ ⟨false⟩⟩ | false ⊢ ∅ ⟩
```
```catala-test-inline
$ catala Interpret_Lcalc -s TestBool --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s TestBool --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] bar = 1
[RESULT] foo = true

View File

@ -11,7 +11,7 @@ scope TestBool:
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [30/30]
@ -39,7 +39,7 @@ $ catala Interpret -s TestBool
[RESULT] foo = true
```
```catala-test-inline
$ catala Interpret_Lcalc -s TestBool --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s TestBool --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] foo = true
```

View File

@ -17,7 +17,7 @@ scope TestXor:
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [85/85]
@ -48,7 +48,7 @@ $ catala Interpret -s TestXor
[RESULT] t_xor_t = false
```
```catala-test-inline
$ catala Interpret_Lcalc -s TestXor --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s TestXor --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] f_xor_f = false
[RESULT] f_xor_t = true

View File

@ -26,7 +26,7 @@ scope A:
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [85/85]
@ -60,7 +60,7 @@ $ catala Interpret -s A
[RESULT] z3 = [5937 days]
```
```catala-test-inline
$ catala Interpret_Lcalc -s A --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s A --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] m = [11874 days]
[RESULT] m2 = [6 months]

View File

@ -25,7 +25,7 @@ scope Test:
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [51/51]
@ -54,7 +54,7 @@ $ catala Interpret -s Test
```
```catala-test-inline
$ catala Interpret_Lcalc -s Test --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s Test --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] r = true
```

View File

@ -25,7 +25,7 @@ champ d'application Test:
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [51/51]
@ -53,7 +53,7 @@ $ catala Interpret -s Test
[RESULT] r = vrai
```
```catala-test-inline
$ catala Interpret_Lcalc -s Test --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s Test --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] r = vrai
```

View File

@ -15,7 +15,7 @@ scope A:
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [58/58]
@ -45,7 +45,7 @@ $ catala Interpret -s A
[RESULT] z = [5937 days]
```
```catala-test-inline
$ catala Interpret_Lcalc -s A --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s A --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] x = 2019-01-01
[RESULT] y = 2002-09-30

View File

@ -17,7 +17,7 @@ scope A:
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [96/96]
@ -50,7 +50,7 @@ a =
[RESULT] z = 654,265,429,805,103,220,650,980,650.5…
```
```catala-test-inline
$ catala Interpret_Lcalc -s A --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s A --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT]
a =

View File

@ -17,7 +17,7 @@ scope A:
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [41/41]
@ -48,7 +48,7 @@ $ catala Interpret -s A
[RESULT] y1 = 4.0
```
```catala-test-inline
$ catala Interpret_Lcalc -s A --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s A --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] x = 84.648,665
[RESULT] x1 = 85.0

View File

@ -17,7 +17,7 @@ scope A:
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [70/70]
@ -48,7 +48,7 @@ $ catala Interpret -s A
[RESULT] z = 19.377,955,528,206,987,757…
```
```catala-test-inline
$ catala Interpret_Lcalc -s A --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s A --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] k = 0.333,333,333,333,333,333,33…
[RESULT] x = 84.648,665

View File

@ -14,7 +14,7 @@ scope A:
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [48/48]
@ -43,7 +43,7 @@ $ catala Interpret -s A
[RESULT] y = 1.04
```
```catala-test-inline
$ catala Interpret_Lcalc -s A --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s A --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] x = 4.0
[RESULT] y = 1.04

View File

@ -12,7 +12,7 @@ scope A:
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[WARNING] These definitions have identical justifications and consequences; is it a mistake?
┌─⯈ tests/test_default/good/mutliple_definitions.catala_en:9.3-9.15:

View File

@ -24,7 +24,7 @@ scope A:
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [62/62]
@ -54,7 +54,7 @@ $ catala Interpret -s A
[RESULT] x = 2
```
```catala-test-inline
$ catala Interpret_Lcalc -s A --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s A --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] e = Case1 ()
[RESULT] f = Case1 2

View File

@ -19,7 +19,7 @@ scope A:
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [66/66]
@ -49,7 +49,7 @@ $ catala Interpret -s A
[RESULT] z = false
```
```catala-test-inline
$ catala Interpret_Lcalc -s A --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s A --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] x = Case1 2
[RESULT] y = true

View File

@ -19,7 +19,7 @@ scope A:
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [43/43]
@ -48,7 +48,7 @@ $ catala Interpret -s A
[RESULT] y = 42
```
```catala-test-inline
$ catala Interpret_Lcalc -s A --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s A --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] x = Case1 2
[RESULT] y = 42

View File

@ -39,7 +39,7 @@ scope Simple_case_2:
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [90/90]
@ -75,13 +75,13 @@ $ catala Interpret -s Simple_case
[RESULT] y = 31
```
```catala-test-inline
$ catala Interpret_Lcalc -s Simple_case_2 --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s Simple_case_2 --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] x = Case3 ()
[RESULT] y = 31
```
```catala-test-inline
$ catala Interpret_Lcalc -s Simple_case --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s Simple_case --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] x = Case1 2
[RESULT] y = 31

View File

@ -18,7 +18,7 @@ scope Bar:
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [48/48]
@ -45,6 +45,6 @@ $ catala Interpret -s Bar
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret_Lcalc -s Bar --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s Bar --avoid-exceptions --optimize
[RESULT] Computation successful!
```

View File

@ -13,7 +13,7 @@ scope Foo:
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[WARNING] These definitions have identical justifications and consequences; is it a mistake?
┌─⯈ tests/test_exception/good/double_definition.catala_en:9.3-9.15:

View File

@ -21,7 +21,7 @@ scope A:
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [59/59]
@ -50,7 +50,7 @@ $ catala Interpret -s A
[RESULT] y = 0
```
```catala-test-inline
$ catala Interpret_Lcalc -s A --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s A --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] x = 0
[RESULT] y = 0

View File

@ -15,7 +15,7 @@ scope A:
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [28/28]
@ -43,7 +43,7 @@ $ catala Interpret -s A
[RESULT] x = 1
```
```catala-test-inline
$ catala Interpret_Lcalc -s A --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s A --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] x = 1
```

View File

@ -19,7 +19,7 @@ scope A:
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [37/37]
@ -47,7 +47,7 @@ $ catala Interpret -s A
[RESULT] x = 2
```
```catala-test-inline
$ catala Interpret_Lcalc -s A --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s A --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] x = 2
```

View File

@ -49,7 +49,7 @@ scope Benefit:
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [61/61]
@ -78,7 +78,7 @@ $ catala Interpret -s Benefit
[RESULT] person = Person { -- age: 26 -- disabled: true }
```
```catala-test-inline
$ catala Interpret_Lcalc -s Benefit --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s Benefit --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] benefit = $2,000.00
[RESULT] person = Person { -- age: 26 -- disabled: true }

View File

@ -43,7 +43,7 @@ scope Test:
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [84/84]

View File

@ -22,7 +22,7 @@ scope A:
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [67/67]
@ -52,7 +52,7 @@ $ catala Interpret -s A
[RESULT] z = 0
```
```catala-test-inline
$ catala Interpret_Lcalc -s A --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s A --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] x = 0
[RESULT] y = 1

View File

@ -17,7 +17,7 @@ scope A:
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [28/28]
@ -45,7 +45,7 @@ $ catala Interpret -s A
[RESULT] x = 1
```
```catala-test-inline
$ catala Interpret_Lcalc -s A --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s A --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] x = 1
```

View File

@ -23,7 +23,7 @@ scope A:
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [45/45]
@ -51,7 +51,7 @@ $ catala Interpret -s A
[RESULT] x = 0
```
```catala-test-inline
$ catala Interpret_Lcalc -s A --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s A --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] x = 0
```

View File

@ -20,7 +20,7 @@ scope A:
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [55/55]
@ -49,7 +49,7 @@ $ catala Interpret -s A
[RESULT] y = 3
```
```catala-test-inline
$ catala Interpret_Lcalc -s A --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s A --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] x = 1
[RESULT] y = 3

View File

@ -14,7 +14,7 @@ scope A:
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [28/28]
@ -42,7 +42,7 @@ $ catala Interpret -s A
[RESULT] x = 1
```
```catala-test-inline
$ catala Interpret_Lcalc -s A --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s A --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] x = 1
```

View File

@ -20,7 +20,7 @@ scope A:
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [55/55]
@ -49,7 +49,7 @@ $ catala Interpret -s A
[RESULT] y = 2
```
```catala-test-inline
$ catala Interpret_Lcalc -s A --avoid_exceptions --optimize
$ catala Interpret_Lcalc -s A --avoid-exceptions --optimize
[RESULT] Computation successful! Results:
[RESULT] x = 1
[RESULT] y = 2

View File

@ -14,7 +14,7 @@ scope S:
```catala-test-inline
$ catala Typecheck --check_invariants
$ catala Typecheck --check-invariants
[RESULT]
Invariant Dcalc__Invariants.invariant_typing_defaults
checked. result: [28/28]
@ -37,7 +37,7 @@ Invariant Dcalc__Invariants.invariant_default_no_arrow
```
```catala-test-inline
$ catala Lcalc --avoid_exceptions -O --closure_conversion
$ catala Lcalc --avoid-exceptions -O --closure-conversion
type S_in = { x_in: bool; }

Some files were not shown because too many files have changed in this diff Show More