Add common linting passes to Catala (#438)

This commit is contained in:
Denis Merigoux 2023-04-03 14:01:02 +02:00 committed by GitHub
commit 38b0041bb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
102 changed files with 20676 additions and 21769 deletions

View File

@ -86,6 +86,7 @@ let style_flag = ref true
(* Max number of digits to show for decimal results *)
let max_prec_digits = ref 20
let trace_flag = ref false
let disable_warnings_flag = ref false
let optimize_flag = ref false
let disable_counterexamples = ref false
let avoid_exceptions_flag = ref false
@ -135,19 +136,26 @@ let trace_opt =
"Displays a trace of the interpreter's computation or generates \
logging instructions in translate programs.")
let disable_warnings_opt =
Arg.(
value
& flag
& info ["disable_warnings"]
~doc:"Disable all the warnings emitted by the compiler.")
let avoid_exceptions =
Arg.(
value
& flag
& info ["avoid_exceptions"]
~doc:"Compiles the default calculus without exceptions")
~doc:"Compiles the default calculus without exceptions.")
let closure_conversion =
Arg.(
value
& flag
& info ["closure_conversion"]
~doc:"Performs closure conversion on the lambda calculus")
~doc:"Performs closure conversion on the lambda calculus.")
let wrap_weaved_output =
Arg.(
@ -243,6 +251,7 @@ type options = {
language : string option;
max_prec_digits : int option;
trace : bool;
disable_warnings : bool;
disable_counterexamples : bool;
optimize : bool;
ex_scope : string option;
@ -263,6 +272,7 @@ let options =
plugins_dirs
language
max_prec_digits
disable_warnings
trace
disable_counterexamples
optimize
@ -278,6 +288,7 @@ let options =
plugins_dirs;
language;
max_prec_digits;
disable_warnings;
trace;
disable_counterexamples;
optimize;
@ -299,6 +310,7 @@ let options =
$ plugins_dirs
$ language
$ max_prec_digits_opt
$ disable_warnings_opt
$ trace_opt
$ disable_counterexamples_opt
$ optimize
@ -315,6 +327,10 @@ let set_option_globals options : unit =
| Always -> true
| Never -> false
| Auto -> Unix.isatty Unix.stdout);
(match options.max_prec_digits with
| None -> ()
| Some i -> max_prec_digits := i);
disable_warnings_flag := options.disable_warnings;
trace_flag := options.trace;
optimize_flag := options.optimize;
disable_counterexamples := options.disable_counterexamples;
@ -495,7 +511,8 @@ let error_print (format : ('a, out_channel, unit) format) =
Printf.eprintf ("%s" ^^ format ^^ "\n%!") (error_marker ())
let warning_print (format : ('a, out_channel, unit) format) =
Printf.printf ("%s" ^^ format ^^ "\n%!") (warning_marker ())
if !disable_warnings_flag then Printf.ifprintf stdout format
else Printf.printf ("%s" ^^ format ^^ "\n%!") (warning_marker ())
let result_print (format : ('a, out_channel, unit) format) =
Printf.printf ("%s" ^^ format ^^ "\n%!") (result_marker ())

View File

@ -64,6 +64,7 @@ val max_prec_digits : int ref
(** Max number of digits to show for decimal results *)
val trace_flag : bool ref
val disable_warnings_flag : bool ref
val disable_counterexamples : bool ref
(** Disables model-generated counterexamples for proofs that fail. *)
@ -99,6 +100,7 @@ type options = {
language : string option;
max_prec_digits : int option;
trace : bool;
disable_warnings : bool;
disable_counterexamples : bool;
optimize : bool;
ex_scope : string option;

View File

@ -23,6 +23,7 @@ let _ =
max_prec_digits = None;
closure_conversion = false;
trace;
disable_warnings = true;
disable_counterexamples = false;
optimize = false;
ex_scope = Some (Js.to_string scope);

View File

@ -247,3 +247,28 @@ let free_variables (def : rule RuleName.Map.t) : Pos.t ScopeDefMap.t =
in
add_locs acc locs)
def ScopeDefMap.empty
let fold_exprs ~(f : 'a -> expr -> 'a) ~(init : 'a) (p : program) : 'a =
let acc =
ScopeName.Map.fold
(fun _ scope acc ->
let acc =
ScopeDefMap.fold
(fun _ scope_def acc ->
RuleName.Map.fold
(fun _ rule acc ->
f
(f acc (Expr.unbox rule.rule_just))
(Expr.unbox rule.rule_cons))
scope_def.scope_def_rules acc)
scope.scope_defs acc
in
let acc =
List.fold_left
(fun acc assertion -> f acc (Expr.unbox assertion))
acc scope.scope_assertions
in
acc)
p.program_scopes init
in
TopdefName.Map.fold (fun _ (e, _) acc -> f acc e) p.program_topdefs acc

View File

@ -134,3 +134,9 @@ type program = {
val locations_used : expr -> LocationSet.t
val free_variables : rule RuleName.Map.t -> Pos.t ScopeDefMap.t
val fold_exprs : f:('a -> expr -> 'a) -> init:'a -> program -> 'a
(** Usage: [fold_exprs ~f ~init program] applies ~f to all the expressions
inside rules (justifications and consequences), expressions and top-level
definitions of the program. Note that there may be free variables in these
expressions. *)

View File

@ -0,0 +1,203 @@
(* This file is part of the Catala compiler, a specification language for tax
and social benefits computation rules. Copyright (C) 2023 Inria, contributor:
Denis Merigoux <denis.merigoux@inria.fr>
Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy of
the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations under
the License. *)
open Shared_ast
open Ast
open Catala_utils
(** If the variable is not an input, then it should be defined somewhere. *)
let detect_empty_definitions (p : program) : unit =
ScopeName.Map.iter
(fun (scope_name : ScopeName.t) scope ->
ScopeDefMap.iter
(fun scope_def_key scope_def ->
if
(match scope_def_key with ScopeDef.Var _ -> true | _ -> false)
&& RuleName.Map.is_empty scope_def.scope_def_rules
&& (not scope_def.scope_def_is_condition)
&&
match Marked.unmark scope_def.scope_def_io.io_input with
| Ast.NoInput -> true
| _ -> false
then
Errors.format_spanned_warning
(ScopeDef.get_position scope_def_key)
"In scope %a, the variable %a is declared but never defined; did \
you forget something?"
(Cli.format_with_style [ANSITerminal.yellow])
(Format.asprintf "\"%a\"" ScopeName.format_t scope_name)
(Cli.format_with_style [ANSITerminal.yellow])
(Format.asprintf "\"%a\"" Ast.ScopeDef.format_t scope_def_key))
scope.scope_defs)
p.program_scopes
let detect_unused_scope_vars (p : program) : unit =
let used_scope_vars =
Ast.fold_exprs
~f:(fun used_scope_vars e ->
let rec used_scope_vars_expr e used_scope_vars =
match Marked.unmark e with
| ELocation (DesugaredScopeVar (v, _)) ->
ScopeVar.Set.add (Marked.unmark v) used_scope_vars
| _ -> Expr.shallow_fold used_scope_vars_expr e used_scope_vars
in
used_scope_vars_expr e used_scope_vars)
~init:ScopeVar.Set.empty p
in
ScopeName.Map.iter
(fun (scope_name : ScopeName.t) scope ->
ScopeDefMap.iter
(fun scope_def_key scope_def ->
match scope_def_key with
| ScopeDef.Var (v, _)
when (not (ScopeVar.Set.mem v used_scope_vars))
&& not (Marked.unmark scope_def.scope_def_io.io_output) ->
Errors.format_spanned_warning
(ScopeDef.get_position scope_def_key)
"In scope %a, the variable %a is never used anywhere; maybe it's \
unnecessary?"
(Cli.format_with_style [ANSITerminal.yellow])
(Format.asprintf "\"%a\"" ScopeName.format_t scope_name)
(Cli.format_with_style [ANSITerminal.yellow])
(Format.asprintf "\"%a\"" Ast.ScopeDef.format_t scope_def_key)
| _ -> ())
scope.scope_defs)
p.program_scopes
let detect_unused_struct_fields (p : program) : unit =
let struct_fields_used =
Ast.fold_exprs
~f:(fun struct_fields_used e ->
let rec structs_fields_used_expr e struct_fields_used =
match Marked.unmark e with
| EDStructAccess { name_opt = Some name; e = e_struct; field } ->
let field =
StructName.Map.find name
(IdentName.Map.find field p.program_ctx.ctx_struct_fields)
in
StructField.Set.add field
(structs_fields_used_expr e_struct struct_fields_used)
| EStruct { name = _; fields } ->
StructField.Map.fold
(fun field e_field struct_fields_used ->
StructField.Set.add field
(structs_fields_used_expr e_field struct_fields_used))
fields struct_fields_used
| _ -> Expr.shallow_fold structs_fields_used_expr e struct_fields_used
in
structs_fields_used_expr e struct_fields_used)
~init:StructField.Set.empty p
in
let scope_out_structs_fields =
ScopeName.Map.fold
(fun _ out_struct acc ->
ScopeVar.Map.fold
(fun _ field acc -> StructField.Set.add field acc)
out_struct.out_struct_fields acc)
p.program_ctx.ctx_scopes StructField.Set.empty
in
StructName.Map.iter
(fun s_name fields ->
if
(not (StructField.Map.is_empty fields))
&& StructField.Map.for_all
(fun field _ ->
(not (StructField.Set.mem field struct_fields_used))
&& not (StructField.Set.mem field scope_out_structs_fields))
fields
then
Errors.format_spanned_warning
(snd (StructName.get_info s_name))
"The structure %a is never used; maybe it's unnecessary?"
(Cli.format_with_style [ANSITerminal.yellow])
(Format.asprintf "\"%a\"" StructName.format_t s_name)
else
StructField.Map.iter
(fun field _ ->
if
(not (StructField.Set.mem field struct_fields_used))
&& not (StructField.Set.mem field scope_out_structs_fields)
then
Errors.format_spanned_warning
(snd (StructField.get_info field))
"The field %a of struct %a is never used; maybe it's \
unnecessary?"
(Cli.format_with_style [ANSITerminal.yellow])
(Format.asprintf "\"%a\"" StructField.format_t field)
(Cli.format_with_style [ANSITerminal.yellow])
(Format.asprintf "\"%a\"" StructName.format_t s_name))
fields)
p.program_ctx.ctx_structs
let detect_unused_enum_constructors (p : program) : unit =
let enum_constructors_used =
Ast.fold_exprs
~f:(fun enum_constructors_used e ->
let rec enum_constructors_used_expr e enum_constructors_used =
match Marked.unmark e with
| EInj { name = _; e = e_enum; cons } ->
EnumConstructor.Set.add cons
(enum_constructors_used_expr e_enum enum_constructors_used)
| EMatch { e = e_match; name = _; cases } ->
let enum_constructors_used =
enum_constructors_used_expr e_match enum_constructors_used
in
EnumConstructor.Map.fold
(fun cons e_cons enum_constructors_used ->
EnumConstructor.Set.add cons
(enum_constructors_used_expr e_cons enum_constructors_used))
cases enum_constructors_used
| _ ->
Expr.shallow_fold enum_constructors_used_expr e
enum_constructors_used
in
enum_constructors_used_expr e enum_constructors_used)
~init:EnumConstructor.Set.empty p
in
EnumName.Map.iter
(fun e_name constructors ->
if
EnumConstructor.Map.for_all
(fun cons _ ->
not (EnumConstructor.Set.mem cons enum_constructors_used))
constructors
then
Errors.format_spanned_warning
(snd (EnumName.get_info e_name))
"The enumeration %a is never used; maybe it's unnecessary?"
(Cli.format_with_style [ANSITerminal.yellow])
(Format.asprintf "\"%a\"" EnumName.format_t e_name)
else
EnumConstructor.Map.iter
(fun constructor _ ->
if not (EnumConstructor.Set.mem constructor enum_constructors_used)
then
Errors.format_spanned_warning
(snd (EnumConstructor.get_info constructor))
"The constructor %a of enumeration %a is never used; maybe \
it's unnecessary?"
(Cli.format_with_style [ANSITerminal.yellow])
(Format.asprintf "\"%a\"" EnumConstructor.format_t constructor)
(Cli.format_with_style [ANSITerminal.yellow])
(Format.asprintf "\"%a\"" EnumName.format_t e_name))
constructors)
p.program_ctx.ctx_enums
let lint_program (p : program) : unit =
detect_empty_definitions p;
detect_unused_scope_vars p;
detect_unused_struct_fields p;
detect_unused_enum_constructors p

View File

@ -0,0 +1,19 @@
(* This file is part of the Catala compiler, a specification language for tax
and social benefits computation rules. Copyright (C) 2023 Inria, contributor:
Denis Merigoux <denis.merigoux@inria.fr>
Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy of
the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations under
the License. *)
val lint_program : Ast.program -> unit
(** Performs various lints on the program, displaying warnings to help the
developer improve the code. *)

View File

@ -39,9 +39,6 @@ let driver source_file (options : Cli.options) : int =
(match source_file with
| Pos.FileName f -> filename := f
| Contents c -> Cli.contents := c);
(match options.max_prec_digits with
| None -> ()
| Some i -> Cli.max_prec_digits := i);
let l =
match options.language with
| Some l -> l
@ -174,6 +171,8 @@ let driver source_file (options : Cli.options) : int =
let prgm = Desugared.From_surface.translate_program ctxt prgm in
Cli.debug_print "Disambiguating...";
let prgm = Desugared.Disambiguate.program prgm in
Cli.debug_print "Linting...";
Desugared.Linting.lint_program prgm;
Cli.debug_print "Collecting rules...";
let prgm = Scopelang.From_desugared.translate_program prgm in
match backend with

View File

@ -91,8 +91,11 @@ let rec translate_expr (ctx : ctx) (e : Desugared.Ast.expr) :
with Not_found ->
(* Should not happen after disambiguation *)
Errors.raise_spanned_error (Expr.mark_pos m)
"Field %s does not belong to structure %a" field StructName.format_t
name
"Field %a does not belong to structure %a"
(Cli.format_with_style [ANSITerminal.yellow])
("\"" ^ field ^ "\"")
(Cli.format_with_style [ANSITerminal.yellow])
(Format.asprintf "\"%a\"" StructName.format_t name)
in
Expr.estructaccess e' field name m
| ETuple es -> Expr.etuple (List.map (translate_expr ctx) es) m

View File

@ -267,7 +267,9 @@ let shallow_fold
| ELit _ | EOp _ | EVar _ | ERaise _ | ELocation _ | EEmptyError -> acc
| EApp { f = e; args } -> acc |> f e |> lfold args
| EArray args -> acc |> lfold args
| EAbs _ -> acc
| EAbs { binder; tys = _ } ->
let _, body = Bindlib.unmbind binder in
acc |> f body
| EIfThenElse { cond; etrue; efalse } -> acc |> f cond |> f etrue |> f efalse
| ETuple args -> acc |> lfold args
| ETupleAccess { e; _ } -> acc |> f e

View File

@ -236,9 +236,9 @@ val map_marks : f:('t1 -> 't2) -> ('a, 't1) gexpr -> ('a, 't2) boxed_gexpr
val shallow_fold :
(('a, 't) gexpr -> 'acc -> 'acc) -> ('a, 't) gexpr -> 'acc -> 'acc
(** Applies a function on all sub-terms of the given expression. Does not
recurse, and doesn't open binders. Useful as helper for recursive calls
within traversal functions. This can be used to compute free variables with
e.g.:
recurse. It opens binders unless you avoid sending binders to the function
like the example below. Useful as helper for recursive calls within
traversal functions. This can be used to compute free variables with e.g.:
{[
let rec free_vars = function

View File

@ -22,6 +22,12 @@ let map_exprs ~f ~varf { code_items; decl_ctx } =
(fun code_items -> { code_items; decl_ctx })
(Scope.map_exprs ~f ~varf code_items)
let fold_left_exprs ~f ~init { code_items; decl_ctx = _ } =
Scope.fold_left ~f:(fun acc e _ -> f acc e) ~init code_items
let fold_right_exprs ~f ~init { code_items; decl_ctx = _ } =
Scope.fold_right ~f:(fun e _ acc -> f e acc) ~init code_items
let get_scope_body { code_items; _ } scope =
match
Scope.fold_left ~init:None

View File

@ -25,6 +25,12 @@ val map_exprs :
'expr1 program ->
'expr2 program Bindlib.box
val fold_left_exprs :
f:('a -> 'expr code_item -> 'a) -> init:'a -> 'expr program -> 'a
val fold_right_exprs :
f:('expr code_item -> 'a -> 'a) -> init:'a -> 'expr program -> 'a
val get_scope_body :
((_ any, 't) gexpr as 'e) program -> ScopeName.t -> 'e scope_body

View File

@ -474,18 +474,27 @@ and typecheck_expr_top_down :
try A.IdentName.Map.find field ctx.ctx_struct_fields
with Not_found ->
Errors.raise_spanned_error context_mark.pos
"Field %s does not belong to structure %a (no structure defines \
"Field %a does not belong to structure %a (no structure defines \
it)"
field A.StructName.format_t name
(Cli.format_with_style [ANSITerminal.yellow])
("\"" ^ field ^ "\"")
(Cli.format_with_style [ANSITerminal.yellow])
(Format.asprintf "\"%a\"" A.StructName.format_t name)
in
try A.StructName.Map.find name candidate_structs
with Not_found ->
Errors.raise_spanned_error context_mark.pos
"Field %s does not belong to structure %a, but to %a" field
A.StructName.format_t name
"Field %a does not belong to structure %a, but to %a"
(Cli.format_with_style [ANSITerminal.yellow])
("\"" ^ field ^ "\"")
(Cli.format_with_style [ANSITerminal.yellow])
(Format.asprintf "\"%a\"" A.StructName.format_t name)
(Format.pp_print_list
~pp_sep:(fun ppf () -> Format.fprintf ppf "@ or@ ")
A.StructName.format_t)
(fun fmt s_name ->
Format.fprintf fmt "%a"
(Cli.format_with_style [ANSITerminal.yellow])
(Format.asprintf "\"%a\"" A.StructName.format_t s_name)))
(List.map fst (A.StructName.Map.bindings candidate_structs))
in
A.StructField.Map.find field str

View File

@ -65,13 +65,13 @@ champ d'application Exemple2 :
```catala-test-inline
$ catala Interpret -s Exemple1
$ catala Interpret -s Exemple1 --disable_warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 345.73 €
```
```catala-test-inline
$ catala Interpret -s Exemple2
$ catala Interpret -s Exemple2 --disable_warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 352.77 €
```

View File

@ -30,7 +30,7 @@ champ d'application CasTest1:
```
```catala-test-inline
$ catala Interpret -s CasTest1
$ catala Interpret -s CasTest1 --disable_warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 76.38 €
```

View File

@ -144,26 +144,26 @@ champ d'application Exemple4:
```
```catala-test-inline
$ catala Interpret -s Exemple1
$ catala Interpret -s Exemple1 --disable_warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 181.91 €
```
```catala-test-inline
$ catala Interpret -s Exemple2
$ catala Interpret -s Exemple2 --disable_warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 67.34 €
```
```catala-test-inline
$ catala Interpret -s Exemple3
$ catala Interpret -s Exemple3 --disable_warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 181.91 €
```
```catala-test-inline
$ catala Interpret -s Exemple4
$ catala Interpret -s Exemple4 --disable_warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 118.59 €
```

View File

@ -270,55 +270,55 @@ champ d'application Exemple9:
```
```catala-test-inline
$ catala Interpret -s Exemple1
$ catala Interpret -s Exemple1 --disable_warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 0.00 €
```
```catala-test-inline
$ catala Interpret -s Exemple2
$ catala Interpret -s Exemple2 --disable_warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 352.77 €
```
```catala-test-inline
$ catala Interpret -s Exemple3
$ catala Interpret -s Exemple3 --disable_warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 321.61 €
```
```catala-test-inline
$ catala Interpret -s Exemple4
$ catala Interpret -s Exemple4 --disable_warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 0.00 €
```
```catala-test-inline
$ catala Interpret -s Exemple5
$ catala Interpret -s Exemple5 --disable_warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 311.56 €
```
```catala-test-inline
$ catala Interpret -s Exemple6
$ catala Interpret -s Exemple6 --disable_warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 0.00 €
```
```catala-test-inline
$ catala Interpret -s Exemple7
$ catala Interpret -s Exemple7 --disable_warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 153.77 €
```
```catala-test-inline
$ catala Interpret -s Exemple8
$ catala Interpret -s Exemple8 --disable_warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 11.06 €
```
```catala-test-inline
$ catala Interpret -s Exemple9
$ catala Interpret -s Exemple9 --disable_warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 210.06 €
```

View File

@ -127,31 +127,31 @@ champ d'application CasTest5:
```
```catala-test-inline
$ catala Interpret -s CasTest1
$ catala Interpret -s CasTest1 --disable_warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 12.06 €
```
```catala-test-inline
$ catala Interpret -s CasTest2
$ catala Interpret -s CasTest2 --disable_warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 23.12 €
```
```catala-test-inline
$ catala Interpret -s CasTest3
$ catala Interpret -s CasTest3 --disable_warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 154.78 €
```
```catala-test-inline
$ catala Interpret -s CasTest4
$ catala Interpret -s CasTest4 --disable_warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 154.78 €
```
```catala-test-inline
$ catala Interpret -s CasTest5
$ catala Interpret -s CasTest5 --disable_warnings
[RESULT] Computation successful! Results:
[RESULT] montant = 129.65 €
```

View File

@ -242,12 +242,240 @@ champ d'application Exemple2 :
```
```catala-test-inline
$ catala Interpret -s Exemple1
$ catala Interpret -s Exemple1 --disable_warnings
[RESULT] Computation successful! Results:
[RESULT] éligible = true
```
```catala-test-inline
$ catala Typecheck
[WARNING] In scope "RessourcesAidesPersonnelleLogement", the variable "ressources_ménage_arrondies.seuil" is declared but never defined; did you forget something?
┌─⯈ examples/aides_logement/tests/../prologue.catala_fr:496.9-14:
└───┐
496 │ état seuil
│ ‾‾‾‾‾
└┬ Prologue : aides au logement
└┬ Déclarations des champs d'application
└─ Prise en compte des ressources pour les aides personnelles au logement
[WARNING] In scope "RessourcesAidesPersonnelleLogement", the variable "ressources_forfaitaires_r822_20" is declared but never defined; did you forget something?
┌─⯈ examples/aides_logement/tests/../prologue.catala_fr:504.10-41:
└───┐
504 │ interne ressources_forfaitaires_r822_20 contenu argent
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└┬ Prologue : aides au logement
└┬ Déclarations des champs d'application
└─ Prise en compte des ressources pour les aides personnelles au logement
[WARNING] In scope "ÉligibilitéAidesPersonnelleLogement", the variable "condition_prêt" is never used anywhere; maybe it's unnecessary?
┌─⯈ examples/aides_logement/tests/../prologue.catala_fr:292.10-24:
└───┐
292 │ interne condition_prêt condition dépend de prêt contenu Prêt
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└┬ Prologue : aides au logement
└┬ Déclarations des champs d'application
└─ Éligibilité aux aides personnelles au logement
[WARNING] In scope "ÉligibilitéAidesPersonnelleLogement", the variable "condition_peuplement_logement_l822_10" is never used anywhere; maybe it's unnecessary?
┌─⯈ examples/aides_logement/tests/../prologue.catala_fr:301.10-47:
└───┐
301 │ interne condition_peuplement_logement_l822_10 condition
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└┬ Prologue : aides au logement
└┬ Déclarations des champs d'application
└─ Éligibilité aux aides personnelles au logement
[WARNING] In scope "ÉligibilitéAidesPersonnelleLogement", the variable "patrimoine_pris_en_compte" is never used anywhere; maybe it's unnecessary?
┌─⯈ examples/aides_logement/tests/../prologue.catala_fr:314.10-35:
└───┐
314 │ interne patrimoine_pris_en_compte contenu argent
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└┬ Prologue : aides au logement
└┬ Déclarations des champs d'application
└─ Éligibilité aux aides personnelles au logement
[WARNING] In scope "ÉligibilitéPrimeDeDéménagement", the variable "éligibilité_logement" is never used anywhere; maybe it's unnecessary?
┌─⯈ examples/aides_logement/tests/../prologue.catala_fr:457.10-30:
└───┐
457 │ interne éligibilité_logement condition
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└┬ Prologue : aides au logement
└┬ Déclarations des champs d'application
└─ Éligibilité à la prime de déménagement
[WARNING] In scope "RessourcesAidesPersonnelleLogement", the variable "ressources_ménage_arrondies.seuil" is never used anywhere; maybe it's unnecessary?
┌─⯈ examples/aides_logement/tests/../prologue.catala_fr:496.9-14:
└───┐
496 │ état seuil
│ ‾‾‾‾‾
└┬ Prologue : aides au logement
└┬ Déclarations des champs d'application
└─ Prise en compte des ressources pour les aides personnelles au logement
[WARNING] In scope "RessourcesAidesPersonnelleLogement", the variable "ressources_ménage_arrondies.base" is never used anywhere; maybe it's unnecessary?
┌─⯈ examples/aides_logement/tests/../prologue.catala_fr:495.9-13:
└───┐
495 │ état base
│ ‾‾‾‾
└┬ Prologue : aides au logement
└┬ Déclarations des champs d'application
└─ Prise en compte des ressources pour les aides personnelles au logement
[WARNING] In scope "RessourcesAidesPersonnelleLogement", the variable "abattement_r_822_8" is never used anywhere; maybe it's unnecessary?
┌─⯈ examples/aides_logement/tests/../prologue.catala_fr:499.10-28:
└───┐
499 │ interne abattement_r_822_8 contenu argent
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└┬ Prologue : aides au logement
└┬ Déclarations des champs d'application
└─ Prise en compte des ressources pour les aides personnelles au logement
[WARNING] In scope "RessourcesAidesPersonnelleLogement", the variable "abattement_r_822_7" is never used anywhere; maybe it's unnecessary?
┌─⯈ examples/aides_logement/tests/../prologue.catala_fr:501.10-28:
└───┐
501 │ interne abattement_r_822_7 contenu argent
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└┬ Prologue : aides au logement
└┬ Déclarations des champs d'application
└─ Prise en compte des ressources pour les aides personnelles au logement
[WARNING] In scope "RessourcesAidesPersonnelleLogement", the variable "abattement_r_822_10" is never used anywhere; maybe it's unnecessary?
┌─⯈ examples/aides_logement/tests/../prologue.catala_fr:503.10-29:
└───┐
503 │ interne abattement_r_822_10 contenu argent
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└┬ Prologue : aides au logement
└┬ Déclarations des champs d'application
└─ Prise en compte des ressources pour les aides personnelles au logement
[WARNING] In scope "CalculAllocationLogement", the variable "catégorie_calcul_apl" is never used anywhere; maybe it's unnecessary?
┌─⯈ examples/aides_logement/tests/../prologue.catala_fr:1000.10-30:
└────┐
1000 │ interne catégorie_calcul_apl contenu CatégorieCalculAPL
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└┬ Prologue : aides au logement
└┬ Calcul du montant de l'allocation logement
└┬ Secteur logement-foyer
└─ Tous secteurs
[WARNING] In scope "ÉligibilitéPrestationsFamiliales", the variable "prestation_courante" is never used anywhere; maybe it's unnecessary?
┌─⯈ examples/aides_logement/tests/../../prestations_familiales/prologue.catala_fr:48.9-28:
└──┐
48 │ entrée prestation_courante contenu ÉlémentPrestationsFamiliales
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└─ Prologue : prestations familiales
[WARNING] The constructor "AllocationJeuneEnfant" of enumeration "PrestationReçue" is never used; maybe it's unnecessary?
┌─⯈ examples/aides_logement/tests/../prologue.catala_fr:132.5-26:
└───┐
132 │ -- AllocationJeuneEnfant
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└┬ Prologue : aides au logement
└┬ Types de données manipulées par le programme
└┬ Calcul et éligibilité des aides personnelles au logement
└─ Calcul et éligibilité pour tous les secteurs
[WARNING] The constructor "Descendant" of enumeration "Parenté" is never used; maybe it's unnecessary?
┌─⯈ examples/aides_logement/tests/../prologue.catala_fr:185.5-15:
└───┐
185 │ -- Descendant
│ ‾‾‾‾‾‾‾‾‾‾
└┬ Prologue : aides au logement
└┬ Types de données manipulées par le programme
└┬ Calcul et éligibilité des aides personnelles au logement
└─ Calcul et éligibilité pour tous les secteurs
[WARNING] The constructor "CollatéralDeuxièmeTroisièmeDegré" of enumeration "Parenté" is never used; maybe it's unnecessary?
┌─⯈ examples/aides_logement/tests/../prologue.catala_fr:186.5-37:
└───┐
186 │ -- CollatéralDeuxièmeTroisièmeDegré
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└┬ Prologue : aides au logement
└┬ Types de données manipulées par le programme
└┬ Calcul et éligibilité des aides personnelles au logement
└─ Calcul et éligibilité pour tous les secteurs
[WARNING] The enumeration "PriseEnCharge" is never used; maybe it's unnecessary?
┌─⯈ examples/aides_logement/tests/../code_construction_legislatif.catala_fr:444.24-37:
└───┐
444 │ déclaration énumération PriseEnCharge:
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾
└┬ Code de la construction et de l'habitation
└┬ Partie législative
└┬ Livre VIII : Aides personnelles au logement
└┬ Titre II : Dispositions communes aux aides personnelles au logement
└┬ Chapitre III : Modalités de liquidation et de versement
└─ Article L823-2
[WARNING] The constructor "GardeAlternéeAllocataireUnique" of enumeration "PriseEnChargeEnfant" is never used; maybe it's unnecessary?
┌─⯈ examples/aides_logement/tests/../../prestations_familiales/prologue.catala_fr:10.5-35:
└──┐
10 │ -- GardeAlternéeAllocataireUnique
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└─ Prologue : prestations familiales
[WARNING] The constructor "ServicesSociauxAllocationVerséeÀLaFamille" of enumeration "PriseEnChargeEnfant" is never used; maybe it's unnecessary?
┌─⯈ examples/aides_logement/tests/../../prestations_familiales/prologue.catala_fr:12.5-46:
└──┐
12 │ -- ServicesSociauxAllocationVerséeÀLaFamille
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└─ Prologue : prestations familiales
[WARNING] The constructor "ServicesSociauxAllocationVerséeAuxServicesSociaux" of enumeration "PriseEnChargeEnfant" is never used; maybe it's unnecessary?
┌─⯈ examples/aides_logement/tests/../../prestations_familiales/prologue.catala_fr:13.5-54:
└──┐
13 │ -- ServicesSociauxAllocationVerséeAuxServicesSociaux
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└─ Prologue : prestations familiales
[WARNING] The constructor "PrestationAccueilJeuneEnfant" of enumeration "ÉlémentPrestationsFamiliales" is never used; maybe it's unnecessary?
┌─⯈ examples/aides_logement/tests/../../prestations_familiales/prologue.catala_fr:30.5-33:
└──┐
30 │ -- PrestationAccueilJeuneEnfant
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└─ Prologue : prestations familiales
[WARNING] The constructor "ComplémentFamilial" of enumeration "ÉlémentPrestationsFamiliales" is never used; maybe it's unnecessary?
┌─⯈ examples/aides_logement/tests/../../prestations_familiales/prologue.catala_fr:32.5-23:
└──┐
32 │ -- ComplémentFamilial
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└─ Prologue : prestations familiales
[WARNING] The constructor "AllocationLogement" of enumeration "ÉlémentPrestationsFamiliales" is never used; maybe it's unnecessary?
┌─⯈ examples/aides_logement/tests/../../prestations_familiales/prologue.catala_fr:33.5-23:
└──┐
33 │ -- AllocationLogement
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└─ Prologue : prestations familiales
[WARNING] The constructor "AllocationÉducationEnfantHandicapé" of enumeration "ÉlémentPrestationsFamiliales" is never used; maybe it's unnecessary?
┌─⯈ examples/aides_logement/tests/../../prestations_familiales/prologue.catala_fr:34.5-39:
└──┐
34 │ -- AllocationÉducationEnfantHandicapé
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└─ Prologue : prestations familiales
[WARNING] The constructor "AllocationSoutienFamilial" of enumeration "ÉlémentPrestationsFamiliales" is never used; maybe it's unnecessary?
┌─⯈ examples/aides_logement/tests/../../prestations_familiales/prologue.catala_fr:35.5-30:
└──┐
35 │ -- AllocationSoutienFamilial
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└─ Prologue : prestations familiales
[WARNING] The constructor "AllocationRentréeScolaire" of enumeration "ÉlémentPrestationsFamiliales" is never used; maybe it's unnecessary?
┌─⯈ examples/aides_logement/tests/../../prestations_familiales/prologue.catala_fr:36.5-30:
└──┐
36 │ -- AllocationRentréeScolaire
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└─ Prologue : prestations familiales
[WARNING] The constructor "AllocationJournalièrePresenceParentale" of enumeration "ÉlémentPrestationsFamiliales" is never used; maybe it's unnecessary?
┌─⯈ examples/aides_logement/tests/../../prestations_familiales/prologue.catala_fr:37.5-43:
└──┐
37 │ -- AllocationJournalièrePresenceParentale
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└─ Prologue : prestations familiales
[RESULT] Typechecking successful!
```

View File

@ -349,71 +349,159 @@ champ d'application Test14:
```
```catala-test-inline
$ catala Interpret -s Test1
$ catala Typecheck
[WARNING] In scope "PrestationsFamiliales", the variable "prestation_courante" is never used anywhere; maybe it's unnecessary?
┌─⯈ examples/allocations_familiales/tests/../prologue.catala_fr:63.9-28:
└──┐
63 │ entrée prestation_courante contenu ÉlémentPrestationsFamiliales
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└┬ Prologue
└┬ Champs d'applications
└─ Prestations familiales
[WARNING] In scope "AllocationsFamiliales", the variable "versement" is never used anywhere; maybe it's unnecessary?
┌─⯈ examples/allocations_familiales/tests/../prologue.catala_fr:98.10-19:
└──┐
98 │ interne versement contenu VersementAllocations dépend de enfant contenu Enfant
│ ‾‾‾‾‾‾‾‾‾
└┬ Prologue
└┬ Champs d'applications
└─ Allocations familiales
[WARNING] In scope "AllocationsFamiliales", the variable "nombre_enfants_l521_1" is never used anywhere; maybe it's unnecessary?
┌─⯈ examples/allocations_familiales/tests/../prologue.catala_fr:151.10-31:
└───┐
151 │ interne nombre_enfants_l521_1 contenu entier
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└┬ Prologue
└┬ Champs d'applications
└─ Allocations familiales
[WARNING] The constructor "PrestationAccueilJeuneEnfant" of enumeration "ÉlémentPrestationsFamiliales" is never used; maybe it's unnecessary?
┌─⯈ examples/allocations_familiales/tests/../prologue.catala_fr:41.5-33:
└──┐
41 │ -- PrestationAccueilJeuneEnfant
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└┬ Prologue
└─ Types de données manipulées par le programme
[WARNING] The constructor "ComplémentFamilial" of enumeration "ÉlémentPrestationsFamiliales" is never used; maybe it's unnecessary?
┌─⯈ examples/allocations_familiales/tests/../prologue.catala_fr:43.5-23:
└──┐
43 │ -- ComplémentFamilial
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└┬ Prologue
└─ Types de données manipulées par le programme
[WARNING] The constructor "AllocationLogement" of enumeration "ÉlémentPrestationsFamiliales" is never used; maybe it's unnecessary?
┌─⯈ examples/allocations_familiales/tests/../prologue.catala_fr:44.5-23:
└──┐
44 │ -- AllocationLogement
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└┬ Prologue
└─ Types de données manipulées par le programme
[WARNING] The constructor "AllocationÉducationEnfantHandicapé" of enumeration "ÉlémentPrestationsFamiliales" is never used; maybe it's unnecessary?
┌─⯈ examples/allocations_familiales/tests/../prologue.catala_fr:45.5-39:
└──┐
45 │ -- AllocationÉducationEnfantHandicapé
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└┬ Prologue
└─ Types de données manipulées par le programme
[WARNING] The constructor "AllocationSoutienFamilial" of enumeration "ÉlémentPrestationsFamiliales" is never used; maybe it's unnecessary?
┌─⯈ examples/allocations_familiales/tests/../prologue.catala_fr:46.5-30:
└──┐
46 │ -- AllocationSoutienFamilial
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└┬ Prologue
└─ Types de données manipulées par le programme
[WARNING] The constructor "AllocationRentréeScolaire" of enumeration "ÉlémentPrestationsFamiliales" is never used; maybe it's unnecessary?
┌─⯈ examples/allocations_familiales/tests/../prologue.catala_fr:47.5-30:
└──┐
47 │ -- AllocationRentréeScolaire
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└┬ Prologue
└─ Types de données manipulées par le programme
[WARNING] The constructor "AllocationJournalièrePresenceParentale" of enumeration "ÉlémentPrestationsFamiliales" is never used; maybe it's unnecessary?
┌─⯈ examples/allocations_familiales/tests/../prologue.catala_fr:48.5-43:
└──┐
48 │ -- AllocationJournalièrePresenceParentale
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└┬ Prologue
└─ Types de données manipulées par le programme
[RESULT] Typechecking successful!
```
```catala-test-inline
$ catala Interpret -s Test1 --disable_warnings
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret -s Test2
$ catala Interpret -s Test2 --disable_warnings
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret -s Test3
$ catala Interpret -s Test3 --disable_warnings
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret -s Test4
$ catala Interpret -s Test4 --disable_warnings
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret -s Test5
$ catala Interpret -s Test5 --disable_warnings
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret -s Test6
$ catala Interpret -s Test6 --disable_warnings
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret -s Test7
$ catala Interpret -s Test7 --disable_warnings
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret -s Test8
$ catala Interpret -s Test8 --disable_warnings
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret -s Test9
$ catala Interpret -s Test9 --disable_warnings
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret -s Test10
$ catala Interpret -s Test10 --disable_warnings
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret -s Test11
$ catala Interpret -s Test11 --disable_warnings
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret -s Test12
$ catala Interpret -s Test12 --disable_warnings
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret -s Test13
$ catala Interpret -s Test13 --disable_warnings
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret -s Test13
$ catala Interpret -s Test13 --disable_warnings
[RESULT] Computation successful!
```

View File

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

View File

@ -23,11 +23,11 @@ zakres Test_A7_U1_P1_PPb:
```
```catala-test-inline
$ catala Interpret -s Test_A7_U1_P1_PPa
$ catala Interpret -s Test_A7_U1_P1_PPa --disable_warnings
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret -s Test_A7_U1_P1_PPb
$ 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
$ catala Interpret -s Test_A7_U1_P2_PPa --disable_warnings
[RESULT] Computation successful!
```
```catala-test-inline
$ catala Interpret -s Test_A7_U1_P2_PPb
$ 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 sprzedaz.podatek = 1 PLN
```
```catala-test-inline
$ catala Interpret -s Test_A7_U1_P3
$ catala Interpret -s Test_A7_U1_P3 --disable_warnings
[RESULT] Computation successful!
```

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

40872
french_law/js/french_law.js generated

File diff suppressed because one or more lines are too long

View File

@ -33,6 +33,30 @@ scope Money:
```catala-test-inline
$ catala Interpret -s Dec
[WARNING] In scope "Int", the variable "i" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_arithmetic/bad/division_by_zero.catala_en:7.10-11:
└─┐
7 │ context i content decimal
│ ‾
└┬ `Division_by_zero` exception management
└─ with integers
[WARNING] In scope "Dec", the variable "i" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_arithmetic/bad/division_by_zero.catala_en:17.10-11:
└──┐
17 │ context i content decimal
│ ‾
└┬ `Division_by_zero` exception management
└─ with decimals
[WARNING] In scope "Money", the variable "i" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_arithmetic/bad/division_by_zero.catala_en:27.10-11:
└──┐
27 │ context i content decimal
│ ‾
└┬ `Division_by_zero` exception management
└─ with money
[ERROR] division by zero at runtime
The division operator:
@ -55,6 +79,30 @@ The null denominator:
```catala-test-inline
$ catala Interpret -s Int
[WARNING] In scope "Int", the variable "i" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_arithmetic/bad/division_by_zero.catala_en:7.10-11:
└─┐
7 │ context i content decimal
│ ‾
└┬ `Division_by_zero` exception management
└─ with integers
[WARNING] In scope "Dec", the variable "i" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_arithmetic/bad/division_by_zero.catala_en:17.10-11:
└──┐
17 │ context i content decimal
│ ‾
└┬ `Division_by_zero` exception management
└─ with decimals
[WARNING] In scope "Money", the variable "i" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_arithmetic/bad/division_by_zero.catala_en:27.10-11:
└──┐
27 │ context i content decimal
│ ‾
└┬ `Division_by_zero` exception management
└─ with money
[ERROR] division by zero at runtime
The division operator:
@ -77,6 +125,30 @@ The null denominator:
```catala-test-inline
$ catala Interpret -s Money
[WARNING] In scope "Int", the variable "i" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_arithmetic/bad/division_by_zero.catala_en:7.10-11:
└─┐
7 │ context i content decimal
│ ‾
└┬ `Division_by_zero` exception management
└─ with integers
[WARNING] In scope "Dec", the variable "i" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_arithmetic/bad/division_by_zero.catala_en:17.10-11:
└──┐
17 │ context i content decimal
│ ‾
└┬ `Division_by_zero` exception management
└─ with decimals
[WARNING] In scope "Money", the variable "i" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_arithmetic/bad/division_by_zero.catala_en:27.10-11:
└──┐
27 │ context i content decimal
│ ‾
└┬ `Division_by_zero` exception management
└─ with money
[ERROR] division by zero at runtime
The division operator:

View File

@ -12,6 +12,13 @@ scope Test:
```catala-test-inline
$ catala Interpret -s Test
[WARNING] In scope "Test", the variable "ambiguous" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_date/bad/rounding_option.catala_en:5.10-19:
└─┐
5 │ context ambiguous content boolean
│ ‾‾‾‾‾‾‾‾‾
catala: internal error, uncaught exception:
Dates_calc.Dates.AmbiguousComputation

View File

@ -12,6 +12,13 @@ champ d'application Test:
```catala-test-inline
$ catala Interpret -s Test
[WARNING] In scope "Test", the variable "ambiguité" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_date/bad/rounding_option.catala_fr:5.11-20:
└─┐
5 │ contexte ambiguité contenu booléen
│ ‾‾‾‾‾‾‾‾‾
catala: internal error, uncaught exception:
Dates_calc.Dates.AmbiguousComputation

View File

@ -42,6 +42,38 @@ scope Ge:
```catala-test-inline
$ catala Interpret -s Ge
[WARNING] In scope "Lt", the variable "d" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:7.10-11:
└─┐
7 │ context d content boolean
│ ‾
└┬ `UncomparableDurations` exception management
└─ `<` operator
[WARNING] In scope "Le", the variable "d" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:17.10-11:
└──┐
17 │ context d content boolean
│ ‾
└┬ `UncomparableDurations` exception management
└─ `<=` operator
[WARNING] In scope "Gt", the variable "d" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:27.10-11:
└──┐
27 │ context d content boolean
│ ‾
└┬ `UncomparableDurations` exception management
└─ `<=` operator
[WARNING] In scope "Ge", the variable "d" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:37.10-11:
└──┐
37 │ context d content boolean
│ ‾
└┬ `UncomparableDurations` exception management
└─ `>=` operator
[ERROR] Cannot compare together durations that cannot be converted to a precise number of days
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:40.22-29:
@ -62,6 +94,38 @@ $ catala Interpret -s Ge
```catala-test-inline
$ catala Interpret -s Gt
[WARNING] In scope "Lt", the variable "d" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:7.10-11:
└─┐
7 │ context d content boolean
│ ‾
└┬ `UncomparableDurations` exception management
└─ `<` operator
[WARNING] In scope "Le", the variable "d" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:17.10-11:
└──┐
17 │ context d content boolean
│ ‾
└┬ `UncomparableDurations` exception management
└─ `<=` operator
[WARNING] In scope "Gt", the variable "d" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:27.10-11:
└──┐
27 │ context d content boolean
│ ‾
└┬ `UncomparableDurations` exception management
└─ `<=` operator
[WARNING] In scope "Ge", the variable "d" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:37.10-11:
└──┐
37 │ context d content boolean
│ ‾
└┬ `UncomparableDurations` exception management
└─ `>=` operator
[ERROR] Cannot compare together durations that cannot be converted to a precise number of days
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:30.22-29:
@ -82,6 +146,38 @@ $ catala Interpret -s Gt
```catala-test-inline
$ catala Interpret -s Le
[WARNING] In scope "Lt", the variable "d" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:7.10-11:
└─┐
7 │ context d content boolean
│ ‾
└┬ `UncomparableDurations` exception management
└─ `<` operator
[WARNING] In scope "Le", the variable "d" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:17.10-11:
└──┐
17 │ context d content boolean
│ ‾
└┬ `UncomparableDurations` exception management
└─ `<=` operator
[WARNING] In scope "Gt", the variable "d" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:27.10-11:
└──┐
27 │ context d content boolean
│ ‾
└┬ `UncomparableDurations` exception management
└─ `<=` operator
[WARNING] In scope "Ge", the variable "d" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:37.10-11:
└──┐
37 │ context d content boolean
│ ‾
└┬ `UncomparableDurations` exception management
└─ `>=` operator
[ERROR] Cannot compare together durations that cannot be converted to a precise number of days
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:20.22-29:
@ -102,6 +198,38 @@ $ catala Interpret -s Le
```catala-test-inline
$ catala Interpret -s Lt
[WARNING] In scope "Lt", the variable "d" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:7.10-11:
└─┐
7 │ context d content boolean
│ ‾
└┬ `UncomparableDurations` exception management
└─ `<` operator
[WARNING] In scope "Le", the variable "d" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:17.10-11:
└──┐
17 │ context d content boolean
│ ‾
└┬ `UncomparableDurations` exception management
└─ `<=` operator
[WARNING] In scope "Gt", the variable "d" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:27.10-11:
└──┐
27 │ context d content boolean
│ ‾
└┬ `UncomparableDurations` exception management
└─ `<=` operator
[WARNING] In scope "Ge", the variable "d" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:37.10-11:
└──┐
37 │ context d content boolean
│ ‾
└┬ `UncomparableDurations` exception management
└─ `>=` operator
[ERROR] Cannot compare together durations that cannot be converted to a precise number of days
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:10.22-29:

View File

@ -11,6 +11,13 @@ scope A:
```catala-test-inline
$ catala Interpret -s A
[WARNING] In scope "A", the variable "x" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_default/bad/conflict.catala_en:5.10-11:
└─┐
5 │ context x content integer
│ ‾
└─ Article
[ERROR] There is a conflict between multiple valid consequences for assigning the same variable.
This consequence has a valid justification:

View File

@ -11,6 +11,20 @@ scope A:
```catala-test-inline
$ catala Interpret -s A
[WARNING] In scope "A", the variable "x" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_default/bad/empty.catala_en:5.10-11:
└─┐
5 │ context x content integer
│ ‾
└─ Article
[WARNING] In scope "A", the variable "y" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_default/bad/empty.catala_en:6.10-11:
└─┐
6 │ context y content boolean
│ ‾
└─ Article
[ERROR] This variable evaluated to an empty term (no rule that defined it applied in this situation)
┌─⯈ tests/test_default/bad/empty.catala_en:6.10-11:

View File

@ -14,6 +14,13 @@ scope A:
```catala-test-inline
$ catala Interpret -s A
[WARNING] In scope "A", the variable "x" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_default/bad/empty_with_rules.catala_en:5.10-11:
└─┐
5 │ context x content integer
│ ‾
└─ Article
[ERROR] This variable evaluated to an empty term (no rule that defined it applied in this situation)
┌─⯈ tests/test_default/bad/empty_with_rules.catala_en:5.10-11:

View File

@ -18,6 +18,20 @@ scope A:
```catala-test-inline
$ catala Interpret -s A
[WARNING] In scope "A", the variable "out" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_enum/bad/missing_case.catala_en:11.10-13:
└──┐
11 │ context out content boolean
│ ‾‾‾
└─ Article
[WARNING] The constructor "Case3" of enumeration "E" is never used; maybe it's unnecessary?
┌─⯈ tests/test_enum/bad/missing_case.catala_en:7.5-10:
└─┐
7 │ -- Case3
│ ‾‾‾‾‾
└─ Article
[ERROR] The constructor Case3 of enum E is missing from this pattern matching
┌─⯈ tests/test_enum/bad/missing_case.catala_en:14.24-16.21:

View File

@ -20,6 +20,13 @@ scope A:
```catala-test-inline
$ catala Interpret -s A
[WARNING] In scope "A", the variable "x" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_exception/bad/exceptions_cycle.catala_en:5.10-11:
└─┐
5 │ context x content integer
│ ‾
└─ Test
[ERROR] Exception cycle detected when defining x: each of these 3 exceptions applies over the previous one, and the first applies over the last
┌─⯈ tests/test_exception/bad/exceptions_cycle.catala_en:8.2-10.14:

View File

@ -12,6 +12,13 @@ scope A:
```catala-test-inline
$ catala Interpret -s A
[WARNING] In scope "A", the variable "y" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_exception/bad/self_exception.catala_en:5.10-11:
└─┐
5 │ context y content integer
│ ‾
└─ Test
[ERROR] Cannot define rule as an exception to itself
┌─⯈ tests/test_exception/bad/self_exception.catala_en:9.12-18:

View File

@ -17,6 +17,13 @@ scope A:
```catala-test-inline
$ catala Interpret -s A
[WARNING] In scope "A", the variable "x" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_exception/bad/two_exceptions.catala_en:5.10-11:
└─┐
5 │ context x content integer
│ ‾
└─ Test
[ERROR] There is a conflict between multiple valid consequences for assigning the same variable.
This consequence has a valid justification:

View File

@ -17,6 +17,13 @@ scope B:
```catala-test-inline
$ catala Scopelang -s B
[WARNING] In scope "A", the variable "f" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_func/good/context_func.catala_en:5.10-11:
└─┐
5 │ context f content integer depends on x content integer
│ ‾
└─ Test
let scope B (b: bool|input) =
let a.f : integer → integer =
λ (x: integer) → ⟨b && x >! 0 ⊢ x -! 1⟩;
@ -25,6 +32,13 @@ let scope B (b: bool|input) =
```catala-test-inline
$ catala Dcalc -s A
[WARNING] In scope "A", the variable "f" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_func/good/context_func.catala_en:5.10-11:
└─┐
5 │ context f content integer depends on x content integer
│ ‾
└─ Test
let A =
λ (A_in: A_in {"f_in": integer → integer}) →
let f : integer → integer = A_in."f_in" in
@ -36,6 +50,13 @@ let A =
```catala-test-inline
$ catala Dcalc -s B
[WARNING] In scope "A", the variable "f" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_func/good/context_func.catala_en:5.10-11:
└─┐
5 │ context f content integer depends on x content integer
│ ‾
└─ Test
let B =
λ (B_in: B_in {"b_in": bool}) →
let b : bool = B_in."b_in" in

View File

@ -9,6 +9,13 @@ scope A:
```
```catala-test-inline
$ catala Typecheck
[WARNING] In scope "A", the variable "a" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_io/bad/redefining_input.catala_en:5.8-9:
└─┐
5 │ input a content integer
│ ‾
└─ Test
[ERROR] It is impossible to give a definition to a scope variable tagged as input.
Incriminated variable:

View File

@ -15,6 +15,13 @@ scope B:
```
```catala-test-inline
$ catala Typecheck
[WARNING] In scope "A", the variable "a" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_io/bad/using_non_output.catala_en:5.11-12:
└─┐
5 │ internal a content integer
│ ‾
└─ Test
[ERROR] The variable a.a cannot be used here, as it is not part of subscope a's results. Maybe you forgot to qualify it as an output?
Incriminated variable usage:

View File

@ -12,6 +12,13 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "y" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/bad/array_length-empty.catala_en:6.10-11:
└─┐
6 │ context y content boolean
│ ‾
└─ Test
[ERROR] [A.y] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/array_length-empty.catala_en:6.10-11:
└─┐

View File

@ -13,6 +13,13 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "y" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/bad/array_length-overlap.catala_en:6.10-11:
└─┐
6 │ context y content boolean
│ ‾
└─ Test
[ERROR] [A.y] At least two exceptions overlap for this variable:
┌─⯈ tests/test_proof/bad/array_length-overlap.catala_en:6.10-11:
└─┐

View File

@ -15,6 +15,13 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "y" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/bad/dates_get_year-empty.catala_en:6.10-11:
└─┐
6 │ context y content boolean
│ ‾
└─ Test
[ERROR] [A.y] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/dates_get_year-empty.catala_en:6.10-11:
└─┐

View File

@ -15,6 +15,13 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "y" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/bad/dates_get_year-overlap.catala_en:6.10-11:
└─┐
6 │ context y content boolean
│ ‾
└─ Test
[ERROR] [A.y] At least two exceptions overlap for this variable:
┌─⯈ tests/test_proof/bad/dates_get_year-overlap.catala_en:6.10-11:
└─┐

View File

@ -14,6 +14,13 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "y" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/bad/dates_simple-empty.catala_en:6.10-11:
└─┐
6 │ context y content boolean
│ ‾
└─ Test
[ERROR] [A.y] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/dates_simple-empty.catala_en:6.10-11:
└─┐

View File

@ -15,6 +15,13 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "y" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/bad/dates_simple-overlap.catala_en:6.10-11:
└─┐
6 │ context y content boolean
│ ‾
└─ Test
[ERROR] [A.y] At least two exceptions overlap for this variable:
┌─⯈ tests/test_proof/bad/dates_simple-overlap.catala_en:6.10-11:
└─┐

View File

@ -12,6 +12,13 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "y" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/bad/duration-empty.catala_en:6.10-11:
└─┐
6 │ context y content boolean
│ ‾
└─ Test
[ERROR] [A.y] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/duration-empty.catala_en:6.10-11:
└─┐

View File

@ -13,6 +13,13 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "y" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/bad/duration-overlap.catala_en:6.10-11:
└─┐
6 │ context y content boolean
│ ‾
└─ Test
[ERROR] [A.y] At least two exceptions overlap for this variable:
┌─⯈ tests/test_proof/bad/duration-overlap.catala_en:6.10-11:
└─┐

View File

@ -23,6 +23,20 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "x" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/bad/enums-empty.catala_en:15.10-11:
└──┐
15 │ context x content integer
│ ‾
└─ Test
[WARNING] The constructor "C" of enumeration "T" is never used; maybe it's unnecessary?
┌─⯈ tests/test_proof/bad/enums-empty.catala_en:7.6-7:
└─┐
7 │ -- C content boolean
│ ‾
└─ Test
[ERROR] [A.x] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/enums-empty.catala_en:15.10-11:
└──┐

View File

@ -21,6 +21,20 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "x" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/bad/enums-nonbool-empty.catala_en:13.10-11:
└──┐
13 │ context x content integer
│ ‾
└─ Test
[WARNING] The constructor "C" of enumeration "T" is never used; maybe it's unnecessary?
┌─⯈ tests/test_proof/bad/enums-nonbool-empty.catala_en:5.6-7:
└─┐
5 │ -- C content boolean
│ ‾
└─ Test
[ERROR] [A.x] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/enums-nonbool-empty.catala_en:13.10-11:
└──┐

View File

@ -21,6 +21,20 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "x" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/bad/enums-nonbool-overlap.catala_en:13.10-11:
└──┐
13 │ context x content integer
│ ‾
└─ Test
[WARNING] The constructor "C" of enumeration "T" is never used; maybe it's unnecessary?
┌─⯈ tests/test_proof/bad/enums-nonbool-overlap.catala_en:5.6-7:
└─┐
5 │ -- C content boolean
│ ‾
└─ Test
[ERROR] [A.x] At least two exceptions overlap for this variable:
┌─⯈ tests/test_proof/bad/enums-nonbool-overlap.catala_en:13.10-11:
└──┐

View File

@ -23,6 +23,20 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "x" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/bad/enums-overlap.catala_en:15.10-11:
└──┐
15 │ context x content integer
│ ‾
└─ Test
[WARNING] The constructor "C" of enumeration "T" is never used; maybe it's unnecessary?
┌─⯈ tests/test_proof/bad/enums-overlap.catala_en:7.6-7:
└─┐
7 │ -- C content boolean
│ ‾
└─ Test
[ERROR] [A.x] At least two exceptions overlap for this variable:
┌─⯈ tests/test_proof/bad/enums-overlap.catala_en:15.10-11:
└──┐

View File

@ -16,6 +16,20 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "y" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/bad/enums_inj-empty.catala_en:10.10-11:
└──┐
10 │ context y content integer
│ ‾
└─ Article
[WARNING] The constructor "C2" of enumeration "E" is never used; maybe it's unnecessary?
┌─⯈ tests/test_proof/bad/enums_inj-empty.catala_en:6.5-7:
└─┐
6 │ -- C2
│ ‾‾
└─ Article
[ERROR] [A.y] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/enums_inj-empty.catala_en:10.10-11:
└──┐

View File

@ -18,6 +18,13 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "y" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/bad/enums_inj-overlap.catala_en:10.10-11:
└──┐
10 │ context y content integer
│ ‾
└─ Article
[ERROR] [A.y] At least two exceptions overlap for this variable:
┌─⯈ tests/test_proof/bad/enums_inj-overlap.catala_en:10.10-11:
└──┐

View File

@ -21,6 +21,13 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "y" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/bad/enums_unit-empty.catala_en:10.10-11:
└──┐
10 │ context y content integer
│ ‾
└─ Article
[ERROR] [A.y] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/enums_unit-empty.catala_en:10.10-11:
└──┐

View File

@ -21,6 +21,13 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "y" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/bad/enums_unit-overlap.catala_en:10.10-11:
└──┐
10 │ context y content integer
│ ‾
└─ Article
[ERROR] [A.y] At least two exceptions overlap for this variable:
┌─⯈ tests/test_proof/bad/enums_unit-overlap.catala_en:10.10-11:
└──┐

View File

@ -13,6 +13,13 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "x" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/bad/let_in_condition-empty.catala_en:5.10-11:
└─┐
5 │ context x content boolean
│ ‾
└─ Test
[ERROR] [A.x] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/let_in_condition-empty.catala_en:5.10-11:
└─┐

View File

@ -16,6 +16,13 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "y" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/bad/money-empty.catala_en:8.10-11:
└─┐
8 │ context y content boolean
│ ‾
└─ Test
[ERROR] [A.y] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/money-empty.catala_en:8.10-11:
└─┐

View File

@ -17,6 +17,13 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "y" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/bad/money-overlap.catala_en:8.10-11:
└─┐
8 │ context y content boolean
│ ‾
└─ Test
[ERROR] [A.y] At least two exceptions overlap for this variable:
┌─⯈ tests/test_proof/bad/money-overlap.catala_en:8.10-11:
└─┐

View File

@ -17,6 +17,13 @@ scope A:
```
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "y" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/bad/no_vars-conflict.catala_en:8.10-11:
└─┐
8 │ context y content integer
│ ‾
└─ Test
[ERROR] [A.y] At least two exceptions overlap for this variable:
┌─⯈ tests/test_proof/bad/no_vars-conflict.catala_en:8.10-11:
└─┐

View File

@ -16,6 +16,13 @@ scope A:
```
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "y" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/bad/no_vars-empty.catala_en:7.10-11:
└─┐
7 │ context y content integer
│ ‾
└─ Test
[ERROR] [A.y] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/no_vars-empty.catala_en:7.10-11:
└─┐

View File

@ -123,6 +123,22 @@ scope Amount:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "Amount", the variable "amount" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/bad/prolala_motivating_example.catala_en:60.10-16:
└──┐
60 │ context amount content integer
│ ‾‾‾‾‾‾
└┬ ProLaLa 2022 Super Cash Bonus
└─ Amount
[WARNING] In scope "Amount", the variable "correct_amount" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/bad/prolala_motivating_example.catala_en:61.10-24:
└──┐
61 │ context correct_amount content integer
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└┬ ProLaLa 2022 Super Cash Bonus
└─ Amount
[ERROR] [Amount.amount] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/prolala_motivating_example.catala_en:60.10-16:
└──┐

View File

@ -12,6 +12,13 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "y" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/bad/rationals-empty.catala_en:6.10-11:
└─┐
6 │ context y content boolean
│ ‾
└─ Test
[ERROR] [A.y] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/rationals-empty.catala_en:6.10-11:
└─┐

View File

@ -13,6 +13,13 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "y" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/bad/rationals-overlap.catala_en:6.10-11:
└─┐
6 │ context y content boolean
│ ‾
└─ Test
[ERROR] [A.y] At least two exceptions overlap for this variable:
┌─⯈ tests/test_proof/bad/rationals-overlap.catala_en:6.10-11:
└─┐

View File

@ -40,6 +40,13 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "x10" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/bad/sat_solving.catala_en:15.10-13:
└──┐
15 │ context x10 content boolean
│ ‾‾‾
└─ Test
[ERROR] [A.x10] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/sat_solving.catala_en:15.10-13:
└──┐

View File

@ -21,6 +21,13 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "x" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/bad/structs-empty.catala_en:13.10-11:
└──┐
13 │ context x content integer
│ ‾
└─ Test
[ERROR] [A.x] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/structs-empty.catala_en:13.10-11:
└──┐

View File

@ -21,6 +21,13 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "x" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/bad/structs-overlap.catala_en:13.10-11:
└──┐
13 │ context x content integer
│ ‾
└─ Test
[ERROR] [A.x] At least two exceptions overlap for this variable:
┌─⯈ tests/test_proof/bad/structs-overlap.catala_en:13.10-11:
└──┐

View File

@ -13,5 +13,12 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "y" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/good/array_length.catala_en:6.10-11:
└─┐
6 │ context y content boolean
│ ‾
└─ Test
[RESULT] No errors found during the proof mode run.
```

View File

@ -15,5 +15,12 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "y" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/good/dates_get_year.catala_en:6.10-11:
└─┐
6 │ context y content boolean
│ ‾
└─ Test
[RESULT] No errors found during the proof mode run.
```

View File

@ -15,5 +15,12 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "y" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/good/dates_simple.catala_en:6.10-11:
└─┐
6 │ context y content boolean
│ ‾
└─ Test
[RESULT] No errors found during the proof mode run.
```

View File

@ -13,5 +13,12 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "y" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/good/duration.catala_en:6.10-11:
└─┐
6 │ context y content boolean
│ ‾
└─ Test
[RESULT] No errors found during the proof mode run.
```

View File

@ -21,5 +21,19 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "x" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/good/enums-arith.catala_en:13.10-11:
└──┐
13 │ context x content integer
│ ‾
└─ Test
[WARNING] The constructor "C" of enumeration "T" is never used; maybe it's unnecessary?
┌─⯈ tests/test_proof/good/enums-arith.catala_en:5.6-7:
└─┐
5 │ -- C content boolean
│ ‾
└─ Test
[RESULT] No errors found during the proof mode run.
```

View File

@ -21,5 +21,19 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "x" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/good/enums-nonbool.catala_en:13.10-11:
└──┐
13 │ context x content integer
│ ‾
└─ Test
[WARNING] The constructor "C" of enumeration "T" is never used; maybe it's unnecessary?
┌─⯈ tests/test_proof/good/enums-nonbool.catala_en:5.6-7:
└─┐
5 │ -- C content boolean
│ ‾
└─ Test
[RESULT] No errors found during the proof mode run.
```

View File

@ -20,5 +20,19 @@ scope A:
```
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "x" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/good/enums.catala_en:13.10-11:
└──┐
13 │ context x content integer
│ ‾
└─ Test
[WARNING] The constructor "C" of enumeration "T" is never used; maybe it's unnecessary?
┌─⯈ tests/test_proof/good/enums.catala_en:5.6-7:
└─┐
5 │ -- C content boolean
│ ‾
└─ Test
[RESULT] No errors found during the proof mode run.
```

View File

@ -17,5 +17,12 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "y" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/good/enums_inj.catala_en:10.10-11:
└──┐
10 │ context y content integer
│ ‾
└─ Article
[RESULT] No errors found during the proof mode run.
```

View File

@ -21,5 +21,12 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "y" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/good/enums_unit.catala_en:10.10-11:
└──┐
10 │ context y content integer
│ ‾
└─ Article
[RESULT] No errors found during the proof mode run.
```

View File

@ -14,5 +14,12 @@ scope A:
```
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "z" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/good/functions.catala_en:6.10-11:
└─┐
6 │ context z content integer
│ ‾
└─ Test
[RESULT] No errors found during the proof mode run.
```

View File

@ -13,5 +13,12 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "x" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/good/let_in_condition.catala_en:5.10-11:
└─┐
5 │ context x content boolean
│ ‾
└─ Test
[RESULT] No errors found during the proof mode run.
```

View File

@ -15,5 +15,12 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "y" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/good/money.catala_en:6.10-11:
└─┐
6 │ context y content boolean
│ ‾
└─ Test
[RESULT] No errors found during the proof mode run.
```

View File

@ -10,5 +10,12 @@ scope A:
```
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "x" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/good/no_vars.catala_en:5.10-11:
└─┐
5 │ context x content integer
│ ‾
└─ Test
[RESULT] No errors found during the proof mode run.
```

View File

@ -13,5 +13,12 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "y" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/good/rationals.catala_en:6.10-11:
└─┐
6 │ context y content boolean
│ ‾
└─ Test
[RESULT] No errors found during the proof mode run.
```

View File

@ -16,5 +16,12 @@ scope A:
```
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "z" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/good/simple_vars.catala_en:7.10-11:
└─┐
7 │ context z content integer
│ ‾
└─ Test
[RESULT] No errors found during the proof mode run.
```

View File

@ -20,5 +20,12 @@ scope A:
```
```catala-test-inline
$ catala Proof --disable_counterexamples
[WARNING] In scope "A", the variable "x" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_proof/good/structs.catala_en:13.10-11:
└──┐
13 │ context x content integer
│ ‾
└─ Test
[RESULT] No errors found during the proof mode run.
```

View File

@ -16,6 +16,20 @@ scope A:
```catala-test-inline
$ catala Interpret -s A
[WARNING] In scope "A", the variable "a" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_scope/bad/scope.catala_en:5.10-11:
└─┐
5 │ context a content integer
│ ‾
└─ Article
[WARNING] In scope "A", the variable "b" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_scope/bad/scope.catala_en:6.10-11:
└─┐
6 │ context b content integer
│ ‾
└─ Article
[ERROR] There is a conflict between multiple valid consequences for assigning the same variable.
This consequence has a valid justification:

View File

@ -16,6 +16,13 @@ scope Titi:
```catala-test-inline
$ catala dcalc -s Titi
[WARNING] In scope "Toto", the variable "baz" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_scope/bad/scope_call_missing.catala_en:4.8-11:
└─┐
4 │ input baz content decimal
│ ‾‾‾
[ERROR] Definition of input variable 'baz' missing in this scope call
┌─⯈ tests/test_scope/bad/scope_call_missing.catala_en:14.25-55:

View File

@ -17,6 +17,13 @@ scope ScopeB:
```catala-test-inline
$ catala OCaml
[WARNING] In scope "ScopeB", the variable "a" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_scope/good/191_fix_record_name_confusion.catala_en:8.10-11:
└─┐
8 │ context a content boolean
│ ‾
└─ Article
(** This file has been generated by the Catala compiler, do not edit! *)
open Runtime_ocaml.Runtime

View File

@ -7,6 +7,13 @@ declaration scope Foo2:
```catala-test-inline
$ catala Scalc -s Foo2 -O -t
[WARNING] In scope "Foo2", the variable "bar" is declared but never defined; did you forget something?
┌─⯈ tests/test_scope/good/nothing.catala_en:5.9-12:
└─┐
5 │ output bar content integer
│ ‾‾‾
└─ Test
let Foo2_3 (Foo2_in_2: Foo2_in {}) =
decl temp_bar_4 : any;
temp_bar_4 = dead_value_1;

View File

@ -26,6 +26,13 @@ scope Foo:
```catala-test-inline
$ catala interpret -s Foo
[WARNING] The structure "Test" is never used; maybe it's unnecessary?
┌─⯈ tests/test_scope/good/scope_call.catala_en:2.22-26:
└─┐
2 │ declaration structure Test:
│ ‾‾‾‾
[RESULT] Computation successful! Results:
[RESULT] example = -7
```

View File

@ -14,6 +14,20 @@ scope A:
```catala-test-inline
$ catala Interpret -s A
[WARNING] In scope "A", the variable "y" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_struct/bad/nested.catala_en:9.10-11:
└─┐
9 │ context y content E
│ ‾
└─ Article
[WARNING] The constructor "Rec" of enumeration "E" is never used; maybe it's unnecessary?
┌─⯈ tests/test_struct/bad/nested.catala_en:6.5-8:
└─┐
6 │ -- Rec content E
│ ‾‾‾
└─ Article
[ERROR] The type E is defined using itself, which is forbidden since Catala does not provide recursive types
┌─⯈ tests/test_struct/bad/nested.catala_en:6.17-18:

View File

@ -15,6 +15,27 @@ declaration scope A:
```catala-test-inline
$ catala Interpret -s A
[WARNING] In scope "A", the variable "x" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_struct/bad/nested2.catala_en:13.10-11:
└──┐
13 │ context x content E
│ ‾
└─ Article
[WARNING] The structure "S" is never used; maybe it's unnecessary?
┌─⯈ tests/test_struct/bad/nested2.catala_en:4.22-23:
└─┐
4 │ declaration structure S:
│ ‾
└─ Article
[WARNING] The enumeration "E" is never used; maybe it's unnecessary?
┌─⯈ tests/test_struct/bad/nested2.catala_en:8.24-25:
└─┐
8 │ declaration enumeration E:
│ ‾
└─ Article
[ERROR] Cyclic dependency detected between types!
Cycle type S, declared:

View File

@ -19,7 +19,7 @@ scope A:
```catala-test-inline
$ catala Interpret -s A
[ERROR] Field g does not belong to structure Foo, but to Bar
[ERROR] Field "g" does not belong to structure "Foo", but to "Bar"
┌─⯈ tests/test_struct/bad/wrong_qualified_field.catala_en:17.22-29:
└──┐

View File

@ -18,5 +18,19 @@ scope A:
```catala-test-inline
$ catala Interpret -s A
[WARNING] In scope "A", the variable "y" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_struct/good/ambiguous_fields.catala_en:12.10-11:
└──┐
12 │ context y content integer
│ ‾
└─ Article
[WARNING] The structure "Bar" is never used; maybe it's unnecessary?
┌─⯈ tests/test_struct/good/ambiguous_fields.catala_en:7.22-25:
└─┐
7 │ declaration structure Bar:
│ ‾‾‾
└─ Article
[RESULT] Computation successful!
```

View File

@ -18,6 +18,13 @@ scope A:
```catala-test-inline
$ catala Interpret -s A
[WARNING] The structure "Bar" is never used; maybe it's unnecessary?
┌─⯈ tests/test_struct/good/same_name_fields.catala_en:7.22-25:
└─┐
7 │ declaration structure Bar:
│ ‾‾‾
└─ Article
[RESULT] Computation successful! Results:
[RESULT] x = Foo { "f"= 1 }
[RESULT] y = 1

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