From 603bd99c1d5f4ff1b3bf92ab611476f5669416ec Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Mon, 12 Jun 2023 14:30:49 +0200 Subject: [PATCH 01/26] Fix extra dot --- catala_legifrance.opam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catala_legifrance.opam b/catala_legifrance.opam index ec0dfcee..6b0a8281 100644 --- a/catala_legifrance.opam +++ b/catala_legifrance.opam @@ -1,6 +1,6 @@ opam-version: "2.0" version: "0.8.0" -synopsis: "Linter that queries the LégiFrance API to check for correctness and expiration of Catala programs." +synopsis: "Linter that queries the LégiFrance API to check for correctness and expiration of Catala programs" maintainer: ["contact@catala-lang.org"] authors: ["Denis Merigoux"] license: "Apache-2.0" From cdae3e43ac5635c8305485d4253a2d6f8a0183c6 Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Mon, 12 Jun 2023 15:02:08 +0200 Subject: [PATCH 02/26] Improve names of temp variable in monadic pass --- compiler/lcalc/ast.ml | 4 +- compiler/lcalc/compile_without_exceptions.ml | 86 +++++++++++++------- compiler/shared_ast/expr.ml | 4 +- compiler/shared_ast/expr.mli | 2 +- 4 files changed, 60 insertions(+), 36 deletions(-) diff --git a/compiler/lcalc/ast.ml b/compiler/lcalc/ast.ml index 23474b05..a9e8ef17 100644 --- a/compiler/lcalc/ast.ml +++ b/compiler/lcalc/ast.ml @@ -113,13 +113,13 @@ module OptionMonad = struct (List.to_seq [ ( Expr.none_constr, - let x = Var.make var_name in + let x = Var.make "_" in Expr.eabs (Expr.bind [| x |] (Expr.eraise NoValueProvided mark)) [TAny, Expr.mark_pos mark] mark ); (* | None x -> raise NoValueProvided *) - Expr.some_constr, Expr.fun_id mark (* | Some x -> x*); + Expr.some_constr, Expr.fun_id ~var_name mark (* | Some x -> x*); ]) in if toplevel then Expr.ematch arg Expr.option_enum cases mark diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index 7929bf54..8f420379 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -102,6 +102,12 @@ let rec trans (ctx : typed ctx) (e : typed D.expr) : (lcalc, typed) boxed_gexpr let mark = m in let pos = Expr.pos e in (* Messages.emit_debug "%a" (Print.expr ~debug:true ()) e; *) + let context_or_same_var (ctx : typed ctx) (e : typed D.expr) : string = + match Mark.remove e with + | EInj { e = EVar v, _; _ } | EVar v -> Bindlib.name_of v + | EInj { e = ELit _, _; _ } | ELit _ -> "lit" + | _ -> ctx.ctx_context_name + in match Mark.remove e with | EVar x -> if (Var.Map.find x ctx.ctx_vars).info_pure then @@ -152,7 +158,7 @@ let rec trans (ctx : typed ctx) (e : typed D.expr) : (lcalc, typed) boxed_gexpr | EErrorOnEmpty arg -> let arg' = trans ctx arg in Ast.OptionMonad.error_on_empty arg' ~mark ~toplevel:false - ~var_name:ctx.ctx_context_name + ~var_name:(context_or_same_var ctx arg) | EApp { f = EVar scope, _; args = [(EStruct { fields; name }, _)] } when (Var.Map.find scope ctx.ctx_vars).is_scope -> (* Scopes are encoded as functions that can take option arguments, and @@ -175,19 +181,21 @@ let rec trans (ctx : typed ctx) (e : typed D.expr) : (lcalc, typed) boxed_gexpr As every function of type [a -> b] but top-level scopes is built using this function, returning a function of type [a -> b option], we should use [Ast.OptionMonad.mbind]. *) - let f_var = Var.make ctx.ctx_context_name in + let f_var = Var.make (Bindlib.name_of ff) in Ast.OptionMonad.bind_var ~mark - (Ast.OptionMonad.mbind ~var_name:ctx.ctx_context_name + (Ast.OptionMonad.mbind + ~var_name:(context_or_same_var ctx (List.hd args)) (Expr.evar f_var mark) (List.map (trans ctx) args) ~mark) f_var (trans ctx f) - | EApp { f = (EStructAccess _, _) as f; args } -> + | EApp { f = (EStructAccess { e = es; _ }, _) as f; args } -> (* This occurs when calling a subscope function. The same encoding as the one for [EApp (Var _) _] if the variable is not a scope works. *) - let f_var = Var.make ctx.ctx_context_name in + let f_var = Var.make (context_or_same_var ctx es) in Ast.OptionMonad.bind_var ~mark - (Ast.OptionMonad.mbind ~var_name:ctx.ctx_context_name + (Ast.OptionMonad.mbind + ~var_name:(context_or_same_var ctx es) (Expr.evar f_var mark) (List.map (trans ctx) args) ~mark) @@ -223,15 +231,17 @@ let rec trans (ctx : typed ctx) (e : typed D.expr) : (lcalc, typed) boxed_gexpr let x1 = Var.make "f" in let x2 = Var.make "init" in let f' = - Ast.OptionMonad.bind_cont ~mark ~var_name:ctx.ctx_context_name - (fun f -> + Ast.OptionMonad.bind_cont ~mark + ~var_name:(context_or_same_var ctx f) + (fun f' -> Ast.OptionMonad.return ~mark (Expr.eabs (Expr.bind [| x1; x2 |] - (Ast.OptionMonad.mbind_cont ~var_name:ctx.ctx_context_name + (Ast.OptionMonad.mbind_cont + ~var_name:(context_or_same_var ctx f) ~mark (fun vars -> - Expr.eapp (Expr.evar f m) + Expr.eapp (Expr.evar f' m) (ListLabels.map vars ~f:(fun v -> Expr.evar v m)) m) [Expr.evar x1 m; Expr.evar x2 m])) @@ -239,7 +249,8 @@ let rec trans (ctx : typed ctx) (e : typed D.expr) : (lcalc, typed) boxed_gexpr m)) (trans ctx f) in - Ast.OptionMonad.mbind ~var_name:ctx.ctx_context_name + Ast.OptionMonad.mbind + ~var_name:(context_or_same_var ctx f) (Expr.eop (trans_op Op.Fold) tys opmark) [f'; Ast.OptionMonad.return ~mark (trans ctx init); trans ctx l] ~mark @@ -247,15 +258,17 @@ let rec trans (ctx : typed ctx) (e : typed D.expr) : (lcalc, typed) boxed_gexpr let x1 = Var.make "f" in let x2 = Var.make "init" in let f' = - Ast.OptionMonad.bind_cont ~mark ~var_name:ctx.ctx_context_name - (fun f -> + Ast.OptionMonad.bind_cont ~mark + ~var_name:(context_or_same_var ctx f) + (fun f' -> Ast.OptionMonad.return ~mark (Expr.eabs (Expr.bind [| x1; x2 |] - (Ast.OptionMonad.mbind_cont ~var_name:ctx.ctx_context_name + (Ast.OptionMonad.mbind_cont + ~var_name:(context_or_same_var ctx f) ~mark (fun vars -> - Expr.eapp (Expr.evar f m) + Expr.eapp (Expr.evar f' m) (ListLabels.map vars ~f:(fun v -> Expr.evar v m)) m) [Expr.evar x1 m; Expr.evar x2 m])) @@ -263,7 +276,8 @@ let rec trans (ctx : typed ctx) (e : typed D.expr) : (lcalc, typed) boxed_gexpr m)) (trans ctx f) in - Ast.OptionMonad.mbind ~var_name:ctx.ctx_context_name + Ast.OptionMonad.mbind + ~var_name:(context_or_same_var ctx f) (Expr.eop (trans_op Op.Reduce) tys opmark) [f'; Ast.OptionMonad.return ~mark (trans ctx init); trans ctx l] ~mark @@ -289,7 +303,8 @@ let rec trans (ctx : typed ctx) (e : typed D.expr) : (lcalc, typed) boxed_gexpr m)) (trans ctx f) in - Ast.OptionMonad.mbind_cont ~var_name:ctx.ctx_context_name + Ast.OptionMonad.mbind_cont + ~var_name:(context_or_same_var ctx f) (fun vars -> Ast.OptionMonad.return ~mark (Expr.eapp @@ -303,19 +318,20 @@ let rec trans (ctx : typed ctx) (e : typed D.expr) : (lcalc, typed) boxed_gexpr requires an function of type [a option -> bool]. Hence we need to modify [f] by first matching the input, and second using the error_on_empty on the result. *) - let x1 = Var.make ctx.ctx_context_name in + let x1 = Var.make (context_or_same_var ctx f) in let f' = - Ast.OptionMonad.bind_cont ~mark ~var_name:ctx.ctx_context_name - (fun f -> + Ast.OptionMonad.bind_cont ~mark + ~var_name:(context_or_same_var ctx f) + (fun f' -> Ast.OptionMonad.return ~mark (Expr.eabs (Expr.bind [| x1 |] (Ast.OptionMonad.error_on_empty ~toplevel:true ~mark - ~var_name:ctx.ctx_context_name + ~var_name:(context_or_same_var ctx f) (Ast.OptionMonad.mbind_cont ~mark - ~var_name:ctx.ctx_context_name + ~var_name:(context_or_same_var ctx f) (fun vars -> - Expr.eapp (Expr.evar f m) + Expr.eapp (Expr.evar f' m) (ListLabels.map vars ~f:(fun v -> Expr.evar v m)) m) [Expr.evar x1 m]))) @@ -323,7 +339,8 @@ let rec trans (ctx : typed ctx) (e : typed D.expr) : (lcalc, typed) boxed_gexpr m)) (trans ctx f) in - Ast.OptionMonad.mbind_cont ~var_name:ctx.ctx_context_name + Ast.OptionMonad.mbind_cont + ~var_name:(context_or_same_var ctx f) (fun vars -> Ast.OptionMonad.return ~mark (Expr.eapp @@ -344,7 +361,8 @@ let rec trans (ctx : typed ctx) (e : typed D.expr) : (lcalc, typed) boxed_gexpr op | EApp { f = EOp { op; tys }, opmark; args } -> let res = - Ast.OptionMonad.mmap ~var_name:ctx.ctx_context_name + Ast.OptionMonad.mmap + ~var_name:(context_or_same_var ctx (List.hd args)) (Expr.eop (trans_op op) tys opmark) (List.map (trans ctx) args) ~mark @@ -376,7 +394,8 @@ let rec trans (ctx : typed ctx) (e : typed D.expr) : (lcalc, typed) boxed_gexpr Expr.eabs binder tys m | _ -> assert false) in - Ast.OptionMonad.bind_cont ~var_name:ctx.ctx_context_name + Ast.OptionMonad.bind_cont + ~var_name:(context_or_same_var ctx e) (fun e -> Expr.ematch (Expr.evar e m) name cases m) (trans ctx e) ~mark | EArray args -> @@ -404,19 +423,22 @@ let rec trans (ctx : typed ctx) (e : typed D.expr) : (lcalc, typed) boxed_gexpr (List.map (trans ctx) fields) ~mark | EIfThenElse { cond; etrue; efalse } -> - Ast.OptionMonad.bind_cont ~mark ~var_name:ctx.ctx_context_name + Ast.OptionMonad.bind_cont ~mark + ~var_name:(context_or_same_var ctx cond) (fun cond -> Expr.eifthenelse (Expr.evar cond mark) (trans ctx etrue) (trans ctx efalse) mark) (trans ctx cond) | EInj { name; cons; e } -> - Ast.OptionMonad.bind_cont ~var_name:ctx.ctx_context_name + Ast.OptionMonad.bind_cont + ~var_name:(context_or_same_var ctx e) (fun e -> Ast.OptionMonad.return ~mark (Expr.einj (Expr.evar e mark) cons name mark)) (trans ctx e) ~mark | EStructAccess { name; e; field } -> - Ast.OptionMonad.bind_cont ~var_name:ctx.ctx_context_name + Ast.OptionMonad.bind_cont + ~var_name:(context_or_same_var ctx e) (fun e -> Expr.estructaccess (Expr.evar e mark) field name mark) (trans ctx e) ~mark | ETuple args -> @@ -427,11 +449,13 @@ let rec trans (ctx : typed ctx) (e : typed D.expr) : (lcalc, typed) boxed_gexpr (List.map (trans ctx) args) ~mark | ETupleAccess { e; index; size } -> - Ast.OptionMonad.bind_cont ~var_name:ctx.ctx_context_name + Ast.OptionMonad.bind_cont + ~var_name:(context_or_same_var ctx e) (fun e -> Expr.etupleaccess (Expr.evar e mark) index size mark) (trans ctx e) ~mark | EAssert e -> - Ast.OptionMonad.bind_cont ~var_name:ctx.ctx_context_name + Ast.OptionMonad.bind_cont + ~var_name:(context_or_same_var ctx e) (fun e -> Ast.OptionMonad.return ~mark (Expr.eassert (Expr.evar e mark) mark)) (trans ctx e) ~mark diff --git a/compiler/shared_ast/expr.ml b/compiler/shared_ast/expr.ml index f55f6940..4ea2dfb2 100644 --- a/compiler/shared_ast/expr.ml +++ b/compiler/shared_ast/expr.ml @@ -181,8 +181,8 @@ let mark_pos (type m) (m : m mark) : Pos.t = let pos (type m) (x : ('a, m) marked) : Pos.t = mark_pos (Mark.get x) -let fun_id mark : ('a any, 'm) boxed_gexpr = - let x = Var.make "x" in +let fun_id ?(var_name : string = "x") mark : ('a any, 'm) boxed_gexpr = + let x = Var.make var_name in eabs (bind [| x |] (evar x mark)) [TAny, mark_pos mark] mark let ty (_, m) : typ = match m with Typed { ty; _ } -> ty diff --git a/compiler/shared_ast/expr.mli b/compiler/shared_ast/expr.mli index 7d55894e..a5044c1a 100644 --- a/compiler/shared_ast/expr.mli +++ b/compiler/shared_ast/expr.mli @@ -142,7 +142,7 @@ val escopecall : 'm mark -> ((< explicitScopes : yes ; .. > as 'a), 'm) boxed_gexpr -val fun_id : 'm mark -> ('a any, 'm) boxed_gexpr +val fun_id : ?var_name:string -> 'm mark -> ('a any, 'm) boxed_gexpr (** {2 Manipulation of marks} *) From 45375dd7b55d9b7b43f1ee59ebae8e4aff21de0c Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Mon, 12 Jun 2023 15:21:06 +0200 Subject: [PATCH 03/26] Fix a bug in closure conversion --- compiler/driver.ml | 12 ++++ compiler/lcalc/closure_conversion.ml | 13 ++-- compiler/shared_ast/print.ml | 2 +- tests/test_array/good/aggregation_3.catala_en | 20 +++--- .../good/closure_conversion.catala_en | 65 ++++++++++++++++--- tests/test_scope/good/scope_call4.catala_en | 12 ++-- tests/test_scope/good/simple.catala_en | 2 +- 7 files changed, 94 insertions(+), 32 deletions(-) diff --git a/compiler/driver.ml b/compiler/driver.ml index e58416ba..0a76a0b4 100644 --- a/compiler/driver.ml +++ b/compiler/driver.ml @@ -435,6 +435,18 @@ let driver source_file (options : Cli.options) : int = Messages.emit_debug "Performing closure conversion..."; let prgm = Lcalc.Closure_conversion.closure_conversion prgm in let prgm = Bindlib.unbox prgm in + let _output_file, with_output = get_output_format () in + with_output + @@ fun fmt -> + if Option.is_some options.ex_scope then + Format.fprintf fmt "%a\n" + (Shared_ast.Print.scope ~debug:options.debug prgm.decl_ctx) + (scope_uid, Shared_ast.Program.get_scope_body prgm scope_uid) + else + Format.fprintf fmt "%a\n" + (Shared_ast.Print.program ~debug:options.debug) + prgm; + Format.pp_print_flush Format.std_formatter (); let prgm = if options.optimize then ( Messages.emit_debug "Optimizing lambda calculus..."; diff --git a/compiler/lcalc/closure_conversion.ml b/compiler/lcalc/closure_conversion.ml index 72652c88..6a677110 100644 --- a/compiler/lcalc/closure_conversion.ml +++ b/compiler/lcalc/closure_conversion.ml @@ -37,12 +37,9 @@ let rec hoist_context_free_closures : fun ctx e -> let m = Mark.get e in match Mark.remove e with - | EStruct _ | EStructAccess _ | ETuple _ | ETupleAccess _ | EInj _ | EArray _ - | ELit _ | EAssert _ | EOp _ | EIfThenElse _ | ERaise _ | ECatch _ | EVar _ -> - Expr.map_gather ~acc:[] ~join:( @ ) ~f:(hoist_context_free_closures ctx) e | EMatch { e; cases; name } -> let collected_closures, new_e = (hoist_context_free_closures ctx) e in - (* We do not close the clotures inside the arms of the match expression, + (* We do not close the closures inside the arms of the match expression, since they get a special treatment at compilation to Scalc. *) let collected_closures, new_cases = EnumConstructor.Map.fold @@ -83,7 +80,9 @@ let rec hoist_context_free_closures : (* this is the closure we want to hoist*) let closure_var = Var.make ctx.name_context in [{ name = closure_var; closure = e }], Expr.make_var closure_var m - | EApp _ -> + | EApp _ | EStruct _ | EStructAccess _ | ETuple _ | ETupleAccess _ | EInj _ + | EArray _ | ELit _ | EAssert _ | EOp _ | EIfThenElse _ | ERaise _ | ECatch _ + | EVar _ -> Expr.map_gather ~acc:[] ~join:( @ ) ~f:(hoist_context_free_closures ctx) e | _ -> . [@@warning "-32"] @@ -118,7 +117,9 @@ let rec transform_closures_expr : let vars, body = Bindlib.unmbind binder in let new_free_vars, new_body = (transform_closures_expr ctx) body in let new_binder = Expr.bind vars new_body in - ( Var.Set.union free_vars new_free_vars, + ( Var.Set.union free_vars + (Var.Set.diff new_free_vars + (Var.Set.of_list (Array.to_list vars))), EnumConstructor.Map.add cons (Expr.eabs new_binder tys (Mark.get e1)) new_cases ) diff --git a/compiler/shared_ast/print.ml b/compiler/shared_ast/print.ml index 08325fea..6c8f30f8 100644 --- a/compiler/shared_ast/print.ml +++ b/compiler/shared_ast/print.ml @@ -546,7 +546,7 @@ let rec expr_aux : | EApp { f; args } -> Format.fprintf fmt "@[%a@ %a@]" (lhs exprc) f (Format.pp_print_list - ~pp_sep:(fun fmt () -> Format.fprintf fmt ",@ ") + ~pp_sep:(fun fmt () -> Format.fprintf fmt "@ ") (rhs exprc)) args | EIfThenElse _ -> diff --git a/tests/test_array/good/aggregation_3.catala_en b/tests/test_array/good/aggregation_3.catala_en index 18c2fc80..767d286d 100644 --- a/tests/test_array/good/aggregation_3.catala_en +++ b/tests/test_array/good/aggregation_3.catala_en @@ -41,27 +41,27 @@ let scope S (x: integer|internal|output) = filter (λ (i: integer) → i > 2) [ 1; 2; 3 ]) = [ 5 ]; assert (reduce - (λ (sum1: integer) (sum2: integer) → sum1 + sum2), - 0, + (λ (sum1: integer) (sum2: integer) → sum1 + sum2) + 0 [ 1; 2; 3 ]) = 6; assert (reduce - (λ (sum1: integer) (sum2: integer) → sum1 + sum2), - 0, + (λ (sum1: integer) (sum2: integer) → sum1 + sum2) + 0 map (λ (i: integer) → i + 2) [ 1; 2; 3 ]) = 12; assert (length [ 1; 2; 3 ]) = 3; assert (length filter (λ (i: integer) → i >= 2) [ 1; 2; 3 ]) = 2; assert (reduce (λ (max1: integer) (max2: integer) → - if max1 > max2 then max1 else max2), - 10, + if max1 > max2 then max1 else max2) + 10 [ 1; 2; 3 ]) = 3; assert (reduce (λ (max1: decimal) (max2: decimal) → - if max1 > max2 then max1 else max2), - 10., + if max1 > max2 then max1 else max2) + 10. map (λ (i: integer) → to_rat i) [ 1; 2; 3 ]) = 3.; assert (reduce @@ -72,8 +72,8 @@ let scope S (x: integer|internal|output) = < let i : integer = i_2 in to_rat ((2 - i) * (2 - i)) then i_1 - else i_2), - 42, + else i_2) + 42 [ 1; 2; 3 ]) = 2 ``` diff --git a/tests/test_func/good/closure_conversion.catala_en b/tests/test_func/good/closure_conversion.catala_en index dcf2b3e2..1c11e6c4 100644 --- a/tests/test_func/good/closure_conversion.catala_en +++ b/tests/test_func/good/closure_conversion.catala_en @@ -13,12 +13,61 @@ scope S: ```catala-test-inline $ catala Lcalc -s S --avoid_exceptions -O --closure_conversion -[ERROR] Variable x not found in the current context - -┌─⯈ tests/test_func/good/closure_conversion.catala_en:5.12-5.13: -└─┐ -5 │ internal f content integer depends on y content integer - │ ‾ - └─ Article -#return code 255# +let scope S (S_in: S_in {x_in: option bool}): S {z: option integer} = + let get x : any = S_in.x_in in + let set f : any = + ESome + let f : any = + λ (env: any) (y: integer) → + let x : any = env.0 in + ESome + match + (match x with + | ENone _ → ENone _ + | ESome x1 → if x1 then ESome y else ESome - y) + with + | ENone _ → raise NoValueProvided + | ESome f → f + in + (f, (x)) + in + let set z : any = + ESome + match + (match f with + | ENone _ → ENone _ + | ESome f → + let code_and_env : any = f in + let code : any = code_and_env.0 in + let env : any = code_and_env.1 in + code env -1) + with + | ENone _ → raise NoValueProvided + | ESome z → z + in + return { S z = z; } +let scope S (S_in: S_in {x_in: option bool}): S {z: option integer} = + let get x : option bool = S_in.x_in in + let set f : + option (((option bool), integer) → option integer * (option bool)) = + ESome + (λ (env: (option bool)) (y: integer) → + ESome + match + (match env.0 with + | ENone _ → ENone _ + | ESome x → if x then ESome y else ESome - y) + with + | ENone _ → raise NoValueProvided + | ESome f → f, (x)) + in + let set z : option integer = + ESome + match (match f with + | ENone _ → ENone _ + | ESome f → f.0 f.1 -1) with + | ENone _ → raise NoValueProvided + | ESome z → z + in + return { S z = z; } ``` diff --git a/tests/test_scope/good/scope_call4.catala_en b/tests/test_scope/good/scope_call4.catala_en index c1a0a6b4..d66d294b 100644 --- a/tests/test_scope/good/scope_call4.catala_en +++ b/tests/test_scope/good/scope_call4.catala_en @@ -46,10 +46,10 @@ f1 = match (match (ESome (λ (x1: integer) → ESome (x1 + 1))) with | ENone _ → ENone _ - | ESome f1 → f1 (x + 1)) + | ESome g → g (x + 1)) with - | ENone f1 → raise NoValueProvided - | ESome x1 → x1) + | ENone _ → raise NoValueProvided + | ESome f1 → f1) [RESULT] f2 = ESome @@ -58,8 +58,8 @@ f2 = match (match (ESome (λ (x1: integer) → ESome (x1 + 1))) with | ENone _ → ENone _ - | ESome f2 → f2 (x + 1)) + | ESome g → g (x + 1)) with - | ENone f2 → raise NoValueProvided - | ESome x1 → x1) + | ENone _ → raise NoValueProvided + | ESome f2 → f2) ``` diff --git a/tests/test_scope/good/simple.catala_en b/tests/test_scope/good/simple.catala_en index ae458fb1..7895be03 100644 --- a/tests/test_scope/good/simple.catala_en +++ b/tests/test_scope/good/simple.catala_en @@ -12,7 +12,7 @@ scope Foo: $ catala Lcalc -s Foo let scope Foo (Foo_in: Foo_in): Foo {bar: integer} = let set bar : integer = - try handle_default [ ], (λ (_: unit) → true), (λ (_: unit) → 0) + try handle_default [ ] (λ (_: unit) → true) (λ (_: unit) → 0) with EmptyError -> raise NoValueProvided in return { Foo bar = bar; } From 26d53cc87f3afbe3378da6ed516290fba46abc89 Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Tue, 13 Jun 2023 08:59:33 +0200 Subject: [PATCH 04/26] Rainbow parenthesis for types --- compiler/driver.ml | 1 + compiler/shared_ast/print.ml | 73 ++++++++++++++++++++++++------------ 2 files changed, 50 insertions(+), 24 deletions(-) diff --git a/compiler/driver.ml b/compiler/driver.ml index 0a76a0b4..3af00b89 100644 --- a/compiler/driver.ml +++ b/compiler/driver.ml @@ -447,6 +447,7 @@ let driver source_file (options : Cli.options) : int = (Shared_ast.Print.program ~debug:options.debug) prgm; Format.pp_print_flush Format.std_formatter (); + (* TODO: delete above *) let prgm = if options.optimize then ( Messages.emit_debug "Optimizing lambda calculus..."; diff --git a/compiler/shared_ast/print.ml b/compiler/shared_ast/print.ml index 6c8f30f8..f509e200 100644 --- a/compiler/shared_ast/print.ml +++ b/compiler/shared_ast/print.ml @@ -80,19 +80,32 @@ let enum_constructor (fmt : Format.formatter) (c : EnumConstructor.t) : unit = let struct_field (fmt : Format.formatter) (c : StructField.t) : unit = Format.fprintf fmt "@{%a@}" StructField.format_t c -let rec typ (ctx : decl_ctx option) (fmt : Format.formatter) (ty : typ) : unit = +let rec typ + (ctx : decl_ctx option) + ~(colors : Ocolor_types.color4 list) + (fmt : Format.formatter) + (ty : typ) : unit = let typ = typ ctx in - let typ_with_parens (fmt : Format.formatter) (t : typ) = - if typ_needs_parens t then Format.fprintf fmt "(%a)" typ t else typ fmt t + let typ_with_parens ~colors (fmt : Format.formatter) (t : typ) = + if typ_needs_parens t then ( + Format.pp_open_hvbox fmt 1; + pp_color_string (List.hd colors) fmt "("; + typ ~colors:(List.tl colors) fmt t; + Format.pp_close_box fmt (); + pp_color_string (List.hd colors) fmt ")") + else typ ~colors fmt t in match Mark.remove ty with | TLit l -> tlit fmt l | TTuple ts -> - Format.fprintf fmt "@[(%a)@]" - (Format.pp_print_list - ~pp_sep:(fun fmt () -> Format.fprintf fmt " %a@ " op_style "*") - typ) - ts + Format.pp_open_hvbox fmt 2; + pp_color_string (List.hd colors) fmt "("; + (Format.pp_print_list + ~pp_sep:(fun fmt () -> Format.fprintf fmt " %a@ " op_style "*") + (typ ~colors:(List.tl colors))) + fmt ts; + Format.pp_close_box fmt (); + pp_color_string (List.hd colors) fmt ")" | TStruct s -> ( match ctx with | None -> StructName.format_t fmt s @@ -101,16 +114,20 @@ let rec typ (ctx : decl_ctx option) (fmt : Format.formatter) (ty : typ) : unit = if StructField.Map.is_empty fields then StructName.format_t fmt s else Format.fprintf fmt "@[%a %a@,%a@;<0 -2>%a@]" StructName.format_t s - punctuation "{" + (pp_color_string (List.hd colors)) + "{" (Format.pp_print_list ~pp_sep:(fun fmt () -> - punctuation fmt ";"; + op_style fmt ";"; Format.pp_print_space fmt ()) (fun fmt (field_name, field_typ) -> Format.fprintf fmt "@[%a%a@ %a@]" struct_field field_name - punctuation ":" typ field_typ)) + punctuation ":" + (typ ~colors:(List.tl colors)) + field_typ)) (StructField.Map.bindings fields) - punctuation "}") + (pp_color_string (List.hd colors)) + "}") | TEnum e -> ( match ctx with | None -> Format.fprintf fmt "@[%a@]" EnumName.format_t e @@ -121,21 +138,29 @@ let rec typ (ctx : decl_ctx option) (fmt : Format.formatter) (ty : typ) : unit = ~pp_sep:(fun fmt () -> Format.fprintf fmt "@ %a@ " punctuation "|") (fun fmt (case, mty) -> Format.fprintf fmt "%a%a@ %a" enum_constructor case punctuation ":" - typ mty)) + (typ ~colors) mty)) (EnumConstructor.Map.bindings (EnumName.Map.find e ctx.ctx_enums)) punctuation "]") - | TOption t -> Format.fprintf fmt "@[%a@ %a@]" base_type "option" typ t + | TOption t -> + Format.fprintf fmt "@[%a@ %a@]" base_type "option" (typ ~colors) t | TArrow ([t1], t2) -> - Format.fprintf fmt "@[%a@ %a@ %a@]" typ_with_parens t1 op_style "→" - typ t2 + Format.fprintf fmt "@[%a@ %a@ %a@]" (typ_with_parens ~colors) t1 + op_style "→" (typ ~colors) t2 | TArrow (t1, t2) -> - Format.fprintf fmt "@[%a%a%a@ %a@ %a@]" op_style "(" + Format.fprintf fmt "@[%a%a%a@ %a@ %a@]" + (pp_color_string (List.hd colors)) + "(" (Format.pp_print_list ~pp_sep:(fun fmt () -> Format.fprintf fmt "%a@ " op_style ",") - typ_with_parens) - t1 op_style ")" op_style "→" typ t2 + (typ_with_parens ~colors:(List.tl colors))) + t1 + (pp_color_string (List.hd colors)) + ")" op_style "→" + (typ ~colors:(List.tl colors)) + t2 | TArray t1 -> - Format.fprintf fmt "@[%a@ %a@]" base_type "collection" typ t1 + Format.fprintf fmt "@[%a@ %a@]" base_type "collection" (typ ~colors) + t1 | TAny -> base_type fmt "any" let lit (fmt : Format.formatter) (l : lit) : unit = @@ -490,7 +515,7 @@ let rec expr_aux : (fun fmt (x, tau, arg) -> Format.fprintf fmt "@[@[%a %a %a@ %a@ %a@]@ %a@;<1 -2>%a@]" keyword - "let" var x punctuation ":" (typ None) tau punctuation "=" + "let" var x punctuation ":" (typ None ~colors) tau punctuation "=" (exprc colors) arg keyword "in") fmt xs_tau_arg; Format.pp_print_cut fmt (); @@ -513,7 +538,7 @@ let rec expr_aux : var fmt x; punctuation fmt ":"; Format.pp_print_space fmt (); - typ None fmt tau; + typ None ~colors fmt tau; Format.pp_close_box fmt (); punctuation fmt ")")) xs_tau punctuation "→" (rhs expr) body @@ -670,8 +695,8 @@ let rec colors = let open Ocolor_types in blue :: cyan :: green :: yellow :: red :: magenta :: colors -let typ_debug = typ None -let typ ctx = typ (Some ctx) +let typ_debug = typ None ~colors +let typ ctx = typ (Some ctx) ~colors let expr ?(hide_function_body = false) ?(debug = !Cli.debug_flag) () ppf e = expr_aux ~hide_function_body ~debug Bindlib.empty_ctxt colors ppf e From 84350b15938b83812b5fd22e23a1d79499e61996 Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Tue, 13 Jun 2023 09:07:42 +0200 Subject: [PATCH 05/26] Better typing error message --- compiler/shared_ast/typing.ml | 6 +++--- tests/test_bool/bad/bad_assert.catala_en | 4 ++-- tests/test_bool/bad/test_xor_with_int.catala_en | 4 ++-- tests/test_enum/bad/quick_pattern_2.catala_en | 4 ++-- tests/test_enum/bad/quick_pattern_3.catala_en | 4 ++-- tests/test_enum/bad/quick_pattern_4.catala_en | 4 ++-- tests/test_typing/bad/err1.catala_en | 4 ++-- tests/test_typing/bad/err2.catala_en | 4 ++-- tests/test_typing/bad/err3.catala_en | 8 ++++---- tests/test_typing/bad/err4.catala_en | 4 ++-- tests/test_typing/bad/err5.catala_en | 4 ++-- tests/test_typing/bad/err6.catala_en | 4 ++-- 12 files changed, 27 insertions(+), 27 deletions(-) diff --git a/compiler/shared_ast/typing.ml b/compiler/shared_ast/typing.ml index 08c69c42..6f2def7f 100644 --- a/compiler/shared_ast/typing.ml +++ b/compiler/shared_ast/typing.ml @@ -195,9 +195,9 @@ let handle_type_error ctx (A.AnyExpr e) t1 t2 = (format_typ ctx) t2), t2_pos ); ] - "@[Error during typechecking, incompatible types:@,\ - @{-->@} @[%a@]@,\ - @{-->@} @[%a@]@]" (format_typ ctx) t1 (format_typ ctx) t2 + "@[Error during typechecking, incompatible types:@]@\n\ + @[@{┌─⯈@} @[%a@]@,\ + @{└─⯈@} @[%a@]@]" (format_typ ctx) t1 (format_typ ctx) t2 let lit_type (lit : A.lit) : naked_typ = match lit with diff --git a/tests/test_bool/bad/bad_assert.catala_en b/tests/test_bool/bad/bad_assert.catala_en index 8bb4eb4d..9b870d49 100644 --- a/tests/test_bool/bad/bad_assert.catala_en +++ b/tests/test_bool/bad/bad_assert.catala_en @@ -13,8 +13,8 @@ scope Foo: ```catala-test-inline $ catala Interpret -s Foo [ERROR] Error during typechecking, incompatible types: - --> integer - --> bool +┌─⯈ integer +└─⯈ bool Error coming from typechecking the following expression: ┌─⯈ tests/test_bool/bad/bad_assert.catala_en:9.13-9.14: diff --git a/tests/test_bool/bad/test_xor_with_int.catala_en b/tests/test_bool/bad/test_xor_with_int.catala_en index 8cf7e0da..170bd685 100644 --- a/tests/test_bool/bad/test_xor_with_int.catala_en +++ b/tests/test_bool/bad/test_xor_with_int.catala_en @@ -11,8 +11,8 @@ scope TestXorWithInt: ```catala-test-inline $ catala Typecheck [ERROR] Error during typechecking, incompatible types: - --> integer - --> bool +┌─⯈ integer +└─⯈ bool Error coming from typechecking the following expression: ┌─⯈ tests/test_bool/bad/test_xor_with_int.catala_en:8.30-8.32: diff --git a/tests/test_enum/bad/quick_pattern_2.catala_en b/tests/test_enum/bad/quick_pattern_2.catala_en index cd61ebab..5281f033 100644 --- a/tests/test_enum/bad/quick_pattern_2.catala_en +++ b/tests/test_enum/bad/quick_pattern_2.catala_en @@ -31,8 +31,8 @@ scope B: ```catala-test-inline $ catala Interpret -s A [ERROR] Error during typechecking, incompatible types: - --> E - --> F +┌─⯈ E +└─⯈ F Error coming from typechecking the following expression: ┌─⯈ tests/test_enum/bad/quick_pattern_2.catala_en:28.23-28.24: diff --git a/tests/test_enum/bad/quick_pattern_3.catala_en b/tests/test_enum/bad/quick_pattern_3.catala_en index b7f5a54a..d22f7913 100644 --- a/tests/test_enum/bad/quick_pattern_3.catala_en +++ b/tests/test_enum/bad/quick_pattern_3.catala_en @@ -21,8 +21,8 @@ definition y equals x with pattern Case3 ```catala-test-inline $ catala Interpret -s A [ERROR] Error during typechecking, incompatible types: - --> E - --> F +┌─⯈ E +└─⯈ F Error coming from typechecking the following expression: ┌─⯈ tests/test_enum/bad/quick_pattern_3.catala_en:18.21-18.22: diff --git a/tests/test_enum/bad/quick_pattern_4.catala_en b/tests/test_enum/bad/quick_pattern_4.catala_en index 40789fc3..861aca14 100644 --- a/tests/test_enum/bad/quick_pattern_4.catala_en +++ b/tests/test_enum/bad/quick_pattern_4.catala_en @@ -20,8 +20,8 @@ definition y equals x with pattern Case3 ```catala-test-inline $ catala Interpret -s A [ERROR] Error during typechecking, incompatible types: - --> E - --> F +┌─⯈ E +└─⯈ F Error coming from typechecking the following expression: ┌─⯈ tests/test_enum/bad/quick_pattern_4.catala_en:17.21-17.22: diff --git a/tests/test_typing/bad/err1.catala_en b/tests/test_typing/bad/err1.catala_en index 701b64d3..a0ff9aab 100644 --- a/tests/test_typing/bad/err1.catala_en +++ b/tests/test_typing/bad/err1.catala_en @@ -13,8 +13,8 @@ scope S: ```catala-test-inline $ catala Typecheck [ERROR] Error during typechecking, incompatible types: - --> decimal - --> integer +┌─⯈ decimal +└─⯈ integer Error coming from typechecking the following expression: ┌─⯈ tests/test_typing/bad/err1.catala_en:7.23-7.26: diff --git a/tests/test_typing/bad/err2.catala_en b/tests/test_typing/bad/err2.catala_en index 2a0a2e70..622ec481 100644 --- a/tests/test_typing/bad/err2.catala_en +++ b/tests/test_typing/bad/err2.catala_en @@ -13,8 +13,8 @@ scope S: ```catala-test-inline $ catala Typecheck [ERROR] Error during typechecking, incompatible types: - --> decimal - --> collection +┌─⯈ decimal +└─⯈ collection Error coming from typechecking the following expression: ┌─⯈ tests/test_typing/bad/err2.catala_en:10.39-10.42: diff --git a/tests/test_typing/bad/err3.catala_en b/tests/test_typing/bad/err3.catala_en index faf420a2..d2385771 100644 --- a/tests/test_typing/bad/err3.catala_en +++ b/tests/test_typing/bad/err3.catala_en @@ -20,8 +20,8 @@ $ catala Typecheck │ ‾‾‾ [ERROR] Error during typechecking, incompatible types: - --> integer - --> decimal +┌─⯈ integer +└─⯈ decimal Error coming from typechecking the following expression: ┌─⯈ tests/test_typing/bad/err3.catala_en:10.42-10.43: @@ -58,8 +58,8 @@ $ catala ocaml │ ‾‾‾ [ERROR] Error during typechecking, incompatible types: - --> integer - --> decimal +┌─⯈ integer +└─⯈ decimal Error coming from typechecking the following expression: ┌─⯈ tests/test_typing/bad/err3.catala_en:10.42-10.43: diff --git a/tests/test_typing/bad/err4.catala_en b/tests/test_typing/bad/err4.catala_en index 935612c7..e7e41a97 100644 --- a/tests/test_typing/bad/err4.catala_en +++ b/tests/test_typing/bad/err4.catala_en @@ -32,8 +32,8 @@ $ catala ocaml │ ‾‾‾ [ERROR] Error during typechecking, incompatible types: - --> Enum - --> Structure +┌─⯈ Enum +└─⯈ Structure Error coming from typechecking the following expression: ┌─⯈ tests/test_typing/bad/err4.catala_en:5.25-5.38: diff --git a/tests/test_typing/bad/err5.catala_en b/tests/test_typing/bad/err5.catala_en index c7baf456..f9f50131 100644 --- a/tests/test_typing/bad/err5.catala_en +++ b/tests/test_typing/bad/err5.catala_en @@ -13,8 +13,8 @@ scope S: ```catala-test-inline $ catala Typecheck [ERROR] Error during typechecking, incompatible types: - --> integer - --> Structure +┌─⯈ integer +└─⯈ Structure Error coming from typechecking the following expression: ┌─⯈ tests/test_typing/bad/err5.catala_en:8.5-8.9: diff --git a/tests/test_typing/bad/err6.catala_en b/tests/test_typing/bad/err6.catala_en index f072d57d..e400108d 100644 --- a/tests/test_typing/bad/err6.catala_en +++ b/tests/test_typing/bad/err6.catala_en @@ -29,8 +29,8 @@ Should be "catala Typecheck", see test err3 ```catala-test-inline $ catala ocaml [ERROR] Error during typechecking, incompatible types: - --> decimal - --> integer +┌─⯈ decimal +└─⯈ integer Error coming from typechecking the following expression: ┌─⯈ tests/test_typing/bad/err6.catala_en:20.27-20.30: From 30eb3c0bdbf2e652bd787ef74ced576ec06d9e64 Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Tue, 13 Jun 2023 09:19:14 +0200 Subject: [PATCH 06/26] Better printing for types in typing error message --- compiler/shared_ast/print.ml | 15 ++++++--- compiler/shared_ast/typing.ml | 63 ++++++++++++++++++++++++++--------- 2 files changed, 58 insertions(+), 20 deletions(-) diff --git a/compiler/shared_ast/print.ml b/compiler/shared_ast/print.ml index f509e200..838e81a0 100644 --- a/compiler/shared_ast/print.ml +++ b/compiler/shared_ast/print.ml @@ -142,7 +142,7 @@ let rec typ (EnumConstructor.Map.bindings (EnumName.Map.find e ctx.ctx_enums)) punctuation "]") | TOption t -> - Format.fprintf fmt "@[%a@ %a@]" base_type "option" (typ ~colors) t + Format.fprintf fmt "@[%a@ %a@]" base_type "eoption" (typ ~colors) t | TArrow ([t1], t2) -> Format.fprintf fmt "@[%a@ %a@ %a@]" (typ_with_parens ~colors) t1 op_style "→" (typ ~colors) t2 @@ -487,11 +487,16 @@ let rec expr_aux : match Mark.remove e with | EVar v -> var fmt v | ETuple es -> - Format.fprintf fmt "@[%a%a%a@]" punctuation "(" + Format.fprintf fmt "@[%a%a%a@]" + (pp_color_string (List.hd colors)) + "(" (Format.pp_print_list - ~pp_sep:(fun fmt () -> Format.fprintf fmt ",@ ") - (fun fmt e -> lhs exprc fmt e)) - es punctuation ")" + ~pp_sep:(fun fmt () -> + Format.fprintf fmt "%a@ " (pp_color_string (List.hd colors)) ",") + (fun fmt e -> lhs ~colors:(List.tl colors) exprc fmt e)) + es + (pp_color_string (List.hd colors)) + ")" | EArray es -> Format.fprintf fmt "@[%a %a@] %a" punctuation "[" (Format.pp_print_list diff --git a/compiler/shared_ast/typing.ml b/compiler/shared_ast/typing.ml index 6f2def7f..e3b9308f 100644 --- a/compiler/shared_ast/typing.ml +++ b/compiler/shared_ast/typing.ml @@ -85,49 +85,82 @@ let rec ast_to_typ (ty : A.typ) : unionfind_typ = let typ_needs_parens (t : unionfind_typ) : bool = let t = UnionFind.get (UnionFind.find t) in - match Mark.remove t with - | TArrow _ | TArray _ | TOption _ -> true - | _ -> false + match Mark.remove t with TArrow _ | TArray _ -> true | _ -> false + +let with_color f color fmt x = + (* equivalent to [Format.fprintf fmt "@{%s@}" s] *) + Format.pp_open_stag fmt Ocolor_format.(Ocolor_style_tag (Fg (C4 color))); + f fmt x; + Format.pp_close_stag fmt () + +let pp_color_string = with_color Format.pp_print_string let rec format_typ (ctx : A.decl_ctx) + ~(colors : Ocolor_types.color4 list) (fmt : Format.formatter) (naked_typ : unionfind_typ) : unit = let format_typ = format_typ ctx in - let format_typ_with_parens (fmt : Format.formatter) (t : unionfind_typ) = - if typ_needs_parens t then Format.fprintf fmt "(%a)" format_typ t - else Format.fprintf fmt "%a" format_typ t + let format_typ_with_parens + ~colors + (fmt : Format.formatter) + (t : unionfind_typ) = + if typ_needs_parens t then ( + Format.pp_open_hvbox fmt 1; + pp_color_string (List.hd colors) fmt "("; + format_typ ~colors:(List.tl colors) fmt t; + Format.pp_close_box fmt (); + pp_color_string (List.hd colors) fmt ")") + else Format.fprintf fmt "%a" (format_typ ~colors) t in let naked_typ = UnionFind.get (UnionFind.find naked_typ) in match Mark.remove naked_typ with | TLit l -> Format.fprintf fmt "%a" Print.tlit l | TTuple ts -> - Format.fprintf fmt "@[(%a)@]" + Format.fprintf fmt "@[%a%a%a@]" + (pp_color_string (List.hd colors)) + "(" (Format.pp_print_list ~pp_sep:(fun fmt () -> Format.fprintf fmt "@ *@ ") - (fun fmt t -> Format.fprintf fmt "%a" format_typ t)) + (fun fmt t -> + Format.fprintf fmt "%a" (format_typ ~colors:(List.tl colors)) t)) ts + (pp_color_string (List.hd colors)) + ")" | TStruct s -> Format.fprintf fmt "%a" A.StructName.format_t s | TEnum e -> Format.fprintf fmt "%a" A.EnumName.format_t e | TOption t -> - Format.fprintf fmt "@[(%a)@ %s@]" format_typ_with_parens t "eoption" + Format.fprintf fmt "@[option %a@]" + (format_typ_with_parens ~colors:(List.tl colors)) + t | TArrow ([t1], t2) -> - Format.fprintf fmt "@[%a@ →@ %a@]" format_typ_with_parens t1 - format_typ t2 + Format.fprintf fmt "@[%a@ →@ %a@]" + (format_typ_with_parens ~colors) + t1 (format_typ ~colors) t2 | TArrow (t1, t2) -> - Format.fprintf fmt "@[(%a)@ →@ %a@]" + Format.fprintf fmt "@[%a%a%a@ →@ %a@]" + (pp_color_string (List.hd colors)) + "(" (Format.pp_print_list ~pp_sep:(fun fmt () -> Format.fprintf fmt ",@ ") - format_typ_with_parens) - t1 format_typ t2 + (format_typ_with_parens ~colors:(List.tl colors))) + t1 + (pp_color_string (List.hd colors)) + ")" (format_typ ~colors) t2 | TArray t1 -> ( match Mark.remove (UnionFind.get (UnionFind.find t1)) with | TAny _ when not !Cli.debug_flag -> Format.pp_print_string fmt "collection" - | _ -> Format.fprintf fmt "@[collection@ %a@]" format_typ t1) + | _ -> Format.fprintf fmt "@[collection@ %a@]" (format_typ ~colors) t1) | TAny v -> if !Cli.debug_flag then Format.fprintf fmt "" (Any.hash v) else Format.pp_print_string fmt "" +let rec colors = + let open Ocolor_types in + blue :: cyan :: green :: yellow :: red :: magenta :: colors + +let format_typ ctx fmt naked_typ = format_typ ctx ~colors fmt naked_typ + exception Type_error of A.any_expr * unionfind_typ * unionfind_typ (** Raises an error if unification cannot be performed. The position annotation From 0e99d1598bbb6b9b6c6d76750c3efec263d682af Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Tue, 13 Jun 2023 10:48:21 +0200 Subject: [PATCH 07/26] Continue closure conversion --- compiler/driver.ml | 13 ---- compiler/lcalc/closure_conversion.ml | 55 ++++++++++++-- compiler/shared_ast/typing.ml | 54 ++++++++++--- .../good/closure_conversion.catala_en | 44 ++--------- tests/test_func/good/closure_return.catala_en | 76 ++++++++++++++++++- 5 files changed, 172 insertions(+), 70 deletions(-) diff --git a/compiler/driver.ml b/compiler/driver.ml index 3af00b89..e58416ba 100644 --- a/compiler/driver.ml +++ b/compiler/driver.ml @@ -435,19 +435,6 @@ let driver source_file (options : Cli.options) : int = Messages.emit_debug "Performing closure conversion..."; let prgm = Lcalc.Closure_conversion.closure_conversion prgm in let prgm = Bindlib.unbox prgm in - let _output_file, with_output = get_output_format () in - with_output - @@ fun fmt -> - if Option.is_some options.ex_scope then - Format.fprintf fmt "%a\n" - (Shared_ast.Print.scope ~debug:options.debug prgm.decl_ctx) - (scope_uid, Shared_ast.Program.get_scope_body prgm scope_uid) - else - Format.fprintf fmt "%a\n" - (Shared_ast.Print.program ~debug:options.debug) - prgm; - Format.pp_print_flush Format.std_formatter (); - (* TODO: delete above *) let prgm = if options.optimize then ( Messages.emit_debug "Optimizing lambda calculus..."; diff --git a/compiler/lcalc/closure_conversion.ml b/compiler/lcalc/closure_conversion.ml index 6a677110..96afecf6 100644 --- a/compiler/lcalc/closure_conversion.ml +++ b/compiler/lcalc/closure_conversion.ml @@ -197,6 +197,28 @@ let rec transform_closures_expr : ]) m) (Expr.pos e) ) + | EApp { f = (EOp { op = HandleDefaultOpt; _ }, _) as f; args } -> + (* Special case for HandleDefaultOpt: its arguments are thunks because if + you want to extract it as a function you need these closures to preserve + evaluation order, but backends that don't support closures will simply + extract HandleDefaultOpt in a inlined way and skip the thunks. *) + let free_vars, new_args = + List.fold_right + (fun (arg : (lcalc, m) gexpr) (free_vars, new_args) -> + match Mark.remove arg with + | EAbs { binder; tys } -> + (* The two last arguments of HandleDefaultOps are closures, see + above*) + let vars, arg = Bindlib.unmbind binder in + let new_free_vars, new_arg = (transform_closures_expr ctx) arg in + let new_arg = Expr.make_abs vars new_arg tys (Expr.pos arg) in + Var.Set.union free_vars new_free_vars, new_arg :: new_args + | _ -> + let new_free_vars, new_arg = transform_closures_expr ctx arg in + Var.Set.union free_vars new_free_vars, new_arg :: new_args) + args (Var.Set.empty, []) + in + free_vars, Expr.eapp (Expr.box f) new_args (Mark.get e) | EApp { f = EOp _, _; _ } -> (* This corresponds to an operator call, which we don't want to transform*) Expr.map_gather ~acc:Var.Set.empty ~join:Var.Set.union @@ -272,7 +294,7 @@ let closure_conversion_scope_let ctx scope_body_expr = scope_body_expr let closure_conversion (p : 'm program) : 'm program Bindlib.box = - let _, new_code_items = + let (_, new_decl_ctx), new_code_items = Scope.fold_map ~f:(fun (toplevel_vars, decl_ctx) var code_item -> match code_item with @@ -297,10 +319,32 @@ let closure_conversion (p : 'm program) : 'm program Bindlib.box = (* Because closure conversion can change the type of input and output scope variables that are structs, their type will change. So we replace their type decleration in the structs with TAny so - that a later re-typing phase can infer them. *) + that a later re-typing phase can infer them. INVARIANT: the only + types that will change are the types of closures taken in and out + of the scopes. *) + let rec type_contains_arrow t = + match Mark.remove t with + | TArrow _ -> true + | TAny -> true + | TOption t' -> type_contains_arrow t' + | TLit _ -> false + | TArray ts -> type_contains_arrow ts + | TTuple ts -> List.exists type_contains_arrow ts + | TEnum e -> + EnumConstructor.Map.exists + (fun _ t' -> type_contains_arrow t') + (EnumName.Map.find e p.decl_ctx.ctx_enums) + | TStruct s -> + StructField.Map.exists + (fun _ t' -> type_contains_arrow t') + (StructName.Map.find s p.decl_ctx.ctx_structs) + in let replace_type_with_any s = Some - (StructField.Map.map (fun t -> Mark.copy t TAny) (Option.get s)) + (StructField.Map.map + (fun t -> + if type_contains_arrow t then Mark.copy t TAny else t) + (Option.get s)) in { decl_ctx with @@ -331,10 +375,9 @@ let closure_conversion (p : 'm program) : 'm program Bindlib.box = (Expr.Box.lift new_expr) )) ~varf:(fun v -> v) (Var.Set.empty, p.decl_ctx) - (* TODO: handle_default and handle_default_opt are now operators and not - variables. *) p.code_items in Bindlib.box_apply - (fun new_code_items -> { p with code_items = new_code_items }) + (fun new_code_items -> + { code_items = new_code_items; decl_ctx = new_decl_ctx }) new_code_items diff --git a/compiler/shared_ast/typing.ml b/compiler/shared_ast/typing.ml index e3b9308f..65bb8d8d 100644 --- a/compiler/shared_ast/typing.ml +++ b/compiler/shared_ast/typing.ml @@ -33,9 +33,9 @@ module Any = () type unionfind_typ = naked_typ Mark.pos UnionFind.elem -(** We do not reuse {!type: Shared_ast.typ} because we have to include a new - [TAny] variant. Indeed, error terms can have any type and this has to be - captured by the type sytem. *) +(** We do not reuse {!type: A.typ} because we have to include a new [TAny] + variant. Indeed, error terms can have any type and this has to be captured + by the type sytem. *) and naked_typ = | TLit of A.typ_lit @@ -928,7 +928,7 @@ let scope_body ~leave_unresolved ctx env body = (TArrow ([ty_in], ty_out))) ) let rec scopes ~leave_unresolved ctx env = function - | A.Nil -> Bindlib.box A.Nil + | A.Nil -> Bindlib.box A.Nil, env | A.Cons (item, next_bind) -> let var, next = Bindlib.unbind next_bind in let env, def = @@ -946,14 +946,46 @@ let rec scopes ~leave_unresolved ctx env = function (fun e -> A.Topdef (name, typ, e)) (Expr.Box.lift e') ) in - let next' = scopes ~leave_unresolved ctx env next in + let next', env = scopes ~leave_unresolved ctx env next in let next_bind' = Bindlib.bind_var (Var.translate var) next' in - Bindlib.box_apply2 (fun item next -> A.Cons (item, next)) def next_bind' + ( Bindlib.box_apply2 (fun item next -> A.Cons (item, next)) def next_bind', + env ) let program ~leave_unresolved prg = - let code_items = - Bindlib.unbox - (scopes ~leave_unresolved prg.A.decl_ctx (Env.empty prg.A.decl_ctx) - prg.A.code_items) + let code_items, new_env = + scopes ~leave_unresolved prg.A.decl_ctx (Env.empty prg.A.decl_ctx) + prg.A.code_items in - { prg with code_items } + { + A.code_items = Bindlib.unbox code_items; + decl_ctx = + { + prg.decl_ctx with + ctx_structs = + A.StructName.Map.mapi + (fun s_name fields -> + A.StructField.Map.mapi + (fun f_name (t : A.typ) -> + match Mark.remove t with + | TAny -> + typ_to_ast ~leave_unresolved + (A.StructField.Map.find f_name + (A.StructName.Map.find s_name new_env.structs)) + | _ -> t) + fields) + prg.decl_ctx.ctx_structs; + ctx_enums = + A.EnumName.Map.mapi + (fun e_name cons -> + A.EnumConstructor.Map.mapi + (fun cons_name (t : A.typ) -> + match Mark.remove t with + | TAny -> + typ_to_ast ~leave_unresolved + (A.EnumConstructor.Map.find cons_name + (A.EnumName.Map.find e_name new_env.enums)) + | _ -> t) + cons) + prg.decl_ctx.ctx_enums; + }; + } diff --git a/tests/test_func/good/closure_conversion.catala_en b/tests/test_func/good/closure_conversion.catala_en index 1c11e6c4..6e4dfb1f 100644 --- a/tests/test_func/good/closure_conversion.catala_en +++ b/tests/test_func/good/closure_conversion.catala_en @@ -13,45 +13,13 @@ scope S: ```catala-test-inline $ catala Lcalc -s S --avoid_exceptions -O --closure_conversion -let scope S (S_in: S_in {x_in: option bool}): S {z: option integer} = - let get x : any = S_in.x_in in - let set f : any = - ESome - let f : any = - λ (env: any) (y: integer) → - let x : any = env.0 in - ESome - match - (match x with - | ENone _ → ENone _ - | ESome x1 → if x1 then ESome y else ESome - y) - with - | ENone _ → raise NoValueProvided - | ESome f → f - in - (f, (x)) - in - let set z : any = - ESome - match - (match f with - | ENone _ → ENone _ - | ESome f → - let code_and_env : any = f in - let code : any = code_and_env.0 in - let env : any = code_and_env.1 in - code env -1) - with - | ENone _ → raise NoValueProvided - | ESome z → z - in - return { S z = z; } -let scope S (S_in: S_in {x_in: option bool}): S {z: option integer} = - let get x : option bool = S_in.x_in in +let scope S (S_in: S_in {x_in: eoption bool}): S {z: eoption integer} = + let get x : eoption bool = S_in.x_in in let set f : - option (((option bool), integer) → option integer * (option bool)) = + eoption + (((eoption bool), integer) → eoption integer * (eoption bool)) = ESome - (λ (env: (option bool)) (y: integer) → + (λ (env: (eoption bool)) (y: integer) → ESome match (match env.0 with @@ -61,7 +29,7 @@ let scope S (S_in: S_in {x_in: option bool}): S {z: option integer} = | ENone _ → raise NoValueProvided | ESome f → f, (x)) in - let set z : option integer = + let set z : eoption integer = ESome match (match f with | ENone _ → ENone _ diff --git a/tests/test_func/good/closure_return.catala_en b/tests/test_func/good/closure_return.catala_en index 33a63e38..c66e46b7 100644 --- a/tests/test_func/good/closure_return.catala_en +++ b/tests/test_func/good/closure_return.catala_en @@ -7,6 +7,78 @@ declaration scope S: scope S: definition f of y equals if x then y else - y - -# TODO: pass this +``` + +```catala-test-inline +$ catala Lcalc -s S --avoid_exceptions -O --closure_conversion +let scope S + (S_in: S_in {x_in: eoption bool}) + : S { + f: + eoption + (((eoption bool), integer) → eoption integer * (eoption bool)) + } + = + let get x : eoption bool = S_in.x_in in + let set f : + eoption + (((eoption bool), integer) → eoption integer * (eoption bool)) = + ESome + (λ (env: (eoption bool)) (y: integer) → + ESome + match + (match env.0 with + | ENone _ → ENone _ + | ESome x → if x then ESome y else ESome - y) + with + | ENone _ → raise NoValueProvided + | ESome f → f, (x)) + in + return { S f = f; } +``` + +```catala-test-inline +$ catala Lcalc -s S --avoid_exceptions --closure_conversion +let scope S + (S_in: S_in {x_in: eoption bool}) + : S { + f: + eoption + (((eoption bool), integer) → eoption integer * (eoption bool)) + } + = + let get x : eoption bool = + match (ESome S_in) with + | ENone _ → ENone _ + | ESome S_in → S_in.x_in + in + let set f : + eoption + (((eoption bool), integer) → eoption integer * (eoption bool)) = + ESome + let f : ((eoption bool), integer) → eoption integer = + λ (env: (eoption bool)) (y: integer) → + let x : eoption bool = env.0 in + ESome + match + (handle_default_opt + [ ] + (λ (_: unit) → ESome true) + (λ (_: unit) → + match x with + | ENone _1 → ENone _1 + | ESome x1 → + if x1 + then ESome y + else + match (ESome y) with + | ENone _1 → ENone _1 + | ESome y_0 → ESome - y_0)) + with + | ENone _ → raise NoValueProvided + | ESome f → f + in + (f, (x)) + in + return { S f = f; } ``` From 926c9436e389f1a738b038b040bdb01bd5984826 Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Tue, 13 Jun 2023 11:15:32 +0200 Subject: [PATCH 08/26] Fix some bugs --- compiler/lcalc/closure_conversion.ml | 12 +++- .../good/closure_through_scope.catala_en | 57 +++++++++++++++++++ 2 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 tests/test_func/good/closure_through_scope.catala_en diff --git a/compiler/lcalc/closure_conversion.ml b/compiler/lcalc/closure_conversion.ml index 96afecf6..789455cd 100644 --- a/compiler/lcalc/closure_conversion.ml +++ b/compiler/lcalc/closure_conversion.ml @@ -197,11 +197,17 @@ let rec transform_closures_expr : ]) m) (Expr.pos e) ) - | EApp { f = (EOp { op = HandleDefaultOpt; _ }, _) as f; args } -> - (* Special case for HandleDefaultOpt: its arguments are thunks because if + | EApp + { + f = + (EOp { op = HandleDefaultOpt | Fold | Map | Filter | Reduce; _ }, _) + as f; + args; + } -> + (* Special case for some operators: its arguments closures thunks because if you want to extract it as a function you need these closures to preserve evaluation order, but backends that don't support closures will simply - extract HandleDefaultOpt in a inlined way and skip the thunks. *) + extract these operators in a inlined way and skip the thunks. *) let free_vars, new_args = List.fold_right (fun (arg : (lcalc, m) gexpr) (free_vars, new_args) -> diff --git a/tests/test_func/good/closure_through_scope.catala_en b/tests/test_func/good/closure_through_scope.catala_en new file mode 100644 index 00000000..41fb8541 --- /dev/null +++ b/tests/test_func/good/closure_through_scope.catala_en @@ -0,0 +1,57 @@ +## Article + +```catala +declaration scope S: + output f content integer depends on y content integer + input x content boolean + +declaration scope T: + s scope S + output y content integer + +scope S: + definition f of y equals if x then y else - y + +scope T: + definition s.x equals false + definition y equals s.f of 2 +``` + +```catala-test-inline +$ catala Lcalc -s T --avoid_exceptions -O --closure_conversion +let scope T (T_in: T_in): T {y: eoption integer} = + let sub_set s.x : bool = false in + let call result : + eoption + S { + f: + eoption + (((eoption bool), integer) → eoption integer * (eoption bool)) + } = + ESome S { S_in x_in = ESome s.x; } + in + let sub_get s.f : + eoption + (((eoption bool), integer) → eoption integer * (eoption bool)) = + match result with + | ENone _ → ENone _ + | ESome result → result.f + in + let set y : eoption integer = + ESome + match + (match s.f with + | ENone _ → ENone _ + | ESome s.f → s.f.0 s.f.1 2) + with + | ENone _ → raise NoValueProvided + | ESome y → y + in + return { T y = y; } +``` + +```catala-test-inline +$ catala Interpret_lcalc -s T --avoid_exceptions -O --closure_conversion +[RESULT] Computation successful! Results: +[RESULT] y = ESome -2 +``` From 7072369b2de4b1d251181aa6036c81961ba431c2 Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Tue, 13 Jun 2023 11:40:58 +0200 Subject: [PATCH 09/26] Starting to work --- compiler/driver.ml | 5 +- compiler/lcalc/closure_conversion.ml | 7 ++- .../good/closure_conversion_reduce.catala_en | 57 +++++++++++++++++++ tests/test_func/good/closure_return.catala_en | 46 --------------- 4 files changed, 65 insertions(+), 50 deletions(-) create mode 100644 tests/test_func/good/closure_conversion_reduce.catala_en diff --git a/compiler/driver.ml b/compiler/driver.ml index e58416ba..29f6ff3c 100644 --- a/compiler/driver.ml +++ b/compiler/driver.ml @@ -432,7 +432,10 @@ let driver source_file (options : Cli.options) : int = Messages.raise_error "Option --avoid_exceptions must be enabled for \ --closure_conversion"; - Messages.emit_debug "Performing closure conversion..."; + if not options.optimize then + Messages.raise_error + "Option --optimize must be enabled for --closure_conversion" + Messages.emit_debug "Performing closure conversion..."; let prgm = Lcalc.Closure_conversion.closure_conversion prgm in let prgm = Bindlib.unbox prgm in let prgm = diff --git a/compiler/lcalc/closure_conversion.ml b/compiler/lcalc/closure_conversion.ml index 789455cd..fce25ede 100644 --- a/compiler/lcalc/closure_conversion.ml +++ b/compiler/lcalc/closure_conversion.ml @@ -211,13 +211,14 @@ let rec transform_closures_expr : let free_vars, new_args = List.fold_right (fun (arg : (lcalc, m) gexpr) (free_vars, new_args) -> + let m_arg = Mark.get arg in match Mark.remove arg with | EAbs { binder; tys } -> - (* The two last arguments of HandleDefaultOps are closures, see - above*) let vars, arg = Bindlib.unmbind binder in let new_free_vars, new_arg = (transform_closures_expr ctx) arg in - let new_arg = Expr.make_abs vars new_arg tys (Expr.pos arg) in + let new_arg = + Expr.make_abs vars new_arg tys (Expr.mark_pos m_arg) + in Var.Set.union free_vars new_free_vars, new_arg :: new_args | _ -> let new_free_vars, new_arg = transform_closures_expr ctx arg in diff --git a/tests/test_func/good/closure_conversion_reduce.catala_en b/tests/test_func/good/closure_conversion_reduce.catala_en new file mode 100644 index 00000000..6cae4c10 --- /dev/null +++ b/tests/test_func/good/closure_conversion_reduce.catala_en @@ -0,0 +1,57 @@ + +# Article + +```catala +declaration scope S: + input x content collection integer + output y content integer + +scope S: + definition y equals + potential_max among x such that potential_max is minimum or if collection empty then -1 +``` + +```catala-test-inline +$ catala Lcalc -s S --avoid_exceptions -O --closure_conversion +let scope S + (S_in: S_in {x_in: eoption collection eoption integer}) + : S {y: eoption integer} + = + let get x : eoption collection eoption integer = S_in.x_in in + let set y : eoption integer = + ESome + match + (match x with + | ENone _ → ENone _ + | ESome y_2 → + reduce + (λ (f: eoption integer) (init: eoption integer) → + match init with + | ENone _ → ENone _ + | ESome y_3 → + match f with + | ENone _ → ENone _ + | ESome y_0 → if y_0 < y_3 then ESome y_0 else ESome y_3) + ESome -1 + y_2) + with + | ENone _ → raise NoValueProvided + | ESome y → y + in + return { S y = y; } +``` + +The next test of closure conversion does not go through for the moment. +The detection of closures that should not be converted because they are arguments +to reduce or other special operators relies on pattern matching the special +operator and its EAbs argument. However without exceptions on, because the +--avoid_exceptions pass is not optimized and produces more options than needed, +the closures that are arguments to special operators are let-binded with an +option. This let-binding is reduced by partial evaluation, which is why the test +with optimizations on passes. + +```catala-test-inline +$ catala Lcalc -s S --avoid_exceptions --closure_conversion +[ERROR] Option --optimize must be enabled for --closure_conversion +#return code 255# +``` diff --git a/tests/test_func/good/closure_return.catala_en b/tests/test_func/good/closure_return.catala_en index c66e46b7..e4f2cb88 100644 --- a/tests/test_func/good/closure_return.catala_en +++ b/tests/test_func/good/closure_return.catala_en @@ -36,49 +36,3 @@ let scope S in return { S f = f; } ``` - -```catala-test-inline -$ catala Lcalc -s S --avoid_exceptions --closure_conversion -let scope S - (S_in: S_in {x_in: eoption bool}) - : S { - f: - eoption - (((eoption bool), integer) → eoption integer * (eoption bool)) - } - = - let get x : eoption bool = - match (ESome S_in) with - | ENone _ → ENone _ - | ESome S_in → S_in.x_in - in - let set f : - eoption - (((eoption bool), integer) → eoption integer * (eoption bool)) = - ESome - let f : ((eoption bool), integer) → eoption integer = - λ (env: (eoption bool)) (y: integer) → - let x : eoption bool = env.0 in - ESome - match - (handle_default_opt - [ ] - (λ (_: unit) → ESome true) - (λ (_: unit) → - match x with - | ENone _1 → ENone _1 - | ESome x1 → - if x1 - then ESome y - else - match (ESome y) with - | ENone _1 → ENone _1 - | ESome y_0 → ESome - y_0)) - with - | ENone _ → raise NoValueProvided - | ESome f → f - in - (f, (x)) - in - return { S f = f; } -``` From 27bbe78438f876163173ba7559680bcb63feb5ea Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Tue, 13 Jun 2023 20:10:42 +0200 Subject: [PATCH 10/26] Understanding a limitation --- compiler/catala_utils/messages.ml | 32 ++++++----- compiler/catala_utils/messages.mli | 4 +- compiler/driver.ml | 31 ++++++++--- .../scope_call_func_struct_closure.catala_en | 54 +++++++++++++++++++ tests/test_scope/good/scope_call.catala_en | 11 ---- 5 files changed, 99 insertions(+), 33 deletions(-) create mode 100644 tests/test_scope/bad/scope_call_func_struct_closure.catala_en diff --git a/compiler/catala_utils/messages.ml b/compiler/catala_utils/messages.ml index 07ec6f89..e92b9549 100644 --- a/compiler/catala_utils/messages.ml +++ b/compiler/catala_utils/messages.ml @@ -75,7 +75,7 @@ let print_time_marker = time := new_time; let delta = (new_time -. old_time) *. 1000. in if delta > 50. then - Format.fprintf ppf "@{[TIME] %.0fms@}@," delta + Format.fprintf ppf "@{[TIME] %.0fms@}@\n" delta let pp_marker target ppf = let open Ocolor_types in @@ -105,22 +105,28 @@ module Content = struct let of_string (s : string) : t = { message = (fun ppf -> Format.pp_print_string ppf s); positions = [] } + + let internal_error_prefix = + "Internal Error, please report to \ + https://github.com/CatalaLang/catala/issues: " + + let prepend_message (content : t) prefix : t = + { + content with + message = (fun ppf -> Format.fprintf ppf "%t@,%t" prefix content.message); + } + + let mark_as_internal_error (content : t) : t = + { + content with + message = + (fun ppf -> + Format.fprintf ppf "%s@,%t" internal_error_prefix content.message); + } end open Content -let internal_error_prefix = - "Internal Error, please report to \ - https://github.com/CatalaLang/catala/issues: " - -let to_internal_error (content : Content.t) : Content.t = - { - content with - message = - (fun ppf -> - Format.fprintf ppf "%s@,%t" internal_error_prefix content.message); - } - let emit_content (content : Content.t) (target : content_type) : unit = let { message; positions } = content in match !Cli.message_format_flag with diff --git a/compiler/catala_utils/messages.mli b/compiler/catala_utils/messages.mli index 2b533fcf..a866d23e 100644 --- a/compiler/catala_utils/messages.mli +++ b/compiler/catala_utils/messages.mli @@ -33,10 +33,10 @@ module Content : sig val of_message : (Format.formatter -> unit) -> t val of_string : string -> t + val mark_as_internal_error : t -> t + val prepend_message : t -> (Format.formatter -> unit) -> t end -val to_internal_error : Content.t -> Content.t - type content_type = Error | Warning | Debug | Log | Result val emit_content : Content.t -> content_type -> unit diff --git a/compiler/driver.ml b/compiler/driver.ml index 29f6ff3c..d2a5c940 100644 --- a/compiler/driver.ml +++ b/compiler/driver.ml @@ -319,7 +319,7 @@ let driver source_file (options : Cli.options) : int = with Messages.CompilerError error_content -> raise (Messages.CompilerError - (Messages.to_internal_error error_content)) + (Messages.Content.mark_as_internal_error error_content)) in (* That's it! *) Messages.emit_result "Typechecking successful!" @@ -355,7 +355,7 @@ let driver source_file (options : Cli.options) : int = with Messages.CompilerError error_content -> raise (Messages.CompilerError - (Messages.to_internal_error error_content)) + (Messages.Content.mark_as_internal_error error_content)) in if !Cli.check_invariants_flag then ( Messages.emit_debug "Checking invariants..."; @@ -445,11 +445,28 @@ let driver source_file (options : Cli.options) : int = else prgm in Messages.emit_debug "Retyping lambda calculus..."; - let prgm = - Shared_ast.Program.untype - (Shared_ast.Typing.program ~leave_unresolved:true prgm) - in - prgm) + try + let prgm = + Shared_ast.Program.untype + (Shared_ast.Typing.program ~leave_unresolved:true prgm) + in + prgm + with Messages.CompilerError content -> + raise + (Messages.CompilerError + (Messages.Content.prepend_message content (fun fmt -> + Format.fprintf fmt + "As part of the compilation process, one of the \ + step (closure conversion) modified the Catala \ + program and re-typing after this modification \ + failed with the error message below. This \ + re-typing error if not your fault, but is \ + likely to indicate that the program you are \ + trying to compile is incompatible with the \ + current compilation scheme provided by the \ + Catala compiler. Try to rewrite the program to \ + avoid the problematic pattern or contact the \ + compiler developers for help.@\n")))) else prgm in match backend with diff --git a/tests/test_scope/bad/scope_call_func_struct_closure.catala_en b/tests/test_scope/bad/scope_call_func_struct_closure.catala_en new file mode 100644 index 00000000..32a0e16c --- /dev/null +++ b/tests/test_scope/bad/scope_call_func_struct_closure.catala_en @@ -0,0 +1,54 @@ +```catala +declaration structure Result: + data r content integer depends on z content integer + +declaration scope SubFoo: + input x content integer + output y content integer depends on z content integer + +declaration scope Foo: + internal r content Result + output z content integer + +scope SubFoo: + definition y of z equals x + z + +scope Foo: + definition r equals Result { --r: (output of SubFoo with { -- x: 10 }).y } + definition z equals r.r of 1 +``` + +Closure conversion fails because the type of `Result` should change to reflect +the transformed closure but we don't allow our closure conversion to change +user-defined types. + +```catala-test-inline +$ catala Lcalc --avoid_exceptions -O --closure_conversion +[ERROR] As part of the compilation process, one of the step (closure conversion) modified the Catala program and re-typing after this modification failed with the error message below. This re-typing error if not your fault, but is likely to indicate that the program you are trying to compile is incompatible with the current compilation scheme provided by the Catala compiler. Try to rewrite the program to avoid the problematic pattern or contact the compiler developers for help. + +Error during typechecking, incompatible types: +┌─⯈ ( * ) +└─⯈ integer → option integer + +Error coming from typechecking the following expression: +┌─⯈ tests/test_scope/bad/scope_call_func_struct_closure.catala_en:10.12-10.13: +└──┐ +10 │ internal r content Result + │ ‾ + + +Type ( * ) coming from expression: +┌─⯈ tests/test_scope/bad/scope_call_func_struct_closure.catala_en:10.12-10.13: +└──┐ +10 │ internal r content Result + │ ‾ + + +Type integer → option integer coming from expression: +┌─⯈ tests/test_scope/bad/scope_call_func_struct_closure.catala_en:3.18-3.25: +└─┐ +3 │ data r content integer depends on z content integer + │ ‾‾‾‾‾‾‾ + +#return code 255# +``` diff --git a/tests/test_scope/good/scope_call.catala_en b/tests/test_scope/good/scope_call.catala_en index 00cf1c06..b2c7fe0f 100644 --- a/tests/test_scope/good/scope_call.catala_en +++ b/tests/test_scope/good/scope_call.catala_en @@ -1,8 +1,4 @@ ```catala -declaration structure Test: - data z2 content integer - data z3 content integer - declaration scope SubFoo: input x content integer input y content integer @@ -26,13 +22,6 @@ 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.23-2.27: -└─┐ -2 │ declaration structure Test: - │ ‾‾‾‾ - [RESULT] Computation successful! Results: [RESULT] example = -7 ``` From 2c9b56fb70431969fb61ff6b387ac921a532a1ef Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Tue, 13 Jun 2023 20:37:23 +0200 Subject: [PATCH 11/26] More agressive re-typing --- compiler/lcalc/closure_conversion.ml | 96 ++++++++++--------- .../scope_call_func_struct_closure.catala_en | 83 ++++++++++++---- 2 files changed, 112 insertions(+), 67 deletions(-) diff --git a/compiler/lcalc/closure_conversion.ml b/compiler/lcalc/closure_conversion.ml index fce25ede..1ea2f5f0 100644 --- a/compiler/lcalc/closure_conversion.ml +++ b/compiler/lcalc/closure_conversion.ml @@ -301,9 +301,9 @@ let closure_conversion_scope_let ctx scope_body_expr = scope_body_expr let closure_conversion (p : 'm program) : 'm program Bindlib.box = - let (_, new_decl_ctx), new_code_items = + let _, new_code_items = Scope.fold_map - ~f:(fun (toplevel_vars, decl_ctx) var code_item -> + ~f:(fun toplevel_vars var code_item -> match code_item with | ScopeDef (name, body) -> let scope_input_var, scope_body_expr = @@ -322,47 +322,8 @@ let closure_conversion (p : 'm program) : 'm program Bindlib.box = let new_scope_body_expr = Bindlib.bind_var scope_input_var new_scope_lets in - let new_decl_ctx = - (* Because closure conversion can change the type of input and - output scope variables that are structs, their type will change. - So we replace their type decleration in the structs with TAny so - that a later re-typing phase can infer them. INVARIANT: the only - types that will change are the types of closures taken in and out - of the scopes. *) - let rec type_contains_arrow t = - match Mark.remove t with - | TArrow _ -> true - | TAny -> true - | TOption t' -> type_contains_arrow t' - | TLit _ -> false - | TArray ts -> type_contains_arrow ts - | TTuple ts -> List.exists type_contains_arrow ts - | TEnum e -> - EnumConstructor.Map.exists - (fun _ t' -> type_contains_arrow t') - (EnumName.Map.find e p.decl_ctx.ctx_enums) - | TStruct s -> - StructField.Map.exists - (fun _ t' -> type_contains_arrow t') - (StructName.Map.find s p.decl_ctx.ctx_structs) - in - let replace_type_with_any s = - Some - (StructField.Map.map - (fun t -> - if type_contains_arrow t then Mark.copy t TAny else t) - (Option.get s)) - in - { - decl_ctx with - ctx_structs = - StructName.Map.update body.scope_body_output_struct - replace_type_with_any - (StructName.Map.update body.scope_body_input_struct - replace_type_with_any decl_ctx.ctx_structs); - } - in - ( (Var.Set.add var toplevel_vars, new_decl_ctx), + + ( Var.Set.add var toplevel_vars, Bindlib.box_apply (fun scope_body_expr -> ScopeDef (name, { body with scope_body_expr })) @@ -376,13 +337,56 @@ let closure_conversion (p : 'm program) : 'm program Bindlib.box = } in let _free_vars, new_expr = transform_closures_expr ctx expr in - ( (Var.Set.add var toplevel_vars, decl_ctx), + ( Var.Set.add var toplevel_vars, Bindlib.box_apply (fun e -> Topdef (name, ty, e)) (Expr.Box.lift new_expr) )) ~varf:(fun v -> v) - (Var.Set.empty, p.decl_ctx) - p.code_items + Var.Set.empty p.code_items + in + (* Now we need to further tweak [decl_ctx] because some of the user-defined + types can have closures in them and these closured might have changed type. + So we reset them to [TAny] in the hopes that the transformation applied + will not yield to type unification conflicts. Indeed, consider the + following closure: [let f = if ... then fun v -> x + v else fun v -> v]. To + be typed correctly once converted, this closure needs an existential type + but the Catala typechecker doesn't have them. However, this kind of type + conflict is difficult to produce using the Catala surface language: it can + only happen if you store a closure which is the output of a scope inside a + user-defined data structure, and if you do it in two different places in + the code with two closures that don't have the same capture footprint. *) + let new_decl_ctx = + let rec type_contains_arrow t = + match Mark.remove t with + | TArrow _ -> true + | TAny -> true + | TOption t' -> type_contains_arrow t' + | TLit _ -> false + | TArray ts -> type_contains_arrow ts + | TTuple ts -> List.exists type_contains_arrow ts + | TEnum e -> + EnumConstructor.Map.exists + (fun _ t' -> type_contains_arrow t') + (EnumName.Map.find e p.decl_ctx.ctx_enums) + | TStruct s -> + StructField.Map.exists + (fun _ t' -> type_contains_arrow t') + (StructName.Map.find s p.decl_ctx.ctx_structs) + in + let replace_fun_typs t = + if type_contains_arrow t then Mark.copy t TAny else t + in + { + p.decl_ctx with + ctx_structs = + StructName.Map.map + (StructField.Map.map replace_fun_typs) + p.decl_ctx.ctx_structs; + ctx_enums = + EnumName.Map.map + (EnumConstructor.Map.map replace_fun_typs) + p.decl_ctx.ctx_enums; + } in Bindlib.box_apply (fun new_code_items -> diff --git a/tests/test_scope/bad/scope_call_func_struct_closure.catala_en b/tests/test_scope/bad/scope_call_func_struct_closure.catala_en index 32a0e16c..a4b376fe 100644 --- a/tests/test_scope/bad/scope_call_func_struct_closure.catala_en +++ b/tests/test_scope/bad/scope_call_func_struct_closure.catala_en @@ -24,31 +24,72 @@ user-defined types. ```catala-test-inline $ catala Lcalc --avoid_exceptions -O --closure_conversion -[ERROR] As part of the compilation process, one of the step (closure conversion) modified the Catala program and re-typing after this modification failed with the error message below. This re-typing error if not your fault, but is likely to indicate that the program you are trying to compile is incompatible with the current compilation scheme provided by the Catala compiler. Try to rewrite the program to avoid the problematic pattern or contact the compiler developers for help. +type eoption = | ENone of unit | ESome of any -Error during typechecking, incompatible types: -┌─⯈ ( * ) -└─⯈ integer → option integer +type Result = { r: eoption (((), integer) → eoption integer * ()); } -Error coming from typechecking the following expression: -┌─⯈ tests/test_scope/bad/scope_call_func_struct_closure.catala_en:10.12-10.13: -└──┐ -10 │ internal r content Result - │ ‾ +type SubFoo = { + y: eoption + (((eoption integer), integer) → eoption integer * (eoption integer)); + } +type Foo = { z: eoption integer; } -Type ( * ) coming from expression: -┌─⯈ tests/test_scope/bad/scope_call_func_struct_closure.catala_en:10.12-10.13: -└──┐ -10 │ internal r content Result - │ ‾ +type SubFoo_in = { x_in: eoption integer; } +type Foo_in = { } + +let scope SubFoo + (SubFoo_in: SubFoo_in {x_in: eoption integer}) + : SubFoo { + y: + eoption + (((eoption integer), integer) → eoption integer * + (eoption integer)) + } + = + let get x : eoption integer = SubFoo_in.x_in in + let set y : + eoption + (((eoption integer), integer) → eoption integer * (eoption integer)) + = + ESome + (λ (env: (eoption integer)) (z: integer) → + ESome + match + (match env.0 with + | ENone _ → ENone _ + | ESome x_0 → ESome (x_0 + z)) + with + | ENone _ → raise NoValueProvided + | ESome y → y, (x)) + in + return { SubFoo y = y; } +let scope Foo (Foo_in: Foo_in): Foo {z: eoption integer} = + let set r : + eoption Result {r: eoption (((), integer) → eoption integer * ())} = + ESome + { Result + r = + ESome + (λ (env: any) (param0: integer) → + match (SubFoo { SubFoo_in x_in = ESome 10; }).y with + | ENone _ → ENone _ + | ESome r → r.0 r.1 param0, ()); + } + in + let set z : eoption integer = + ESome + match + (match (match r with + | ENone _ → ENone _ + | ESome r → r.r) with + | ENone _ → ENone _ + | ESome r → r.0 r.1 1) + with + | ENone _ → raise NoValueProvided + | ESome z → z + in + return { Foo z = z; } -Type integer → option integer coming from expression: -┌─⯈ tests/test_scope/bad/scope_call_func_struct_closure.catala_en:3.18-3.25: -└─┐ -3 │ data r content integer depends on z content integer - │ ‾‾‾‾‾‾‾ - -#return code 255# ``` From 42aaa1017d4afe72f78c567740d36219f929ea87 Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Wed, 14 Jun 2023 11:18:39 +0200 Subject: [PATCH 12/26] Created minimal not working example and tame down beta-reduction --- compiler/shared_ast/optimizations.ml | 6 +- .../good/closure_conversion.catala_en | 30 ++++-- .../good/closure_conversion_reduce.catala_en | 7 +- tests/test_func/good/closure_return.catala_en | 12 ++- .../good/closure_through_scope.catala_en | 12 ++- .../scope_call_func_struct_closure.catala_en | 73 ++++++++++++++ .../scope_call_func_struct_closure.catala_en | 95 ------------------- 7 files changed, 125 insertions(+), 110 deletions(-) create mode 100644 tests/test_func/good/scope_call_func_struct_closure.catala_en delete mode 100644 tests/test_scope/bad/scope_call_func_struct_closure.catala_en diff --git a/compiler/shared_ast/optimizations.ml b/compiler/shared_ast/optimizations.ml index 293ae9d8..a33b0d6a 100644 --- a/compiler/shared_ast/optimizations.ml +++ b/compiler/shared_ast/optimizations.ml @@ -177,8 +177,10 @@ let rec optimize_expr : | _ -> assert false) in EMatch { e = arg; cases; name = n1 } - | EApp { f = EAbs { binder; _ }, _; args } -> - (* beta reduction *) + | EApp { f = EAbs { binder; _ }, _; args } + when not (Array.exists Fun.id (Bindlib.mbinder_occurs binder)) -> + (* beta reduction when variables not used. TODO: also optimize when + variable is used only once. *) Mark.remove (Bindlib.msubst binder (List.map fst args |> Array.of_list)) | EStructAccess { name; field; e = EStruct { name = name1; fields }, _ } when name = name1 -> diff --git a/tests/test_func/good/closure_conversion.catala_en b/tests/test_func/good/closure_conversion.catala_en index 6e4dfb1f..c93d6f10 100644 --- a/tests/test_func/good/closure_conversion.catala_en +++ b/tests/test_func/good/closure_conversion.catala_en @@ -19,21 +19,37 @@ let scope S (S_in: S_in {x_in: eoption bool}): S {z: eoption integer} = eoption (((eoption bool), integer) → eoption integer * (eoption bool)) = ESome - (λ (env: (eoption bool)) (y: integer) → + let f : ((eoption bool), integer) → eoption integer = + λ (env: (eoption bool)) (y: integer) → + let x : eoption bool = env.0 in ESome match - (match env.0 with + (match x with | ENone _ → ENone _ - | ESome x → if x then ESome y else ESome - y) + | ESome x1 → if x1 then ESome y else ESome - y) with | ENone _ → raise NoValueProvided - | ESome f → f, (x)) + | ESome f → f + in + (f, (x)) in let set z : eoption integer = ESome - match (match f with - | ENone _ → ENone _ - | ESome f → f.0 f.1 -1) with + match + (match f with + | ENone _ → ENone _ + | ESome f → + let code_and_env : + (((eoption bool), integer) → eoption integer * + (eoption bool)) = + f + in + let code : ((eoption bool), integer) → eoption integer = + code_and_env.0 + in + let env : (eoption bool) = code_and_env.1 in + code env -1) + with | ENone _ → raise NoValueProvided | ESome z → z in diff --git a/tests/test_func/good/closure_conversion_reduce.catala_en b/tests/test_func/good/closure_conversion_reduce.catala_en index 6cae4c10..34983359 100644 --- a/tests/test_func/good/closure_conversion_reduce.catala_en +++ b/tests/test_func/good/closure_conversion_reduce.catala_en @@ -31,7 +31,12 @@ let scope S | ESome y_3 → match f with | ENone _ → ENone _ - | ESome y_0 → if y_0 < y_3 then ESome y_0 else ESome y_3) + | ESome y_0 → + let potential_max_1 : integer = y_0 in + let potential_max_2 : integer = y_3 in + if potential_max_1 < potential_max_2 + then ESome potential_max_1 + else ESome potential_max_2) ESome -1 y_2) with diff --git a/tests/test_func/good/closure_return.catala_en b/tests/test_func/good/closure_return.catala_en index e4f2cb88..43ba22bf 100644 --- a/tests/test_func/good/closure_return.catala_en +++ b/tests/test_func/good/closure_return.catala_en @@ -24,15 +24,19 @@ let scope S eoption (((eoption bool), integer) → eoption integer * (eoption bool)) = ESome - (λ (env: (eoption bool)) (y: integer) → + let f : ((eoption bool), integer) → eoption integer = + λ (env: (eoption bool)) (y: integer) → + let x : eoption bool = env.0 in ESome match - (match env.0 with + (match x with | ENone _ → ENone _ - | ESome x → if x then ESome y else ESome - y) + | ESome x1 → if x1 then ESome y else ESome - y) with | ENone _ → raise NoValueProvided - | ESome f → f, (x)) + | ESome f → f + in + (f, (x)) in return { S f = f; } ``` diff --git a/tests/test_func/good/closure_through_scope.catala_en b/tests/test_func/good/closure_through_scope.catala_en index 41fb8541..2f517edb 100644 --- a/tests/test_func/good/closure_through_scope.catala_en +++ b/tests/test_func/good/closure_through_scope.catala_en @@ -42,7 +42,17 @@ let scope T (T_in: T_in): T {y: eoption integer} = match (match s.f with | ENone _ → ENone _ - | ESome s.f → s.f.0 s.f.1 2) + | ESome s.f → + let code_and_env : + (((eoption bool), integer) → eoption integer * + (eoption bool)) = + s.f + in + let code : ((eoption bool), integer) → eoption integer = + code_and_env.0 + in + let env : (eoption bool) = code_and_env.1 in + code env 2) with | ENone _ → raise NoValueProvided | ESome y → y diff --git a/tests/test_func/good/scope_call_func_struct_closure.catala_en b/tests/test_func/good/scope_call_func_struct_closure.catala_en new file mode 100644 index 00000000..ebc1dff7 --- /dev/null +++ b/tests/test_func/good/scope_call_func_struct_closure.catala_en @@ -0,0 +1,73 @@ +```catala +declaration structure Result: + data r content integer depends on z content integer + data q content integer + +declaration scope SubFoo1: + input output x content integer + output y content integer depends on z content integer + +declaration scope SubFoo2: + input output x1 content integer + input x2 content integer + output y content integer depends on z content integer + + +declaration scope Foo: + input b content boolean + internal r content Result + output z content integer + +scope SubFoo1: + definition y of z equals x + z + +scope SubFoo2: + definition y of z equals x1 + x2 + z + + +scope Foo: + definition r equals + if b then + let f equals output of SubFoo1 with { -- x: 10 } in + Result { --r: f.y --q: f.x } + else + let f equals output of SubFoo2 with { -- x1: 5 -- x2: 5 } in + Result { --r: f.y --q: f.x1 } + definition z equals r.r of 1 +``` + +This test case is tricky because it creates a situation where the type of the +two closures in Foo.r are different even with optimizations enabled. +TODO fix this. + +```catala-test-inline +$ catala Lcalc --avoid_exceptions -O --closure_conversion +[ERROR] As part of the compilation process, one of the step (closure conversion) modified the Catala program and re-typing after this modification failed with the error message below. This re-typing error if not your fault, but is likely to indicate that the program you are trying to compile is incompatible with the current compilation scheme provided by the Catala compiler. Try to rewrite the program to avoid the problematic pattern or contact the compiler developers for help. + +Error during typechecking, incompatible types: +┌─⯈ () +└─⯈ (option integer) + +Error coming from typechecking the following expression: +┌─⯈ tests/test_func/good/scope_call_func_struct_closure.catala_en:31.20-31.55: +└──┐ +31 │ let f equals output of SubFoo1 with { -- x: 10 } in + │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ + + +Type () coming from expression: +┌─⯈ tests/test_func/good/scope_call_func_struct_closure.catala_en:31.20-31.55: +└──┐ +31 │ let f equals output of SubFoo1 with { -- x: 10 } in + │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ + + +Type (option integer) coming from expression: +┌─⯈ tests/test_func/good/scope_call_func_struct_closure.catala_en:8.10-8.11: +└─┐ +8 │ output y content integer depends on z content integer + │ ‾ + +#return code 255# +``` + diff --git a/tests/test_scope/bad/scope_call_func_struct_closure.catala_en b/tests/test_scope/bad/scope_call_func_struct_closure.catala_en deleted file mode 100644 index a4b376fe..00000000 --- a/tests/test_scope/bad/scope_call_func_struct_closure.catala_en +++ /dev/null @@ -1,95 +0,0 @@ -```catala -declaration structure Result: - data r content integer depends on z content integer - -declaration scope SubFoo: - input x content integer - output y content integer depends on z content integer - -declaration scope Foo: - internal r content Result - output z content integer - -scope SubFoo: - definition y of z equals x + z - -scope Foo: - definition r equals Result { --r: (output of SubFoo with { -- x: 10 }).y } - definition z equals r.r of 1 -``` - -Closure conversion fails because the type of `Result` should change to reflect -the transformed closure but we don't allow our closure conversion to change -user-defined types. - -```catala-test-inline -$ catala Lcalc --avoid_exceptions -O --closure_conversion -type eoption = | ENone of unit | ESome of any - -type Result = { r: eoption (((), integer) → eoption integer * ()); } - -type SubFoo = { - y: eoption - (((eoption integer), integer) → eoption integer * (eoption integer)); - } - -type Foo = { z: eoption integer; } - -type SubFoo_in = { x_in: eoption integer; } - -type Foo_in = { } - -let scope SubFoo - (SubFoo_in: SubFoo_in {x_in: eoption integer}) - : SubFoo { - y: - eoption - (((eoption integer), integer) → eoption integer * - (eoption integer)) - } - = - let get x : eoption integer = SubFoo_in.x_in in - let set y : - eoption - (((eoption integer), integer) → eoption integer * (eoption integer)) - = - ESome - (λ (env: (eoption integer)) (z: integer) → - ESome - match - (match env.0 with - | ENone _ → ENone _ - | ESome x_0 → ESome (x_0 + z)) - with - | ENone _ → raise NoValueProvided - | ESome y → y, (x)) - in - return { SubFoo y = y; } -let scope Foo (Foo_in: Foo_in): Foo {z: eoption integer} = - let set r : - eoption Result {r: eoption (((), integer) → eoption integer * ())} = - ESome - { Result - r = - ESome - (λ (env: any) (param0: integer) → - match (SubFoo { SubFoo_in x_in = ESome 10; }).y with - | ENone _ → ENone _ - | ESome r → r.0 r.1 param0, ()); - } - in - let set z : eoption integer = - ESome - match - (match (match r with - | ENone _ → ENone _ - | ESome r → r.r) with - | ENone _ → ENone _ - | ESome r → r.0 r.1 1) - with - | ENone _ → raise NoValueProvided - | ESome z → z - in - return { Foo z = z; } - -``` From 571c7c5d894020b1a7430d34617be8c26dbe5644 Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Wed, 14 Jun 2023 11:39:27 +0200 Subject: [PATCH 13/26] Correctly count number of var occurences --- compiler/shared_ast/optimizations.ml | 28 +++++++++++++++++-- .../good/closure_conversion.catala_en | 18 ++++-------- tests/test_func/good/closure_return.catala_en | 12 +++----- .../good/closure_through_scope.catala_en | 6 +--- 4 files changed, 35 insertions(+), 29 deletions(-) diff --git a/compiler/shared_ast/optimizations.ml b/compiler/shared_ast/optimizations.ml index a33b0d6a..ee60258e 100644 --- a/compiler/shared_ast/optimizations.ml +++ b/compiler/shared_ast/optimizations.ml @@ -58,6 +58,29 @@ let all_match_cases_map_to_same_constructor cases n = | _ -> false) | _ -> assert false) +let binder_vars_used_at_most_once + (binder : + ( (('a, 'b) dcalc_lcalc, ('a, 'b) dcalc_lcalc, 'm) base_gexpr, + (('a, 'b) dcalc_lcalc, 'm) gexpr ) + Bindlib.mbinder) : bool = + (* fast path: variables not used at all *) + (not (Array.exists Fun.id (Bindlib.mbinder_occurs binder))) + || + let vars, body = Bindlib.unmbind binder in + let rec vars_count (e : (('a, 'b) dcalc_lcalc, 'm) gexpr) : int array = + match e with + | EVar v, _ -> + Array.map + (fun i -> if Bindlib.eq_vars v (Array.get vars i) then 1 else 0) + (Array.make (Array.length vars) 0) + | e -> + Expr.shallow_fold + (fun e' acc -> Array.map2 (fun x y -> x + y) (vars_count e') acc) + e + (Array.make (Array.length vars) 0) + in + not (Array.exists (fun c -> c > 1) (vars_count body)) + let rec optimize_expr : type a b. (a, b, 'm) optimizations_ctx -> @@ -178,9 +201,8 @@ let rec optimize_expr : in EMatch { e = arg; cases; name = n1 } | EApp { f = EAbs { binder; _ }, _; args } - when not (Array.exists Fun.id (Bindlib.mbinder_occurs binder)) -> - (* beta reduction when variables not used. TODO: also optimize when - variable is used only once. *) + when binder_vars_used_at_most_once binder -> + (* beta reduction when variables not used. *) Mark.remove (Bindlib.msubst binder (List.map fst args |> Array.of_list)) | EStructAccess { name; field; e = EStruct { name = name1; fields }, _ } when name = name1 -> diff --git a/tests/test_func/good/closure_conversion.catala_en b/tests/test_func/good/closure_conversion.catala_en index c93d6f10..ffa71d0a 100644 --- a/tests/test_func/good/closure_conversion.catala_en +++ b/tests/test_func/good/closure_conversion.catala_en @@ -19,19 +19,15 @@ let scope S (S_in: S_in {x_in: eoption bool}): S {z: eoption integer} = eoption (((eoption bool), integer) → eoption integer * (eoption bool)) = ESome - let f : ((eoption bool), integer) → eoption integer = - λ (env: (eoption bool)) (y: integer) → - let x : eoption bool = env.0 in + (λ (env: (eoption bool)) (y: integer) → ESome match - (match x with + (match env.0 with | ENone _ → ENone _ - | ESome x1 → if x1 then ESome y else ESome - y) + | ESome x → if x then ESome y else ESome - y) with | ENone _ → raise NoValueProvided - | ESome f → f - in - (f, (x)) + | ESome f → f, (x)) in let set z : eoption integer = ESome @@ -44,11 +40,7 @@ let scope S (S_in: S_in {x_in: eoption bool}): S {z: eoption integer} = (eoption bool)) = f in - let code : ((eoption bool), integer) → eoption integer = - code_and_env.0 - in - let env : (eoption bool) = code_and_env.1 in - code env -1) + code_and_env.0 code_and_env.1 -1) with | ENone _ → raise NoValueProvided | ESome z → z diff --git a/tests/test_func/good/closure_return.catala_en b/tests/test_func/good/closure_return.catala_en index 43ba22bf..e4f2cb88 100644 --- a/tests/test_func/good/closure_return.catala_en +++ b/tests/test_func/good/closure_return.catala_en @@ -24,19 +24,15 @@ let scope S eoption (((eoption bool), integer) → eoption integer * (eoption bool)) = ESome - let f : ((eoption bool), integer) → eoption integer = - λ (env: (eoption bool)) (y: integer) → - let x : eoption bool = env.0 in + (λ (env: (eoption bool)) (y: integer) → ESome match - (match x with + (match env.0 with | ENone _ → ENone _ - | ESome x1 → if x1 then ESome y else ESome - y) + | ESome x → if x then ESome y else ESome - y) with | ENone _ → raise NoValueProvided - | ESome f → f - in - (f, (x)) + | ESome f → f, (x)) in return { S f = f; } ``` diff --git a/tests/test_func/good/closure_through_scope.catala_en b/tests/test_func/good/closure_through_scope.catala_en index 2f517edb..57892cbf 100644 --- a/tests/test_func/good/closure_through_scope.catala_en +++ b/tests/test_func/good/closure_through_scope.catala_en @@ -48,11 +48,7 @@ let scope T (T_in: T_in): T {y: eoption integer} = (eoption bool)) = s.f in - let code : ((eoption bool), integer) → eoption integer = - code_and_env.0 - in - let env : (eoption bool) = code_and_env.1 in - code env 2) + code_and_env.0 code_and_env.1 2) with | ENone _ → raise NoValueProvided | ESome y → y From a3087ee1636d242ad17b4b5fbd18fe4c0d67a481 Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Thu, 15 Jun 2023 11:11:56 +0200 Subject: [PATCH 14/26] Adding typing for closure env --- compiler/scopelang/dependency.ml | 2 +- compiler/shared_ast/definitions.ml | 1 + compiler/shared_ast/print.ml | 1 + compiler/shared_ast/type.ml | 12 ++++++++---- compiler/shared_ast/typing.ml | 7 ++++++- 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/compiler/scopelang/dependency.ml b/compiler/scopelang/dependency.ml index 653d8cea..32560136 100644 --- a/compiler/scopelang/dependency.ml +++ b/compiler/scopelang/dependency.ml @@ -258,7 +258,7 @@ let rec get_structs_or_enums_in_type (t : typ) : TVertexSet.t = |> List.map get_structs_or_enums_in_type |> List.fold_left TVertexSet.union TVertexSet.empty) (get_structs_or_enums_in_type t2) - | TLit _ | TAny -> TVertexSet.empty + | TClosureEnv | TLit _ | TAny -> TVertexSet.empty | TOption t1 | TArray t1 -> get_structs_or_enums_in_type t1 | TTuple ts -> List.fold_left diff --git a/compiler/shared_ast/definitions.ml b/compiler/shared_ast/definitions.ml index 01fa6f2d..be7f2b71 100644 --- a/compiler/shared_ast/definitions.ml +++ b/compiler/shared_ast/definitions.ml @@ -149,6 +149,7 @@ and naked_typ = | TArrow of typ list * typ | TArray of typ | TAny + | TClosureEnv (** Hides an existential type needed for closure conversion *) (** {2 Constants and operators} *) diff --git a/compiler/shared_ast/print.ml b/compiler/shared_ast/print.ml index 838e81a0..a67d2b74 100644 --- a/compiler/shared_ast/print.ml +++ b/compiler/shared_ast/print.ml @@ -162,6 +162,7 @@ let rec typ Format.fprintf fmt "@[%a@ %a@]" base_type "collection" (typ ~colors) t1 | TAny -> base_type fmt "any" + | TClosureEnv -> base_type fmt "closure_env" let lit (fmt : Format.formatter) (l : lit) : unit = match l with diff --git a/compiler/shared_ast/type.ml b/compiler/shared_ast/type.ml index 2c01f7b9..c6e17770 100644 --- a/compiler/shared_ast/type.ml +++ b/compiler/shared_ast/type.ml @@ -31,9 +31,9 @@ let rec equal ty1 ty2 = | TOption t1, TOption t2 -> equal t1 t2 | TArrow (t1, t1'), TArrow (t2, t2') -> equal_list t1 t2 && equal t1' t2' | TArray t1, TArray t2 -> equal t1 t2 - | TAny, TAny -> true + | TClosureEnv, TClosureEnv | TAny, TAny -> true | ( ( TLit _ | TTuple _ | TStruct _ | TEnum _ | TOption _ | TArrow _ - | TArray _ | TAny ), + | TArray _ | TAny | TClosureEnv ), _ ) -> false @@ -52,7 +52,9 @@ let rec unifiable ty1 ty2 = | TArrow (t1, t1'), TArrow (t2, t2') -> unifiable_list t1 t2 && unifiable t1' t2' | TArray t1, TArray t2 -> unifiable t1 t2 - | ( (TLit _ | TTuple _ | TStruct _ | TEnum _ | TOption _ | TArrow _ | TArray _), + | TClosureEnv, TClosureEnv -> true + | ( ( TLit _ | TTuple _ | TStruct _ | TEnum _ | TOption _ | TArrow _ + | TArray _ | TClosureEnv ), _ ) -> false @@ -69,7 +71,7 @@ let rec compare ty1 ty2 = | TArrow (a1, b1), TArrow (a2, b2) -> ( match List.compare compare a1 a2 with 0 -> compare b1 b2 | n -> n) | TArray t1, TArray t2 -> compare t1 t2 - | TAny, TAny -> 0 + | TAny, TAny | TClosureEnv, TClosureEnv -> 0 | TLit _, _ -> -1 | _, TLit _ -> 1 | TTuple _, _ -> -1 @@ -84,5 +86,7 @@ let rec compare ty1 ty2 = | _, TArrow _ -> 1 | TArray _, _ -> -1 | _, TArray _ -> 1 + | TClosureEnv, _ -> -1 + | _, TClosureEnv -> 1 let rec arrow_return = function TArrow (_, b), _ -> arrow_return b | t -> t diff --git a/compiler/shared_ast/typing.ml b/compiler/shared_ast/typing.ml index 65bb8d8d..844d6f8f 100644 --- a/compiler/shared_ast/typing.ml +++ b/compiler/shared_ast/typing.ml @@ -46,6 +46,7 @@ and naked_typ = | TOption of unionfind_typ | TArray of unionfind_typ | TAny of Any.t + | TClosureEnv let rec typ_to_ast ~leave_unresolved (ty : unionfind_typ) : A.typ = let typ_to_ast = typ_to_ast ~leave_unresolved in @@ -66,6 +67,7 @@ let rec typ_to_ast ~leave_unresolved (ty : unionfind_typ) : A.typ = typing. *) Messages.raise_spanned_error pos "Internal error: typing at this point could not be resolved" + | TClosureEnv -> TClosureEnv, pos let rec ast_to_typ (ty : A.typ) : unionfind_typ = let ty' = @@ -78,6 +80,7 @@ let rec ast_to_typ (ty : A.typ) : unionfind_typ = | A.TOption t -> TOption (ast_to_typ t) | A.TArray t -> TArray (ast_to_typ t) | A.TAny -> TAny (Any.fresh ()) + | A.TClosureEnv -> TClosureEnv in UnionFind.make (Mark.copy ty ty') @@ -154,6 +157,7 @@ let rec format_typ | TAny v -> if !Cli.debug_flag then Format.fprintf fmt "" (Any.hash v) else Format.pp_print_string fmt "" + | TClosureEnv -> Format.fprintf fmt "closure_env" let rec colors = let open Ocolor_types in @@ -192,9 +196,10 @@ let rec unify if not (A.EnumName.equal e1 e2) then raise_type_error () | TOption t1, TOption t2 -> unify e t1 t2 | TArray t1', TArray t2' -> unify e t1' t2' + | TClosureEnv, TClosureEnv -> () | TAny _, _ | _, TAny _ -> () | ( ( TLit _ | TArrow _ | TTuple _ | TStruct _ | TEnum _ | TOption _ - | TArray _ ), + | TArray _ | TClosureEnv ), _ ) -> raise_type_error () in From 57abfbf2c734c5b9896b652942004671e9f2fa3a Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Thu, 15 Jun 2023 16:33:14 +0200 Subject: [PATCH 15/26] Other pattern matching --- compiler/lcalc/closure_conversion.ml | 2 +- compiler/lcalc/compile_without_exceptions.ml | 6 +++--- compiler/lcalc/to_ocaml.ml | 1 + compiler/scalc/to_python.ml | 1 + compiler/verification/z3backend.real.ml | 3 +++ 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/compiler/lcalc/closure_conversion.ml b/compiler/lcalc/closure_conversion.ml index 1ea2f5f0..e4488b79 100644 --- a/compiler/lcalc/closure_conversion.ml +++ b/compiler/lcalc/closure_conversion.ml @@ -361,7 +361,7 @@ let closure_conversion (p : 'm program) : 'm program Bindlib.box = | TArrow _ -> true | TAny -> true | TOption t' -> type_contains_arrow t' - | TLit _ -> false + | TClosureEnv | TLit _ -> false | TArray ts -> type_contains_arrow ts | TTuple ts -> List.exists type_contains_arrow ts | TEnum e -> diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index 8f420379..308c87f4 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -56,10 +56,10 @@ let rec trans_typ_keep (tau : typ) : typ = | TTuple ts -> TTuple (List.map trans_typ_keep ts) | TStruct s -> TStruct s | TEnum en -> TEnum en - | TOption _ -> + | TOption _ | TClosureEnv -> Messages.raise_internal_error - "The type option should not appear before the dcalc -> lcalc \ - translation step." + "The types option and closure_env should not appear before the dcalc \ + -> lcalc translation step." | TAny -> TAny | TArray ts -> TArray (TOption (trans_typ_keep ts), m) (* catala is not polymorphic *) diff --git a/compiler/lcalc/to_ocaml.ml b/compiler/lcalc/to_ocaml.ml index 0169ca3d..1de09146 100644 --- a/compiler/lcalc/to_ocaml.ml +++ b/compiler/lcalc/to_ocaml.ml @@ -174,6 +174,7 @@ let rec format_typ (fmt : Format.formatter) (typ : typ) : unit = (t1 @ [t2]) | TArray t1 -> Format.fprintf fmt "@[%a@ array@]" format_typ_with_parens t1 | TAny -> Format.fprintf fmt "_" + | TClosureEnv -> failwith "unimplemented!" let format_var (fmt : Format.formatter) (v : 'm Var.t) : unit = let lowercase_name = diff --git a/compiler/scalc/to_python.ml b/compiler/scalc/to_python.ml index c592546f..ba371d1f 100644 --- a/compiler/scalc/to_python.ml +++ b/compiler/scalc/to_python.ml @@ -184,6 +184,7 @@ let rec format_typ (fmt : Format.formatter) (typ : typ) : unit = t1 format_typ_with_parens t2 | TArray t1 -> Format.fprintf fmt "List[%a]" format_typ_with_parens t1 | TAny -> Format.fprintf fmt "Any" + | TClosureEnv -> failwith "unimplemented!" let format_name_cleaned (fmt : Format.formatter) (s : string) : unit = s diff --git a/compiler/verification/z3backend.real.ml b/compiler/verification/z3backend.real.ml index d1a3a31e..5875143b 100644 --- a/compiler/verification/z3backend.real.ml +++ b/compiler/verification/z3backend.real.ml @@ -204,6 +204,8 @@ let rec print_z3model_expr (ctx : context) (ty : typ) (e : Expr.expr) : string = (* For now, only the length of arrays is modeled *) Format.asprintf "(length = %s)" (Expr.to_string e) | TAny -> failwith "[Z3 model]: Pretty-printing of Any not supported" + | TClosureEnv -> + failwith "[Z3 model]: Pretty-printing of closure_env not supported" (** [print_model] pretty prints a Z3 model, used to exhibit counter examples where verification conditions are not satisfied. The context [ctx] is useful @@ -277,6 +279,7 @@ let rec translate_typ (ctx : context) (t : naked_typ) : context * Sort.sort = Ultimately, the type of an array should also contain its elements *) ctx, Arithmetic.Integer.mk_sort ctx.ctx_z3 | TAny -> failwith "[Z3 encoding] TAny type not supported" + | TClosureEnv -> failwith "[Z3 encoding] TClosureEnv type not supported" (** [find_or_create_enum] attempts to retrieve the Z3 sort corresponding to the Catala enumeration [enum]. If no such sort exists yet, it constructs it by From d850ac688a1bdb23222f61aa000530c5cca95198 Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Thu, 15 Jun 2023 16:52:36 +0200 Subject: [PATCH 16/26] Added operators for closure environment handling --- compiler/scalc/to_python.ml | 1 + compiler/shared_ast/definitions.ml | 2 ++ compiler/shared_ast/interpreter.ml | 6 ++++++ compiler/shared_ast/operator.ml | 13 ++++++++++--- compiler/shared_ast/print.ml | 6 +++++- compiler/shared_ast/typing.ml | 3 +++ 6 files changed, 27 insertions(+), 4 deletions(-) diff --git a/compiler/scalc/to_python.ml b/compiler/scalc/to_python.ml index ba371d1f..8af42050 100644 --- a/compiler/scalc/to_python.ml +++ b/compiler/scalc/to_python.ml @@ -89,6 +89,7 @@ let format_op (fmt : Format.formatter) (op : operator Mark.pos) : unit = | Fold -> Format.pp_print_string fmt "list_fold_left" | HandleDefault -> Format.pp_print_string fmt "handle_default" | HandleDefaultOpt -> Format.pp_print_string fmt "handle_default_opt" + | FromClosureEnv | ToClosureEnv -> failwith "unimplemented" let format_uid_list (fmt : Format.formatter) (uids : Uid.MarkedString.info list) : unit = diff --git a/compiler/shared_ast/definitions.ml b/compiler/shared_ast/definitions.ml index be7f2b71..78c5bf38 100644 --- a/compiler/shared_ast/definitions.ml +++ b/compiler/shared_ast/definitions.ml @@ -202,6 +202,8 @@ module Op = struct (* * polymorphic *) | Length : < polymorphic ; .. > t | Log : log_entry * Uid.MarkedString.info list -> < polymorphic ; .. > t + | ToClosureEnv : < polymorphic ; .. > t + | FromClosureEnv : < polymorphic ; .. > t (* * overloaded *) | Minus : < overloaded ; .. > t | Minus_int : < resolved ; .. > t diff --git a/compiler/shared_ast/interpreter.ml b/compiler/shared_ast/interpreter.ml index 4aec7537..88ca40fa 100644 --- a/compiler/shared_ast/interpreter.ml +++ b/compiler/shared_ast/interpreter.ml @@ -169,6 +169,12 @@ let rec evaluate_operator | Log (entry, infos), [e'] -> print_log entry infos pos e'; Mark.remove e' + | (FromClosureEnv | ToClosureEnv), [e'] -> + (* [FromClosureEnv] and [ToClosureEnv] are just there to bypass the need for + existential types when typing code after closure conversion. There are + effectively no-ops. *) + Mark.remove e' + | (ToClosureEnv | FromClosureEnv), _ -> err () | Eq, [(e1, _); (e2, _)] -> ELit (LBool (handle_eq (evaluate_operator evaluate_expr) m e1 e2)) | Map, [f; (EArray es, _)] -> diff --git a/compiler/shared_ast/operator.ml b/compiler/shared_ast/operator.ml index 5a7a2533..052c0ed7 100644 --- a/compiler/shared_ast/operator.ml +++ b/compiler/shared_ast/operator.ml @@ -109,6 +109,8 @@ let name : type a. a t -> string = function | Fold -> "o_fold" | HandleDefault -> "o_handledefault" | HandleDefaultOpt -> "o_handledefaultopt" + | ToClosureEnv -> "o_toclosureenv" + | FromClosureEnv -> "o_fromclosureenv" let compare_log_entries l1 l2 = match l1, l2 with @@ -229,7 +231,8 @@ let compare (type a1 a2) (t1 : a1 t) (t2 : a2 t) = | Eq_dur_dur, Eq_dur_dur | Fold, Fold | HandleDefault, HandleDefault - | HandleDefaultOpt, HandleDefaultOpt -> 0 + | HandleDefaultOpt, HandleDefaultOpt + | FromClosureEnv, FromClosureEnv | ToClosureEnv, ToClosureEnv -> 0 | Not, _ -> -1 | _, Not -> 1 | Length, _ -> -1 | _, Length -> 1 | GetDay, _ -> -1 | _, GetDay -> 1 @@ -314,6 +317,8 @@ let compare (type a1 a2) (t1 : a1 t) (t2 : a2 t) = | Eq_dur_dur, _ -> -1 | _, Eq_dur_dur -> 1 | HandleDefault, _ -> -1 | _, HandleDefault -> 1 | HandleDefaultOpt, _ -> -1 | _, HandleDefaultOpt -> 1 + | FromClosureEnv, _ -> -1 | _, FromClosureEnv -> 1 + | ToClosureEnv, _ -> -1 | _, ToClosureEnv -> 1 | Fold, _ | _, Fold -> . let equal t1 t2 = compare t1 t2 = 0 @@ -335,7 +340,8 @@ let kind_dispatch : | Or | Xor ) as op -> monomorphic op | ( Log _ | Length | Eq | Map | Concat | Filter | Reduce | Fold - | HandleDefault | HandleDefaultOpt ) as op -> + | HandleDefault | HandleDefaultOpt | FromClosureEnv | ToClosureEnv ) as op + -> polymorphic op | ( Minus | ToRat | ToMoney | Round | Add | Sub | Mult | Div | Lt | Lte | Gt | Gte ) as op -> @@ -376,7 +382,8 @@ let translate (t : 'a no_overloads t) : 'b no_overloads t = | Lte_int_int | Lte_rat_rat | Lte_mon_mon | Lte_dat_dat | Lte_dur_dur | Gt_int_int | Gt_rat_rat | Gt_mon_mon | Gt_dat_dat | Gt_dur_dur | Gte_int_int | Gte_rat_rat | Gte_mon_mon | Gte_dat_dat | Gte_dur_dur - | Eq_int_int | Eq_rat_rat | Eq_mon_mon | Eq_dat_dat | Eq_dur_dur ) as op -> + | Eq_int_int | Eq_rat_rat | Eq_mon_mon | Eq_dat_dat | Eq_dur_dur + | FromClosureEnv | ToClosureEnv ) as op -> op let monomorphic_type ((op : monomorphic t), pos) = diff --git a/compiler/shared_ast/print.ml b/compiler/shared_ast/print.ml index a67d2b74..7660db9c 100644 --- a/compiler/shared_ast/print.ml +++ b/compiler/shared_ast/print.ml @@ -278,6 +278,8 @@ let operator_to_string : type a. a Op.t -> string = | Fold -> "fold" | HandleDefault -> "handle_default" | HandleDefaultOpt -> "handle_default_opt" + | ToClosureEnv -> "to_closure_env" + | FromClosureEnv -> "from_closure_env" let operator_to_shorter_string : type a. a Op.t -> string = let open Op in @@ -320,6 +322,8 @@ let operator_to_shorter_string : type a. a Op.t -> string = | Fold -> "fold" | HandleDefault -> "handle_default" | HandleDefaultOpt -> "handle_default_opt" + | ToClosureEnv -> "to_closure_env" + | FromClosureEnv -> "from_closure_env" let operator : type a. ?debug:bool -> Format.formatter -> a operator -> unit = fun ?(debug = true) fmt op -> @@ -399,7 +403,7 @@ module Precedence = struct | Div_dur_dur -> Op Div | HandleDefault | HandleDefaultOpt | Map | Concat | Filter | Reduce | Fold - -> + | ToClosureEnv | FromClosureEnv -> App) | EApp _ -> App | EOp _ -> Contained diff --git a/compiler/shared_ast/typing.ml b/compiler/shared_ast/typing.ml index 844d6f8f..a5ed4d61 100644 --- a/compiler/shared_ast/typing.ml +++ b/compiler/shared_ast/typing.ml @@ -261,6 +261,7 @@ let polymorphic_op_type (op : Operator.polymorphic A.operator Mark.pos) : let bt = lazy (UnionFind.make (TLit TBool, pos)) in let ut = lazy (UnionFind.make (TLit TUnit, pos)) in let it = lazy (UnionFind.make (TLit TInt, pos)) in + let cet = lazy (UnionFind.make (TClosureEnv, pos)) in let array a = lazy (UnionFind.make (TArray (Lazy.force a), pos)) in let option a = lazy (UnionFind.make (TOption (Lazy.force a), pos)) in let ( @-> ) x y = @@ -281,6 +282,8 @@ let polymorphic_op_type (op : Operator.polymorphic A.operator Mark.pos) : | HandleDefaultOpt -> [array (option any); [ut] @-> option bt; [ut] @-> option any] @-> option any + | ToClosureEnv -> [any] @-> cet + | FromClosureEnv -> [cet] @-> any in Lazy.force ty From ed2891c7616ad1c892ac7af913800a3eddec9851 Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Thu, 15 Jun 2023 17:32:00 +0200 Subject: [PATCH 17/26] Closure conversion should work now --- compiler/driver.ml | 15 +- compiler/lcalc/closure_conversion.ml | 60 ++++--- compiler/plugins/api_web.ml | 1 + compiler/shared_ast/interpreter.mli | 2 + .../good/closure_conversion.catala_en | 12 +- tests/test_func/good/closure_return.catala_en | 15 +- .../good/closure_through_scope.catala_en | 8 +- .../scope_call_func_struct_closure.catala_en | 165 ++++++++++++++---- 8 files changed, 203 insertions(+), 75 deletions(-) diff --git a/compiler/driver.ml b/compiler/driver.ml index d2a5c940..a42087d7 100644 --- a/compiler/driver.ml +++ b/compiler/driver.ml @@ -377,7 +377,12 @@ let driver source_file (options : Cli.options) : int = | `Interpret -> Messages.emit_debug "Starting interpretation (dcalc)..."; let results = - Shared_ast.Interpreter.interpret_program_dcalc prgm scope_uid + try Shared_ast.Interpreter.interpret_program_dcalc prgm scope_uid + with Shared_ast.Interpreter.CatalaException exn -> + Messages.raise_error + "During interpretation, the error %a has been raised but not \ + caught!" + Shared_ast.Print.except exn in let results = List.sort @@ -485,7 +490,13 @@ let driver source_file (options : Cli.options) : int = | `Interpret_Lcalc -> Messages.emit_debug "Starting interpretation (lcalc)..."; let results = - Shared_ast.Interpreter.interpret_program_lcalc prgm scope_uid + try + Shared_ast.Interpreter.interpret_program_lcalc prgm scope_uid + with Shared_ast.Interpreter.CatalaException exn -> + Messages.raise_error + "During interpretation, the error %a has been raised but \ + not caught!" + Shared_ast.Print.except exn in let results = List.sort diff --git a/compiler/lcalc/closure_conversion.ml b/compiler/lcalc/closure_conversion.ml index e4488b79..1eac038a 100644 --- a/compiler/lcalc/closure_conversion.ml +++ b/compiler/lcalc/closure_conversion.ml @@ -158,28 +158,38 @@ let rec transform_closures_expr : (* x1, ..., xn *) let code_var = Var.make ctx.name_context in (* code *) - let inner_c_var = Var.make "env" in + let closure_env_arg_var = Var.make "env" in + let closure_env_var = Var.make "env" in let any_ty = TAny, binder_pos in + (* let env = from_closure_env env in let arg0 = env.0 in ... *) let new_closure_body = - Expr.make_multiple_let_in - (Array.of_list extra_vars_list) - (List.map (fun _ -> any_ty) extra_vars_list) - (List.mapi - (fun i _ -> - Expr.etupleaccess - (Expr.evar inner_c_var binder_mark) - i - (List.length extra_vars_list) - binder_mark) - extra_vars_list) - new_body - (Expr.mark_pos binder_mark) + Expr.make_let_in closure_env_var any_ty + (Expr.eapp + (Expr.eop Operator.FromClosureEnv + [TClosureEnv, binder_pos] + binder_mark) + [Expr.evar closure_env_arg_var binder_mark] + binder_mark) + (Expr.make_multiple_let_in + (Array.of_list extra_vars_list) + (List.map (fun _ -> any_ty) extra_vars_list) + (List.mapi + (fun i _ -> + Expr.etupleaccess + (Expr.evar closure_env_var binder_mark) + i + (List.length extra_vars_list) + binder_mark) + extra_vars_list) + new_body binder_pos) + binder_pos in + (* fun env arg0 ... -> new_closure_body *) let new_closure = Expr.make_abs - (Array.concat [Array.make 1 inner_c_var; vars]) + (Array.concat [Array.make 1 closure_env_arg_var; vars]) new_closure_body - ((TAny, binder_pos) :: tys) + ((TClosureEnv, binder_pos) :: tys) (Expr.pos e) in ( extra_vars, @@ -189,11 +199,19 @@ let rec transform_closures_expr : (Expr.etuple ((Bindlib.box_var code_var, binder_mark) :: [ - Expr.etuple - (List.map - (fun extra_var -> Bindlib.box_var extra_var, binder_mark) - extra_vars_list) - m; + Expr.eapp + (Expr.eop Operator.ToClosureEnv + [TAny, Expr.pos e] + (Mark.get e)) + [ + Expr.etuple + (List.map + (fun extra_var -> + Bindlib.box_var extra_var, binder_mark) + extra_vars_list) + m; + ] + (Mark.get e); ]) m) (Expr.pos e) ) diff --git a/compiler/plugins/api_web.ml b/compiler/plugins/api_web.ml index 3431a739..f85670af 100644 --- a/compiler/plugins/api_web.ml +++ b/compiler/plugins/api_web.ml @@ -83,6 +83,7 @@ module To_jsoo = struct ~pp_sep:(fun fmt () -> Format.pp_print_string fmt " -> ") format_typ_with_parens) t1 format_typ_with_parens t2 + | TClosureEnv -> Format.fprintf fmt "Js.Unsafe.any Js.t" let rec format_typ_to_jsoo fmt typ = match Mark.remove typ with diff --git a/compiler/shared_ast/interpreter.mli b/compiler/shared_ast/interpreter.mli index a59210e5..f4566299 100644 --- a/compiler/shared_ast/interpreter.mli +++ b/compiler/shared_ast/interpreter.mli @@ -20,6 +20,8 @@ open Catala_utils open Definitions +exception CatalaException of except + val evaluate_operator : ((((_, _) dcalc_lcalc as 'a), 'm) gexpr -> ('a, 'm) gexpr) -> 'a operator -> diff --git a/tests/test_func/good/closure_conversion.catala_en b/tests/test_func/good/closure_conversion.catala_en index ffa71d0a..5fff50b4 100644 --- a/tests/test_func/good/closure_conversion.catala_en +++ b/tests/test_func/good/closure_conversion.catala_en @@ -16,18 +16,17 @@ $ catala Lcalc -s S --avoid_exceptions -O --closure_conversion let scope S (S_in: S_in {x_in: eoption bool}): S {z: eoption integer} = let get x : eoption bool = S_in.x_in in let set f : - eoption - (((eoption bool), integer) → eoption integer * (eoption bool)) = + eoption ((closure_env, integer) → eoption integer * closure_env) = ESome - (λ (env: (eoption bool)) (y: integer) → + (λ (env: closure_env) (y: integer) → ESome match - (match env.0 with + (match (from_closure_env env).0 with | ENone _ → ENone _ | ESome x → if x then ESome y else ESome - y) with | ENone _ → raise NoValueProvided - | ESome f → f, (x)) + | ESome f → f, to_closure_env (x)) in let set z : eoption integer = ESome @@ -36,8 +35,7 @@ let scope S (S_in: S_in {x_in: eoption bool}): S {z: eoption integer} = | ENone _ → ENone _ | ESome f → let code_and_env : - (((eoption bool), integer) → eoption integer * - (eoption bool)) = + ((closure_env, integer) → eoption integer * closure_env) = f in code_and_env.0 code_and_env.1 -1) diff --git a/tests/test_func/good/closure_return.catala_en b/tests/test_func/good/closure_return.catala_en index e4f2cb88..ae554393 100644 --- a/tests/test_func/good/closure_return.catala_en +++ b/tests/test_func/good/closure_return.catala_en @@ -13,26 +13,21 @@ scope S: $ catala Lcalc -s S --avoid_exceptions -O --closure_conversion let scope S (S_in: S_in {x_in: eoption bool}) - : S { - f: - eoption - (((eoption bool), integer) → eoption integer * (eoption bool)) - } + : S {f: eoption ((closure_env, integer) → eoption integer * closure_env)} = let get x : eoption bool = S_in.x_in in let set f : - eoption - (((eoption bool), integer) → eoption integer * (eoption bool)) = + eoption ((closure_env, integer) → eoption integer * closure_env) = ESome - (λ (env: (eoption bool)) (y: integer) → + (λ (env: closure_env) (y: integer) → ESome match - (match env.0 with + (match (from_closure_env env).0 with | ENone _ → ENone _ | ESome x → if x then ESome y else ESome - y) with | ENone _ → raise NoValueProvided - | ESome f → f, (x)) + | ESome f → f, to_closure_env (x)) in return { S f = f; } ``` diff --git a/tests/test_func/good/closure_through_scope.catala_en b/tests/test_func/good/closure_through_scope.catala_en index 57892cbf..ef2823b7 100644 --- a/tests/test_func/good/closure_through_scope.catala_en +++ b/tests/test_func/good/closure_through_scope.catala_en @@ -26,13 +26,12 @@ let scope T (T_in: T_in): T {y: eoption integer} = S { f: eoption - (((eoption bool), integer) → eoption integer * (eoption bool)) + ((closure_env, integer) → eoption integer * closure_env) } = ESome S { S_in x_in = ESome s.x; } in let sub_get s.f : - eoption - (((eoption bool), integer) → eoption integer * (eoption bool)) = + eoption ((closure_env, integer) → eoption integer * closure_env) = match result with | ENone _ → ENone _ | ESome result → result.f @@ -44,8 +43,7 @@ let scope T (T_in: T_in): T {y: eoption integer} = | ENone _ → ENone _ | ESome s.f → let code_and_env : - (((eoption bool), integer) → eoption integer * - (eoption bool)) = + ((closure_env, integer) → eoption integer * closure_env) = s.f in code_and_env.0 code_and_env.1 2) diff --git a/tests/test_func/good/scope_call_func_struct_closure.catala_en b/tests/test_func/good/scope_call_func_struct_closure.catala_en index ebc1dff7..14d5c543 100644 --- a/tests/test_func/good/scope_call_func_struct_closure.catala_en +++ b/tests/test_func/good/scope_call_func_struct_closure.catala_en @@ -14,7 +14,7 @@ declaration scope SubFoo2: declaration scope Foo: - input b content boolean + context b content boolean internal r content Result output z content integer @@ -26,12 +26,13 @@ scope SubFoo2: scope Foo: + definition b equals true definition r equals if b then let f equals output of SubFoo1 with { -- x: 10 } in Result { --r: f.y --q: f.x } else - let f equals output of SubFoo2 with { -- x1: 5 -- x2: 5 } in + let f equals output of SubFoo2 with { -- x1: 10 -- x2: 10 } in Result { --r: f.y --q: f.x1 } definition z equals r.r of 1 ``` @@ -41,33 +42,137 @@ two closures in Foo.r are different even with optimizations enabled. TODO fix this. ```catala-test-inline -$ catala Lcalc --avoid_exceptions -O --closure_conversion -[ERROR] As part of the compilation process, one of the step (closure conversion) modified the Catala program and re-typing after this modification failed with the error message below. This re-typing error if not your fault, but is likely to indicate that the program you are trying to compile is incompatible with the current compilation scheme provided by the Catala compiler. Try to rewrite the program to avoid the problematic pattern or contact the compiler developers for help. - -Error during typechecking, incompatible types: -┌─⯈ () -└─⯈ (option integer) - -Error coming from typechecking the following expression: -┌─⯈ tests/test_func/good/scope_call_func_struct_closure.catala_en:31.20-31.55: -└──┐ -31 │ let f equals output of SubFoo1 with { -- x: 10 } in - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ - - -Type () coming from expression: -┌─⯈ tests/test_func/good/scope_call_func_struct_closure.catala_en:31.20-31.55: -└──┐ -31 │ let f equals output of SubFoo1 with { -- x: 10 } in - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ - - -Type (option integer) coming from expression: -┌─⯈ tests/test_func/good/scope_call_func_struct_closure.catala_en:8.10-8.11: -└─┐ -8 │ output y content integer depends on z content integer - │ ‾ - -#return code 255# +$ catala Lcalc --avoid_exceptions -O --closure_conversion -s Foo +let scope Foo + (Foo_in: Foo_in {b_in: eoption bool}) + : Foo {z: eoption integer} + = + let get b : eoption bool = Foo_in.b_in in + let set b : eoption bool = + ESome + match + (handle_default_opt + [ b ] + (λ (_: unit) → ESome true) + (λ (_: unit) → ESome true)) + with + | ENone _ → raise NoValueProvided + | ESome b → b + in + let set r : + eoption + Result { + r: + eoption + ((closure_env, integer) → eoption integer * closure_env); + q: eoption integer + } = + ESome + match + (match b with + | ENone _ → ENone _ + | ESome b → + if b + then + match + (match (SubFoo1 { SubFoo1_in x_in = ESome 10; }).x with + | ENone _ → ENone _ + | ESome result_0 → + ESome + { SubFoo1 + x = ESome result_0; + y = + ESome + (λ (env: closure_env) (param0: integer) → + match + (SubFoo1 { SubFoo1_in x_in = ESome 10; }).y + with + | ENone _ → ENone _ + | ESome result → + let code_and_env : + ((closure_env, integer) → eoption integer * + closure_env) = + result + in + code_and_env.0 code_and_env.1 param0, + to_closure_env ()); + }) + with + | ENone _ → ENone _ + | ESome f → + match f.x with + | ENone _ → ENone _ + | ESome f_1 → + match f.y with + | ENone _ → ENone _ + | ESome f_0 → ESome { Result r = ESome f_0; q = ESome f_1; } + else + match + (match + (SubFoo2 { SubFoo2_in x1_in = ESome 10; x2_in = ESome 10; }). + x1 + with + | ENone _ → ENone _ + | ESome result_0 → + ESome + { SubFoo2 + x1 = ESome result_0; + y = + ESome + (λ (env: closure_env) (param0: integer) → + match + (SubFoo2 + { SubFoo2_in + x1_in = ESome 10; + x2_in = ESome 10; + }). + y + with + | ENone _ → ENone _ + | ESome result → + let code_and_env : + ((closure_env, integer) → eoption integer * + closure_env) = + result + in + code_and_env.0 code_and_env.1 param0, + to_closure_env ()); + }) + with + | ENone _ → ENone _ + | ESome f → + match f.x1 with + | ENone _ → ENone _ + | ESome f_1 → + match f.y with + | ENone _ → ENone _ + | ESome f_0 → ESome { Result r = ESome f_0; q = ESome f_1; }) + with + | ENone _ → raise NoValueProvided + | ESome r → r + in + let set z : eoption integer = + ESome + match + (match (match r with + | ENone _ → ENone _ + | ESome r → r.r) with + | ENone _ → ENone _ + | ESome r → + let code_and_env : + ((closure_env, integer) → eoption integer * closure_env) = + r + in + code_and_env.0 code_and_env.1 1) + with + | ENone _ → raise NoValueProvided + | ESome z → z + in + return { Foo z = z; } ``` +```catala-test-inline +$ catala Interpret_lcalc -s Foo --avoid_exceptions -O --closure_conversion +[RESULT] Computation successful! Results: +[RESULT] z = ESome 11 +``` From 3d3e735402e9e6a4933b2b5f51b72a964503fff4 Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Thu, 15 Jun 2023 17:47:58 +0200 Subject: [PATCH 18/26] Nicer error message --- compiler/shared_ast/interpreter.ml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/compiler/shared_ast/interpreter.ml b/compiler/shared_ast/interpreter.ml index 88ca40fa..aa42a17b 100644 --- a/compiler/shared_ast/interpreter.ml +++ b/compiler/shared_ast/interpreter.ml @@ -147,7 +147,13 @@ let rec evaluate_operator in let err () = Messages.raise_multispanned_error - ([Some "Operator:", pos] + ([ + ( Some + (Format.asprintf "Operator (value %a):" + (Print.operator ~debug:true) + op), + pos ); + ] @ List.mapi (fun i arg -> ( Some @@ -324,6 +330,13 @@ let rec evaluate_operator ELit (LBool (o_eq_dat_dat x y)) | Eq_dur_dur, [(ELit (LDuration x), _); (ELit (LDuration y), _)] -> ELit (LBool (protect o_eq_dur_dur x y)) + | HandleDefault, _ -> + Messages.raise_internal_error + "The interpreter is trying to evaluate the \"handle_default\" operator, \ + which is the leftover from the dcalc->lcalc compilation pass. This \ + indicates that you are trying to interpret the lcalc without having \ + activating --avoid_exceptions. This interpretation is not implemented, \ + just try to interpret the dcalc (with \"Interpret\") instead." | HandleDefaultOpt, [(EArray exps, _); justification; conclusion] -> ( let valid_exceptions = ListLabels.filter exps ~f:(function @@ -331,7 +344,6 @@ let rec evaluate_operator EnumConstructor.equal cons Expr.some_constr | _ -> err ()) in - match valid_exceptions with | [] -> ( match @@ -376,8 +388,7 @@ let rec evaluate_operator | Lte_mon_mon | Lte_dat_dat | Lte_dur_dur | Gt_int_int | Gt_rat_rat | Gt_mon_mon | Gt_dat_dat | Gt_dur_dur | Gte_int_int | Gte_rat_rat | Gte_mon_mon | Gte_dat_dat | Gte_dur_dur | Eq_int_int | Eq_rat_rat - | Eq_mon_mon | Eq_dat_dat | Eq_dur_dur | HandleDefault | HandleDefaultOpt - ), + | Eq_mon_mon | Eq_dat_dat | Eq_dur_dur | HandleDefaultOpt ), _ ) -> err () From 9cf55b0edd6f9bd84ad456e7a800b8bca584d42e Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Sun, 18 Jun 2023 15:49:02 +0200 Subject: [PATCH 19/26] Closure env is unit if no extra variable captured --- compiler/lcalc/closure_conversion.ml | 14 ++++++++------ .../good/scope_call_func_struct_closure.catala_en | 1 - 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/compiler/lcalc/closure_conversion.ml b/compiler/lcalc/closure_conversion.ml index 1eac038a..11622362 100644 --- a/compiler/lcalc/closure_conversion.ml +++ b/compiler/lcalc/closure_conversion.ml @@ -204,12 +204,14 @@ let rec transform_closures_expr : [TAny, Expr.pos e] (Mark.get e)) [ - Expr.etuple - (List.map - (fun extra_var -> - Bindlib.box_var extra_var, binder_mark) - extra_vars_list) - m; + (if extra_vars_list = [] then Expr.elit LUnit binder_mark + else + Expr.etuple + (List.map + (fun extra_var -> + Bindlib.box_var extra_var, binder_mark) + extra_vars_list) + m); ] (Mark.get e); ]) diff --git a/tests/test_func/good/scope_call_func_struct_closure.catala_en b/tests/test_func/good/scope_call_func_struct_closure.catala_en index 14d5c543..06c3aba1 100644 --- a/tests/test_func/good/scope_call_func_struct_closure.catala_en +++ b/tests/test_func/good/scope_call_func_struct_closure.catala_en @@ -39,7 +39,6 @@ scope Foo: This test case is tricky because it creates a situation where the type of the two closures in Foo.r are different even with optimizations enabled. -TODO fix this. ```catala-test-inline $ catala Lcalc --avoid_exceptions -O --closure_conversion -s Foo From 2c45ca1599010406e95e24584dfd6dfca166482e Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Sun, 18 Jun 2023 16:08:16 +0200 Subject: [PATCH 20/26] More doc --- compiler/index.mld | 4 ++-- compiler/lcalc/closure_conversion.ml | 5 ++++- compiler/lcalc/closure_conversion.mli | 9 +++++++-- compiler/lcalc/lcalc.mld | 8 ++++++++ 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/compiler/index.mld b/compiler/index.mld index e7f9fff5..07cdb420 100644 --- a/compiler/index.mld +++ b/compiler/index.mld @@ -89,9 +89,9 @@ More documentation can be found on each intermediate representations here. } Most of these intermediate representations use a {{: shared_ast.html} shared AST libary}. -The main compilation chain is defined in: +The main compilation chain is defined in {!module: Driver}. -{!modules: Driver} +{!modules: Shared_ast Driver} Additionally, the compiler features a verification plugin that generates verification condition for proof backends. More information can be found here: diff --git a/compiler/lcalc/closure_conversion.ml b/compiler/lcalc/closure_conversion.ml index 11622362..459fdadb 100644 --- a/compiler/lcalc/closure_conversion.ml +++ b/compiler/lcalc/closure_conversion.ml @@ -30,7 +30,10 @@ type 'm ctx = { let tys_as_tanys tys = List.map (fun x -> Mark.map (fun _ -> TAny) x) tys -type 'm hoisted_closure = { name : 'm expr Var.t; closure : 'm expr } +type 'm hoisted_closure = { + name : 'm expr Var.t; + closure : 'm expr (* Starts with [EAbs]. *); +} let rec hoist_context_free_closures : type m. m ctx -> m expr -> m hoisted_closure list * m expr boxed = diff --git a/compiler/lcalc/closure_conversion.mli b/compiler/lcalc/closure_conversion.mli index 1cc68459..01b2a637 100644 --- a/compiler/lcalc/closure_conversion.mli +++ b/compiler/lcalc/closure_conversion.mli @@ -14,6 +14,11 @@ License for the specific language governing permissions and limitations under the License. *) +(** This module performs environment-passing style closure conversion, relying + on the existential [TClosureEnv] type and tuples for closure environments. + The implementation is based on François Pottier's + {{:http://gallium.inria.fr/~fpottier/mpri/cours04.pdf#page=10} MPRI lesson}. + After closure conversion, closure hoisting is perform and all closures end + up as toplevel definitions. *) + val closure_conversion : 'm Ast.program -> 'm Ast.program Bindlib.box -(** Warning/todo: no effort was yet made to ensure correct propagation of type - annotations in the typed case *) diff --git a/compiler/lcalc/lcalc.mld b/compiler/lcalc/lcalc.mld index 9be70589..c02fd15a 100644 --- a/compiler/lcalc/lcalc.mld +++ b/compiler/lcalc/lcalc.mld @@ -23,6 +23,14 @@ Related modules: {!modules: Lcalc.Compile_with_exceptions Lcalc.Compile_without_exceptions} +{1 Closure conversion } + +To target languages that don't have support for closures, we need to convert +the closures to first-class functions in function-pointer-passing style +computations. + +{!modules: Lcalc.Closure_conversion } + {1 Backends} The OCaml backend of the lambda calculus is merely a syntactic formatting, From a20adc0055610f424bca93c1d26d831b619dcd8a Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Sun, 18 Jun 2023 18:08:18 +0200 Subject: [PATCH 21/26] Closure hoisting (missing a bug on hardest case) --- Dockerfile | 2 + compiler/driver.ml | 7 + compiler/lcalc/closure_conversion.ml | 266 +++++++++++++----- compiler/shared_ast/print.ml | 7 +- compiler/shared_ast/typing.ml | 2 +- .../good/closure_conversion.catala_en | 30 +- tests/test_func/good/closure_return.catala_en | 32 ++- 7 files changed, 254 insertions(+), 92 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7093f7ea..dec54020 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,8 @@ RUN sudo apk add python3 RUN sudo ln -s /usr/bin/python3 /usr/bin/python RUN sudo apk add g++ RUN sudo apk add make +# We also need bash to build JaneStreet's base +RUN sudo apk add bash RUN mkdir catala WORKDIR catala diff --git a/compiler/driver.ml b/compiler/driver.ml index 56eff416..540dc0a8 100644 --- a/compiler/driver.ml +++ b/compiler/driver.ml @@ -443,6 +443,13 @@ let driver source_file (options : Cli.options) : int = Message.emit_debug "Performing closure conversion..."; let prgm = Lcalc.Closure_conversion.closure_conversion prgm in let prgm = Bindlib.unbox prgm in + (* let _output_file, with_output = get_output_format () in + with_output @@ fun fmt -> if Option.is_some options.ex_scope + then Format.fprintf fmt "%a\n" (Shared_ast.Print.scope + ~debug:options.debug prgm.decl_ctx) (scope_uid, + Shared_ast.Program.get_scope_body prgm scope_uid) else + Format.fprintf fmt "%a\n" (Shared_ast.Print.program + ~debug:options.debug) prgm; *) let prgm = if options.optimize then ( Message.emit_debug "Optimizing lambda calculus..."; diff --git a/compiler/lcalc/closure_conversion.ml b/compiler/lcalc/closure_conversion.ml index 459fdadb..ff9b85fd 100644 --- a/compiler/lcalc/closure_conversion.ml +++ b/compiler/lcalc/closure_conversion.ml @@ -19,9 +19,6 @@ open Shared_ast open Ast module D = Dcalc.Ast -(** TODO: This version is not yet debugged and ought to be specialized when - Lcalc has more structure. *) - type 'm ctx = { decl_ctx : decl_ctx; name_context : string; @@ -30,65 +27,7 @@ type 'm ctx = { let tys_as_tanys tys = List.map (fun x -> Mark.map (fun _ -> TAny) x) tys -type 'm hoisted_closure = { - name : 'm expr Var.t; - closure : 'm expr (* Starts with [EAbs]. *); -} - -let rec hoist_context_free_closures : - type m. m ctx -> m expr -> m hoisted_closure list * m expr boxed = - fun ctx e -> - let m = Mark.get e in - match Mark.remove e with - | EMatch { e; cases; name } -> - let collected_closures, new_e = (hoist_context_free_closures ctx) e in - (* We do not close the closures inside the arms of the match expression, - since they get a special treatment at compilation to Scalc. *) - let collected_closures, new_cases = - EnumConstructor.Map.fold - (fun cons e1 (collected_closures, new_cases) -> - match Mark.remove e1 with - | EAbs { binder; tys } -> - let vars, body = Bindlib.unmbind binder in - let new_collected_closures, new_body = - (hoist_context_free_closures ctx) body - in - let new_binder = Expr.bind vars new_body in - ( collected_closures @ new_collected_closures, - EnumConstructor.Map.add cons - (Expr.eabs new_binder tys (Mark.get e1)) - new_cases ) - | _ -> failwith "should not happen") - cases - (collected_closures, EnumConstructor.Map.empty) - in - collected_closures, Expr.ematch new_e name new_cases m - | EApp { f = EAbs { binder; tys }, e1_pos; args } -> - (* let-binding, we should not close these *) - let vars, body = Bindlib.unmbind binder in - let collected_closures, new_body = (hoist_context_free_closures ctx) body in - let new_binder = Expr.bind vars new_body in - let collected_closures, new_args = - List.fold_right - (fun arg (collected_closures, new_args) -> - let new_collected_closures, new_arg = - (hoist_context_free_closures ctx) arg - in - collected_closures @ new_collected_closures, new_arg :: new_args) - args (collected_closures, []) - in - ( collected_closures, - Expr.eapp (Expr.eabs new_binder (tys_as_tanys tys) e1_pos) new_args m ) - | EAbs _ -> - (* this is the closure we want to hoist*) - let closure_var = Var.make ctx.name_context in - [{ name = closure_var; closure = e }], Expr.make_var closure_var m - | EApp _ | EStruct _ | EStructAccess _ | ETuple _ | ETupleAccess _ | EInj _ - | EArray _ | ELit _ | EAssert _ | EOp _ | EIfThenElse _ | ERaise _ | ECatch _ - | EVar _ -> - Expr.map_gather ~acc:[] ~join:( @ ) ~f:(hoist_context_free_closures ctx) e - | _ -> . - [@@warning "-32"] +(** { 1 Transforming closures}*) (** Returns the expression with closed closures and the set of free variables inside this new expression. Implementation guided by @@ -294,7 +233,7 @@ let rec transform_closures_expr : (* Here I have to reimplement Scope.map_exprs_in_lets because I'm changing the type *) -let closure_conversion_scope_let ctx scope_body_expr = +let transform_closures_scope_let ctx scope_body_expr = Scope.fold_right_lets ~f:(fun scope_let var_next acc -> let _free_vars, new_scope_let_expr = @@ -323,7 +262,7 @@ let closure_conversion_scope_let ctx scope_body_expr = (Expr.Box.lift new_scope_let_expr)) scope_body_expr -let closure_conversion (p : 'm program) : 'm program Bindlib.box = +let transform_closures_program (p : 'm program) : 'm program Bindlib.box = let _, new_code_items = Scope.fold_map ~f:(fun toplevel_vars var code_item -> @@ -340,7 +279,7 @@ let closure_conversion (p : 'm program) : 'm program Bindlib.box = } in let new_scope_lets = - closure_conversion_scope_let ctx scope_body_expr + transform_closures_scope_let ctx scope_body_expr in let new_scope_body_expr = Bindlib.bind_var scope_input_var new_scope_lets @@ -415,3 +354,200 @@ let closure_conversion (p : 'm program) : 'm program Bindlib.box = (fun new_code_items -> { code_items = new_code_items; decl_ctx = new_decl_ctx }) new_code_items + +(** {1 Hoisting closures}*) + +type 'm hoisted_closure = { + name : 'm expr Var.t; + ty : typ; + closure : 'm expr (* Starts with [EAbs]. *); +} + +let rec hoist_closures_expr : + type m. + string -> m expr -> m hoisted_closure Bindlib.box list * m expr boxed = + fun name_context e -> + let m = Mark.get e in + match Mark.remove e with + | EMatch { e; cases; name } -> + let collected_closures, new_e = (hoist_closures_expr name_context) e in + (* We do not close the closures inside the arms of the match expression, + since they get a special treatment at compilation to Scalc. *) + let collected_closures, new_cases = + EnumConstructor.Map.fold + (fun cons e1 (collected_closures, new_cases) -> + match Mark.remove e1 with + | EAbs { binder; tys } -> + let vars, body = Bindlib.unmbind binder in + let new_collected_closures, new_body = + (hoist_closures_expr name_context) body + in + let new_binder = Expr.bind vars new_body in + ( collected_closures @ new_collected_closures, + EnumConstructor.Map.add cons + (Expr.eabs new_binder tys (Mark.get e1)) + new_cases ) + | _ -> failwith "should not happen") + cases + (collected_closures, EnumConstructor.Map.empty) + in + collected_closures, Expr.ematch new_e name new_cases m + | EApp { f = EAbs { binder; tys }, e1_pos; args } -> + (* let-binding, we should not close these *) + let vars, body = Bindlib.unmbind binder in + let collected_closures, new_body = + (hoist_closures_expr name_context) body + in + let new_binder = Expr.bind vars new_body in + let collected_closures, new_args = + List.fold_right + (fun arg (collected_closures, new_args) -> + let new_collected_closures, new_arg = + (hoist_closures_expr name_context) arg + in + collected_closures @ new_collected_closures, new_arg :: new_args) + args (collected_closures, []) + in + ( collected_closures, + Expr.eapp (Expr.eabs new_binder (tys_as_tanys tys) e1_pos) new_args m ) + | EApp + { + f = + (EOp { op = HandleDefaultOpt | Fold | Map | Filter | Reduce; _ }, _) + as f; + args; + } -> + (* Special case for some operators: its arguments closures thunks because if + you want to extract it as a function you need these closures to preserve + evaluation order, but backends that don't support closures will simply + extract these operators in a inlined way and skip the thunks. *) + let collected_closures, new_args = + List.fold_right + (fun (arg : (lcalc, m) gexpr) (collected_closures, new_args) -> + let m_arg = Mark.get arg in + match Mark.remove arg with + | EAbs { binder; tys } -> + let vars, arg = Bindlib.unmbind binder in + let new_collected_closures, new_arg = + (hoist_closures_expr name_context) arg + in + let new_arg = + Expr.make_abs vars new_arg tys (Expr.mark_pos m_arg) + in + new_collected_closures @ collected_closures, new_arg :: new_args + | _ -> + let new_collected_closures, new_arg = + hoist_closures_expr name_context arg + in + new_collected_closures @ collected_closures, new_arg :: new_args) + args ([], []) + in + collected_closures, Expr.eapp (Expr.box f) new_args (Mark.get e) + | EAbs { tys; _ } -> + (* this is the closure we want to hoist*) + let closure_var = Var.make ("closure_" ^ name_context) in + ( [ + Bindlib.box_apply + (fun e -> + { + name = closure_var; + ty = TArrow (tys, (TAny, Expr.mark_pos m)), Expr.mark_pos m; + closure = e, m; + }) + (fst (Expr.box e)); + ], + Expr.make_var closure_var m ) + | EApp _ | EStruct _ | EStructAccess _ | ETuple _ | ETupleAccess _ | EInj _ + | EArray _ | ELit _ | EAssert _ | EOp _ | EIfThenElse _ | ERaise _ | ECatch _ + | EVar _ -> + Expr.map_gather ~acc:[] ~join:( @ ) ~f:(hoist_closures_expr name_context) e + | _ -> . + [@@warning "-32"] + +(* Here I have to reimplement Scope.map_exprs_in_lets because I'm changing the + type *) +let hoist_closures_scope_let name_context scope_body_expr = + Scope.fold_right_lets + ~f:(fun scope_let var_next (hoisted_closures, next_scope_lets) -> + let new_hoisted_closures, new_scope_let_expr = + (hoist_closures_expr (Bindlib.name_of var_next)) + scope_let.scope_let_expr + in + ( new_hoisted_closures @ hoisted_closures, + Bindlib.box_apply2 + (fun scope_let_next scope_let_expr -> + ScopeLet { scope_let with scope_let_next; scope_let_expr }) + (Bindlib.bind_var var_next next_scope_lets) + (Expr.Box.lift new_scope_let_expr) )) + ~init:(fun res -> + let hoisted_closures, new_scope_let_expr = + (hoist_closures_expr name_context) res + in + (* INVARIANT here: the result expr of a scope is simply a struct + containing all output variables so nothing should be converted here, so + no need to take into account free variables. *) + ( hoisted_closures, + Bindlib.box_apply + (fun res -> Result res) + (Expr.Box.lift new_scope_let_expr) )) + scope_body_expr + +let hoist_closures_program (p : 'm program) : 'm program Bindlib.box = + let hoisted_closures, new_code_items = + Scope.fold_map + ~f:(fun hoisted_closures _var code_item -> + match code_item with + | ScopeDef (name, body) -> + let scope_input_var, scope_body_expr = + Bindlib.unbind body.scope_body_expr + in + let new_hoisted_closures, new_scope_lets = + hoist_closures_scope_let + (fst (ScopeName.get_info name)) + scope_body_expr + in + let new_scope_body_expr = + Bindlib.bind_var scope_input_var new_scope_lets + in + ( new_hoisted_closures @ hoisted_closures, + Bindlib.box_apply + (fun scope_body_expr -> + ScopeDef (name, { body with scope_body_expr })) + new_scope_body_expr ) + | Topdef (name, ty, expr) -> + let new_hoisted_closures, new_expr = + hoist_closures_expr (Mark.remove (TopdefName.get_info name)) expr + in + ( new_hoisted_closures @ hoisted_closures, + Bindlib.box_apply + (fun e -> Topdef (name, ty, e)) + (Expr.Box.lift new_expr) )) + ~varf:(fun v -> v) + [] p.code_items + in + Bindlib.box_apply + (fun hoisted_closures -> + let new_code_items = + List.fold_left + (fun (new_code_items : _ gexpr code_item_list Bindlib.box) hc -> + let next = Bindlib.bind_var hc.name new_code_items in + Bindlib.box_apply + (fun next -> + Cons + ( Topdef + ( TopdefName.fresh + (Bindlib.name_of hc.name, Expr.pos hc.closure), + hc.ty, + hc.closure ), + next )) + next) + new_code_items hoisted_closures + in + { p with code_items = Bindlib.unbox new_code_items }) + (Bindlib.box_list hoisted_closures) + +(** { 1 Closure conversion }*) + +let closure_conversion (p : 'm program) : 'm program Bindlib.box = + let new_p = transform_closures_program p in + hoist_closures_program (Bindlib.unbox new_p) diff --git a/compiler/shared_ast/print.ml b/compiler/shared_ast/print.ml index 7660db9c..b137c49e 100644 --- a/compiler/shared_ast/print.ml +++ b/compiler/shared_ast/print.ml @@ -855,16 +855,15 @@ let code_item ?(debug = false) decl_ctx fmt c = match c with | ScopeDef (n, b) -> scope ~debug decl_ctx fmt (n, b) | Topdef (n, ty, e) -> - Format.fprintf fmt "@[%a %a %a %a %a %a @]" keyword "let topval" - TopdefName.format_t n op_style ":" (typ decl_ctx) ty op_style "=" - (expr ~debug ()) e + Format.fprintf fmt "@[@[%a@ %a@ %a@ %a@ %a@]@ %a@]" keyword + "let topval" TopdefName.format_t n op_style ":" (typ decl_ctx) ty op_style + "=" (expr ~debug ()) e let rec code_item_list ?(debug = false) decl_ctx fmt c = match c with | Nil -> () | Cons (c, b) -> let _x, cl = Bindlib.unbind b in - Format.fprintf fmt "%a @.%a" (code_item ~debug decl_ctx) c diff --git a/compiler/shared_ast/typing.ml b/compiler/shared_ast/typing.ml index a1e9e677..8e89ad8f 100644 --- a/compiler/shared_ast/typing.ml +++ b/compiler/shared_ast/typing.ml @@ -951,7 +951,7 @@ let rec scopes ~leave_unresolved ctx env = function let e' = Expr.map_marks ~f:(get_ty_mark ~leave_unresolved) e' in ( Env.add var uf env, Bindlib.box_apply - (fun e -> A.Topdef (name, typ, e)) + (fun e -> A.Topdef (name, Expr.ty e', e)) (Expr.Box.lift e') ) in let next', env = scopes ~leave_unresolved ctx env next in diff --git a/tests/test_func/good/closure_conversion.catala_en b/tests/test_func/good/closure_conversion.catala_en index 5fff50b4..9b4cbb26 100644 --- a/tests/test_func/good/closure_conversion.catala_en +++ b/tests/test_func/good/closure_conversion.catala_en @@ -12,21 +12,28 @@ scope S: ``` ```catala-test-inline -$ catala Lcalc -s S --avoid_exceptions -O --closure_conversion +$ catala Lcalc --avoid_exceptions -O --closure_conversion +type eoption = | ENone of unit | ESome of any + +type S = { z: eoption integer; } + +type S_in = { x_in: eoption bool; } + +let topval closure_f : (closure_env, integer) → eoption integer = + λ (env: closure_env) (y: integer) → + ESome + match + (match (from_closure_env env).0 with + | ENone _ → ENone _ + | ESome x → if x then ESome y else ESome - y) + with + | ENone _ → raise NoValueProvided + | ESome f → f let scope S (S_in: S_in {x_in: eoption bool}): S {z: eoption integer} = let get x : eoption bool = S_in.x_in in let set f : eoption ((closure_env, integer) → eoption integer * closure_env) = - ESome - (λ (env: closure_env) (y: integer) → - ESome - match - (match (from_closure_env env).0 with - | ENone _ → ENone _ - | ESome x → if x then ESome y else ESome - y) - with - | ENone _ → raise NoValueProvided - | ESome f → f, to_closure_env (x)) + ESome (closure_f, to_closure_env (x)) in let set z : eoption integer = ESome @@ -44,4 +51,5 @@ let scope S (S_in: S_in {x_in: eoption bool}): S {z: eoption integer} = | ESome z → z in return { S z = z; } + ``` diff --git a/tests/test_func/good/closure_return.catala_en b/tests/test_func/good/closure_return.catala_en index ae554393..fea06f77 100644 --- a/tests/test_func/good/closure_return.catala_en +++ b/tests/test_func/good/closure_return.catala_en @@ -10,7 +10,25 @@ scope S: ``` ```catala-test-inline -$ catala Lcalc -s S --avoid_exceptions -O --closure_conversion +$ catala Lcalc --avoid_exceptions -O --closure_conversion +type eoption = | ENone of unit | ESome of any + +type S = { + f: eoption ((closure_env, integer) → eoption integer * closure_env); + } + +type S_in = { x_in: eoption bool; } + +let topval closure_f : (closure_env, integer) → eoption integer = + λ (env: closure_env) (y: integer) → + ESome + match + (match (from_closure_env env).0 with + | ENone _ → ENone _ + | ESome x → if x then ESome y else ESome - y) + with + | ENone _ → raise NoValueProvided + | ESome f → f let scope S (S_in: S_in {x_in: eoption bool}) : S {f: eoption ((closure_env, integer) → eoption integer * closure_env)} @@ -18,16 +36,8 @@ let scope S let get x : eoption bool = S_in.x_in in let set f : eoption ((closure_env, integer) → eoption integer * closure_env) = - ESome - (λ (env: closure_env) (y: integer) → - ESome - match - (match (from_closure_env env).0 with - | ENone _ → ENone _ - | ESome x → if x then ESome y else ESome - y) - with - | ENone _ → raise NoValueProvided - | ESome f → f, to_closure_env (x)) + ESome (closure_f, to_closure_env (x)) in return { S f = f; } + ``` From 2ddbe93126be415f0c12040c123f6f65715e99c9 Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Sun, 18 Jun 2023 18:15:29 +0200 Subject: [PATCH 22/26] Bug identified --- compiler/driver.ml | 7 ------- compiler/lcalc/closure_conversion.ml | 3 +++ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/compiler/driver.ml b/compiler/driver.ml index 540dc0a8..56eff416 100644 --- a/compiler/driver.ml +++ b/compiler/driver.ml @@ -443,13 +443,6 @@ let driver source_file (options : Cli.options) : int = Message.emit_debug "Performing closure conversion..."; let prgm = Lcalc.Closure_conversion.closure_conversion prgm in let prgm = Bindlib.unbox prgm in - (* let _output_file, with_output = get_output_format () in - with_output @@ fun fmt -> if Option.is_some options.ex_scope - then Format.fprintf fmt "%a\n" (Shared_ast.Print.scope - ~debug:options.debug prgm.decl_ctx) (scope_uid, - Shared_ast.Program.get_scope_body prgm scope_uid) else - Format.fprintf fmt "%a\n" (Shared_ast.Print.program - ~debug:options.debug) prgm; *) let prgm = if options.optimize then ( Message.emit_debug "Optimizing lambda calculus..."; diff --git a/compiler/lcalc/closure_conversion.ml b/compiler/lcalc/closure_conversion.ml index ff9b85fd..041b08e0 100644 --- a/compiler/lcalc/closure_conversion.ml +++ b/compiler/lcalc/closure_conversion.ml @@ -525,6 +525,9 @@ let hoist_closures_program (p : 'm program) : 'm program Bindlib.box = ~varf:(fun v -> v) [] p.code_items in + (*TODO: we need to insert the hoisted closures just before the scopes they + belong to, because some of them call sub-scopes and putting them all at the + beginning breaks dependency ordering. *) Bindlib.box_apply (fun hoisted_closures -> let new_code_items = From b55d8c823b718734bb39af5e3560af8ec93559cf Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Sun, 18 Jun 2023 21:30:55 +0200 Subject: [PATCH 23/26] Closure conversion & hoisting working --- compiler/lcalc/closure_conversion.ml | 138 +++++++++-------- .../scope_call_func_struct_closure.catala_en | 140 +++++++++++++----- 2 files changed, 180 insertions(+), 98 deletions(-) diff --git a/compiler/lcalc/closure_conversion.ml b/compiler/lcalc/closure_conversion.ml index 041b08e0..87ad5709 100644 --- a/compiler/lcalc/closure_conversion.ml +++ b/compiler/lcalc/closure_conversion.ml @@ -360,12 +360,11 @@ let transform_closures_program (p : 'm program) : 'm program Bindlib.box = type 'm hoisted_closure = { name : 'm expr Var.t; ty : typ; - closure : 'm expr (* Starts with [EAbs]. *); + closure : (lcalc, 'm) boxed_gexpr (* Starts with [EAbs]. *); } let rec hoist_closures_expr : - type m. - string -> m expr -> m hoisted_closure Bindlib.box list * m expr boxed = + type m. string -> m expr -> m hoisted_closure list * m expr boxed = fun name_context e -> let m = Mark.get e in match Mark.remove e with @@ -447,14 +446,11 @@ let rec hoist_closures_expr : (* this is the closure we want to hoist*) let closure_var = Var.make ("closure_" ^ name_context) in ( [ - Bindlib.box_apply - (fun e -> - { - name = closure_var; - ty = TArrow (tys, (TAny, Expr.mark_pos m)), Expr.mark_pos m; - closure = e, m; - }) - (fst (Expr.box e)); + { + name = closure_var; + ty = TArrow (tys, (TAny, Expr.mark_pos m)), Expr.mark_pos m; + closure = Expr.rebox e; + }; ], Expr.make_var closure_var m ) | EApp _ | EStruct _ | EStructAccess _ | ETuple _ | ETupleAccess _ | EInj _ @@ -492,62 +488,80 @@ let hoist_closures_scope_let name_context scope_body_expr = (Expr.Box.lift new_scope_let_expr) )) scope_body_expr +let rec hoist_closures_code_item_list + (code_items : (lcalc, 'm) gexpr code_item_list) : + (lcalc, 'm) gexpr code_item_list Bindlib.box = + match code_items with + | Nil -> Bindlib.box Nil + | Cons (code_item, next_code_items) -> + let code_item_var, next_code_items = Bindlib.unbind next_code_items in + let hoisted_closures, new_code_item = + match code_item with + | ScopeDef (name, body) -> + let scope_input_var, scope_body_expr = + Bindlib.unbind body.scope_body_expr + in + let new_hoisted_closures, new_scope_lets = + hoist_closures_scope_let + (fst (ScopeName.get_info name)) + scope_body_expr + in + let new_scope_body_expr = + Bindlib.bind_var scope_input_var new_scope_lets + in + ( new_hoisted_closures, + Bindlib.box_apply + (fun scope_body_expr -> + ScopeDef (name, { body with scope_body_expr })) + new_scope_body_expr ) + | Topdef (name, ty, expr) -> + let new_hoisted_closures, new_expr = + hoist_closures_expr (Mark.remove (TopdefName.get_info name)) expr + in + ( new_hoisted_closures, + Bindlib.box_apply + (fun e -> Topdef (name, ty, e)) + (Expr.Box.lift new_expr) ) + in + let next_code_items = hoist_closures_code_item_list next_code_items in + let next_code_items = + Bindlib.box_apply2 + (fun next_code_items new_code_item -> + Cons (new_code_item, next_code_items)) + (Bindlib.bind_var code_item_var next_code_items) + new_code_item + in + let next_code_items = + List.fold_left + (fun (next_code_items : (lcalc, 'm) gexpr code_item_list Bindlib.box) + (hoisted_closure : 'm hoisted_closure) -> + let next_code_items = + Bindlib.bind_var hoisted_closure.name next_code_items + in + let closure, closure_mark = hoisted_closure.closure in + Bindlib.box_apply2 + (fun next_code_items closure -> + Cons + ( Topdef + ( TopdefName.fresh + ( Bindlib.name_of hoisted_closure.name, + Expr.mark_pos closure_mark ), + hoisted_closure.ty, + (closure, closure_mark) ), + next_code_items )) + next_code_items closure) + next_code_items hoisted_closures + in + next_code_items + let hoist_closures_program (p : 'm program) : 'm program Bindlib.box = - let hoisted_closures, new_code_items = - Scope.fold_map - ~f:(fun hoisted_closures _var code_item -> - match code_item with - | ScopeDef (name, body) -> - let scope_input_var, scope_body_expr = - Bindlib.unbind body.scope_body_expr - in - let new_hoisted_closures, new_scope_lets = - hoist_closures_scope_let - (fst (ScopeName.get_info name)) - scope_body_expr - in - let new_scope_body_expr = - Bindlib.bind_var scope_input_var new_scope_lets - in - ( new_hoisted_closures @ hoisted_closures, - Bindlib.box_apply - (fun scope_body_expr -> - ScopeDef (name, { body with scope_body_expr })) - new_scope_body_expr ) - | Topdef (name, ty, expr) -> - let new_hoisted_closures, new_expr = - hoist_closures_expr (Mark.remove (TopdefName.get_info name)) expr - in - ( new_hoisted_closures @ hoisted_closures, - Bindlib.box_apply - (fun e -> Topdef (name, ty, e)) - (Expr.Box.lift new_expr) )) - ~varf:(fun v -> v) - [] p.code_items - in + let new_code_items = hoist_closures_code_item_list p.code_items in (*TODO: we need to insert the hoisted closures just before the scopes they belong to, because some of them call sub-scopes and putting them all at the beginning breaks dependency ordering. *) Bindlib.box_apply - (fun hoisted_closures -> - let new_code_items = - List.fold_left - (fun (new_code_items : _ gexpr code_item_list Bindlib.box) hc -> - let next = Bindlib.bind_var hc.name new_code_items in - Bindlib.box_apply - (fun next -> - Cons - ( Topdef - ( TopdefName.fresh - (Bindlib.name_of hc.name, Expr.pos hc.closure), - hc.ty, - hc.closure ), - next )) - next) - new_code_items hoisted_closures - in - { p with code_items = Bindlib.unbox new_code_items }) - (Bindlib.box_list hoisted_closures) + (fun new_code_items -> { p with code_items = new_code_items }) + new_code_items (** { 1 Closure conversion }*) diff --git a/tests/test_func/good/scope_call_func_struct_closure.catala_en b/tests/test_func/good/scope_call_func_struct_closure.catala_en index 06c3aba1..d88c0f66 100644 --- a/tests/test_func/good/scope_call_func_struct_closure.catala_en +++ b/tests/test_func/good/scope_call_func_struct_closure.catala_en @@ -41,7 +41,107 @@ This test case is tricky because it creates a situation where the type of the two closures in Foo.r are different even with optimizations enabled. ```catala-test-inline -$ catala Lcalc --avoid_exceptions -O --closure_conversion -s Foo +$ catala Lcalc --avoid_exceptions -O --closure_conversion +type eoption = | ENone of unit | ESome of any + +type Result = { + r: eoption ((closure_env, integer) → eoption integer * closure_env); + q: eoption integer; + } + +type SubFoo1 = { + x: eoption integer; + y: eoption ((closure_env, integer) → eoption integer * closure_env); + } + +type SubFoo2 = { + x1: eoption integer; + y: eoption ((closure_env, integer) → eoption integer * closure_env); + } + +type Foo = { z: eoption integer; } + +type SubFoo1_in = { x_in: eoption integer; } + +type SubFoo2_in = { x1_in: eoption integer; x2_in: eoption integer; } + +type Foo_in = { b_in: eoption bool; } + +let topval closure_y : (closure_env, integer) → eoption integer = + λ (env: closure_env) (z: integer) → + ESome + match + (match (from_closure_env env).0 with + | ENone _ → ENone _ + | ESome x_0 → ESome (x_0 + z)) + with + | ENone _ → raise NoValueProvided + | ESome y → y +let scope SubFoo1 + (SubFoo1_in: SubFoo1_in {x_in: eoption integer}) + : SubFoo1 { + x: eoption integer; + y: eoption ((closure_env, integer) → eoption integer * closure_env) + } + = + let get x : eoption integer = SubFoo1_in.x_in in + let set y : + eoption ((closure_env, integer) → eoption integer * closure_env) = + ESome (closure_y, to_closure_env (x)) + in + return { SubFoo1 x = x; y = y; } +let topval closure_y : (closure_env, integer) → eoption integer = + λ (env: closure_env) (z: integer) → + let env1 : (eoption integer * eoption integer) = from_closure_env env in + ESome + match + (match + (match env1.0 with + | ENone _ → ENone _ + | ESome x1_1 → + match env1.1 with + | ENone _ → ENone _ + | ESome x1_0 → ESome (x1_0 + x1_1)) + with + | ENone _ → ENone _ + | ESome y_0 → ESome (y_0 + z)) + with + | ENone _ → raise NoValueProvided + | ESome y → y +let scope SubFoo2 + (SubFoo2_in: SubFoo2_in {x1_in: eoption integer; x2_in: eoption integer}) + : SubFoo2 { + x1: eoption integer; + y: eoption ((closure_env, integer) → eoption integer * closure_env) + } + = + let get x1 : eoption integer = SubFoo2_in.x1_in in + let get x2 : eoption integer = SubFoo2_in.x2_in in + let set y : + eoption ((closure_env, integer) → eoption integer * closure_env) = + ESome (closure_y, to_closure_env (x2, x1)) + in + return { SubFoo2 x1 = x1; y = y; } +let topval closure_r : (closure_env, integer) → eoption integer = + λ (env: closure_env) (param0: integer) → + match (SubFoo2 { SubFoo2_in x1_in = ESome 10; x2_in = ESome 10; }).y with + | ENone _ → ENone _ + | ESome result → + let code_and_env : + ((closure_env, integer) → eoption integer * closure_env) = + result + in + code_and_env.0 code_and_env.1 param0 +let topval closure_r : (closure_env, integer) → eoption integer = + λ (env: closure_env) (param0: integer) → + match (SubFoo1 { SubFoo1_in x_in = ESome 10; }).y with + | ENone _ → ENone _ + | ESome result → + let code_and_env : + ((closure_env, integer) → eoption integer * closure_env) = + result + in + code_and_env.0 code_and_env.1 param0 let scope Foo (Foo_in: Foo_in {b_in: eoption bool}) : Foo {z: eoption integer} @@ -80,21 +180,7 @@ let scope Foo ESome { SubFoo1 x = ESome result_0; - y = - ESome - (λ (env: closure_env) (param0: integer) → - match - (SubFoo1 { SubFoo1_in x_in = ESome 10; }).y - with - | ENone _ → ENone _ - | ESome result → - let code_and_env : - ((closure_env, integer) → eoption integer * - closure_env) = - result - in - code_and_env.0 code_and_env.1 param0, - to_closure_env ()); + y = ESome (closure_r, to_closure_env ()); }) with | ENone _ → ENone _ @@ -116,26 +202,7 @@ let scope Foo ESome { SubFoo2 x1 = ESome result_0; - y = - ESome - (λ (env: closure_env) (param0: integer) → - match - (SubFoo2 - { SubFoo2_in - x1_in = ESome 10; - x2_in = ESome 10; - }). - y - with - | ENone _ → ENone _ - | ESome result → - let code_and_env : - ((closure_env, integer) → eoption integer * - closure_env) = - result - in - code_and_env.0 code_and_env.1 param0, - to_closure_env ()); + y = ESome (closure_r, to_closure_env ()); }) with | ENone _ → ENone _ @@ -168,6 +235,7 @@ let scope Foo | ESome z → z in return { Foo z = z; } + ``` ```catala-test-inline From 420348beda7e93090a88f1267d4d0f273539b155 Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Sun, 18 Jun 2023 21:38:00 +0200 Subject: [PATCH 24/26] Added a last TODO and put big example under CI --- compiler/lcalc/closure_conversion.ml | 5 +++++ .../tests/tests_calculette_globale.catala_fr | 14 ++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/compiler/lcalc/closure_conversion.ml b/compiler/lcalc/closure_conversion.ml index 87ad5709..599e3a21 100644 --- a/compiler/lcalc/closure_conversion.ml +++ b/compiler/lcalc/closure_conversion.ml @@ -445,6 +445,11 @@ let rec hoist_closures_expr : | EAbs { tys; _ } -> (* this is the closure we want to hoist*) let closure_var = Var.make ("closure_" ^ name_context) in + (* TODO: This will end up as a toplevel name. However for now we assume + toplevel names are unique, but this breaks this assertions and can lead + to name wrangling in the backends. We need to have a better system for + name disambiguation when for instance printing to Dcalc/Lcalc/Scalc but + also OCaml, Python, etc. *) ( [ { name = closure_var; diff --git a/examples/aides_logement/tests/tests_calculette_globale.catala_fr b/examples/aides_logement/tests/tests_calculette_globale.catala_fr index 4d04f9b9..350a5ba3 100644 --- a/examples/aides_logement/tests/tests_calculette_globale.catala_fr +++ b/examples/aides_logement/tests/tests_calculette_globale.catala_fr @@ -168,6 +168,13 @@ $ catala Interpret_Lcalc -s Exemple1 --avoid_exceptions [RESULT] éligibilité = ESome true ``` +```catala-test-inline +$ catala Interpret_Lcalc -s Exemple1 --avoid_exceptions -O --closure_conversion +[RESULT] Computation successful! Results: +[RESULT] montant_versé = ESome 246.23 € +[RESULT] éligibilité = ESome true +``` + ```catala-test-inline $ catala Interpret -s Exemple2 [RESULT] Computation successful! Results: @@ -181,3 +188,10 @@ $ catala Interpret -s Exemple2 --avoid_exceptions [RESULT] montant_versé = 230.63 € [RESULT] éligibilité = true ``` + +```catala-test-inline +$ catala Interpret -s Exemple2 --avoid_exceptions -O --closure_conversion +[RESULT] Computation successful! Results: +[RESULT] montant_versé = 230.63 € +[RESULT] éligibilité = true +``` From 10cd3b0fc8190c5b19797c7ebe774387c2fe16f8 Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Sun, 18 Jun 2023 21:45:09 +0200 Subject: [PATCH 25/26] Update assets --- french_law/python/src/aides_logement.py | 13618 ++++++++++------------ 1 file changed, 5880 insertions(+), 7738 deletions(-) diff --git a/french_law/python/src/aides_logement.py b/french_law/python/src/aides_logement.py index ecc472d5..ee146d4d 100644 --- a/french_law/python/src/aides_logement.py +++ b/french_law/python/src/aides_logement.py @@ -2892,24 +2892,25 @@ def calcul_equivalence_loyer_minimale(calcul_equivalence_loyer_minimale_in:Calcu try: try: def temp_montant_4(_:Unit): + ressources_menage_arrondies_1 = decimal_of_money(ressources_menage_arrondies) def temp_montant_5(tranche_1:TrancheRevenuDecimal): - if (decimal_of_money(ressources_menage_arrondies) <= + if (ressources_menage_arrondies_1 <= tranche_1.bas): return decimal_of_string("0.") else: match_arg_2 = tranche_1.haut if match_arg_2.code == LimiteTrancheDecimal_Code.Revenu: tranche_haut_1 = match_arg_2.value - if (decimal_of_money(ressources_menage_arrondies) >= + if (ressources_menage_arrondies_1 >= tranche_haut_1): return ((tranche_haut_1 - tranche_1.bas) * tranche_1.taux) else: - return ((decimal_of_money(ressources_menage_arrondies) - + return ((ressources_menage_arrondies_1 - tranche_1.bas) * tranche_1.taux) elif match_arg_2.code == LimiteTrancheDecimal_Code.Infini: _ = match_arg_2.value - return ((decimal_of_money(ressources_menage_arrondies) - + return ((ressources_menage_arrondies_1 - tranche_1.bas) * tranche_1.taux) def temp_montant_6(sum1:Decimal, sum2:Decimal): return (sum1 + sum2) @@ -2927,24 +2928,25 @@ def calcul_equivalence_loyer_minimale(calcul_equivalence_loyer_minimale_in:Calcu law_headings=[]), [], temp_montant_7, temp_montant_4) except EmptyError: + ressources_menage_arrondies_2 = decimal_of_money(ressources_menage_arrondies) def temp_montant_9(tranche_2:TrancheRevenuDecimal): - if (decimal_of_money(ressources_menage_arrondies) <= + if (ressources_menage_arrondies_2 <= tranche_2.bas): return decimal_of_string("0.") else: match_arg_3 = tranche_2.haut if match_arg_3.code == LimiteTrancheDecimal_Code.Revenu: tranche_haut_2 = match_arg_3.value - if (decimal_of_money(ressources_menage_arrondies) >= + if (ressources_menage_arrondies_2 >= tranche_haut_2): return ((tranche_haut_2 - tranche_2.bas) * tranche_2.taux) else: - return ((decimal_of_money(ressources_menage_arrondies) - + return ((ressources_menage_arrondies_2 - tranche_2.bas) * tranche_2.taux) elif match_arg_3.code == LimiteTrancheDecimal_Code.Infini: _ = match_arg_3.value - return ((decimal_of_money(ressources_menage_arrondies) - + return ((ressources_menage_arrondies_2 - tranche_2.bas) * tranche_2.taux) def temp_montant_10(sum1_1:Decimal, sum2_1:Decimal): return (sum1_1 + sum2_1) @@ -4165,7 +4167,7 @@ def calcul_aide_personnalisee_logement_foyer(calcul_aide_personnalisee_logement_ logement_foyer_jeunes_travailleurs = calcul_aide_personnalisee_logement_foyer_in.logement_foyer_jeunes_travailleurs_in type_logement_foyer = calcul_aide_personnalisee_logement_foyer_in.type_logement_foyer_in date_conventionnement = calcul_aide_personnalisee_logement_foyer_in.date_conventionnement_in - ressources_menage_arrondies_1 = calcul_aide_personnalisee_logement_foyer_in.ressources_menage_arrondies_in + ressources_menage_arrondies_3 = calcul_aide_personnalisee_logement_foyer_in.ressources_menage_arrondies_in nombre_personnes_a_charge_2 = calcul_aide_personnalisee_logement_foyer_in.nombre_personnes_a_charge_in situation_familiale_calcul_apl_2 = calcul_aide_personnalisee_logement_foyer_in.situation_familiale_calcul_apl_in zone = calcul_aide_personnalisee_logement_foyer_in.zone_in @@ -4885,10 +4887,10 @@ def calcul_aide_personnalisee_logement_foyer(calcul_aide_personnalisee_logement_ n_nombre_parts_d832_25_3 = temp_n_nombre_parts_d832_25_1 def temp_abattement_depense_nette_minimale_d832_27(allocation_mensuelle_1:Money): try: - if (depense_nette_minimale_d832_27(allocation_mensuelle_1) <= + depense_nette_minimale = depense_nette_minimale_d832_27(allocation_mensuelle_1) + if (depense_nette_minimale <= montant_forfaitaire_d832_27): - return (montant_forfaitaire_d832_27 - - depense_nette_minimale_d832_27(allocation_mensuelle_1)) + return (montant_forfaitaire_d832_27 - depense_nette_minimale) else: return money_of_cents_string("0") except EmptyError: @@ -4914,7 +4916,7 @@ def calcul_aide_personnalisee_logement_foyer(calcul_aide_personnalisee_logement_ "Prologue : aides au logement"])) calcul_equivalence_loyer_minimale_dot_date_courante = temp_calcul_equivalence_loyer_minimale_dot_date_courante try: - temp_calcul_equivalence_loyer_minimale_dot_ressources_menage_arrondies = ressources_menage_arrondies_1 + temp_calcul_equivalence_loyer_minimale_dot_ressources_menage_arrondies = ressources_menage_arrondies_3 except EmptyError: temp_calcul_equivalence_loyer_minimale_dot_ressources_menage_arrondies = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", @@ -4973,7 +4975,7 @@ def calcul_aide_personnalisee_logement_foyer(calcul_aide_personnalisee_logement_ try: def temp_coefficient_prise_en_charge_d832_25_formule(_:Unit): return (decimal_of_string("0.9") - - (ressources_menage_arrondies_1 / + (ressources_menage_arrondies_3 / (coefficient_multiplicateur_d832_25 * n_nombre_parts_d832_25_3))) def temp_coefficient_prise_en_charge_d832_25_formule_1(_:Unit): @@ -4984,13 +4986,13 @@ def calcul_aide_personnalisee_logement_foyer(calcul_aide_personnalisee_logement_ temp_coefficient_prise_en_charge_d832_25_formule_1, temp_coefficient_prise_en_charge_d832_25_formule) except EmptyError: - if ((ressources_menage_arrondies_1 - (coefficient_r_d832_25 * - n_nombre_parts_d832_25_3)) < + denominateur = (ressources_menage_arrondies_3 - + (coefficient_r_d832_25 * n_nombre_parts_d832_25_3)) + if (denominateur < money_of_cents_string("0")): temp_coefficient_prise_en_charge_d832_25_formule_3 = money_of_cents_string("0") else: - temp_coefficient_prise_en_charge_d832_25_formule_3 = (ressources_menage_arrondies_1 - - (coefficient_r_d832_25 * n_nombre_parts_d832_25_3)) + temp_coefficient_prise_en_charge_d832_25_formule_3 = denominateur temp_coefficient_prise_en_charge_d832_25_formule_2 = (decimal_of_string("0.95") - (temp_coefficient_prise_en_charge_d832_25_formule_3 / (coefficient_multiplicateur_d832_25 * @@ -5007,14 +5009,13 @@ def calcul_aide_personnalisee_logement_foyer(calcul_aide_personnalisee_logement_ coefficient_prise_en_charge_d832_25_formule = temp_coefficient_prise_en_charge_d832_25_formule_2 def temp_traitement_aide_finale_abattement(aide_finale_4:Money): try: - if ((traitement_aide_finale_minoration_forfaitaire(aide_finale_4) - - abattement_depense_nette_minimale_d832_27(traitement_aide_finale_minoration_forfaitaire( - aide_finale_4))) >= + aide_finale_5 = traitement_aide_finale_minoration_forfaitaire( + aide_finale_4) + aide_finale_6 = (aide_finale_5 - + abattement_depense_nette_minimale_d832_27(aide_finale_5)) + if (aide_finale_6 >= money_of_cents_string("0")): - return (traitement_aide_finale_minoration_forfaitaire( - aide_finale_4) - - abattement_depense_nette_minimale_d832_27(traitement_aide_finale_minoration_forfaitaire( - aide_finale_4))) + return aide_finale_6 else: return money_of_cents_string("0") except EmptyError: @@ -5066,22 +5067,15 @@ def calcul_aide_personnalisee_logement_foyer(calcul_aide_personnalisee_logement_ "Déclarations des champs d'application", "Prologue : aides au logement"])) coefficient_prise_en_charge_d832_25_coeff_arrondi = temp_coefficient_prise_en_charge_d832_25_coeff_arrondi_2 - def temp_traitement_aide_finale_contributions_sociales_arrondi(aide_finale_5:Money): + def temp_traitement_aide_finale_contributions_sociales_arrondi(aide_finale_7:Money): try: - if ((money_round(((traitement_aide_finale_abattement(aide_finale_5) - - contributions_sociales_dot_montant(traitement_aide_finale_abattement( - aide_finale_5))) - - money_of_cents_string("50"))) + - contributions_sociales_dot_montant(traitement_aide_finale_abattement( - aide_finale_5))) >= + aide_finale_8 = traitement_aide_finale_abattement(aide_finale_7) + crds = contributions_sociales_dot_montant(aide_finale_8) + aide_finale_moins_crds_arrondie = money_round(((aide_finale_8 - + crds) - money_of_cents_string("50"))) + if ((aide_finale_moins_crds_arrondie + crds) >= money_of_cents_string("0")): - return (money_round(((traitement_aide_finale_abattement( - aide_finale_5) - - contributions_sociales_dot_montant(traitement_aide_finale_abattement( - aide_finale_5))) - - money_of_cents_string("50"))) + - contributions_sociales_dot_montant(traitement_aide_finale_abattement( - aide_finale_5))) + return (aide_finale_moins_crds_arrondie + crds) else: return money_of_cents_string("0") except EmptyError: @@ -5125,15 +5119,15 @@ def calcul_aide_personnalisee_logement_foyer(calcul_aide_personnalisee_logement_ "Déclarations des champs d'application", "Prologue : aides au logement"])) coefficient_prise_en_charge_d832_25_seuil = temp_coefficient_prise_en_charge_d832_25_seuil_2 - def temp_traitement_aide_finale_montant_minimal(aide_finale_6:Money): + def temp_traitement_aide_finale_montant_minimal(aide_finale_9:Money): try: - if (traitement_aide_finale_contributions_sociales_arrondi( - aide_finale_6) < + aide_finale_10 = traitement_aide_finale_contributions_sociales_arrondi( + aide_finale_9) + if (aide_finale_10 < montant_minimal_aide_d823_24): return money_of_cents_string("0") else: - return traitement_aide_finale_contributions_sociales_arrondi( - aide_finale_6) + return aide_finale_10 except EmptyError: raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", start_line=677, @@ -5145,14 +5139,14 @@ def calcul_aide_personnalisee_logement_foyer(calcul_aide_personnalisee_logement_ "Prologue : aides au logement"])) traitement_aide_finale_montant_minimal = temp_traitement_aide_finale_montant_minimal try: - if (((equivalence_loyer_eligible - equivalence_loyer_minimale) * - coefficient_prise_en_charge_d832_25_seuil) < + aide_finale_11 = ((equivalence_loyer_eligible - + equivalence_loyer_minimale) * + coefficient_prise_en_charge_d832_25_seuil) + if (aide_finale_11 < money_of_cents_string("0")): temp_aide_finale_formule = money_of_cents_string("0") else: - temp_aide_finale_formule = ((equivalence_loyer_eligible - - equivalence_loyer_minimale) * - coefficient_prise_en_charge_d832_25_seuil) + temp_aide_finale_formule = aide_finale_11 except EmptyError: temp_aide_finale_formule = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", @@ -5175,7 +5169,7 @@ def calcul_aide_personnalisee_logement_foyer(calcul_aide_personnalisee_logement_ def calcul_aide_personnalisee_logement_accession_propriete(calcul_aide_personnalisee_logement_accession_propriete_in:CalculAidePersonnaliseeLogementAccessionProprieteIn): mensualite_principale = calcul_aide_personnalisee_logement_accession_propriete_in.mensualite_principale_in - ressources_menage_arrondies_2 = calcul_aide_personnalisee_logement_accession_propriete_in.ressources_menage_arrondies_in + ressources_menage_arrondies_4 = calcul_aide_personnalisee_logement_accession_propriete_in.ressources_menage_arrondies_in nombre_personnes_a_charge_3 = calcul_aide_personnalisee_logement_accession_propriete_in.nombre_personnes_a_charge_in situation_familiale_calcul_apl_3 = calcul_aide_personnalisee_logement_accession_propriete_in.situation_familiale_calcul_apl_in type_travaux_logement = calcul_aide_personnalisee_logement_accession_propriete_in.type_travaux_logement_in @@ -9617,7 +9611,7 @@ def calcul_aide_personnalisee_logement_accession_propriete(calcul_aide_personnal try: try: def temp_ressources_menage_avec_d832_18(_:Unit): - return ressources_menage_arrondies_2 + return ressources_menage_arrondies_4 def temp_ressources_menage_avec_d832_18_1(_:Unit): return situation_r822_11_13_17 temp_ressources_menage_avec_d832_18_2 = handle_default(SourcePosition(filename="", @@ -9628,12 +9622,12 @@ def calcul_aide_personnalisee_logement_accession_propriete(calcul_aide_personnal temp_ressources_menage_avec_d832_18_1, temp_ressources_menage_avec_d832_18) except EmptyError: - if (ressources_menage_arrondies_2 <= (mensualite_principale * + if (ressources_menage_arrondies_4 <= (mensualite_principale * coefficient_multiplicateur_d832_18)): temp_ressources_menage_avec_d832_18_2 = (mensualite_principale * coefficient_multiplicateur_d832_18) else: - temp_ressources_menage_avec_d832_18_2 = ressources_menage_arrondies_2 + temp_ressources_menage_avec_d832_18_2 = ressources_menage_arrondies_4 except EmptyError: temp_ressources_menage_avec_d832_18_2 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", @@ -9644,11 +9638,11 @@ def calcul_aide_personnalisee_logement_accession_propriete(calcul_aide_personnal "Déclarations des champs d'application", "Prologue : aides au logement"])) ressources_menage_avec_d832_18 = temp_ressources_menage_avec_d832_18_2 - def temp_traitement_aide_finale_minoration_forfaitaire_1(aide_finale_7:Money): + def temp_traitement_aide_finale_minoration_forfaitaire_1(aide_finale_12:Money): try: - if ((aide_finale_7 - montant_forfaitaire_d832_10) >= + if ((aide_finale_12 - montant_forfaitaire_d832_10) >= money_of_cents_string("0")): - return (aide_finale_7 - montant_forfaitaire_d832_10) + return (aide_finale_12 - montant_forfaitaire_d832_10) else: return money_of_cents_string("0") except EmptyError: @@ -9692,11 +9686,14 @@ def calcul_aide_personnalisee_logement_accession_propriete(calcul_aide_personnal try: try: def temp_plafond_mensualite_d832_10_3_base(_:Unit): - if (calcul_plafond_mensualite_d832_10_3(date_signature_pret) < - calcul_plafond_mensualite_d832_10_3(date_entree_logement)): - return calcul_plafond_mensualite_d832_10_3(date_entree_logement) + plafond_signature = calcul_plafond_mensualite_d832_10_3( + date_signature_pret) + plafond_entree = calcul_plafond_mensualite_d832_10_3( + date_entree_logement) + if (plafond_signature < plafond_entree): + return plafond_entree else: - return calcul_plafond_mensualite_d832_10_3(date_signature_pret) + return plafond_signature def temp_plafond_mensualite_d832_10_3_base_1(_:Unit): return local_habite_premiere_fois_beneficiaire temp_plafond_mensualite_d832_10_3_base_2 = handle_default( @@ -9730,7 +9727,7 @@ def calcul_aide_personnalisee_logement_accession_propriete(calcul_aide_personnal "Prologue : aides au logement"])) calcul_equivalence_loyer_minimale_dot_date_courante_1 = temp_calcul_equivalence_loyer_minimale_dot_date_courante_1 try: - temp_calcul_equivalence_loyer_minimale_dot_ressources_menage_arrondies_1 = ressources_menage_arrondies_2 + temp_calcul_equivalence_loyer_minimale_dot_ressources_menage_arrondies_1 = ressources_menage_arrondies_4 except EmptyError: temp_calcul_equivalence_loyer_minimale_dot_ressources_menage_arrondies_1 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", @@ -9784,7 +9781,7 @@ def calcul_aide_personnalisee_logement_accession_propriete(calcul_aide_personnal calcul_equivalence_loyer_minimale_dot_montant_1 = result_5.montant try: temp_coefficient_prise_en_charge_d832_10_formule = (decimal_of_string("0.95") - - (ressources_menage_arrondies_2 / + (ressources_menage_arrondies_4 / (coefficient_multiplicateur_d832_11 * n_nombre_parts_d832_11_1))) except EmptyError: temp_coefficient_prise_en_charge_d832_10_formule = dead_value @@ -9798,12 +9795,13 @@ def calcul_aide_personnalisee_logement_accession_propriete(calcul_aide_personnal coefficient_prise_en_charge_d832_10_formule = temp_coefficient_prise_en_charge_d832_10_formule def temp_abattement_depense_nette_minimale_d832_10(allocation_mensuelle_3:Money): try: - if (depense_nette_minimale_d832_10(allocation_mensuelle_3) <= - (ressources_menage_avec_d832_18 * + depense_nette_minimale_1 = depense_nette_minimale_d832_10( + allocation_mensuelle_3) + if (depense_nette_minimale_1 <= (ressources_menage_avec_d832_18 * coefficient_multiplicateur_d832_17_3)): return ((ressources_menage_avec_d832_18 * coefficient_multiplicateur_d832_17_3) - - depense_nette_minimale_d832_10(allocation_mensuelle_3)) + depense_nette_minimale_1) else: return money_of_cents_string("0") except EmptyError: @@ -9893,20 +9891,22 @@ def calcul_aide_personnalisee_logement_accession_propriete(calcul_aide_personnal temp_mensualite_minimale_3) def temp_mensualite_minimale_5(_:Unit): def temp_mensualite_minimale_6(_:Unit): - if (decimal_of_money(ressources_menage_arrondies_2) <= - (decimal_of_money(montant_limite_tranches_d832_15_1) * + ressources_menage_arrondies_5 = decimal_of_money(ressources_menage_arrondies_4) + montant_limite_tranches_d832_15_1_1 = decimal_of_money(montant_limite_tranches_d832_15_1) + if (ressources_menage_arrondies_5 <= + (montant_limite_tranches_d832_15_1_1 * n_nombre_parts_d832_11_1)): - temp_mensualite_minimale_7 = (decimal_of_money(ressources_menage_arrondies_2) * + temp_mensualite_minimale_7 = (ressources_menage_arrondies_5 * taux_tranche_inferieure_d832_15_1) else: - temp_mensualite_minimale_7 = ((decimal_of_money(montant_limite_tranches_d832_15_1) * + temp_mensualite_minimale_7 = ((montant_limite_tranches_d832_15_1_1 * n_nombre_parts_d832_11_1) * taux_tranche_inferieure_d832_15_1) - if (decimal_of_money(ressources_menage_arrondies_2) >= - (decimal_of_money(montant_limite_tranches_d832_15_1) * + if (ressources_menage_arrondies_5 >= + (montant_limite_tranches_d832_15_1_1 * n_nombre_parts_d832_11_1)): - temp_mensualite_minimale_8 = ((decimal_of_money(ressources_menage_arrondies_2) - - (decimal_of_money(montant_limite_tranches_d832_15_1) * + temp_mensualite_minimale_8 = ((ressources_menage_arrondies_5 - + (montant_limite_tranches_d832_15_1_1 * n_nombre_parts_d832_11_1)) * taux_tranche_superieure_d832_15_1) else: @@ -9973,16 +9973,15 @@ def calcul_aide_personnalisee_logement_accession_propriete(calcul_aide_personnal "Déclarations des champs d'application", "Prologue : aides au logement"])) coefficient_prise_en_charge_d832_10_coeff_arrondi = temp_coefficient_prise_en_charge_d832_10_coeff_arrondi - def temp_traitement_aide_finale_abattement_1(aide_finale_8:Money): + def temp_traitement_aide_finale_abattement_1(aide_finale_13:Money): try: - if ((traitement_aide_finale_minoration_forfaitaire_1(aide_finale_8) - - abattement_depense_nette_minimale_d832_10(traitement_aide_finale_minoration_forfaitaire_1( - aide_finale_8))) >= + aide_finale_14 = traitement_aide_finale_minoration_forfaitaire_1( + aide_finale_13) + aide_finale_15 = (aide_finale_14 - + abattement_depense_nette_minimale_d832_10(aide_finale_14)) + if (aide_finale_15 >= money_of_cents_string("0")): - return (traitement_aide_finale_minoration_forfaitaire_1( - aide_finale_8) - - abattement_depense_nette_minimale_d832_10(traitement_aide_finale_minoration_forfaitaire_1( - aide_finale_8))) + return aide_finale_15 else: return money_of_cents_string("0") except EmptyError: @@ -10027,22 +10026,15 @@ def calcul_aide_personnalisee_logement_accession_propriete(calcul_aide_personnal "Déclarations des champs d'application", "Prologue : aides au logement"])) coefficient_prise_en_charge_d832_10_seuil = temp_coefficient_prise_en_charge_d832_10_seuil - def temp_traitement_aide_finale_contributions_sociales_arrondi_1(aide_finale_9:Money): + def temp_traitement_aide_finale_contributions_sociales_arrondi_1(aide_finale_16:Money): try: - if ((money_round(((traitement_aide_finale_abattement_1(aide_finale_9) - - contributions_sociales_dot_montant_1(traitement_aide_finale_abattement_1( - aide_finale_9))) - - money_of_cents_string("50"))) + - contributions_sociales_dot_montant_1(traitement_aide_finale_abattement_1( - aide_finale_9))) >= + aide_finale_17 = traitement_aide_finale_abattement_1(aide_finale_16) + crds_1 = contributions_sociales_dot_montant_1(aide_finale_17) + aide_finale_moins_crds_arrondie_1 = money_round(((aide_finale_17 - + crds_1) - money_of_cents_string("50"))) + if ((aide_finale_moins_crds_arrondie_1 + crds_1) >= money_of_cents_string("0")): - return (money_round(((traitement_aide_finale_abattement_1( - aide_finale_9) - - contributions_sociales_dot_montant_1(traitement_aide_finale_abattement_1( - aide_finale_9))) - - money_of_cents_string("50"))) + - contributions_sociales_dot_montant_1(traitement_aide_finale_abattement_1( - aide_finale_9))) + return (aide_finale_moins_crds_arrondie_1 + crds_1) else: return money_of_cents_string("0") except EmptyError: @@ -10056,15 +10048,14 @@ def calcul_aide_personnalisee_logement_accession_propriete(calcul_aide_personnal "Prologue : aides au logement"])) traitement_aide_finale_contributions_sociales_arrondi_1 = temp_traitement_aide_finale_contributions_sociales_arrondi_1 try: - if ((((mensualite_eligible + montant_forfaitaire_charges_d832_10) - - mensualite_minimale) * - coefficient_prise_en_charge_d832_10_seuil) < + aide_finale_18 = (((mensualite_eligible + + montant_forfaitaire_charges_d832_10) - mensualite_minimale) * + coefficient_prise_en_charge_d832_10_seuil) + if (aide_finale_18 < money_of_cents_string("0")): temp_aide_finale_formule_1 = money_of_cents_string("0") else: - temp_aide_finale_formule_1 = (((mensualite_eligible + - montant_forfaitaire_charges_d832_10) - mensualite_minimale) * - coefficient_prise_en_charge_d832_10_seuil) + temp_aide_finale_formule_1 = aide_finale_18 except EmptyError: temp_aide_finale_formule_1 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", @@ -10075,15 +10066,15 @@ def calcul_aide_personnalisee_logement_accession_propriete(calcul_aide_personnal "Déclarations des champs d'application", "Prologue : aides au logement"])) aide_finale_formule_1 = temp_aide_finale_formule_1 - def temp_traitement_aide_finale_montant_minimal_1(aide_finale_10:Money): + def temp_traitement_aide_finale_montant_minimal_1(aide_finale_19:Money): try: - if (traitement_aide_finale_contributions_sociales_arrondi_1( - aide_finale_10) < + aide_finale_20 = traitement_aide_finale_contributions_sociales_arrondi_1( + aide_finale_19) + if (aide_finale_20 < montant_minimal_aide_d832_10): return money_of_cents_string("0") else: - return traitement_aide_finale_contributions_sociales_arrondi_1( - aide_finale_10) + return aide_finale_20 except EmptyError: raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", start_line=757, @@ -10364,7 +10355,7 @@ def eligibilite_prestations_familiales(eligibilite_prestations_familiales_in:Eli def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logement_locatif_in:CalculAidePersonnaliseeLogementLocatifIn): loyer_principal_base = calcul_aide_personnalisee_logement_locatif_in.loyer_principal_base_in - ressources_menage_arrondies_3 = calcul_aide_personnalisee_logement_locatif_in.ressources_menage_arrondies_in + ressources_menage_arrondies_6 = calcul_aide_personnalisee_logement_locatif_in.ressources_menage_arrondies_in beneficiaire_aide_adulte_ou_enfant_handicapes = calcul_aide_personnalisee_logement_locatif_in.beneficiaire_aide_adulte_ou_enfant_handicapes_in date_courante_11 = calcul_aide_personnalisee_logement_locatif_in.date_courante_in nombre_personnes_a_charge_4 = calcul_aide_personnalisee_logement_locatif_in.nombre_personnes_a_charge_in @@ -11997,491 +11988,406 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen match_arg_344 = situation_familiale_calcul_apl_4 if match_arg_344.code == SituationFamilialeCalculAPL_Code.PersonneSeule: _ = match_arg_344.value - temp_montant_forfaitaire_charges_d823_16_4 = money_of_cents_string("1858") + temp_montant_29 = money_of_cents_string("1858") elif match_arg_344.code == SituationFamilialeCalculAPL_Code.Couple: _ = match_arg_344.value - temp_montant_forfaitaire_charges_d823_16_4 = money_of_cents_string("3614") + temp_montant_29 = money_of_cents_string("3614") + montant_3 = (temp_montant_29 + + (money_of_cents_string("929") * + decimal_of_integer(nombre_personnes_a_charge_4))) match_arg_345 = situation_familiale_calcul_apl_4 if match_arg_345.code == SituationFamilialeCalculAPL_Code.PersonneSeule: _ = match_arg_345.value - temp_montant_forfaitaire_charges_d823_16_5 = money_of_cents_string("1858") + temp_limite = money_of_cents_string("1858") elif match_arg_345.code == SituationFamilialeCalculAPL_Code.Couple: _ = match_arg_345.value - temp_montant_forfaitaire_charges_d823_16_5 = money_of_cents_string("3614") - if ((temp_montant_forfaitaire_charges_d823_16_5 + + temp_limite = money_of_cents_string("3614") + limite = (temp_limite + (money_of_cents_string("929") * - decimal_of_integer(nombre_personnes_a_charge_4))) > - (temp_montant_forfaitaire_charges_d823_16_4 + - (money_of_cents_string("929") * - decimal_of_string("6.")))): - match_arg_346 = situation_familiale_calcul_apl_4 - if match_arg_346.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_346.value - temp_montant_forfaitaire_charges_d823_16_6 = money_of_cents_string("1858") - elif match_arg_346.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_346.value - temp_montant_forfaitaire_charges_d823_16_6 = money_of_cents_string("3614") - return (temp_montant_forfaitaire_charges_d823_16_6 + - (money_of_cents_string("929") * - decimal_of_string("6."))) + decimal_of_string("6."))) + if (montant_3 > limite): + return limite else: - match_arg_347 = situation_familiale_calcul_apl_4 - if match_arg_347.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_347.value - temp_montant_forfaitaire_charges_d823_16_7 = money_of_cents_string("1858") - elif match_arg_347.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_347.value - temp_montant_forfaitaire_charges_d823_16_7 = money_of_cents_string("3614") - return (temp_montant_forfaitaire_charges_d823_16_7 + - (money_of_cents_string("929") * - decimal_of_integer(nombre_personnes_a_charge_4))) - def temp_montant_forfaitaire_charges_d823_16_8(_:Unit): - match_arg_348 = residence_5 - if match_arg_348.code == Collectivite_Code.Guadeloupe: - _ = match_arg_348.value - temp_montant_forfaitaire_charges_d823_16_9 = True - elif match_arg_348.code == Collectivite_Code.Guyane: - _ = match_arg_348.value - temp_montant_forfaitaire_charges_d823_16_9 = False - elif match_arg_348.code == Collectivite_Code.Martinique: - _ = match_arg_348.value - temp_montant_forfaitaire_charges_d823_16_9 = True - elif match_arg_348.code == Collectivite_Code.LaReunion: - _ = match_arg_348.value - temp_montant_forfaitaire_charges_d823_16_9 = True - elif match_arg_348.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_348.value - temp_montant_forfaitaire_charges_d823_16_9 = True - elif match_arg_348.code == Collectivite_Code.SaintMartin: - _ = match_arg_348.value - temp_montant_forfaitaire_charges_d823_16_9 = True - elif match_arg_348.code == Collectivite_Code.Metropole: - _ = match_arg_348.value - temp_montant_forfaitaire_charges_d823_16_9 = False - elif match_arg_348.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_348.value - temp_montant_forfaitaire_charges_d823_16_9 = False - elif match_arg_348.code == Collectivite_Code.Mayotte: - _ = match_arg_348.value - temp_montant_forfaitaire_charges_d823_16_9 = True + return montant_3 + def temp_montant_forfaitaire_charges_d823_16_4(_:Unit): + match_arg_346 = residence_5 + if match_arg_346.code == Collectivite_Code.Guadeloupe: + _ = match_arg_346.value + temp_montant_forfaitaire_charges_d823_16_5 = True + elif match_arg_346.code == Collectivite_Code.Guyane: + _ = match_arg_346.value + temp_montant_forfaitaire_charges_d823_16_5 = False + elif match_arg_346.code == Collectivite_Code.Martinique: + _ = match_arg_346.value + temp_montant_forfaitaire_charges_d823_16_5 = True + elif match_arg_346.code == Collectivite_Code.LaReunion: + _ = match_arg_346.value + temp_montant_forfaitaire_charges_d823_16_5 = True + elif match_arg_346.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_346.value + temp_montant_forfaitaire_charges_d823_16_5 = True + elif match_arg_346.code == Collectivite_Code.SaintMartin: + _ = match_arg_346.value + temp_montant_forfaitaire_charges_d823_16_5 = True + elif match_arg_346.code == Collectivite_Code.Metropole: + _ = match_arg_346.value + temp_montant_forfaitaire_charges_d823_16_5 = False + elif match_arg_346.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_346.value + temp_montant_forfaitaire_charges_d823_16_5 = False + elif match_arg_346.code == Collectivite_Code.Mayotte: + _ = match_arg_346.value + temp_montant_forfaitaire_charges_d823_16_5 = True return (((date_courante_11 >= date_of_numbers(2020,1,1)) and (date_courante_11 < date_of_numbers(2020,10,1))) and + temp_montant_forfaitaire_charges_d823_16_5) + return handle_default(SourcePosition(filename="", + start_line=0, start_column=1, + end_line=0, end_column=1, + law_headings=[]), [], + temp_montant_forfaitaire_charges_d823_16_4, + temp_montant_forfaitaire_charges_d823_16_3) + def temp_montant_forfaitaire_charges_d823_16_6(_:Unit): + def temp_montant_forfaitaire_charges_d823_16_7(_:Unit): + match_arg_347 = situation_familiale_calcul_apl_4 + if match_arg_347.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_347.value + temp_montant_30 = money_of_cents_string("1864") + elif match_arg_347.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_347.value + temp_montant_30 = money_of_cents_string("3625") + montant_4 = (temp_montant_30 + + (money_of_cents_string("932") * + decimal_of_integer(nombre_personnes_a_charge_4))) + match_arg_348 = situation_familiale_calcul_apl_4 + if match_arg_348.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_348.value + temp_limite_1 = money_of_cents_string("1864") + elif match_arg_348.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_348.value + temp_limite_1 = money_of_cents_string("3625") + limite_1 = (temp_limite_1 + + (money_of_cents_string("932") * + decimal_of_string("6."))) + if (montant_4 > limite_1): + return limite_1 + else: + return montant_4 + def temp_montant_forfaitaire_charges_d823_16_8(_:Unit): + match_arg_349 = residence_5 + if match_arg_349.code == Collectivite_Code.Guadeloupe: + _ = match_arg_349.value + temp_montant_forfaitaire_charges_d823_16_9 = True + elif match_arg_349.code == Collectivite_Code.Guyane: + _ = match_arg_349.value + temp_montant_forfaitaire_charges_d823_16_9 = False + elif match_arg_349.code == Collectivite_Code.Martinique: + _ = match_arg_349.value + temp_montant_forfaitaire_charges_d823_16_9 = True + elif match_arg_349.code == Collectivite_Code.LaReunion: + _ = match_arg_349.value + temp_montant_forfaitaire_charges_d823_16_9 = True + elif match_arg_349.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_349.value + temp_montant_forfaitaire_charges_d823_16_9 = True + elif match_arg_349.code == Collectivite_Code.SaintMartin: + _ = match_arg_349.value + temp_montant_forfaitaire_charges_d823_16_9 = True + elif match_arg_349.code == Collectivite_Code.Metropole: + _ = match_arg_349.value + temp_montant_forfaitaire_charges_d823_16_9 = False + elif match_arg_349.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_349.value + temp_montant_forfaitaire_charges_d823_16_9 = False + elif match_arg_349.code == Collectivite_Code.Mayotte: + _ = match_arg_349.value + temp_montant_forfaitaire_charges_d823_16_9 = True + return (((date_courante_11 >= + date_of_numbers(2020,10,1)) and + (date_courante_11 < + date_of_numbers(2021,10,1))) and temp_montant_forfaitaire_charges_d823_16_9) return handle_default(SourcePosition(filename="", start_line=0, start_column=1, end_line=0, end_column=1, law_headings=[]), [], temp_montant_forfaitaire_charges_d823_16_8, - temp_montant_forfaitaire_charges_d823_16_3) + temp_montant_forfaitaire_charges_d823_16_7) def temp_montant_forfaitaire_charges_d823_16_10(_:Unit): - def temp_montant_forfaitaire_charges_d823_16_11(_:Unit): - match_arg_349 = situation_familiale_calcul_apl_4 - if match_arg_349.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_349.value - temp_montant_forfaitaire_charges_d823_16_12 = money_of_cents_string("1864") - elif match_arg_349.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_349.value - temp_montant_forfaitaire_charges_d823_16_12 = money_of_cents_string("3625") - match_arg_350 = situation_familiale_calcul_apl_4 - if match_arg_350.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_350.value - temp_montant_forfaitaire_charges_d823_16_13 = money_of_cents_string("1864") - elif match_arg_350.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_350.value - temp_montant_forfaitaire_charges_d823_16_13 = money_of_cents_string("3625") - if ((temp_montant_forfaitaire_charges_d823_16_13 + - (money_of_cents_string("932") * - decimal_of_integer(nombre_personnes_a_charge_4))) > - (temp_montant_forfaitaire_charges_d823_16_12 + - (money_of_cents_string("932") * - decimal_of_string("6.")))): + try: + def temp_montant_forfaitaire_charges_d823_16_11(_:Unit): + match_arg_350 = situation_familiale_calcul_apl_4 + if match_arg_350.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_350.value + temp_montant_31 = money_of_cents_string("1872") + elif match_arg_350.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_350.value + temp_montant_31 = money_of_cents_string("3640") + montant_5 = (temp_montant_31 + + (money_of_cents_string("936") * + decimal_of_integer(nombre_personnes_a_charge_4))) match_arg_351 = situation_familiale_calcul_apl_4 if match_arg_351.code == SituationFamilialeCalculAPL_Code.PersonneSeule: _ = match_arg_351.value - temp_montant_forfaitaire_charges_d823_16_14 = money_of_cents_string("1864") + temp_limite_2 = money_of_cents_string("1872") elif match_arg_351.code == SituationFamilialeCalculAPL_Code.Couple: _ = match_arg_351.value - temp_montant_forfaitaire_charges_d823_16_14 = money_of_cents_string("3625") - return (temp_montant_forfaitaire_charges_d823_16_14 + - (money_of_cents_string("932") * + temp_limite_2 = money_of_cents_string("3640") + limite_2 = (temp_limite_2 + + (money_of_cents_string("936") * decimal_of_string("6."))) - else: - match_arg_352 = situation_familiale_calcul_apl_4 - if match_arg_352.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_352.value - temp_montant_forfaitaire_charges_d823_16_15 = money_of_cents_string("1864") - elif match_arg_352.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_352.value - temp_montant_forfaitaire_charges_d823_16_15 = money_of_cents_string("3625") - return (temp_montant_forfaitaire_charges_d823_16_15 + - (money_of_cents_string("932") * - decimal_of_integer(nombre_personnes_a_charge_4))) - def temp_montant_forfaitaire_charges_d823_16_16(_:Unit): - match_arg_353 = residence_5 - if match_arg_353.code == Collectivite_Code.Guadeloupe: - _ = match_arg_353.value - temp_montant_forfaitaire_charges_d823_16_17 = True - elif match_arg_353.code == Collectivite_Code.Guyane: - _ = match_arg_353.value - temp_montant_forfaitaire_charges_d823_16_17 = False - elif match_arg_353.code == Collectivite_Code.Martinique: - _ = match_arg_353.value - temp_montant_forfaitaire_charges_d823_16_17 = True - elif match_arg_353.code == Collectivite_Code.LaReunion: - _ = match_arg_353.value - temp_montant_forfaitaire_charges_d823_16_17 = True - elif match_arg_353.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_353.value - temp_montant_forfaitaire_charges_d823_16_17 = True - elif match_arg_353.code == Collectivite_Code.SaintMartin: - _ = match_arg_353.value - temp_montant_forfaitaire_charges_d823_16_17 = True - elif match_arg_353.code == Collectivite_Code.Metropole: - _ = match_arg_353.value - temp_montant_forfaitaire_charges_d823_16_17 = False - elif match_arg_353.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_353.value - temp_montant_forfaitaire_charges_d823_16_17 = False - elif match_arg_353.code == Collectivite_Code.Mayotte: - _ = match_arg_353.value - temp_montant_forfaitaire_charges_d823_16_17 = True - return (((date_courante_11 >= - date_of_numbers(2020,10,1)) and - (date_courante_11 < - date_of_numbers(2021,10,1))) and - temp_montant_forfaitaire_charges_d823_16_17) - return handle_default(SourcePosition(filename="", - start_line=0, start_column=1, - end_line=0, end_column=1, - law_headings=[]), [], - temp_montant_forfaitaire_charges_d823_16_16, - temp_montant_forfaitaire_charges_d823_16_11) - def temp_montant_forfaitaire_charges_d823_16_18(_:Unit): - try: - def temp_montant_forfaitaire_charges_d823_16_19(_:Unit): - match_arg_354 = situation_familiale_calcul_apl_4 - if match_arg_354.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_354.value - temp_montant_forfaitaire_charges_d823_16_20 = money_of_cents_string("1872") - elif match_arg_354.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_354.value - temp_montant_forfaitaire_charges_d823_16_20 = money_of_cents_string("3640") - match_arg_355 = situation_familiale_calcul_apl_4 - if match_arg_355.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_355.value - temp_montant_forfaitaire_charges_d823_16_21 = money_of_cents_string("1872") - elif match_arg_355.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_355.value - temp_montant_forfaitaire_charges_d823_16_21 = money_of_cents_string("3640") - if ((temp_montant_forfaitaire_charges_d823_16_21 + - (money_of_cents_string("936") * - decimal_of_integer(nombre_personnes_a_charge_4))) > - (temp_montant_forfaitaire_charges_d823_16_20 + - (money_of_cents_string("936") * - decimal_of_string("6.")))): - match_arg_356 = situation_familiale_calcul_apl_4 - if match_arg_356.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_356.value - temp_montant_forfaitaire_charges_d823_16_22 = money_of_cents_string("1872") - elif match_arg_356.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_356.value - temp_montant_forfaitaire_charges_d823_16_22 = money_of_cents_string("3640") - return (temp_montant_forfaitaire_charges_d823_16_22 + - (money_of_cents_string("936") * - decimal_of_string("6."))) + if (montant_5 > limite_2): + return limite_2 else: - match_arg_357 = situation_familiale_calcul_apl_4 - if match_arg_357.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_357.value - temp_montant_forfaitaire_charges_d823_16_23 = money_of_cents_string("1872") - elif match_arg_357.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_357.value - temp_montant_forfaitaire_charges_d823_16_23 = money_of_cents_string("3640") - return (temp_montant_forfaitaire_charges_d823_16_23 + - (money_of_cents_string("936") * - decimal_of_integer(nombre_personnes_a_charge_4))) - def temp_montant_forfaitaire_charges_d823_16_24(_:Unit): - match_arg_358 = residence_5 - if match_arg_358.code == Collectivite_Code.Guadeloupe: - _ = match_arg_358.value - temp_montant_forfaitaire_charges_d823_16_25 = True - elif match_arg_358.code == Collectivite_Code.Guyane: - _ = match_arg_358.value - temp_montant_forfaitaire_charges_d823_16_25 = False - elif match_arg_358.code == Collectivite_Code.Martinique: - _ = match_arg_358.value - temp_montant_forfaitaire_charges_d823_16_25 = True - elif match_arg_358.code == Collectivite_Code.LaReunion: - _ = match_arg_358.value - temp_montant_forfaitaire_charges_d823_16_25 = True - elif match_arg_358.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_358.value - temp_montant_forfaitaire_charges_d823_16_25 = True - elif match_arg_358.code == Collectivite_Code.SaintMartin: - _ = match_arg_358.value - temp_montant_forfaitaire_charges_d823_16_25 = True - elif match_arg_358.code == Collectivite_Code.Metropole: - _ = match_arg_358.value - temp_montant_forfaitaire_charges_d823_16_25 = False - elif match_arg_358.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_358.value - temp_montant_forfaitaire_charges_d823_16_25 = False - elif match_arg_358.code == Collectivite_Code.Mayotte: - _ = match_arg_358.value - temp_montant_forfaitaire_charges_d823_16_25 = True + return montant_5 + def temp_montant_forfaitaire_charges_d823_16_12(_:Unit): + match_arg_352 = residence_5 + if match_arg_352.code == Collectivite_Code.Guadeloupe: + _ = match_arg_352.value + temp_montant_forfaitaire_charges_d823_16_13 = True + elif match_arg_352.code == Collectivite_Code.Guyane: + _ = match_arg_352.value + temp_montant_forfaitaire_charges_d823_16_13 = False + elif match_arg_352.code == Collectivite_Code.Martinique: + _ = match_arg_352.value + temp_montant_forfaitaire_charges_d823_16_13 = True + elif match_arg_352.code == Collectivite_Code.LaReunion: + _ = match_arg_352.value + temp_montant_forfaitaire_charges_d823_16_13 = True + elif match_arg_352.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_352.value + temp_montant_forfaitaire_charges_d823_16_13 = True + elif match_arg_352.code == Collectivite_Code.SaintMartin: + _ = match_arg_352.value + temp_montant_forfaitaire_charges_d823_16_13 = True + elif match_arg_352.code == Collectivite_Code.Metropole: + _ = match_arg_352.value + temp_montant_forfaitaire_charges_d823_16_13 = False + elif match_arg_352.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_352.value + temp_montant_forfaitaire_charges_d823_16_13 = False + elif match_arg_352.code == Collectivite_Code.Mayotte: + _ = match_arg_352.value + temp_montant_forfaitaire_charges_d823_16_13 = True return (((date_courante_11 >= date_of_numbers(2021,10,1)) and (date_courante_11 < date_of_numbers(2022,1,1))) and - temp_montant_forfaitaire_charges_d823_16_25) + temp_montant_forfaitaire_charges_d823_16_13) return handle_default(SourcePosition(filename="", start_line=0, start_column=1, end_line=0, end_column=1, law_headings=[]), [], - temp_montant_forfaitaire_charges_d823_16_24, - temp_montant_forfaitaire_charges_d823_16_19) + temp_montant_forfaitaire_charges_d823_16_12, + temp_montant_forfaitaire_charges_d823_16_11) except EmptyError: - match_arg_359 = residence_5 - if match_arg_359.code == Collectivite_Code.Guadeloupe: - _ = match_arg_359.value - temp_montant_forfaitaire_charges_d823_16_26 = True - elif match_arg_359.code == Collectivite_Code.Guyane: - _ = match_arg_359.value - temp_montant_forfaitaire_charges_d823_16_26 = False - elif match_arg_359.code == Collectivite_Code.Martinique: - _ = match_arg_359.value - temp_montant_forfaitaire_charges_d823_16_26 = True - elif match_arg_359.code == Collectivite_Code.LaReunion: - _ = match_arg_359.value - temp_montant_forfaitaire_charges_d823_16_26 = True - elif match_arg_359.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_359.value - temp_montant_forfaitaire_charges_d823_16_26 = True - elif match_arg_359.code == Collectivite_Code.SaintMartin: - _ = match_arg_359.value - temp_montant_forfaitaire_charges_d823_16_26 = True - elif match_arg_359.code == Collectivite_Code.Metropole: - _ = match_arg_359.value - temp_montant_forfaitaire_charges_d823_16_26 = False - elif match_arg_359.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_359.value - temp_montant_forfaitaire_charges_d823_16_26 = False - elif match_arg_359.code == Collectivite_Code.Mayotte: - _ = match_arg_359.value - temp_montant_forfaitaire_charges_d823_16_26 = True + match_arg_353 = residence_5 + if match_arg_353.code == Collectivite_Code.Guadeloupe: + _ = match_arg_353.value + temp_montant_forfaitaire_charges_d823_16_14 = True + elif match_arg_353.code == Collectivite_Code.Guyane: + _ = match_arg_353.value + temp_montant_forfaitaire_charges_d823_16_14 = False + elif match_arg_353.code == Collectivite_Code.Martinique: + _ = match_arg_353.value + temp_montant_forfaitaire_charges_d823_16_14 = True + elif match_arg_353.code == Collectivite_Code.LaReunion: + _ = match_arg_353.value + temp_montant_forfaitaire_charges_d823_16_14 = True + elif match_arg_353.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_353.value + temp_montant_forfaitaire_charges_d823_16_14 = True + elif match_arg_353.code == Collectivite_Code.SaintMartin: + _ = match_arg_353.value + temp_montant_forfaitaire_charges_d823_16_14 = True + elif match_arg_353.code == Collectivite_Code.Metropole: + _ = match_arg_353.value + temp_montant_forfaitaire_charges_d823_16_14 = False + elif match_arg_353.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_353.value + temp_montant_forfaitaire_charges_d823_16_14 = False + elif match_arg_353.code == Collectivite_Code.Mayotte: + _ = match_arg_353.value + temp_montant_forfaitaire_charges_d823_16_14 = True if (((date_courante_11 >= date_of_numbers(2022,1,1)) and (date_courante_11 < date_of_numbers(2022,7,1))) and - temp_montant_forfaitaire_charges_d823_16_26): - match_arg_360 = situation_familiale_calcul_apl_4 - if match_arg_360.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_360.value - temp_montant_forfaitaire_charges_d823_16_27 = money_of_cents_string("1872") - elif match_arg_360.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_360.value - temp_montant_forfaitaire_charges_d823_16_27 = money_of_cents_string("3640") - match_arg_361 = situation_familiale_calcul_apl_4 - if match_arg_361.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_361.value - temp_montant_forfaitaire_charges_d823_16_28 = money_of_cents_string("1872") - elif match_arg_361.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_361.value - temp_montant_forfaitaire_charges_d823_16_28 = money_of_cents_string("3640") - if ((temp_montant_forfaitaire_charges_d823_16_28 + + temp_montant_forfaitaire_charges_d823_16_14): + match_arg_354 = situation_familiale_calcul_apl_4 + if match_arg_354.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_354.value + temp_montant_32 = money_of_cents_string("1872") + elif match_arg_354.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_354.value + temp_montant_32 = money_of_cents_string("3640") + montant_6 = (temp_montant_32 + (money_of_cents_string("936") * - decimal_of_integer(nombre_personnes_a_charge_4))) > - (temp_montant_forfaitaire_charges_d823_16_27 + + decimal_of_integer(nombre_personnes_a_charge_4))) + match_arg_355 = situation_familiale_calcul_apl_4 + if match_arg_355.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_355.value + temp_limite_3 = money_of_cents_string("1872") + elif match_arg_355.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_355.value + temp_limite_3 = money_of_cents_string("3640") + limite_3 = (temp_limite_3 + (money_of_cents_string("936") * - decimal_of_string("6.")))): - match_arg_362 = situation_familiale_calcul_apl_4 - if match_arg_362.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_362.value - temp_montant_forfaitaire_charges_d823_16_29 = money_of_cents_string("1872") - elif match_arg_362.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_362.value - temp_montant_forfaitaire_charges_d823_16_29 = money_of_cents_string("3640") - return (temp_montant_forfaitaire_charges_d823_16_29 + - (money_of_cents_string("936") * - decimal_of_string("6."))) + decimal_of_string("6."))) + if (montant_6 > limite_3): + return limite_3 else: - match_arg_363 = situation_familiale_calcul_apl_4 - if match_arg_363.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_363.value - temp_montant_forfaitaire_charges_d823_16_30 = money_of_cents_string("1872") - elif match_arg_363.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_363.value - temp_montant_forfaitaire_charges_d823_16_30 = money_of_cents_string("3640") - return (temp_montant_forfaitaire_charges_d823_16_30 + - (money_of_cents_string("936") * - decimal_of_integer(nombre_personnes_a_charge_4))) + return montant_6 else: raise EmptyError - def temp_montant_forfaitaire_charges_d823_16_31(_:Unit): - def temp_montant_forfaitaire_charges_d823_16_32(_:Unit): - match_arg_364 = situation_familiale_calcul_apl_4 - if match_arg_364.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_364.value - temp_montant_forfaitaire_charges_d823_16_33 = money_of_cents_string("1938") - elif match_arg_364.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_364.value - temp_montant_forfaitaire_charges_d823_16_33 = money_of_cents_string("3767") - match_arg_365 = situation_familiale_calcul_apl_4 - if match_arg_365.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_365.value - temp_montant_forfaitaire_charges_d823_16_34 = money_of_cents_string("1938") - elif match_arg_365.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_365.value - temp_montant_forfaitaire_charges_d823_16_34 = money_of_cents_string("3767") - if ((temp_montant_forfaitaire_charges_d823_16_34 + + def temp_montant_forfaitaire_charges_d823_16_15(_:Unit): + def temp_montant_forfaitaire_charges_d823_16_16(_:Unit): + match_arg_356 = situation_familiale_calcul_apl_4 + if match_arg_356.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_356.value + temp_montant_33 = money_of_cents_string("1938") + elif match_arg_356.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_356.value + temp_montant_33 = money_of_cents_string("3767") + montant_7 = (temp_montant_33 + (money_of_cents_string("969") * - decimal_of_integer(nombre_personnes_a_charge_4))) > - (temp_montant_forfaitaire_charges_d823_16_33 + + decimal_of_integer(nombre_personnes_a_charge_4))) + match_arg_357 = situation_familiale_calcul_apl_4 + if match_arg_357.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_357.value + temp_limite_4 = money_of_cents_string("1938") + elif match_arg_357.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_357.value + temp_limite_4 = money_of_cents_string("3767") + limite_4 = (temp_limite_4 + (money_of_cents_string("969") * - decimal_of_string("6.")))): - match_arg_366 = situation_familiale_calcul_apl_4 - if match_arg_366.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_366.value - temp_montant_forfaitaire_charges_d823_16_35 = money_of_cents_string("1938") - elif match_arg_366.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_366.value - temp_montant_forfaitaire_charges_d823_16_35 = money_of_cents_string("3767") - return (temp_montant_forfaitaire_charges_d823_16_35 + - (money_of_cents_string("969") * - decimal_of_string("6."))) + decimal_of_string("6."))) + if (montant_7 > limite_4): + return limite_4 else: - match_arg_367 = situation_familiale_calcul_apl_4 - if match_arg_367.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_367.value - temp_montant_forfaitaire_charges_d823_16_36 = money_of_cents_string("1938") - elif match_arg_367.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_367.value - temp_montant_forfaitaire_charges_d823_16_36 = money_of_cents_string("3767") - return (temp_montant_forfaitaire_charges_d823_16_36 + - (money_of_cents_string("969") * - decimal_of_integer(nombre_personnes_a_charge_4))) - def temp_montant_forfaitaire_charges_d823_16_37(_:Unit): - match_arg_368 = residence_5 - if match_arg_368.code == Collectivite_Code.Guadeloupe: - _ = match_arg_368.value - temp_montant_forfaitaire_charges_d823_16_38 = True - elif match_arg_368.code == Collectivite_Code.Guyane: - _ = match_arg_368.value - temp_montant_forfaitaire_charges_d823_16_38 = False - elif match_arg_368.code == Collectivite_Code.Martinique: - _ = match_arg_368.value - temp_montant_forfaitaire_charges_d823_16_38 = True - elif match_arg_368.code == Collectivite_Code.LaReunion: - _ = match_arg_368.value - temp_montant_forfaitaire_charges_d823_16_38 = True - elif match_arg_368.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_368.value - temp_montant_forfaitaire_charges_d823_16_38 = True - elif match_arg_368.code == Collectivite_Code.SaintMartin: - _ = match_arg_368.value - temp_montant_forfaitaire_charges_d823_16_38 = True - elif match_arg_368.code == Collectivite_Code.Metropole: - _ = match_arg_368.value - temp_montant_forfaitaire_charges_d823_16_38 = False - elif match_arg_368.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_368.value - temp_montant_forfaitaire_charges_d823_16_38 = False - elif match_arg_368.code == Collectivite_Code.Mayotte: - _ = match_arg_368.value - temp_montant_forfaitaire_charges_d823_16_38 = True + return montant_7 + def temp_montant_forfaitaire_charges_d823_16_17(_:Unit): + match_arg_358 = residence_5 + if match_arg_358.code == Collectivite_Code.Guadeloupe: + _ = match_arg_358.value + temp_montant_forfaitaire_charges_d823_16_18 = True + elif match_arg_358.code == Collectivite_Code.Guyane: + _ = match_arg_358.value + temp_montant_forfaitaire_charges_d823_16_18 = False + elif match_arg_358.code == Collectivite_Code.Martinique: + _ = match_arg_358.value + temp_montant_forfaitaire_charges_d823_16_18 = True + elif match_arg_358.code == Collectivite_Code.LaReunion: + _ = match_arg_358.value + temp_montant_forfaitaire_charges_d823_16_18 = True + elif match_arg_358.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_358.value + temp_montant_forfaitaire_charges_d823_16_18 = True + elif match_arg_358.code == Collectivite_Code.SaintMartin: + _ = match_arg_358.value + temp_montant_forfaitaire_charges_d823_16_18 = True + elif match_arg_358.code == Collectivite_Code.Metropole: + _ = match_arg_358.value + temp_montant_forfaitaire_charges_d823_16_18 = False + elif match_arg_358.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_358.value + temp_montant_forfaitaire_charges_d823_16_18 = False + elif match_arg_358.code == Collectivite_Code.Mayotte: + _ = match_arg_358.value + temp_montant_forfaitaire_charges_d823_16_18 = True return (((date_courante_11 >= date_of_numbers(2022,7,1)) and (date_courante_11 < date_of_numbers(2023,1,1))) and - temp_montant_forfaitaire_charges_d823_16_38) + temp_montant_forfaitaire_charges_d823_16_18) return handle_default(SourcePosition(filename="", start_line=0, start_column=1, end_line=0, end_column=1, law_headings=[]), [], - temp_montant_forfaitaire_charges_d823_16_37, - temp_montant_forfaitaire_charges_d823_16_32) - def temp_montant_forfaitaire_charges_d823_16_39(_:Unit): - def temp_montant_forfaitaire_charges_d823_16_40(_:Unit): - match_arg_369 = situation_familiale_calcul_apl_4 - if match_arg_369.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_369.value - temp_montant_forfaitaire_charges_d823_16_41 = money_of_cents_string("1938") - elif match_arg_369.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_369.value - temp_montant_forfaitaire_charges_d823_16_41 = money_of_cents_string("3767") - return (temp_montant_forfaitaire_charges_d823_16_41 + + temp_montant_forfaitaire_charges_d823_16_17, + temp_montant_forfaitaire_charges_d823_16_16) + def temp_montant_forfaitaire_charges_d823_16_19(_:Unit): + def temp_montant_forfaitaire_charges_d823_16_20(_:Unit): + match_arg_359 = situation_familiale_calcul_apl_4 + if match_arg_359.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_359.value + temp_montant_forfaitaire_charges_d823_16_21 = money_of_cents_string("1938") + elif match_arg_359.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_359.value + temp_montant_forfaitaire_charges_d823_16_21 = money_of_cents_string("3767") + return (temp_montant_forfaitaire_charges_d823_16_21 + (money_of_cents_string("969") * multiplicateur_majoration_charges_d823_16)) - def temp_montant_forfaitaire_charges_d823_16_42(_:Unit): - match_arg_370 = residence_5 - if match_arg_370.code == Collectivite_Code.Guadeloupe: - _ = match_arg_370.value - temp_montant_forfaitaire_charges_d823_16_43 = True - elif match_arg_370.code == Collectivite_Code.Guyane: - _ = match_arg_370.value - temp_montant_forfaitaire_charges_d823_16_43 = False - elif match_arg_370.code == Collectivite_Code.Martinique: - _ = match_arg_370.value - temp_montant_forfaitaire_charges_d823_16_43 = True - elif match_arg_370.code == Collectivite_Code.LaReunion: - _ = match_arg_370.value - temp_montant_forfaitaire_charges_d823_16_43 = True - elif match_arg_370.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_370.value - temp_montant_forfaitaire_charges_d823_16_43 = True - elif match_arg_370.code == Collectivite_Code.SaintMartin: - _ = match_arg_370.value - temp_montant_forfaitaire_charges_d823_16_43 = True - elif match_arg_370.code == Collectivite_Code.Metropole: - _ = match_arg_370.value - temp_montant_forfaitaire_charges_d823_16_43 = False - elif match_arg_370.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_370.value - temp_montant_forfaitaire_charges_d823_16_43 = False - elif match_arg_370.code == Collectivite_Code.Mayotte: - _ = match_arg_370.value - temp_montant_forfaitaire_charges_d823_16_43 = True + def temp_montant_forfaitaire_charges_d823_16_22(_:Unit): + match_arg_360 = residence_5 + if match_arg_360.code == Collectivite_Code.Guadeloupe: + _ = match_arg_360.value + temp_montant_forfaitaire_charges_d823_16_23 = True + elif match_arg_360.code == Collectivite_Code.Guyane: + _ = match_arg_360.value + temp_montant_forfaitaire_charges_d823_16_23 = False + elif match_arg_360.code == Collectivite_Code.Martinique: + _ = match_arg_360.value + temp_montant_forfaitaire_charges_d823_16_23 = True + elif match_arg_360.code == Collectivite_Code.LaReunion: + _ = match_arg_360.value + temp_montant_forfaitaire_charges_d823_16_23 = True + elif match_arg_360.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_360.value + temp_montant_forfaitaire_charges_d823_16_23 = True + elif match_arg_360.code == Collectivite_Code.SaintMartin: + _ = match_arg_360.value + temp_montant_forfaitaire_charges_d823_16_23 = True + elif match_arg_360.code == Collectivite_Code.Metropole: + _ = match_arg_360.value + temp_montant_forfaitaire_charges_d823_16_23 = False + elif match_arg_360.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_360.value + temp_montant_forfaitaire_charges_d823_16_23 = False + elif match_arg_360.code == Collectivite_Code.Mayotte: + _ = match_arg_360.value + temp_montant_forfaitaire_charges_d823_16_23 = True return ((date_courante_11 >= date_of_numbers(2023,1,1)) and - (temp_montant_forfaitaire_charges_d823_16_43 and + (temp_montant_forfaitaire_charges_d823_16_23 and colocation)) return handle_default(SourcePosition(filename="", start_line=0, start_column=1, end_line=0, end_column=1, law_headings=[]), [], - temp_montant_forfaitaire_charges_d823_16_42, - temp_montant_forfaitaire_charges_d823_16_40) - temp_montant_forfaitaire_charges_d823_16_44 = handle_default( + temp_montant_forfaitaire_charges_d823_16_22, + temp_montant_forfaitaire_charges_d823_16_20) + temp_montant_forfaitaire_charges_d823_16_24 = handle_default( SourcePosition(filename="", start_line=0, start_column=1, end_line=0, end_column=1, - law_headings=[]), [temp_montant_forfaitaire_charges_d823_16_39, - temp_montant_forfaitaire_charges_d823_16_31, - temp_montant_forfaitaire_charges_d823_16_18, + law_headings=[]), [temp_montant_forfaitaire_charges_d823_16_19, + temp_montant_forfaitaire_charges_d823_16_15, temp_montant_forfaitaire_charges_d823_16_10, + temp_montant_forfaitaire_charges_d823_16_6, temp_montant_forfaitaire_charges_d823_16_2], temp_montant_forfaitaire_charges_d823_16_1, temp_montant_forfaitaire_charges_d823_16) except EmptyError: - def temp_montant_forfaitaire_charges_d823_16_45(_:Unit): + def temp_montant_forfaitaire_charges_d823_16_25(_:Unit): raise EmptyError - def temp_montant_forfaitaire_charges_d823_16_46(_:Unit): + def temp_montant_forfaitaire_charges_d823_16_26(_:Unit): return False - def temp_montant_forfaitaire_charges_d823_16_47(_:Unit): - def temp_montant_forfaitaire_charges_d823_16_48(_:Unit): - match_arg_371 = situation_familiale_calcul_apl_4 - if match_arg_371.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_371.value - temp_montant_forfaitaire_charges_d823_16_49 = money_of_cents_string("2699") - elif match_arg_371.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_371.value - temp_montant_forfaitaire_charges_d823_16_49 = money_of_cents_string("5399") - return (temp_montant_forfaitaire_charges_d823_16_49 + + def temp_montant_forfaitaire_charges_d823_16_27(_:Unit): + def temp_montant_forfaitaire_charges_d823_16_28(_:Unit): + match_arg_361 = situation_familiale_calcul_apl_4 + if match_arg_361.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_361.value + temp_montant_forfaitaire_charges_d823_16_29 = money_of_cents_string("2699") + elif match_arg_361.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_361.value + temp_montant_forfaitaire_charges_d823_16_29 = money_of_cents_string("5399") + return (temp_montant_forfaitaire_charges_d823_16_29 + (money_of_cents_string("1224") * multiplicateur_majoration_charges_d823_16)) - def temp_montant_forfaitaire_charges_d823_16_50(_:Unit): + def temp_montant_forfaitaire_charges_d823_16_30(_:Unit): return ((date_courante_11 < date_of_numbers(2021,10,1)) and ((date_courante_11 >= @@ -12490,21 +12396,21 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen start_line=0, start_column=1, end_line=0, end_column=1, law_headings=[]), [], - temp_montant_forfaitaire_charges_d823_16_50, - temp_montant_forfaitaire_charges_d823_16_48) - def temp_montant_forfaitaire_charges_d823_16_51(_:Unit): - def temp_montant_forfaitaire_charges_d823_16_52(_:Unit): - match_arg_372 = situation_familiale_calcul_apl_4 - if match_arg_372.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_372.value - temp_montant_forfaitaire_charges_d823_16_53 = money_of_cents_string("2710") - elif match_arg_372.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_372.value - temp_montant_forfaitaire_charges_d823_16_53 = money_of_cents_string("5422") - return (temp_montant_forfaitaire_charges_d823_16_53 + + temp_montant_forfaitaire_charges_d823_16_30, + temp_montant_forfaitaire_charges_d823_16_28) + def temp_montant_forfaitaire_charges_d823_16_31(_:Unit): + def temp_montant_forfaitaire_charges_d823_16_32(_:Unit): + match_arg_362 = situation_familiale_calcul_apl_4 + if match_arg_362.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_362.value + temp_montant_forfaitaire_charges_d823_16_33 = money_of_cents_string("2710") + elif match_arg_362.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_362.value + temp_montant_forfaitaire_charges_d823_16_33 = money_of_cents_string("5422") + return (temp_montant_forfaitaire_charges_d823_16_33 + (money_of_cents_string("1229") * multiplicateur_majoration_charges_d823_16)) - def temp_montant_forfaitaire_charges_d823_16_54(_:Unit): + def temp_montant_forfaitaire_charges_d823_16_34(_:Unit): return ((date_courante_11 >= date_of_numbers(2021,10,1)) and ((date_courante_11 < @@ -12513,376 +12419,361 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen start_line=0, start_column=1, end_line=0, end_column=1, law_headings=[]), [], - temp_montant_forfaitaire_charges_d823_16_54, - temp_montant_forfaitaire_charges_d823_16_52) - def temp_montant_forfaitaire_charges_d823_16_55(_:Unit): - def temp_montant_forfaitaire_charges_d823_16_56(_:Unit): - match_arg_373 = situation_familiale_calcul_apl_4 - if match_arg_373.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_373.value - temp_montant_forfaitaire_charges_d823_16_57 = money_of_cents_string("2805") - elif match_arg_373.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_373.value - temp_montant_forfaitaire_charges_d823_16_57 = money_of_cents_string("5612") - return (temp_montant_forfaitaire_charges_d823_16_57 + + temp_montant_forfaitaire_charges_d823_16_34, + temp_montant_forfaitaire_charges_d823_16_32) + def temp_montant_forfaitaire_charges_d823_16_35(_:Unit): + def temp_montant_forfaitaire_charges_d823_16_36(_:Unit): + match_arg_363 = situation_familiale_calcul_apl_4 + if match_arg_363.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_363.value + temp_montant_forfaitaire_charges_d823_16_37 = money_of_cents_string("2805") + elif match_arg_363.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_363.value + temp_montant_forfaitaire_charges_d823_16_37 = money_of_cents_string("5612") + return (temp_montant_forfaitaire_charges_d823_16_37 + (money_of_cents_string("1272") * multiplicateur_majoration_charges_d823_16)) - def temp_montant_forfaitaire_charges_d823_16_58(_:Unit): + def temp_montant_forfaitaire_charges_d823_16_38(_:Unit): return ((date_courante_11 >= date_of_numbers(2022,7,1)) and colocation) return handle_default(SourcePosition(filename="", start_line=0, start_column=1, end_line=0, end_column=1, law_headings=[]), [], - temp_montant_forfaitaire_charges_d823_16_58, - temp_montant_forfaitaire_charges_d823_16_56) - temp_montant_forfaitaire_charges_d823_16_44 = handle_default( + temp_montant_forfaitaire_charges_d823_16_38, + temp_montant_forfaitaire_charges_d823_16_36) + temp_montant_forfaitaire_charges_d823_16_24 = handle_default( SourcePosition(filename="", start_line=0, start_column=1, end_line=0, end_column=1, - law_headings=[]), [temp_montant_forfaitaire_charges_d823_16_55, - temp_montant_forfaitaire_charges_d823_16_51, - temp_montant_forfaitaire_charges_d823_16_47], - temp_montant_forfaitaire_charges_d823_16_46, - temp_montant_forfaitaire_charges_d823_16_45) + law_headings=[]), [temp_montant_forfaitaire_charges_d823_16_35, + temp_montant_forfaitaire_charges_d823_16_31, + temp_montant_forfaitaire_charges_d823_16_27], + temp_montant_forfaitaire_charges_d823_16_26, + temp_montant_forfaitaire_charges_d823_16_25) except EmptyError: - def temp_montant_forfaitaire_charges_d823_16_59(_:Unit): + def temp_montant_forfaitaire_charges_d823_16_39(_:Unit): raise EmptyError - def temp_montant_forfaitaire_charges_d823_16_60(_:Unit): + def temp_montant_forfaitaire_charges_d823_16_40(_:Unit): return False - def temp_montant_forfaitaire_charges_d823_16_61(_:Unit): - def temp_montant_forfaitaire_charges_d823_16_62(_:Unit): - if ((money_of_cents_string("3614") + + def temp_montant_forfaitaire_charges_d823_16_41(_:Unit): + def temp_montant_forfaitaire_charges_d823_16_42(_:Unit): + montant_8 = (money_of_cents_string("3614") + (money_of_cents_string("929") * - decimal_of_integer(nombre_personnes_a_charge_4))) > - (money_of_cents_string("3614") + + decimal_of_integer(nombre_personnes_a_charge_4))) + limite_5 = (money_of_cents_string("3614") + (money_of_cents_string("929") * - decimal_of_string("6.")))): - return (money_of_cents_string("3614") + - (money_of_cents_string("929") * - decimal_of_string("6."))) + decimal_of_string("6."))) + if (montant_8 > limite_5): + return limite_5 else: - return (money_of_cents_string("3614") + - (money_of_cents_string("929") * - decimal_of_integer(nombre_personnes_a_charge_4))) - def temp_montant_forfaitaire_charges_d823_16_63(_:Unit): - match_arg_374 = residence_5 - if match_arg_374.code == Collectivite_Code.Guadeloupe: - _ = match_arg_374.value - temp_montant_forfaitaire_charges_d823_16_64 = True - elif match_arg_374.code == Collectivite_Code.Guyane: - _ = match_arg_374.value - temp_montant_forfaitaire_charges_d823_16_64 = False - elif match_arg_374.code == Collectivite_Code.Martinique: - _ = match_arg_374.value - temp_montant_forfaitaire_charges_d823_16_64 = True - elif match_arg_374.code == Collectivite_Code.LaReunion: - _ = match_arg_374.value - temp_montant_forfaitaire_charges_d823_16_64 = True - elif match_arg_374.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_374.value - temp_montant_forfaitaire_charges_d823_16_64 = True - elif match_arg_374.code == Collectivite_Code.SaintMartin: - _ = match_arg_374.value - temp_montant_forfaitaire_charges_d823_16_64 = True - elif match_arg_374.code == Collectivite_Code.Metropole: - _ = match_arg_374.value - temp_montant_forfaitaire_charges_d823_16_64 = False - elif match_arg_374.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_374.value - temp_montant_forfaitaire_charges_d823_16_64 = False - elif match_arg_374.code == Collectivite_Code.Mayotte: - _ = match_arg_374.value - temp_montant_forfaitaire_charges_d823_16_64 = True + return montant_8 + def temp_montant_forfaitaire_charges_d823_16_43(_:Unit): + match_arg_364 = residence_5 + if match_arg_364.code == Collectivite_Code.Guadeloupe: + _ = match_arg_364.value + temp_montant_forfaitaire_charges_d823_16_44 = True + elif match_arg_364.code == Collectivite_Code.Guyane: + _ = match_arg_364.value + temp_montant_forfaitaire_charges_d823_16_44 = False + elif match_arg_364.code == Collectivite_Code.Martinique: + _ = match_arg_364.value + temp_montant_forfaitaire_charges_d823_16_44 = True + elif match_arg_364.code == Collectivite_Code.LaReunion: + _ = match_arg_364.value + temp_montant_forfaitaire_charges_d823_16_44 = True + elif match_arg_364.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_364.value + temp_montant_forfaitaire_charges_d823_16_44 = True + elif match_arg_364.code == Collectivite_Code.SaintMartin: + _ = match_arg_364.value + temp_montant_forfaitaire_charges_d823_16_44 = True + elif match_arg_364.code == Collectivite_Code.Metropole: + _ = match_arg_364.value + temp_montant_forfaitaire_charges_d823_16_44 = False + elif match_arg_364.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_364.value + temp_montant_forfaitaire_charges_d823_16_44 = False + elif match_arg_364.code == Collectivite_Code.Mayotte: + _ = match_arg_364.value + temp_montant_forfaitaire_charges_d823_16_44 = True return (((date_courante_11 >= date_of_numbers(2020,1,1)) and (date_courante_11 < date_of_numbers(2020,10,1))) and - temp_montant_forfaitaire_charges_d823_16_64) + temp_montant_forfaitaire_charges_d823_16_44) return handle_default(SourcePosition(filename="", start_line=0, start_column=1, end_line=0, end_column=1, law_headings=[]), [], - temp_montant_forfaitaire_charges_d823_16_63, - temp_montant_forfaitaire_charges_d823_16_62) - def temp_montant_forfaitaire_charges_d823_16_65(_:Unit): - def temp_montant_forfaitaire_charges_d823_16_66(_:Unit): - if ((money_of_cents_string("3625") + + temp_montant_forfaitaire_charges_d823_16_43, + temp_montant_forfaitaire_charges_d823_16_42) + def temp_montant_forfaitaire_charges_d823_16_45(_:Unit): + def temp_montant_forfaitaire_charges_d823_16_46(_:Unit): + montant_9 = (money_of_cents_string("3625") + (money_of_cents_string("932") * - decimal_of_integer(nombre_personnes_a_charge_4))) > - (money_of_cents_string("3625") + + decimal_of_integer(nombre_personnes_a_charge_4))) + limite_6 = (money_of_cents_string("3625") + (money_of_cents_string("932") * - decimal_of_string("6.")))): - return (money_of_cents_string("3625") + - (money_of_cents_string("932") * - decimal_of_string("6."))) + decimal_of_string("6."))) + if (montant_9 > limite_6): + return limite_6 else: - return (money_of_cents_string("3625") + - (money_of_cents_string("932") * - decimal_of_integer(nombre_personnes_a_charge_4))) - def temp_montant_forfaitaire_charges_d823_16_67(_:Unit): - match_arg_375 = residence_5 - if match_arg_375.code == Collectivite_Code.Guadeloupe: - _ = match_arg_375.value - temp_montant_forfaitaire_charges_d823_16_68 = True - elif match_arg_375.code == Collectivite_Code.Guyane: - _ = match_arg_375.value - temp_montant_forfaitaire_charges_d823_16_68 = False - elif match_arg_375.code == Collectivite_Code.Martinique: - _ = match_arg_375.value - temp_montant_forfaitaire_charges_d823_16_68 = True - elif match_arg_375.code == Collectivite_Code.LaReunion: - _ = match_arg_375.value - temp_montant_forfaitaire_charges_d823_16_68 = True - elif match_arg_375.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_375.value - temp_montant_forfaitaire_charges_d823_16_68 = True - elif match_arg_375.code == Collectivite_Code.SaintMartin: - _ = match_arg_375.value - temp_montant_forfaitaire_charges_d823_16_68 = True - elif match_arg_375.code == Collectivite_Code.Metropole: - _ = match_arg_375.value - temp_montant_forfaitaire_charges_d823_16_68 = False - elif match_arg_375.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_375.value - temp_montant_forfaitaire_charges_d823_16_68 = False - elif match_arg_375.code == Collectivite_Code.Mayotte: - _ = match_arg_375.value - temp_montant_forfaitaire_charges_d823_16_68 = True + return montant_9 + def temp_montant_forfaitaire_charges_d823_16_47(_:Unit): + match_arg_365 = residence_5 + if match_arg_365.code == Collectivite_Code.Guadeloupe: + _ = match_arg_365.value + temp_montant_forfaitaire_charges_d823_16_48 = True + elif match_arg_365.code == Collectivite_Code.Guyane: + _ = match_arg_365.value + temp_montant_forfaitaire_charges_d823_16_48 = False + elif match_arg_365.code == Collectivite_Code.Martinique: + _ = match_arg_365.value + temp_montant_forfaitaire_charges_d823_16_48 = True + elif match_arg_365.code == Collectivite_Code.LaReunion: + _ = match_arg_365.value + temp_montant_forfaitaire_charges_d823_16_48 = True + elif match_arg_365.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_365.value + temp_montant_forfaitaire_charges_d823_16_48 = True + elif match_arg_365.code == Collectivite_Code.SaintMartin: + _ = match_arg_365.value + temp_montant_forfaitaire_charges_d823_16_48 = True + elif match_arg_365.code == Collectivite_Code.Metropole: + _ = match_arg_365.value + temp_montant_forfaitaire_charges_d823_16_48 = False + elif match_arg_365.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_365.value + temp_montant_forfaitaire_charges_d823_16_48 = False + elif match_arg_365.code == Collectivite_Code.Mayotte: + _ = match_arg_365.value + temp_montant_forfaitaire_charges_d823_16_48 = True return (((date_courante_11 >= date_of_numbers(2020,10,1)) and (date_courante_11 < date_of_numbers(2021,10,1))) and - temp_montant_forfaitaire_charges_d823_16_68) + temp_montant_forfaitaire_charges_d823_16_48) return handle_default(SourcePosition(filename="", start_line=0, start_column=1, end_line=0, end_column=1, law_headings=[]), [], - temp_montant_forfaitaire_charges_d823_16_67, - temp_montant_forfaitaire_charges_d823_16_66) - def temp_montant_forfaitaire_charges_d823_16_69(_:Unit): + temp_montant_forfaitaire_charges_d823_16_47, + temp_montant_forfaitaire_charges_d823_16_46) + def temp_montant_forfaitaire_charges_d823_16_49(_:Unit): try: - def temp_montant_forfaitaire_charges_d823_16_70(_:Unit): - if ((money_of_cents_string("3640") + + def temp_montant_forfaitaire_charges_d823_16_50(_:Unit): + montant_10 = (money_of_cents_string("3640") + (money_of_cents_string("936") * - decimal_of_integer(nombre_personnes_a_charge_4))) > - (money_of_cents_string("3640") + + decimal_of_integer(nombre_personnes_a_charge_4))) + limite_7 = (money_of_cents_string("3640") + (money_of_cents_string("936") * - decimal_of_string("6.")))): - return (money_of_cents_string("3640") + - (money_of_cents_string("936") * - decimal_of_string("6."))) + decimal_of_string("6."))) + if (montant_10 > limite_7): + return limite_7 else: - return (money_of_cents_string("3640") + - (money_of_cents_string("936") * - decimal_of_integer(nombre_personnes_a_charge_4))) - def temp_montant_forfaitaire_charges_d823_16_71(_:Unit): - match_arg_376 = residence_5 - if match_arg_376.code == Collectivite_Code.Guadeloupe: - _ = match_arg_376.value - temp_montant_forfaitaire_charges_d823_16_72 = True - elif match_arg_376.code == Collectivite_Code.Guyane: - _ = match_arg_376.value - temp_montant_forfaitaire_charges_d823_16_72 = False - elif match_arg_376.code == Collectivite_Code.Martinique: - _ = match_arg_376.value - temp_montant_forfaitaire_charges_d823_16_72 = True - elif match_arg_376.code == Collectivite_Code.LaReunion: - _ = match_arg_376.value - temp_montant_forfaitaire_charges_d823_16_72 = True - elif match_arg_376.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_376.value - temp_montant_forfaitaire_charges_d823_16_72 = True - elif match_arg_376.code == Collectivite_Code.SaintMartin: - _ = match_arg_376.value - temp_montant_forfaitaire_charges_d823_16_72 = True - elif match_arg_376.code == Collectivite_Code.Metropole: - _ = match_arg_376.value - temp_montant_forfaitaire_charges_d823_16_72 = False - elif match_arg_376.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_376.value - temp_montant_forfaitaire_charges_d823_16_72 = False - elif match_arg_376.code == Collectivite_Code.Mayotte: - _ = match_arg_376.value - temp_montant_forfaitaire_charges_d823_16_72 = True + return montant_10 + def temp_montant_forfaitaire_charges_d823_16_51(_:Unit): + match_arg_366 = residence_5 + if match_arg_366.code == Collectivite_Code.Guadeloupe: + _ = match_arg_366.value + temp_montant_forfaitaire_charges_d823_16_52 = True + elif match_arg_366.code == Collectivite_Code.Guyane: + _ = match_arg_366.value + temp_montant_forfaitaire_charges_d823_16_52 = False + elif match_arg_366.code == Collectivite_Code.Martinique: + _ = match_arg_366.value + temp_montant_forfaitaire_charges_d823_16_52 = True + elif match_arg_366.code == Collectivite_Code.LaReunion: + _ = match_arg_366.value + temp_montant_forfaitaire_charges_d823_16_52 = True + elif match_arg_366.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_366.value + temp_montant_forfaitaire_charges_d823_16_52 = True + elif match_arg_366.code == Collectivite_Code.SaintMartin: + _ = match_arg_366.value + temp_montant_forfaitaire_charges_d823_16_52 = True + elif match_arg_366.code == Collectivite_Code.Metropole: + _ = match_arg_366.value + temp_montant_forfaitaire_charges_d823_16_52 = False + elif match_arg_366.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_366.value + temp_montant_forfaitaire_charges_d823_16_52 = False + elif match_arg_366.code == Collectivite_Code.Mayotte: + _ = match_arg_366.value + temp_montant_forfaitaire_charges_d823_16_52 = True return (((date_courante_11 >= date_of_numbers(2021,10,1)) and (date_courante_11 < date_of_numbers(2022,1,1))) and - temp_montant_forfaitaire_charges_d823_16_72) + temp_montant_forfaitaire_charges_d823_16_52) return handle_default(SourcePosition(filename="", start_line=0, start_column=1, end_line=0, end_column=1, law_headings=[]), [], - temp_montant_forfaitaire_charges_d823_16_71, - temp_montant_forfaitaire_charges_d823_16_70) + temp_montant_forfaitaire_charges_d823_16_51, + temp_montant_forfaitaire_charges_d823_16_50) except EmptyError: - match_arg_377 = residence_5 - if match_arg_377.code == Collectivite_Code.Guadeloupe: - _ = match_arg_377.value - temp_montant_forfaitaire_charges_d823_16_73 = True - elif match_arg_377.code == Collectivite_Code.Guyane: - _ = match_arg_377.value - temp_montant_forfaitaire_charges_d823_16_73 = False - elif match_arg_377.code == Collectivite_Code.Martinique: - _ = match_arg_377.value - temp_montant_forfaitaire_charges_d823_16_73 = True - elif match_arg_377.code == Collectivite_Code.LaReunion: - _ = match_arg_377.value - temp_montant_forfaitaire_charges_d823_16_73 = True - elif match_arg_377.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_377.value - temp_montant_forfaitaire_charges_d823_16_73 = True - elif match_arg_377.code == Collectivite_Code.SaintMartin: - _ = match_arg_377.value - temp_montant_forfaitaire_charges_d823_16_73 = True - elif match_arg_377.code == Collectivite_Code.Metropole: - _ = match_arg_377.value - temp_montant_forfaitaire_charges_d823_16_73 = False - elif match_arg_377.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_377.value - temp_montant_forfaitaire_charges_d823_16_73 = False - elif match_arg_377.code == Collectivite_Code.Mayotte: - _ = match_arg_377.value - temp_montant_forfaitaire_charges_d823_16_73 = True + match_arg_367 = residence_5 + if match_arg_367.code == Collectivite_Code.Guadeloupe: + _ = match_arg_367.value + temp_montant_forfaitaire_charges_d823_16_53 = True + elif match_arg_367.code == Collectivite_Code.Guyane: + _ = match_arg_367.value + temp_montant_forfaitaire_charges_d823_16_53 = False + elif match_arg_367.code == Collectivite_Code.Martinique: + _ = match_arg_367.value + temp_montant_forfaitaire_charges_d823_16_53 = True + elif match_arg_367.code == Collectivite_Code.LaReunion: + _ = match_arg_367.value + temp_montant_forfaitaire_charges_d823_16_53 = True + elif match_arg_367.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_367.value + temp_montant_forfaitaire_charges_d823_16_53 = True + elif match_arg_367.code == Collectivite_Code.SaintMartin: + _ = match_arg_367.value + temp_montant_forfaitaire_charges_d823_16_53 = True + elif match_arg_367.code == Collectivite_Code.Metropole: + _ = match_arg_367.value + temp_montant_forfaitaire_charges_d823_16_53 = False + elif match_arg_367.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_367.value + temp_montant_forfaitaire_charges_d823_16_53 = False + elif match_arg_367.code == Collectivite_Code.Mayotte: + _ = match_arg_367.value + temp_montant_forfaitaire_charges_d823_16_53 = True if (((date_courante_11 >= date_of_numbers(2022,1,1)) and (date_courante_11 < date_of_numbers(2022,7,1))) and - temp_montant_forfaitaire_charges_d823_16_73): - if ((money_of_cents_string("3640") + + temp_montant_forfaitaire_charges_d823_16_53): + montant_11 = (money_of_cents_string("3640") + (money_of_cents_string("936") * - decimal_of_integer(nombre_personnes_a_charge_4))) > - (money_of_cents_string("3640") + + decimal_of_integer(nombre_personnes_a_charge_4))) + limite_8 = (money_of_cents_string("3640") + (money_of_cents_string("936") * - decimal_of_string("6.")))): - return (money_of_cents_string("3640") + - (money_of_cents_string("936") * - decimal_of_string("6."))) + decimal_of_string("6."))) + if (montant_11 > limite_8): + return limite_8 else: - return (money_of_cents_string("3640") + - (money_of_cents_string("936") * - decimal_of_integer(nombre_personnes_a_charge_4))) + return montant_11 else: raise EmptyError - def temp_montant_forfaitaire_charges_d823_16_74(_:Unit): - def temp_montant_forfaitaire_charges_d823_16_75(_:Unit): - if ((money_of_cents_string("3767") + + def temp_montant_forfaitaire_charges_d823_16_54(_:Unit): + def temp_montant_forfaitaire_charges_d823_16_55(_:Unit): + montant_12 = (money_of_cents_string("3767") + (money_of_cents_string("969") * - decimal_of_integer(nombre_personnes_a_charge_4))) > - (money_of_cents_string("3767") + + decimal_of_integer(nombre_personnes_a_charge_4))) + limite_9 = (money_of_cents_string("3767") + (money_of_cents_string("969") * - decimal_of_string("6.")))): - return (money_of_cents_string("3767") + - (money_of_cents_string("969") * - decimal_of_string("6."))) + decimal_of_string("6."))) + if (montant_12 > limite_9): + return limite_9 else: - return (money_of_cents_string("3767") + - (money_of_cents_string("969") * - decimal_of_integer(nombre_personnes_a_charge_4))) - def temp_montant_forfaitaire_charges_d823_16_76(_:Unit): - match_arg_378 = residence_5 - if match_arg_378.code == Collectivite_Code.Guadeloupe: - _ = match_arg_378.value - temp_montant_forfaitaire_charges_d823_16_77 = True - elif match_arg_378.code == Collectivite_Code.Guyane: - _ = match_arg_378.value - temp_montant_forfaitaire_charges_d823_16_77 = False - elif match_arg_378.code == Collectivite_Code.Martinique: - _ = match_arg_378.value - temp_montant_forfaitaire_charges_d823_16_77 = True - elif match_arg_378.code == Collectivite_Code.LaReunion: - _ = match_arg_378.value - temp_montant_forfaitaire_charges_d823_16_77 = True - elif match_arg_378.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_378.value - temp_montant_forfaitaire_charges_d823_16_77 = True - elif match_arg_378.code == Collectivite_Code.SaintMartin: - _ = match_arg_378.value - temp_montant_forfaitaire_charges_d823_16_77 = True - elif match_arg_378.code == Collectivite_Code.Metropole: - _ = match_arg_378.value - temp_montant_forfaitaire_charges_d823_16_77 = False - elif match_arg_378.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_378.value - temp_montant_forfaitaire_charges_d823_16_77 = False - elif match_arg_378.code == Collectivite_Code.Mayotte: - _ = match_arg_378.value - temp_montant_forfaitaire_charges_d823_16_77 = True + return montant_12 + def temp_montant_forfaitaire_charges_d823_16_56(_:Unit): + match_arg_368 = residence_5 + if match_arg_368.code == Collectivite_Code.Guadeloupe: + _ = match_arg_368.value + temp_montant_forfaitaire_charges_d823_16_57 = True + elif match_arg_368.code == Collectivite_Code.Guyane: + _ = match_arg_368.value + temp_montant_forfaitaire_charges_d823_16_57 = False + elif match_arg_368.code == Collectivite_Code.Martinique: + _ = match_arg_368.value + temp_montant_forfaitaire_charges_d823_16_57 = True + elif match_arg_368.code == Collectivite_Code.LaReunion: + _ = match_arg_368.value + temp_montant_forfaitaire_charges_d823_16_57 = True + elif match_arg_368.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_368.value + temp_montant_forfaitaire_charges_d823_16_57 = True + elif match_arg_368.code == Collectivite_Code.SaintMartin: + _ = match_arg_368.value + temp_montant_forfaitaire_charges_d823_16_57 = True + elif match_arg_368.code == Collectivite_Code.Metropole: + _ = match_arg_368.value + temp_montant_forfaitaire_charges_d823_16_57 = False + elif match_arg_368.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_368.value + temp_montant_forfaitaire_charges_d823_16_57 = False + elif match_arg_368.code == Collectivite_Code.Mayotte: + _ = match_arg_368.value + temp_montant_forfaitaire_charges_d823_16_57 = True return (((date_courante_11 >= date_of_numbers(2022,7,1)) and (date_courante_11 < date_of_numbers(2023,1,1))) and - temp_montant_forfaitaire_charges_d823_16_77) + temp_montant_forfaitaire_charges_d823_16_57) return handle_default(SourcePosition(filename="", start_line=0, start_column=1, end_line=0, end_column=1, law_headings=[]), [], - temp_montant_forfaitaire_charges_d823_16_76, - temp_montant_forfaitaire_charges_d823_16_75) - def temp_montant_forfaitaire_charges_d823_16_78(_:Unit): - def temp_montant_forfaitaire_charges_d823_16_79(_:Unit): + temp_montant_forfaitaire_charges_d823_16_56, + temp_montant_forfaitaire_charges_d823_16_55) + def temp_montant_forfaitaire_charges_d823_16_58(_:Unit): + def temp_montant_forfaitaire_charges_d823_16_59(_:Unit): return (money_of_cents_string("3767") + (money_of_cents_string("969") * multiplicateur_majoration_charges_d823_16)) - def temp_montant_forfaitaire_charges_d823_16_80(_:Unit): - match_arg_379 = residence_5 - if match_arg_379.code == Collectivite_Code.Guadeloupe: - _ = match_arg_379.value - temp_montant_forfaitaire_charges_d823_16_81 = True - elif match_arg_379.code == Collectivite_Code.Guyane: - _ = match_arg_379.value - temp_montant_forfaitaire_charges_d823_16_81 = False - elif match_arg_379.code == Collectivite_Code.Martinique: - _ = match_arg_379.value - temp_montant_forfaitaire_charges_d823_16_81 = True - elif match_arg_379.code == Collectivite_Code.LaReunion: - _ = match_arg_379.value - temp_montant_forfaitaire_charges_d823_16_81 = True - elif match_arg_379.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_379.value - temp_montant_forfaitaire_charges_d823_16_81 = True - elif match_arg_379.code == Collectivite_Code.SaintMartin: - _ = match_arg_379.value - temp_montant_forfaitaire_charges_d823_16_81 = True - elif match_arg_379.code == Collectivite_Code.Metropole: - _ = match_arg_379.value - temp_montant_forfaitaire_charges_d823_16_81 = False - elif match_arg_379.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_379.value - temp_montant_forfaitaire_charges_d823_16_81 = False - elif match_arg_379.code == Collectivite_Code.Mayotte: - _ = match_arg_379.value - temp_montant_forfaitaire_charges_d823_16_81 = True + def temp_montant_forfaitaire_charges_d823_16_60(_:Unit): + match_arg_369 = residence_5 + if match_arg_369.code == Collectivite_Code.Guadeloupe: + _ = match_arg_369.value + temp_montant_forfaitaire_charges_d823_16_61 = True + elif match_arg_369.code == Collectivite_Code.Guyane: + _ = match_arg_369.value + temp_montant_forfaitaire_charges_d823_16_61 = False + elif match_arg_369.code == Collectivite_Code.Martinique: + _ = match_arg_369.value + temp_montant_forfaitaire_charges_d823_16_61 = True + elif match_arg_369.code == Collectivite_Code.LaReunion: + _ = match_arg_369.value + temp_montant_forfaitaire_charges_d823_16_61 = True + elif match_arg_369.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_369.value + temp_montant_forfaitaire_charges_d823_16_61 = True + elif match_arg_369.code == Collectivite_Code.SaintMartin: + _ = match_arg_369.value + temp_montant_forfaitaire_charges_d823_16_61 = True + elif match_arg_369.code == Collectivite_Code.Metropole: + _ = match_arg_369.value + temp_montant_forfaitaire_charges_d823_16_61 = False + elif match_arg_369.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_369.value + temp_montant_forfaitaire_charges_d823_16_61 = False + elif match_arg_369.code == Collectivite_Code.Mayotte: + _ = match_arg_369.value + temp_montant_forfaitaire_charges_d823_16_61 = True return ((date_courante_11 >= date_of_numbers(2023,1,1)) and - temp_montant_forfaitaire_charges_d823_16_81) + temp_montant_forfaitaire_charges_d823_16_61) return handle_default(SourcePosition(filename="", start_line=0, start_column=1, end_line=0, end_column=1, law_headings=[]), [], - temp_montant_forfaitaire_charges_d823_16_80, - temp_montant_forfaitaire_charges_d823_16_79) - temp_montant_forfaitaire_charges_d823_16_44 = handle_default( + temp_montant_forfaitaire_charges_d823_16_60, + temp_montant_forfaitaire_charges_d823_16_59) + temp_montant_forfaitaire_charges_d823_16_24 = handle_default( SourcePosition(filename="", start_line=0, start_column=1, end_line=0, end_column=1, - law_headings=[]), [temp_montant_forfaitaire_charges_d823_16_78, - temp_montant_forfaitaire_charges_d823_16_74, - temp_montant_forfaitaire_charges_d823_16_69, - temp_montant_forfaitaire_charges_d823_16_65, - temp_montant_forfaitaire_charges_d823_16_61], - temp_montant_forfaitaire_charges_d823_16_60, - temp_montant_forfaitaire_charges_d823_16_59) + law_headings=[]), [temp_montant_forfaitaire_charges_d823_16_58, + temp_montant_forfaitaire_charges_d823_16_54, + temp_montant_forfaitaire_charges_d823_16_49, + temp_montant_forfaitaire_charges_d823_16_45, + temp_montant_forfaitaire_charges_d823_16_41], + temp_montant_forfaitaire_charges_d823_16_40, + temp_montant_forfaitaire_charges_d823_16_39) except EmptyError: - def temp_montant_forfaitaire_charges_d823_16_82(_:Unit): + def temp_montant_forfaitaire_charges_d823_16_62(_:Unit): raise EmptyError - def temp_montant_forfaitaire_charges_d823_16_83(_:Unit): + def temp_montant_forfaitaire_charges_d823_16_63(_:Unit): return False - def temp_montant_forfaitaire_charges_d823_16_84(_:Unit): - def temp_montant_forfaitaire_charges_d823_16_85(_:Unit): + def temp_montant_forfaitaire_charges_d823_16_64(_:Unit): + def temp_montant_forfaitaire_charges_d823_16_65(_:Unit): return (money_of_cents_string("5399") + (money_of_cents_string("1224") * multiplicateur_majoration_charges_d823_16)) - def temp_montant_forfaitaire_charges_d823_16_86(_:Unit): + def temp_montant_forfaitaire_charges_d823_16_66(_:Unit): return ((date_courante_11 < date_of_numbers(2021,10,1)) and (date_courante_11 >= date_of_numbers(2020,10,1))) @@ -12890,14 +12781,14 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen start_line=0, start_column=1, end_line=0, end_column=1, law_headings=[]), [], - temp_montant_forfaitaire_charges_d823_16_86, - temp_montant_forfaitaire_charges_d823_16_85) - def temp_montant_forfaitaire_charges_d823_16_87(_:Unit): - def temp_montant_forfaitaire_charges_d823_16_88(_:Unit): + temp_montant_forfaitaire_charges_d823_16_66, + temp_montant_forfaitaire_charges_d823_16_65) + def temp_montant_forfaitaire_charges_d823_16_67(_:Unit): + def temp_montant_forfaitaire_charges_d823_16_68(_:Unit): return (money_of_cents_string("5422") + (money_of_cents_string("1229") * multiplicateur_majoration_charges_d823_16)) - def temp_montant_forfaitaire_charges_d823_16_89(_:Unit): + def temp_montant_forfaitaire_charges_d823_16_69(_:Unit): return ((date_courante_11 >= date_of_numbers(2021,10,1)) and (date_courante_11 < date_of_numbers(2022,7,1))) @@ -12905,31 +12796,31 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen start_line=0, start_column=1, end_line=0, end_column=1, law_headings=[]), [], - temp_montant_forfaitaire_charges_d823_16_89, - temp_montant_forfaitaire_charges_d823_16_88) - def temp_montant_forfaitaire_charges_d823_16_90(_:Unit): - def temp_montant_forfaitaire_charges_d823_16_91(_:Unit): + temp_montant_forfaitaire_charges_d823_16_69, + temp_montant_forfaitaire_charges_d823_16_68) + def temp_montant_forfaitaire_charges_d823_16_70(_:Unit): + def temp_montant_forfaitaire_charges_d823_16_71(_:Unit): return (money_of_cents_string("5612") + (money_of_cents_string("1272") * multiplicateur_majoration_charges_d823_16)) - def temp_montant_forfaitaire_charges_d823_16_92(_:Unit): + def temp_montant_forfaitaire_charges_d823_16_72(_:Unit): return (date_courante_11 >= date_of_numbers(2022,7,1)) return handle_default(SourcePosition(filename="", start_line=0, start_column=1, end_line=0, end_column=1, law_headings=[]), [], - temp_montant_forfaitaire_charges_d823_16_92, - temp_montant_forfaitaire_charges_d823_16_91) - temp_montant_forfaitaire_charges_d823_16_44 = handle_default( + temp_montant_forfaitaire_charges_d823_16_72, + temp_montant_forfaitaire_charges_d823_16_71) + temp_montant_forfaitaire_charges_d823_16_24 = handle_default( SourcePosition(filename="", start_line=0, start_column=1, end_line=0, end_column=1, - law_headings=[]), [temp_montant_forfaitaire_charges_d823_16_90, - temp_montant_forfaitaire_charges_d823_16_87, - temp_montant_forfaitaire_charges_d823_16_84], - temp_montant_forfaitaire_charges_d823_16_83, - temp_montant_forfaitaire_charges_d823_16_82) + law_headings=[]), [temp_montant_forfaitaire_charges_d823_16_70, + temp_montant_forfaitaire_charges_d823_16_67, + temp_montant_forfaitaire_charges_d823_16_64], + temp_montant_forfaitaire_charges_d823_16_63, + temp_montant_forfaitaire_charges_d823_16_62) except EmptyError: - temp_montant_forfaitaire_charges_d823_16_44 = dead_value + temp_montant_forfaitaire_charges_d823_16_24 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", start_line=560, start_column=12, end_line=560, end_column=47, @@ -12937,7 +12828,7 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen "Calcul du montant de l'aide personnalisée au logement", "Déclarations des champs d'application", "Prologue : aides au logement"])) - montant_forfaitaire_charges_d823_16 = temp_montant_forfaitaire_charges_d823_16_44 + montant_forfaitaire_charges_d823_16 = temp_montant_forfaitaire_charges_d823_16_24 try: def temp_abattement_forfaitaire_d823_17(_:Unit): def temp_abattement_forfaitaire_d823_17_1(_:Unit): @@ -12948,12 +12839,12 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen def temp_abattement_forfaitaire_d823_17_4(_:Unit): if (nombre_personnes_a_charge_4 == integer_of_string("0")): - match_arg_380 = situation_familiale_calcul_apl_4 - if match_arg_380.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_380.value + match_arg_370 = situation_familiale_calcul_apl_4 + if match_arg_370.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_370.value return money_of_cents_string("458800") - elif match_arg_380.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_380.value + elif match_arg_370.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_370.value return money_of_cents_string("657200") else: if (nombre_personnes_a_charge_4 == @@ -12998,12 +12889,12 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen def temp_abattement_forfaitaire_d823_17_7(_:Unit): if (nombre_personnes_a_charge_4 == integer_of_string("0")): - match_arg_381 = situation_familiale_calcul_apl_4 - if match_arg_381.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_381.value + match_arg_371 = situation_familiale_calcul_apl_4 + if match_arg_371.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_371.value return money_of_cents_string("468300") - elif match_arg_381.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_381.value + elif match_arg_371.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_371.value return money_of_cents_string("670900") else: if (nombre_personnes_a_charge_4 == @@ -13047,12 +12938,12 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen def temp_abattement_forfaitaire_d823_17_10(_:Unit): if (nombre_personnes_a_charge_4 == integer_of_string("0")): - match_arg_382 = situation_familiale_calcul_apl_4 - if match_arg_382.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_382.value + match_arg_372 = situation_familiale_calcul_apl_4 + if match_arg_372.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_372.value return money_of_cents_string("487000") - elif match_arg_382.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_382.value + elif match_arg_372.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_372.value return money_of_cents_string("697700") else: if (nombre_personnes_a_charge_4 == @@ -13096,12 +12987,12 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen def temp_abattement_forfaitaire_d823_17_13(_:Unit): if (nombre_personnes_a_charge_4 == integer_of_string("0")): - match_arg_383 = situation_familiale_calcul_apl_4 - if match_arg_383.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_383.value + match_arg_373 = situation_familiale_calcul_apl_4 + if match_arg_373.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_373.value return money_of_cents_string("494900") - elif match_arg_383.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_383.value + elif match_arg_373.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_373.value return money_of_cents_string("709000") else: if (nombre_personnes_a_charge_4 == @@ -13158,33 +13049,33 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen def temp_abattement_forfaitaire_d823_17_20(_:Unit): return money_of_cents_string("758400") def temp_abattement_forfaitaire_d823_17_21(_:Unit): - match_arg_384 = residence_5 - if match_arg_384.code == Collectivite_Code.Guadeloupe: - _ = match_arg_384.value + match_arg_374 = residence_5 + if match_arg_374.code == Collectivite_Code.Guadeloupe: + _ = match_arg_374.value temp_abattement_forfaitaire_d823_17_22 = True - elif match_arg_384.code == Collectivite_Code.Guyane: - _ = match_arg_384.value + elif match_arg_374.code == Collectivite_Code.Guyane: + _ = match_arg_374.value temp_abattement_forfaitaire_d823_17_22 = False - elif match_arg_384.code == Collectivite_Code.Martinique: - _ = match_arg_384.value + elif match_arg_374.code == Collectivite_Code.Martinique: + _ = match_arg_374.value temp_abattement_forfaitaire_d823_17_22 = True - elif match_arg_384.code == Collectivite_Code.LaReunion: - _ = match_arg_384.value + elif match_arg_374.code == Collectivite_Code.LaReunion: + _ = match_arg_374.value temp_abattement_forfaitaire_d823_17_22 = True - elif match_arg_384.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_384.value + elif match_arg_374.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_374.value temp_abattement_forfaitaire_d823_17_22 = True - elif match_arg_384.code == Collectivite_Code.SaintMartin: - _ = match_arg_384.value + elif match_arg_374.code == Collectivite_Code.SaintMartin: + _ = match_arg_374.value temp_abattement_forfaitaire_d823_17_22 = True - elif match_arg_384.code == Collectivite_Code.Metropole: - _ = match_arg_384.value + elif match_arg_374.code == Collectivite_Code.Metropole: + _ = match_arg_374.value temp_abattement_forfaitaire_d823_17_22 = False - elif match_arg_384.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_384.value + elif match_arg_374.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_374.value temp_abattement_forfaitaire_d823_17_22 = False - elif match_arg_384.code == Collectivite_Code.Mayotte: - _ = match_arg_384.value + elif match_arg_374.code == Collectivite_Code.Mayotte: + _ = match_arg_374.value temp_abattement_forfaitaire_d823_17_22 = True return (((date_courante_11 >= date_of_numbers(2020,1,1)) and (date_courante_11 < @@ -13202,33 +13093,33 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen def temp_abattement_forfaitaire_d823_17_24(_:Unit): return money_of_cents_string("774200") def temp_abattement_forfaitaire_d823_17_25(_:Unit): - match_arg_385 = residence_5 - if match_arg_385.code == Collectivite_Code.Guadeloupe: - _ = match_arg_385.value + match_arg_375 = residence_5 + if match_arg_375.code == Collectivite_Code.Guadeloupe: + _ = match_arg_375.value temp_abattement_forfaitaire_d823_17_26 = True - elif match_arg_385.code == Collectivite_Code.Guyane: - _ = match_arg_385.value + elif match_arg_375.code == Collectivite_Code.Guyane: + _ = match_arg_375.value temp_abattement_forfaitaire_d823_17_26 = False - elif match_arg_385.code == Collectivite_Code.Martinique: - _ = match_arg_385.value + elif match_arg_375.code == Collectivite_Code.Martinique: + _ = match_arg_375.value temp_abattement_forfaitaire_d823_17_26 = True - elif match_arg_385.code == Collectivite_Code.LaReunion: - _ = match_arg_385.value + elif match_arg_375.code == Collectivite_Code.LaReunion: + _ = match_arg_375.value temp_abattement_forfaitaire_d823_17_26 = True - elif match_arg_385.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_385.value + elif match_arg_375.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_375.value temp_abattement_forfaitaire_d823_17_26 = True - elif match_arg_385.code == Collectivite_Code.SaintMartin: - _ = match_arg_385.value + elif match_arg_375.code == Collectivite_Code.SaintMartin: + _ = match_arg_375.value temp_abattement_forfaitaire_d823_17_26 = True - elif match_arg_385.code == Collectivite_Code.Metropole: - _ = match_arg_385.value + elif match_arg_375.code == Collectivite_Code.Metropole: + _ = match_arg_375.value temp_abattement_forfaitaire_d823_17_26 = False - elif match_arg_385.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_385.value + elif match_arg_375.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_375.value temp_abattement_forfaitaire_d823_17_26 = False - elif match_arg_385.code == Collectivite_Code.Mayotte: - _ = match_arg_385.value + elif match_arg_375.code == Collectivite_Code.Mayotte: + _ = match_arg_375.value temp_abattement_forfaitaire_d823_17_26 = True return (((date_courante_11 >= date_of_numbers(2022,1,1)) and (date_courante_11 < @@ -13246,12 +13137,12 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen def temp_abattement_forfaitaire_d823_17_28(_:Unit): if (nombre_personnes_a_charge_4 == integer_of_string("0")): - match_arg_386 = situation_familiale_calcul_apl_4 - if match_arg_386.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_386.value + match_arg_376 = situation_familiale_calcul_apl_4 + if match_arg_376.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_376.value return money_of_cents_string("487000") - elif match_arg_386.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_386.value + elif match_arg_376.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_376.value return money_of_cents_string("697700") else: if (nombre_personnes_a_charge_4 == @@ -13283,33 +13174,33 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen decimal_of_integer((nombre_personnes_a_charge_4 - integer_of_string("6"))))) def temp_abattement_forfaitaire_d823_17_29(_:Unit): - match_arg_387 = residence_5 - if match_arg_387.code == Collectivite_Code.Guadeloupe: - _ = match_arg_387.value + match_arg_377 = residence_5 + if match_arg_377.code == Collectivite_Code.Guadeloupe: + _ = match_arg_377.value temp_abattement_forfaitaire_d823_17_30 = False - elif match_arg_387.code == Collectivite_Code.Guyane: - _ = match_arg_387.value + elif match_arg_377.code == Collectivite_Code.Guyane: + _ = match_arg_377.value temp_abattement_forfaitaire_d823_17_30 = False - elif match_arg_387.code == Collectivite_Code.Martinique: - _ = match_arg_387.value + elif match_arg_377.code == Collectivite_Code.Martinique: + _ = match_arg_377.value temp_abattement_forfaitaire_d823_17_30 = False - elif match_arg_387.code == Collectivite_Code.LaReunion: - _ = match_arg_387.value + elif match_arg_377.code == Collectivite_Code.LaReunion: + _ = match_arg_377.value temp_abattement_forfaitaire_d823_17_30 = False - elif match_arg_387.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_387.value + elif match_arg_377.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_377.value temp_abattement_forfaitaire_d823_17_30 = False - elif match_arg_387.code == Collectivite_Code.SaintMartin: - _ = match_arg_387.value + elif match_arg_377.code == Collectivite_Code.SaintMartin: + _ = match_arg_377.value temp_abattement_forfaitaire_d823_17_30 = False - elif match_arg_387.code == Collectivite_Code.Metropole: - _ = match_arg_387.value + elif match_arg_377.code == Collectivite_Code.Metropole: + _ = match_arg_377.value temp_abattement_forfaitaire_d823_17_30 = False - elif match_arg_387.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_387.value + elif match_arg_377.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_377.value temp_abattement_forfaitaire_d823_17_30 = True - elif match_arg_387.code == Collectivite_Code.Mayotte: - _ = match_arg_387.value + elif match_arg_377.code == Collectivite_Code.Mayotte: + _ = match_arg_377.value temp_abattement_forfaitaire_d823_17_30 = False return (((date_courante_11 >= date_of_numbers(2022,7,1)) and (date_courante_11 < @@ -13325,33 +13216,33 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen def temp_abattement_forfaitaire_d823_17_32(_:Unit): return money_of_cents_string("805100") def temp_abattement_forfaitaire_d823_17_33(_:Unit): - match_arg_388 = residence_5 - if match_arg_388.code == Collectivite_Code.Guadeloupe: - _ = match_arg_388.value + match_arg_378 = residence_5 + if match_arg_378.code == Collectivite_Code.Guadeloupe: + _ = match_arg_378.value temp_abattement_forfaitaire_d823_17_34 = True - elif match_arg_388.code == Collectivite_Code.Guyane: - _ = match_arg_388.value + elif match_arg_378.code == Collectivite_Code.Guyane: + _ = match_arg_378.value temp_abattement_forfaitaire_d823_17_34 = False - elif match_arg_388.code == Collectivite_Code.Martinique: - _ = match_arg_388.value + elif match_arg_378.code == Collectivite_Code.Martinique: + _ = match_arg_378.value temp_abattement_forfaitaire_d823_17_34 = True - elif match_arg_388.code == Collectivite_Code.LaReunion: - _ = match_arg_388.value + elif match_arg_378.code == Collectivite_Code.LaReunion: + _ = match_arg_378.value temp_abattement_forfaitaire_d823_17_34 = True - elif match_arg_388.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_388.value + elif match_arg_378.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_378.value temp_abattement_forfaitaire_d823_17_34 = True - elif match_arg_388.code == Collectivite_Code.SaintMartin: - _ = match_arg_388.value + elif match_arg_378.code == Collectivite_Code.SaintMartin: + _ = match_arg_378.value temp_abattement_forfaitaire_d823_17_34 = True - elif match_arg_388.code == Collectivite_Code.Metropole: - _ = match_arg_388.value + elif match_arg_378.code == Collectivite_Code.Metropole: + _ = match_arg_378.value temp_abattement_forfaitaire_d823_17_34 = False - elif match_arg_388.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_388.value + elif match_arg_378.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_378.value temp_abattement_forfaitaire_d823_17_34 = False - elif match_arg_388.code == Collectivite_Code.Mayotte: - _ = match_arg_388.value + elif match_arg_378.code == Collectivite_Code.Mayotte: + _ = match_arg_378.value temp_abattement_forfaitaire_d823_17_34 = True return (((date_courante_11 >= date_of_numbers(2022,7,1)) and (date_courante_11 < @@ -13369,12 +13260,12 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen def temp_abattement_forfaitaire_d823_17_36(_:Unit): if (nombre_personnes_a_charge_4 == integer_of_string("0")): - match_arg_389 = situation_familiale_calcul_apl_4 - if match_arg_389.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_389.value + match_arg_379 = situation_familiale_calcul_apl_4 + if match_arg_379.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_379.value return money_of_cents_string("527200") - elif match_arg_389.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_389.value + elif match_arg_379.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_379.value return money_of_cents_string("755200") else: if (nombre_personnes_a_charge_4 == @@ -13406,33 +13297,33 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen decimal_of_integer((nombre_personnes_a_charge_4 - integer_of_string("6"))))) def temp_abattement_forfaitaire_d823_17_37(_:Unit): - match_arg_390 = residence_5 - if match_arg_390.code == Collectivite_Code.Guadeloupe: - _ = match_arg_390.value + match_arg_380 = residence_5 + if match_arg_380.code == Collectivite_Code.Guadeloupe: + _ = match_arg_380.value temp_abattement_forfaitaire_d823_17_38 = False - elif match_arg_390.code == Collectivite_Code.Guyane: - _ = match_arg_390.value + elif match_arg_380.code == Collectivite_Code.Guyane: + _ = match_arg_380.value temp_abattement_forfaitaire_d823_17_38 = False - elif match_arg_390.code == Collectivite_Code.Martinique: - _ = match_arg_390.value + elif match_arg_380.code == Collectivite_Code.Martinique: + _ = match_arg_380.value temp_abattement_forfaitaire_d823_17_38 = False - elif match_arg_390.code == Collectivite_Code.LaReunion: - _ = match_arg_390.value + elif match_arg_380.code == Collectivite_Code.LaReunion: + _ = match_arg_380.value temp_abattement_forfaitaire_d823_17_38 = False - elif match_arg_390.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_390.value + elif match_arg_380.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_380.value temp_abattement_forfaitaire_d823_17_38 = False - elif match_arg_390.code == Collectivite_Code.SaintMartin: - _ = match_arg_390.value + elif match_arg_380.code == Collectivite_Code.SaintMartin: + _ = match_arg_380.value temp_abattement_forfaitaire_d823_17_38 = False - elif match_arg_390.code == Collectivite_Code.Metropole: - _ = match_arg_390.value + elif match_arg_380.code == Collectivite_Code.Metropole: + _ = match_arg_380.value temp_abattement_forfaitaire_d823_17_38 = False - elif match_arg_390.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_390.value + elif match_arg_380.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_380.value temp_abattement_forfaitaire_d823_17_38 = True - elif match_arg_390.code == Collectivite_Code.Mayotte: - _ = match_arg_390.value + elif match_arg_380.code == Collectivite_Code.Mayotte: + _ = match_arg_380.value temp_abattement_forfaitaire_d823_17_38 = False return ((date_courante_11 >= date_of_numbers(2023,1,1)) and @@ -13447,33 +13338,33 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen def temp_abattement_forfaitaire_d823_17_40(_:Unit): return money_of_cents_string("818100") def temp_abattement_forfaitaire_d823_17_41(_:Unit): - match_arg_391 = residence_5 - if match_arg_391.code == Collectivite_Code.Guadeloupe: - _ = match_arg_391.value + match_arg_381 = residence_5 + if match_arg_381.code == Collectivite_Code.Guadeloupe: + _ = match_arg_381.value temp_abattement_forfaitaire_d823_17_42 = True - elif match_arg_391.code == Collectivite_Code.Guyane: - _ = match_arg_391.value + elif match_arg_381.code == Collectivite_Code.Guyane: + _ = match_arg_381.value temp_abattement_forfaitaire_d823_17_42 = False - elif match_arg_391.code == Collectivite_Code.Martinique: - _ = match_arg_391.value + elif match_arg_381.code == Collectivite_Code.Martinique: + _ = match_arg_381.value temp_abattement_forfaitaire_d823_17_42 = True - elif match_arg_391.code == Collectivite_Code.LaReunion: - _ = match_arg_391.value + elif match_arg_381.code == Collectivite_Code.LaReunion: + _ = match_arg_381.value temp_abattement_forfaitaire_d823_17_42 = True - elif match_arg_391.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_391.value + elif match_arg_381.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_381.value temp_abattement_forfaitaire_d823_17_42 = True - elif match_arg_391.code == Collectivite_Code.SaintMartin: - _ = match_arg_391.value + elif match_arg_381.code == Collectivite_Code.SaintMartin: + _ = match_arg_381.value temp_abattement_forfaitaire_d823_17_42 = True - elif match_arg_391.code == Collectivite_Code.Metropole: - _ = match_arg_391.value + elif match_arg_381.code == Collectivite_Code.Metropole: + _ = match_arg_381.value temp_abattement_forfaitaire_d823_17_42 = False - elif match_arg_391.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_391.value + elif match_arg_381.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_381.value temp_abattement_forfaitaire_d823_17_42 = False - elif match_arg_391.code == Collectivite_Code.Mayotte: - _ = match_arg_391.value + elif match_arg_381.code == Collectivite_Code.Mayotte: + _ = match_arg_381.value temp_abattement_forfaitaire_d823_17_42 = True return ((date_courante_11 >= date_of_numbers(2023,1,1)) and @@ -13506,12 +13397,12 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen def temp_abattement_forfaitaire_d823_17_47(_:Unit): if (nombre_personnes_a_charge_4 == integer_of_string("0")): - match_arg_392 = situation_familiale_calcul_apl_4 - if match_arg_392.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_392.value + match_arg_382 = situation_familiale_calcul_apl_4 + if match_arg_382.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_382.value return money_of_cents_string("396000") - elif match_arg_392.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_392.value + elif match_arg_382.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_382.value return money_of_cents_string("567300") else: if (nombre_personnes_a_charge_4 == @@ -13536,33 +13427,33 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen else: return money_of_cents_string("903200") def temp_abattement_forfaitaire_d823_17_48(_:Unit): - match_arg_393 = residence_5 - if match_arg_393.code == Collectivite_Code.Guadeloupe: - _ = match_arg_393.value + match_arg_383 = residence_5 + if match_arg_383.code == Collectivite_Code.Guadeloupe: + _ = match_arg_383.value temp_abattement_forfaitaire_d823_17_49 = False - elif match_arg_393.code == Collectivite_Code.Guyane: - _ = match_arg_393.value + elif match_arg_383.code == Collectivite_Code.Guyane: + _ = match_arg_383.value temp_abattement_forfaitaire_d823_17_49 = False - elif match_arg_393.code == Collectivite_Code.Martinique: - _ = match_arg_393.value + elif match_arg_383.code == Collectivite_Code.Martinique: + _ = match_arg_383.value temp_abattement_forfaitaire_d823_17_49 = False - elif match_arg_393.code == Collectivite_Code.LaReunion: - _ = match_arg_393.value + elif match_arg_383.code == Collectivite_Code.LaReunion: + _ = match_arg_383.value temp_abattement_forfaitaire_d823_17_49 = False - elif match_arg_393.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_393.value + elif match_arg_383.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_383.value temp_abattement_forfaitaire_d823_17_49 = False - elif match_arg_393.code == Collectivite_Code.SaintMartin: - _ = match_arg_393.value + elif match_arg_383.code == Collectivite_Code.SaintMartin: + _ = match_arg_383.value temp_abattement_forfaitaire_d823_17_49 = False - elif match_arg_393.code == Collectivite_Code.Metropole: - _ = match_arg_393.value + elif match_arg_383.code == Collectivite_Code.Metropole: + _ = match_arg_383.value temp_abattement_forfaitaire_d823_17_49 = False - elif match_arg_393.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_393.value + elif match_arg_383.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_383.value temp_abattement_forfaitaire_d823_17_49 = False - elif match_arg_393.code == Collectivite_Code.Mayotte: - _ = match_arg_393.value + elif match_arg_383.code == Collectivite_Code.Mayotte: + _ = match_arg_383.value temp_abattement_forfaitaire_d823_17_49 = True return (((date_courante_11 >= date_of_numbers(2020,1,1)) and @@ -13579,12 +13470,12 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen def temp_abattement_forfaitaire_d823_17_51(_:Unit): if (nombre_personnes_a_charge_4 == integer_of_string("0")): - match_arg_394 = situation_familiale_calcul_apl_4 - if match_arg_394.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_394.value + match_arg_384 = situation_familiale_calcul_apl_4 + if match_arg_384.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_384.value return money_of_cents_string("427400") - elif match_arg_394.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_394.value + elif match_arg_384.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_384.value return money_of_cents_string("612200") else: if (nombre_personnes_a_charge_4 == @@ -13609,33 +13500,33 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen else: return money_of_cents_string("913900") def temp_abattement_forfaitaire_d823_17_52(_:Unit): - match_arg_395 = residence_5 - if match_arg_395.code == Collectivite_Code.Guadeloupe: - _ = match_arg_395.value + match_arg_385 = residence_5 + if match_arg_385.code == Collectivite_Code.Guadeloupe: + _ = match_arg_385.value temp_abattement_forfaitaire_d823_17_53 = False - elif match_arg_395.code == Collectivite_Code.Guyane: - _ = match_arg_395.value + elif match_arg_385.code == Collectivite_Code.Guyane: + _ = match_arg_385.value temp_abattement_forfaitaire_d823_17_53 = False - elif match_arg_395.code == Collectivite_Code.Martinique: - _ = match_arg_395.value + elif match_arg_385.code == Collectivite_Code.Martinique: + _ = match_arg_385.value temp_abattement_forfaitaire_d823_17_53 = False - elif match_arg_395.code == Collectivite_Code.LaReunion: - _ = match_arg_395.value + elif match_arg_385.code == Collectivite_Code.LaReunion: + _ = match_arg_385.value temp_abattement_forfaitaire_d823_17_53 = False - elif match_arg_395.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_395.value + elif match_arg_385.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_385.value temp_abattement_forfaitaire_d823_17_53 = False - elif match_arg_395.code == Collectivite_Code.SaintMartin: - _ = match_arg_395.value + elif match_arg_385.code == Collectivite_Code.SaintMartin: + _ = match_arg_385.value temp_abattement_forfaitaire_d823_17_53 = False - elif match_arg_395.code == Collectivite_Code.Metropole: - _ = match_arg_395.value + elif match_arg_385.code == Collectivite_Code.Metropole: + _ = match_arg_385.value temp_abattement_forfaitaire_d823_17_53 = False - elif match_arg_395.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_395.value + elif match_arg_385.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_385.value temp_abattement_forfaitaire_d823_17_53 = False - elif match_arg_395.code == Collectivite_Code.Mayotte: - _ = match_arg_395.value + elif match_arg_385.code == Collectivite_Code.Mayotte: + _ = match_arg_385.value temp_abattement_forfaitaire_d823_17_53 = True return (((date_courante_11 >= date_of_numbers(2021,1,1)) and @@ -13660,33 +13551,33 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen def temp_abattement_forfaitaire_d823_17_54(_:Unit): return money_of_cents_string("758400") def temp_abattement_forfaitaire_d823_17_55(_:Unit): - match_arg_396 = residence_5 - if match_arg_396.code == Collectivite_Code.Guadeloupe: - _ = match_arg_396.value + match_arg_386 = residence_5 + if match_arg_386.code == Collectivite_Code.Guadeloupe: + _ = match_arg_386.value temp_abattement_forfaitaire_d823_17_56 = True - elif match_arg_396.code == Collectivite_Code.Guyane: - _ = match_arg_396.value + elif match_arg_386.code == Collectivite_Code.Guyane: + _ = match_arg_386.value temp_abattement_forfaitaire_d823_17_56 = False - elif match_arg_396.code == Collectivite_Code.Martinique: - _ = match_arg_396.value + elif match_arg_386.code == Collectivite_Code.Martinique: + _ = match_arg_386.value temp_abattement_forfaitaire_d823_17_56 = True - elif match_arg_396.code == Collectivite_Code.LaReunion: - _ = match_arg_396.value + elif match_arg_386.code == Collectivite_Code.LaReunion: + _ = match_arg_386.value temp_abattement_forfaitaire_d823_17_56 = True - elif match_arg_396.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_396.value + elif match_arg_386.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_386.value temp_abattement_forfaitaire_d823_17_56 = True - elif match_arg_396.code == Collectivite_Code.SaintMartin: - _ = match_arg_396.value + elif match_arg_386.code == Collectivite_Code.SaintMartin: + _ = match_arg_386.value temp_abattement_forfaitaire_d823_17_56 = True - elif match_arg_396.code == Collectivite_Code.Metropole: - _ = match_arg_396.value + elif match_arg_386.code == Collectivite_Code.Metropole: + _ = match_arg_386.value temp_abattement_forfaitaire_d823_17_56 = False - elif match_arg_396.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_396.value + elif match_arg_386.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_386.value temp_abattement_forfaitaire_d823_17_56 = False - elif match_arg_396.code == Collectivite_Code.Mayotte: - _ = match_arg_396.value + elif match_arg_386.code == Collectivite_Code.Mayotte: + _ = match_arg_386.value temp_abattement_forfaitaire_d823_17_56 = True return (((date_courante_11 >= date_of_numbers(2020,10,1)) and @@ -13702,33 +13593,33 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen temp_abattement_forfaitaire_d823_17_55, temp_abattement_forfaitaire_d823_17_54) except EmptyError: - match_arg_397 = residence_5 - if match_arg_397.code == Collectivite_Code.Guadeloupe: - _ = match_arg_397.value + match_arg_387 = residence_5 + if match_arg_387.code == Collectivite_Code.Guadeloupe: + _ = match_arg_387.value temp_abattement_forfaitaire_d823_17_57 = True - elif match_arg_397.code == Collectivite_Code.Guyane: - _ = match_arg_397.value + elif match_arg_387.code == Collectivite_Code.Guyane: + _ = match_arg_387.value temp_abattement_forfaitaire_d823_17_57 = False - elif match_arg_397.code == Collectivite_Code.Martinique: - _ = match_arg_397.value + elif match_arg_387.code == Collectivite_Code.Martinique: + _ = match_arg_387.value temp_abattement_forfaitaire_d823_17_57 = True - elif match_arg_397.code == Collectivite_Code.LaReunion: - _ = match_arg_397.value + elif match_arg_387.code == Collectivite_Code.LaReunion: + _ = match_arg_387.value temp_abattement_forfaitaire_d823_17_57 = True - elif match_arg_397.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_397.value + elif match_arg_387.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_387.value temp_abattement_forfaitaire_d823_17_57 = True - elif match_arg_397.code == Collectivite_Code.SaintMartin: - _ = match_arg_397.value + elif match_arg_387.code == Collectivite_Code.SaintMartin: + _ = match_arg_387.value temp_abattement_forfaitaire_d823_17_57 = True - elif match_arg_397.code == Collectivite_Code.Metropole: - _ = match_arg_397.value + elif match_arg_387.code == Collectivite_Code.Metropole: + _ = match_arg_387.value temp_abattement_forfaitaire_d823_17_57 = False - elif match_arg_397.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_397.value + elif match_arg_387.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_387.value temp_abattement_forfaitaire_d823_17_57 = False - elif match_arg_397.code == Collectivite_Code.Mayotte: - _ = match_arg_397.value + elif match_arg_387.code == Collectivite_Code.Mayotte: + _ = match_arg_387.value temp_abattement_forfaitaire_d823_17_57 = True if (((date_courante_11 >= date_of_numbers(2021,10,1)) and (date_courante_11 < date_of_numbers(2022,1,1))) and @@ -13765,12 +13656,12 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen def temp_loyer_reference_3(_:Unit): if (nombre_personnes_a_charge_4 == integer_of_string("0")): - match_arg_398 = situation_familiale_calcul_apl_4 - if match_arg_398.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_398.value + match_arg_388 = situation_familiale_calcul_apl_4 + if match_arg_388.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_388.value return money_of_cents_string("25869") - elif match_arg_398.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_398.value + elif match_arg_388.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_388.value return money_of_cents_string("31664") else: return (money_of_cents_string("35630") + @@ -13788,12 +13679,12 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen def temp_loyer_reference_6(_:Unit): if (nombre_personnes_a_charge_4 == integer_of_string("0")): - match_arg_399 = situation_familiale_calcul_apl_4 - if match_arg_399.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_399.value + match_arg_389 = situation_familiale_calcul_apl_4 + if match_arg_389.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_389.value return money_of_cents_string("25978") - elif match_arg_399.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_399.value + elif match_arg_389.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_389.value return money_of_cents_string("31797") else: return (money_of_cents_string("35780") + @@ -13811,12 +13702,12 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen def temp_loyer_reference_9(_:Unit): if (nombre_personnes_a_charge_4 == integer_of_string("0")): - match_arg_400 = situation_familiale_calcul_apl_4 - if match_arg_400.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_400.value + match_arg_390 = situation_familiale_calcul_apl_4 + if match_arg_390.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_390.value return money_of_cents_string("26887") - elif match_arg_400.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_400.value + elif match_arg_390.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_390.value return money_of_cents_string("32910") else: return (money_of_cents_string("37032") + @@ -13856,19 +13747,19 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen return False def temp_plafond_loyer_d823_16_2_3(_:Unit): def temp_plafond_loyer_d823_16_2_4(_:Unit): - match_arg_401 = zone_2 - if match_arg_401.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_401.value + match_arg_391 = zone_2 + if match_arg_391.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_391.value return (money_of_cents_string("40460") + (money_of_cents_string("5870") * multiplicateur_majoration_plafond_loyer_d823_16_2)) - elif match_arg_401.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_401.value + elif match_arg_391.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_391.value return (money_of_cents_string("35630") + (money_of_cents_string("5186") * multiplicateur_majoration_plafond_loyer_d823_16_2)) - elif match_arg_401.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_401.value + elif match_arg_391.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_391.value return (money_of_cents_string("32956") + (money_of_cents_string("4723") * multiplicateur_majoration_plafond_loyer_d823_16_2)) @@ -13886,23 +13777,23 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen temp_plafond_loyer_d823_16_2_4) def temp_plafond_loyer_d823_16_2_6(_:Unit): def temp_plafond_loyer_d823_16_2_7(_:Unit): - match_arg_402 = zone_2 - if match_arg_402.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_402.value + match_arg_392 = zone_2 + if match_arg_392.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_392.value return money_of_cents_string("35799") - elif match_arg_402.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_402.value + elif match_arg_392.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_392.value return money_of_cents_string("31664") - elif match_arg_402.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_402.value + elif match_arg_392.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_392.value return money_of_cents_string("29392") def temp_plafond_loyer_d823_16_2_8(_:Unit): - match_arg_403 = situation_familiale_calcul_apl_4 - if match_arg_403.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_403.value + match_arg_393 = situation_familiale_calcul_apl_4 + if match_arg_393.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_393.value temp_plafond_loyer_d823_16_2_9 = False - elif match_arg_403.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_403.value + elif match_arg_393.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_393.value temp_plafond_loyer_d823_16_2_9 = True return (((date_courante_11 < date_of_numbers(2021,10,1)) and (date_courante_11 >= @@ -13918,23 +13809,23 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen temp_plafond_loyer_d823_16_2_7) def temp_plafond_loyer_d823_16_2_10(_:Unit): def temp_plafond_loyer_d823_16_2_11(_:Unit): - match_arg_404 = zone_2 - if match_arg_404.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_404.value + match_arg_394 = zone_2 + if match_arg_394.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_394.value return money_of_cents_string("29682") - elif match_arg_404.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_404.value + elif match_arg_394.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_394.value return money_of_cents_string("25859") - elif match_arg_404.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_404.value + elif match_arg_394.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_394.value return money_of_cents_string("24246") def temp_plafond_loyer_d823_16_2_12(_:Unit): - match_arg_405 = situation_familiale_calcul_apl_4 - if match_arg_405.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_405.value + match_arg_395 = situation_familiale_calcul_apl_4 + if match_arg_395.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_395.value temp_plafond_loyer_d823_16_2_13 = True - elif match_arg_405.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_405.value + elif match_arg_395.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_395.value temp_plafond_loyer_d823_16_2_13 = False return (((date_courante_11 < date_of_numbers(2021,10,1)) and (date_courante_11 >= @@ -13950,19 +13841,19 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen temp_plafond_loyer_d823_16_2_11) def temp_plafond_loyer_d823_16_2_14(_:Unit): def temp_plafond_loyer_d823_16_2_15(_:Unit): - match_arg_406 = zone_2 - if match_arg_406.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_406.value + match_arg_396 = zone_2 + if match_arg_396.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_396.value return (money_of_cents_string("40630") + (money_of_cents_string("5895") * multiplicateur_majoration_plafond_loyer_d823_16_2)) - elif match_arg_406.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_406.value + elif match_arg_396.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_396.value return (money_of_cents_string("35780") + (money_of_cents_string("5208") * multiplicateur_majoration_plafond_loyer_d823_16_2)) - elif match_arg_406.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_406.value + elif match_arg_396.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_396.value return (money_of_cents_string("33094") + (money_of_cents_string("4743") * multiplicateur_majoration_plafond_loyer_d823_16_2)) @@ -13980,23 +13871,23 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen temp_plafond_loyer_d823_16_2_15) def temp_plafond_loyer_d823_16_2_17(_:Unit): def temp_plafond_loyer_d823_16_2_18(_:Unit): - match_arg_407 = zone_2 - if match_arg_407.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_407.value + match_arg_397 = zone_2 + if match_arg_397.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_397.value return money_of_cents_string("35949") - elif match_arg_407.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_407.value + elif match_arg_397.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_397.value return money_of_cents_string("31797") - elif match_arg_407.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_407.value + elif match_arg_397.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_397.value return money_of_cents_string("29515") def temp_plafond_loyer_d823_16_2_19(_:Unit): - match_arg_408 = situation_familiale_calcul_apl_4 - if match_arg_408.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_408.value + match_arg_398 = situation_familiale_calcul_apl_4 + if match_arg_398.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_398.value temp_plafond_loyer_d823_16_2_20 = False - elif match_arg_408.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_408.value + elif match_arg_398.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_398.value temp_plafond_loyer_d823_16_2_20 = True return (((date_courante_11 >= date_of_numbers(2021,10,1)) and (date_courante_11 < @@ -14012,23 +13903,23 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen temp_plafond_loyer_d823_16_2_18) def temp_plafond_loyer_d823_16_2_21(_:Unit): def temp_plafond_loyer_d823_16_2_22(_:Unit): - match_arg_409 = zone_2 - if match_arg_409.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_409.value + match_arg_399 = zone_2 + if match_arg_399.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_399.value return money_of_cents_string("29807") - elif match_arg_409.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_409.value + elif match_arg_399.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_399.value return money_of_cents_string("25978") - elif match_arg_409.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_409.value + elif match_arg_399.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_399.value return money_of_cents_string("24348") def temp_plafond_loyer_d823_16_2_23(_:Unit): - match_arg_410 = situation_familiale_calcul_apl_4 - if match_arg_410.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_410.value + match_arg_400 = situation_familiale_calcul_apl_4 + if match_arg_400.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_400.value temp_plafond_loyer_d823_16_2_24 = True - elif match_arg_410.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_410.value + elif match_arg_400.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_400.value temp_plafond_loyer_d823_16_2_24 = False return (((date_courante_11 >= date_of_numbers(2021,10,1)) and (date_courante_11 < @@ -14044,19 +13935,19 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen temp_plafond_loyer_d823_16_2_22) def temp_plafond_loyer_d823_16_2_25(_:Unit): def temp_plafond_loyer_d823_16_2_26(_:Unit): - match_arg_411 = zone_2 - if match_arg_411.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_411.value + match_arg_401 = zone_2 + if match_arg_401.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_401.value return (money_of_cents_string("42052") + (money_of_cents_string("6101") * multiplicateur_majoration_plafond_loyer_d823_16_2)) - elif match_arg_411.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_411.value + elif match_arg_401.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_401.value return (money_of_cents_string("37032") + (money_of_cents_string("5390") * multiplicateur_majoration_plafond_loyer_d823_16_2)) - elif match_arg_411.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_411.value + elif match_arg_401.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_401.value return (money_of_cents_string("34252") + (money_of_cents_string("4909") * multiplicateur_majoration_plafond_loyer_d823_16_2)) @@ -14073,23 +13964,23 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen temp_plafond_loyer_d823_16_2_26) def temp_plafond_loyer_d823_16_2_28(_:Unit): def temp_plafond_loyer_d823_16_2_29(_:Unit): - match_arg_412 = zone_2 - if match_arg_412.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_412.value + match_arg_402 = zone_2 + if match_arg_402.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_402.value return money_of_cents_string("37207") - elif match_arg_412.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_412.value + elif match_arg_402.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_402.value return money_of_cents_string("32910") - elif match_arg_412.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_412.value + elif match_arg_402.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_402.value return money_of_cents_string("30548") def temp_plafond_loyer_d823_16_2_30(_:Unit): - match_arg_413 = situation_familiale_calcul_apl_4 - if match_arg_413.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_413.value + match_arg_403 = situation_familiale_calcul_apl_4 + if match_arg_403.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_403.value temp_plafond_loyer_d823_16_2_31 = False - elif match_arg_413.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_413.value + elif match_arg_403.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_403.value temp_plafond_loyer_d823_16_2_31 = True return ((date_courante_11 >= date_of_numbers(2022,7,1)) and @@ -14104,23 +13995,23 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen temp_plafond_loyer_d823_16_2_29) def temp_plafond_loyer_d823_16_2_32(_:Unit): def temp_plafond_loyer_d823_16_2_33(_:Unit): - match_arg_414 = zone_2 - if match_arg_414.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_414.value + match_arg_404 = zone_2 + if match_arg_404.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_404.value return money_of_cents_string("30850") - elif match_arg_414.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_414.value + elif match_arg_404.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_404.value return money_of_cents_string("26887") - elif match_arg_414.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_414.value + elif match_arg_404.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_404.value return money_of_cents_string("25200") def temp_plafond_loyer_d823_16_2_34(_:Unit): - match_arg_415 = situation_familiale_calcul_apl_4 - if match_arg_415.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_415.value + match_arg_405 = situation_familiale_calcul_apl_4 + if match_arg_405.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_405.value temp_plafond_loyer_d823_16_2_35 = True - elif match_arg_415.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_415.value + elif match_arg_405.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_405.value temp_plafond_loyer_d823_16_2_35 = False return ((date_courante_11 >= date_of_numbers(2022,7,1)) and @@ -14156,15 +14047,15 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen return False def temp_plafond_loyer_d823_16_2_40(_:Unit): def temp_plafond_loyer_d823_16_2_41(_:Unit): - match_arg_416 = zone_2 - if match_arg_416.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_416.value + match_arg_406 = zone_2 + if match_arg_406.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_406.value return money_of_cents_string("22262") - elif match_arg_416.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_416.value + elif match_arg_406.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_406.value return money_of_cents_string("19402") - elif match_arg_416.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_416.value + elif match_arg_406.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_406.value return money_of_cents_string("18185") def temp_plafond_loyer_d823_16_2_42(_:Unit): return (((date_courante_11 < @@ -14181,15 +14072,15 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen temp_plafond_loyer_d823_16_2_41) def temp_plafond_loyer_d823_16_2_43(_:Unit): def temp_plafond_loyer_d823_16_2_44(_:Unit): - match_arg_417 = zone_2 - if match_arg_417.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_417.value + match_arg_407 = zone_2 + if match_arg_407.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_407.value return money_of_cents_string("22355") - elif match_arg_417.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_417.value + elif match_arg_407.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_407.value return money_of_cents_string("19484") - elif match_arg_417.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_417.value + elif match_arg_407.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_407.value return money_of_cents_string("18261") def temp_plafond_loyer_d823_16_2_45(_:Unit): return (((date_courante_11 >= @@ -14206,15 +14097,15 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen temp_plafond_loyer_d823_16_2_44) def temp_plafond_loyer_d823_16_2_46(_:Unit): def temp_plafond_loyer_d823_16_2_47(_:Unit): - match_arg_418 = zone_2 - if match_arg_418.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_418.value + match_arg_408 = zone_2 + if match_arg_408.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_408.value return money_of_cents_string("23138") - elif match_arg_418.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_418.value + elif match_arg_408.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_408.value return money_of_cents_string("20165") - elif match_arg_418.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_418.value + elif match_arg_408.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_408.value return money_of_cents_string("18900") def temp_plafond_loyer_d823_16_2_48(_:Unit): return (((date_courante_11 >= @@ -14242,15 +14133,15 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen return False def temp_plafond_loyer_d823_16_2_51(_:Unit): def temp_plafond_loyer_d823_16_2_52(_:Unit): - match_arg_419 = zone_2 - if match_arg_419.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_419.value + match_arg_409 = zone_2 + if match_arg_409.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_409.value return money_of_cents_string("26714") - elif match_arg_419.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_419.value + elif match_arg_409.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_409.value return money_of_cents_string("23282") - elif match_arg_419.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_419.value + elif match_arg_409.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_409.value return money_of_cents_string("21821") def temp_plafond_loyer_d823_16_2_53(_:Unit): return ((date_courante_11 < @@ -14266,15 +14157,15 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen temp_plafond_loyer_d823_16_2_52) def temp_plafond_loyer_d823_16_2_54(_:Unit): def temp_plafond_loyer_d823_16_2_55(_:Unit): - match_arg_420 = zone_2 - if match_arg_420.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_420.value + match_arg_410 = zone_2 + if match_arg_410.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_410.value return money_of_cents_string("26826") - elif match_arg_420.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_420.value + elif match_arg_410.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_410.value return money_of_cents_string("23380") - elif match_arg_420.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_420.value + elif match_arg_410.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_410.value return money_of_cents_string("21913") def temp_plafond_loyer_d823_16_2_56(_:Unit): return ((date_courante_11 >= @@ -14290,15 +14181,15 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen temp_plafond_loyer_d823_16_2_55) def temp_plafond_loyer_d823_16_2_57(_:Unit): def temp_plafond_loyer_d823_16_2_58(_:Unit): - match_arg_421 = zone_2 - if match_arg_421.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_421.value + match_arg_411 = zone_2 + if match_arg_411.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_411.value return money_of_cents_string("27765") - elif match_arg_421.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_421.value + elif match_arg_411.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_411.value return money_of_cents_string("24198") - elif match_arg_421.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_421.value + elif match_arg_411.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_411.value return money_of_cents_string("22680") def temp_plafond_loyer_d823_16_2_59(_:Unit): return ((date_courante_11 >= @@ -14325,19 +14216,19 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen return False def temp_plafond_loyer_d823_16_2_63(_:Unit): def temp_plafond_loyer_d823_16_2_64(_:Unit): - match_arg_422 = zone_2 - if match_arg_422.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_422.value + match_arg_412 = zone_2 + if match_arg_412.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_412.value return (money_of_cents_string("30345") + (money_of_cents_string("4403") * multiplicateur_majoration_plafond_loyer_d823_16_2)) - elif match_arg_422.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_422.value + elif match_arg_412.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_412.value return (money_of_cents_string("26723") + (money_of_cents_string("3890") * multiplicateur_majoration_plafond_loyer_d823_16_2)) - elif match_arg_422.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_422.value + elif match_arg_412.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_412.value return (money_of_cents_string("24717") + (money_of_cents_string("3542") * multiplicateur_majoration_plafond_loyer_d823_16_2)) @@ -14355,23 +14246,23 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen temp_plafond_loyer_d823_16_2_64) def temp_plafond_loyer_d823_16_2_66(_:Unit): def temp_plafond_loyer_d823_16_2_67(_:Unit): - match_arg_423 = zone_2 - if match_arg_423.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_423.value + match_arg_413 = zone_2 + if match_arg_413.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_413.value return money_of_cents_string("26849") - elif match_arg_423.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_423.value + elif match_arg_413.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_413.value return money_of_cents_string("23748") - elif match_arg_423.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_423.value + elif match_arg_413.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_413.value return money_of_cents_string("22044") def temp_plafond_loyer_d823_16_2_68(_:Unit): - match_arg_424 = situation_familiale_calcul_apl_4 - if match_arg_424.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_424.value + match_arg_414 = situation_familiale_calcul_apl_4 + if match_arg_414.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_414.value temp_plafond_loyer_d823_16_2_69 = False - elif match_arg_424.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_424.value + elif match_arg_414.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_414.value temp_plafond_loyer_d823_16_2_69 = True return (((date_courante_11 < date_of_numbers(2021,10,1)) and ((date_courante_11 >= @@ -14387,23 +14278,23 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen temp_plafond_loyer_d823_16_2_67) def temp_plafond_loyer_d823_16_2_70(_:Unit): def temp_plafond_loyer_d823_16_2_71(_:Unit): - match_arg_425 = zone_2 - if match_arg_425.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_425.value + match_arg_415 = zone_2 + if match_arg_415.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_415.value return money_of_cents_string("22262") - elif match_arg_425.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_425.value + elif match_arg_415.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_415.value return money_of_cents_string("19402") - elif match_arg_425.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_425.value + elif match_arg_415.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_415.value return money_of_cents_string("18185") def temp_plafond_loyer_d823_16_2_72(_:Unit): - match_arg_426 = situation_familiale_calcul_apl_4 - if match_arg_426.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_426.value + match_arg_416 = situation_familiale_calcul_apl_4 + if match_arg_416.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_416.value temp_plafond_loyer_d823_16_2_73 = True - elif match_arg_426.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_426.value + elif match_arg_416.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_416.value temp_plafond_loyer_d823_16_2_73 = False return (((date_courante_11 < date_of_numbers(2021,10,1)) and ((date_courante_11 >= @@ -14419,19 +14310,19 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen temp_plafond_loyer_d823_16_2_71) def temp_plafond_loyer_d823_16_2_74(_:Unit): def temp_plafond_loyer_d823_16_2_75(_:Unit): - match_arg_427 = zone_2 - if match_arg_427.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_427.value + match_arg_417 = zone_2 + if match_arg_417.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_417.value return (money_of_cents_string("30473") + (money_of_cents_string("4421") * multiplicateur_majoration_plafond_loyer_d823_16_2)) - elif match_arg_427.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_427.value + elif match_arg_417.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_417.value return (money_of_cents_string("26835") + (money_of_cents_string("3906") * multiplicateur_majoration_plafond_loyer_d823_16_2)) - elif match_arg_427.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_427.value + elif match_arg_417.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_417.value return (money_of_cents_string("24821") + (money_of_cents_string("3557") * multiplicateur_majoration_plafond_loyer_d823_16_2)) @@ -14449,23 +14340,23 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen temp_plafond_loyer_d823_16_2_75) def temp_plafond_loyer_d823_16_2_77(_:Unit): def temp_plafond_loyer_d823_16_2_78(_:Unit): - match_arg_428 = zone_2 - if match_arg_428.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_428.value + match_arg_418 = zone_2 + if match_arg_418.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_418.value return money_of_cents_string("26962") - elif match_arg_428.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_428.value + elif match_arg_418.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_418.value return money_of_cents_string("23848") - elif match_arg_428.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_428.value + elif match_arg_418.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_418.value return money_of_cents_string("22136") def temp_plafond_loyer_d823_16_2_79(_:Unit): - match_arg_429 = situation_familiale_calcul_apl_4 - if match_arg_429.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_429.value + match_arg_419 = situation_familiale_calcul_apl_4 + if match_arg_419.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_419.value temp_plafond_loyer_d823_16_2_80 = False - elif match_arg_429.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_429.value + elif match_arg_419.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_419.value temp_plafond_loyer_d823_16_2_80 = True return (((date_courante_11 >= date_of_numbers(2021,10,1)) and ((date_courante_11 < @@ -14481,23 +14372,23 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen temp_plafond_loyer_d823_16_2_78) def temp_plafond_loyer_d823_16_2_81(_:Unit): def temp_plafond_loyer_d823_16_2_82(_:Unit): - match_arg_430 = zone_2 - if match_arg_430.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_430.value + match_arg_420 = zone_2 + if match_arg_420.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_420.value return money_of_cents_string("22355") - elif match_arg_430.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_430.value + elif match_arg_420.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_420.value return money_of_cents_string("19484") - elif match_arg_430.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_430.value + elif match_arg_420.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_420.value return money_of_cents_string("18261") def temp_plafond_loyer_d823_16_2_83(_:Unit): - match_arg_431 = situation_familiale_calcul_apl_4 - if match_arg_431.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_431.value + match_arg_421 = situation_familiale_calcul_apl_4 + if match_arg_421.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_421.value temp_plafond_loyer_d823_16_2_84 = True - elif match_arg_431.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_431.value + elif match_arg_421.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_421.value temp_plafond_loyer_d823_16_2_84 = False return (((date_courante_11 >= date_of_numbers(2021,10,1)) and ((date_courante_11 < @@ -14513,19 +14404,19 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen temp_plafond_loyer_d823_16_2_82) def temp_plafond_loyer_d823_16_2_85(_:Unit): def temp_plafond_loyer_d823_16_2_86(_:Unit): - match_arg_432 = zone_2 - if match_arg_432.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_432.value + match_arg_422 = zone_2 + if match_arg_422.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_422.value return (money_of_cents_string("31539") + (money_of_cents_string("4576") * multiplicateur_majoration_plafond_loyer_d823_16_2)) - elif match_arg_432.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_432.value + elif match_arg_422.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_422.value return (money_of_cents_string("27774") + (money_of_cents_string("4043") * multiplicateur_majoration_plafond_loyer_d823_16_2)) - elif match_arg_432.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_432.value + elif match_arg_422.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_422.value return (money_of_cents_string("25689") + (money_of_cents_string("3682") * multiplicateur_majoration_plafond_loyer_d823_16_2)) @@ -14542,23 +14433,23 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen temp_plafond_loyer_d823_16_2_86) def temp_plafond_loyer_d823_16_2_88(_:Unit): def temp_plafond_loyer_d823_16_2_89(_:Unit): - match_arg_433 = zone_2 - if match_arg_433.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_433.value + match_arg_423 = zone_2 + if match_arg_423.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_423.value return money_of_cents_string("27905") - elif match_arg_433.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_433.value + elif match_arg_423.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_423.value return money_of_cents_string("24683") - elif match_arg_433.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_433.value + elif match_arg_423.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_423.value return money_of_cents_string("22911") def temp_plafond_loyer_d823_16_2_90(_:Unit): - match_arg_434 = situation_familiale_calcul_apl_4 - if match_arg_434.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_434.value + match_arg_424 = situation_familiale_calcul_apl_4 + if match_arg_424.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_424.value temp_plafond_loyer_d823_16_2_91 = False - elif match_arg_434.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_434.value + elif match_arg_424.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_424.value temp_plafond_loyer_d823_16_2_91 = True return (((date_courante_11 >= date_of_numbers(2022,7,1)) and colocation) and @@ -14573,23 +14464,23 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen temp_plafond_loyer_d823_16_2_89) def temp_plafond_loyer_d823_16_2_92(_:Unit): def temp_plafond_loyer_d823_16_2_93(_:Unit): - match_arg_435 = zone_2 - if match_arg_435.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_435.value + match_arg_425 = zone_2 + if match_arg_425.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_425.value return money_of_cents_string("23138") - elif match_arg_435.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_435.value + elif match_arg_425.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_425.value return money_of_cents_string("20165") - elif match_arg_435.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_435.value + elif match_arg_425.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_425.value return money_of_cents_string("18900") def temp_plafond_loyer_d823_16_2_94(_:Unit): - match_arg_436 = situation_familiale_calcul_apl_4 - if match_arg_436.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_436.value + match_arg_426 = situation_familiale_calcul_apl_4 + if match_arg_426.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_426.value temp_plafond_loyer_d823_16_2_95 = True - elif match_arg_436.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_436.value + elif match_arg_426.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_426.value temp_plafond_loyer_d823_16_2_95 = False return (((date_courante_11 >= date_of_numbers(2022,7,1)) and colocation) and @@ -14635,15 +14526,15 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen plafond_loyer_d823_16_2 = temp_plafond_loyer_d823_16_2_96 try: def temp_plafond_suppression_d823_16(_:Unit): - match_arg_437 = zone_2 - if match_arg_437.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_437.value + match_arg_427 = zone_2 + if match_arg_427.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_427.value return (plafond_loyer_d823_16_2 * decimal_of_string("4.")) - elif match_arg_437.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_437.value + elif match_arg_427.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_427.value return (plafond_loyer_d823_16_2 * decimal_of_string("3.1")) - elif match_arg_437.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_437.value + elif match_arg_427.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_427.value return (plafond_loyer_d823_16_2 * decimal_of_string("3.1")) def temp_plafond_suppression_d823_16_1(_:Unit): return (date_courante_11 >= date_of_numbers(2019,10,1)) @@ -14666,15 +14557,15 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen plafond_suppression_d823_16 = temp_plafond_suppression_d823_16_2 try: def temp_plafond_degressivite_d823_16(_:Unit): - match_arg_438 = zone_2 - if match_arg_438.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_438.value + match_arg_428 = zone_2 + if match_arg_428.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_428.value return (plafond_loyer_d823_16_2 * decimal_of_string("3.4")) - elif match_arg_438.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_438.value + elif match_arg_428.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_428.value return (plafond_loyer_d823_16_2 * decimal_of_string("2.5")) - elif match_arg_438.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_438.value + elif match_arg_428.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_428.value return (plafond_loyer_d823_16_2 * decimal_of_string("2.5")) def temp_plafond_degressivite_d823_16_1(_:Unit): return (date_courante_11 >= date_of_numbers(2019,10,1)) @@ -14741,11 +14632,11 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen "Livre VIII : Aides personnelles au logement", "Partie réglementaire", "Code de la construction et de l'habitation"])) - def temp_traitement_aide_finale_diminue(aide_finale_11:Money): + def temp_traitement_aide_finale_diminue(aide_finale_21:Money): try: try: def temp_traitement_aide_finale_diminue_1(_:Unit): - return aide_finale_11 + return aide_finale_21 def temp_traitement_aide_finale_diminue_2(_:Unit): return beneficiaire_aide_adulte_ou_enfant_handicapes return handle_default(SourcePosition(filename="", @@ -14761,13 +14652,13 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen else: if (loyer_principal_avec_reduction_meuble > plafond_degressivite_d823_16): - return (aide_finale_11 - (aide_finale_11 * + return (aide_finale_21 - (aide_finale_21 * ((loyer_principal_avec_reduction_meuble - plafond_degressivite_d823_16) / (plafond_suppression_d823_16 - plafond_degressivite_d823_16)))) else: - return aide_finale_11 + return aide_finale_21 except EmptyError: raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", start_line=573, @@ -14902,13 +14793,12 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen "Déclarations des champs d'application", "Prologue : aides au logement"])) rapport_loyers = temp_rapport_loyers_2 - def temp_traitement_aide_finale_minoration_forfaitaire_2(aide_finale_12:Money): + def temp_traitement_aide_finale_minoration_forfaitaire_2(aide_finale_22:Money): try: - if ((traitement_aide_finale_diminue(aide_finale_12) - - montant_forfaitaire_d823_16) >= + aide_finale_23 = traitement_aide_finale_diminue(aide_finale_22) + if ((aide_finale_23 - montant_forfaitaire_d823_16) >= money_of_cents_string("0")): - return (traitement_aide_finale_diminue(aide_finale_12) - - montant_forfaitaire_d823_16) + return (aide_finale_23 - montant_forfaitaire_d823_16) else: return money_of_cents_string("0") except EmptyError: @@ -15018,23 +14908,16 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen "Déclarations des champs d'application", "Prologue : aides au logement"])) taux_loyer_eligible_formule = temp_taux_loyer_eligible_formule_2 - def temp_traitement_aide_finale_contributions_sociales_arrondi_2(aide_finale_13:Money): + def temp_traitement_aide_finale_contributions_sociales_arrondi_2(aide_finale_24:Money): try: - if ((money_round(((traitement_aide_finale_minoration_forfaitaire_2( - aide_finale_13) - - contributions_sociales_dot_montant_2(traitement_aide_finale_minoration_forfaitaire_2( - aide_finale_13))) - - money_of_cents_string("50"))) + - contributions_sociales_dot_montant_2(traitement_aide_finale_minoration_forfaitaire_2( - aide_finale_13))) >= + aide_finale_25 = traitement_aide_finale_minoration_forfaitaire_2( + aide_finale_24) + crds_2 = contributions_sociales_dot_montant_2(aide_finale_25) + aide_finale_moins_crds_arrondie_2 = money_round(((aide_finale_25 - + crds_2) - money_of_cents_string("50"))) + if ((aide_finale_moins_crds_arrondie_2 + crds_2) >= money_of_cents_string("0")): - return (money_round(((traitement_aide_finale_minoration_forfaitaire_2( - aide_finale_13) - - contributions_sociales_dot_montant_2(traitement_aide_finale_minoration_forfaitaire_2( - aide_finale_13))) - - money_of_cents_string("50"))) + - contributions_sociales_dot_montant_2(traitement_aide_finale_minoration_forfaitaire_2( - aide_finale_13))) + return (aide_finale_moins_crds_arrondie_2 + crds_2) else: return money_of_cents_string("0") except EmptyError: @@ -15092,14 +14975,14 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen "Déclarations des champs d'application", "Prologue : aides au logement"])) taux_loyer_eligible_taux_arrondi = temp_taux_loyer_eligible_taux_arrondi_2 - def temp_traitement_aide_finale_reduction_loyer_solidarite(aide_finale_14:Money): + def temp_traitement_aide_finale_reduction_loyer_solidarite(aide_finale_26:Money): try: - if ((traitement_aide_finale_contributions_sociales_arrondi_2( - aide_finale_14) - (reduction_loyer_solidarite * + aide_finale_27 = traitement_aide_finale_contributions_sociales_arrondi_2( + aide_finale_26) + if ((aide_finale_27 - (reduction_loyer_solidarite * fraction_l832_3)) >= money_of_cents_string("0")): - return (traitement_aide_finale_contributions_sociales_arrondi_2( - aide_finale_14) - (reduction_loyer_solidarite * + return (aide_finale_27 - (reduction_loyer_solidarite * fraction_l832_3)) else: return money_of_cents_string("0") @@ -15126,10 +15009,10 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen "Déclarations des champs d'application", "Prologue : aides au logement"])) taux_prise_compte_ressources = temp_taux_prise_compte_ressources - def temp_traitement_aide_finale_montee_en_charge_saint_pierre_miquelon(aide_finale_15:Money): + def temp_traitement_aide_finale_montee_en_charge_saint_pierre_miquelon(aide_finale_28:Money): try: return montee_en_charge_saint_pierre_miquelon(traitement_aide_finale_reduction_loyer_solidarite( - aide_finale_15), + aide_finale_28), residence_5, date_courante_11) except EmptyError: @@ -15143,14 +15026,13 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen "Prologue : aides au logement"])) traitement_aide_finale_montee_en_charge_saint_pierre_miquelon = temp_traitement_aide_finale_montee_en_charge_saint_pierre_miquelon try: - if (((ressources_menage_arrondies_3 - - abattement_forfaitaire_d823_17) * taux_prise_compte_ressources) < + participation_ressources = ((ressources_menage_arrondies_6 - + abattement_forfaitaire_d823_17) * taux_prise_compte_ressources) + if (participation_ressources < money_of_cents_string("0")): temp_participation_personnelle = money_of_cents_string("0") else: - temp_participation_personnelle = ((ressources_menage_arrondies_3 - - abattement_forfaitaire_d823_17) * - taux_prise_compte_ressources) + temp_participation_personnelle = participation_ressources temp_participation_personnelle_1 = (participation_minimale + temp_participation_personnelle) except EmptyError: @@ -15163,15 +15045,15 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen "Déclarations des champs d'application", "Prologue : aides au logement"])) participation_personnelle = temp_participation_personnelle_1 - def temp_traitement_aide_finale_montant_minimal_2(aide_finale_16:Money): + def temp_traitement_aide_finale_montant_minimal_2(aide_finale_29:Money): try: - if (traitement_aide_finale_montee_en_charge_saint_pierre_miquelon( - aide_finale_16) < + aide_finale_30 = traitement_aide_finale_montee_en_charge_saint_pierre_miquelon( + aide_finale_29) + if (aide_finale_30 < montant_minimal_aide_d823_16): return money_of_cents_string("0") else: - return traitement_aide_finale_montee_en_charge_saint_pierre_miquelon( - aide_finale_16) + return aide_finale_30 except EmptyError: raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", start_line=584, @@ -15183,14 +15065,13 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen "Prologue : aides au logement"])) traitement_aide_finale_montant_minimal_2 = temp_traitement_aide_finale_montant_minimal_2 try: - if (((loyer_eligible + montant_forfaitaire_charges_d823_16) - - participation_personnelle) < + aide_finale_31 = ((loyer_eligible + + montant_forfaitaire_charges_d823_16) - participation_personnelle) + if (aide_finale_31 < money_of_cents_string("0")): temp_aide_finale_formule_2 = money_of_cents_string("0") else: - temp_aide_finale_formule_2 = ((loyer_eligible + - montant_forfaitaire_charges_d823_16) - - participation_personnelle) + temp_aide_finale_formule_2 = aide_finale_31 except EmptyError: temp_aide_finale_formule_2 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", @@ -15215,7 +15096,7 @@ def calcul_allocation_logement_foyer(calcul_allocation_logement_foyer_in:CalculA date_conventionnement_1 = calcul_allocation_logement_foyer_in.date_conventionnement_in residence_6 = calcul_allocation_logement_foyer_in.residence_in redevance_1 = calcul_allocation_logement_foyer_in.redevance_in - ressources_menage_arrondies_4 = calcul_allocation_logement_foyer_in.ressources_menage_arrondies_in + ressources_menage_arrondies_7 = calcul_allocation_logement_foyer_in.ressources_menage_arrondies_in nombre_personnes_a_charge_5 = calcul_allocation_logement_foyer_in.nombre_personnes_a_charge_in situation_familiale_calcul_apl_5 = calcul_allocation_logement_foyer_in.situation_familiale_calcul_apl_in zone_3 = calcul_allocation_logement_foyer_in.zone_in @@ -15316,7 +15197,7 @@ def calcul_allocation_logement_foyer(calcul_allocation_logement_foyer_in:CalculA "Prologue : aides au logement"])) calcul_apl_logement_foyer_dot_date_conventionnement = temp_calcul_apl_logement_foyer_dot_date_conventionnement try: - temp_calcul_apl_logement_foyer_dot_ressources_menage_arrondies = ressources_menage_arrondies_4 + temp_calcul_apl_logement_foyer_dot_ressources_menage_arrondies = ressources_menage_arrondies_7 except EmptyError: temp_calcul_apl_logement_foyer_dot_ressources_menage_arrondies = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", @@ -15394,33 +15275,33 @@ def calcul_allocation_logement_foyer(calcul_allocation_logement_foyer_in:CalculA def temp_calcul_apl_logement_foyer_dot_limitation_majoration_personnes_a_charge_1(_:Unit): return True def temp_calcul_apl_logement_foyer_dot_limitation_majoration_personnes_a_charge_2(_:Unit): - match_arg_439 = residence_6 - if match_arg_439.code == Collectivite_Code.Guadeloupe: - _ = match_arg_439.value + match_arg_429 = residence_6 + if match_arg_429.code == Collectivite_Code.Guadeloupe: + _ = match_arg_429.value temp_calcul_apl_logement_foyer_dot_limitation_majoration_personnes_a_charge_3 = True - elif match_arg_439.code == Collectivite_Code.Guyane: - _ = match_arg_439.value + elif match_arg_429.code == Collectivite_Code.Guyane: + _ = match_arg_429.value temp_calcul_apl_logement_foyer_dot_limitation_majoration_personnes_a_charge_3 = True - elif match_arg_439.code == Collectivite_Code.Martinique: - _ = match_arg_439.value + elif match_arg_429.code == Collectivite_Code.Martinique: + _ = match_arg_429.value temp_calcul_apl_logement_foyer_dot_limitation_majoration_personnes_a_charge_3 = True - elif match_arg_439.code == Collectivite_Code.LaReunion: - _ = match_arg_439.value + elif match_arg_429.code == Collectivite_Code.LaReunion: + _ = match_arg_429.value temp_calcul_apl_logement_foyer_dot_limitation_majoration_personnes_a_charge_3 = True - elif match_arg_439.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_439.value + elif match_arg_429.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_429.value temp_calcul_apl_logement_foyer_dot_limitation_majoration_personnes_a_charge_3 = False - elif match_arg_439.code == Collectivite_Code.SaintMartin: - _ = match_arg_439.value + elif match_arg_429.code == Collectivite_Code.SaintMartin: + _ = match_arg_429.value temp_calcul_apl_logement_foyer_dot_limitation_majoration_personnes_a_charge_3 = False - elif match_arg_439.code == Collectivite_Code.Metropole: - _ = match_arg_439.value + elif match_arg_429.code == Collectivite_Code.Metropole: + _ = match_arg_429.value temp_calcul_apl_logement_foyer_dot_limitation_majoration_personnes_a_charge_3 = False - elif match_arg_439.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_439.value + elif match_arg_429.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_429.value temp_calcul_apl_logement_foyer_dot_limitation_majoration_personnes_a_charge_3 = False - elif match_arg_439.code == Collectivite_Code.Mayotte: - _ = match_arg_439.value + elif match_arg_429.code == Collectivite_Code.Mayotte: + _ = match_arg_429.value temp_calcul_apl_logement_foyer_dot_limitation_majoration_personnes_a_charge_3 = True return (((date_courante_12 >= date_of_numbers(2019,9,1)) and (date_courante_12 < date_of_numbers(2023,4,5))) and @@ -15538,33 +15419,33 @@ def calcul_allocation_logement_foyer(calcul_allocation_logement_foyer_in:CalculA def temp_multiplicateur_majoration_charges(_:Unit): return decimal_of_string("6.") def temp_multiplicateur_majoration_charges_1(_:Unit): - match_arg_440 = residence_6 - if match_arg_440.code == Collectivite_Code.Guadeloupe: - _ = match_arg_440.value + match_arg_430 = residence_6 + if match_arg_430.code == Collectivite_Code.Guadeloupe: + _ = match_arg_430.value temp_multiplicateur_majoration_charges_2 = True - elif match_arg_440.code == Collectivite_Code.Guyane: - _ = match_arg_440.value + elif match_arg_430.code == Collectivite_Code.Guyane: + _ = match_arg_430.value temp_multiplicateur_majoration_charges_2 = False - elif match_arg_440.code == Collectivite_Code.Martinique: - _ = match_arg_440.value + elif match_arg_430.code == Collectivite_Code.Martinique: + _ = match_arg_430.value temp_multiplicateur_majoration_charges_2 = True - elif match_arg_440.code == Collectivite_Code.LaReunion: - _ = match_arg_440.value + elif match_arg_430.code == Collectivite_Code.LaReunion: + _ = match_arg_430.value temp_multiplicateur_majoration_charges_2 = True - elif match_arg_440.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_440.value + elif match_arg_430.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_430.value temp_multiplicateur_majoration_charges_2 = True - elif match_arg_440.code == Collectivite_Code.SaintMartin: - _ = match_arg_440.value + elif match_arg_430.code == Collectivite_Code.SaintMartin: + _ = match_arg_430.value temp_multiplicateur_majoration_charges_2 = True - elif match_arg_440.code == Collectivite_Code.Metropole: - _ = match_arg_440.value + elif match_arg_430.code == Collectivite_Code.Metropole: + _ = match_arg_430.value temp_multiplicateur_majoration_charges_2 = False - elif match_arg_440.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_440.value + elif match_arg_430.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_430.value temp_multiplicateur_majoration_charges_2 = False - elif match_arg_440.code == Collectivite_Code.Mayotte: - _ = match_arg_440.value + elif match_arg_430.code == Collectivite_Code.Mayotte: + _ = match_arg_430.value temp_multiplicateur_majoration_charges_2 = True return (((date_courante_12 >= date_of_numbers(2020,1,1)) and @@ -15580,33 +15461,33 @@ def calcul_allocation_logement_foyer(calcul_allocation_logement_foyer_in:CalculA temp_multiplicateur_majoration_charges_1, temp_multiplicateur_majoration_charges) except EmptyError: - match_arg_441 = residence_6 - if match_arg_441.code == Collectivite_Code.Guadeloupe: - _ = match_arg_441.value + match_arg_431 = residence_6 + if match_arg_431.code == Collectivite_Code.Guadeloupe: + _ = match_arg_431.value temp_multiplicateur_majoration_charges_4 = True - elif match_arg_441.code == Collectivite_Code.Guyane: - _ = match_arg_441.value + elif match_arg_431.code == Collectivite_Code.Guyane: + _ = match_arg_431.value temp_multiplicateur_majoration_charges_4 = False - elif match_arg_441.code == Collectivite_Code.Martinique: - _ = match_arg_441.value + elif match_arg_431.code == Collectivite_Code.Martinique: + _ = match_arg_431.value temp_multiplicateur_majoration_charges_4 = True - elif match_arg_441.code == Collectivite_Code.LaReunion: - _ = match_arg_441.value + elif match_arg_431.code == Collectivite_Code.LaReunion: + _ = match_arg_431.value temp_multiplicateur_majoration_charges_4 = True - elif match_arg_441.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_441.value + elif match_arg_431.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_431.value temp_multiplicateur_majoration_charges_4 = True - elif match_arg_441.code == Collectivite_Code.SaintMartin: - _ = match_arg_441.value + elif match_arg_431.code == Collectivite_Code.SaintMartin: + _ = match_arg_431.value temp_multiplicateur_majoration_charges_4 = True - elif match_arg_441.code == Collectivite_Code.Metropole: - _ = match_arg_441.value + elif match_arg_431.code == Collectivite_Code.Metropole: + _ = match_arg_431.value temp_multiplicateur_majoration_charges_4 = False - elif match_arg_441.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_441.value + elif match_arg_431.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_431.value temp_multiplicateur_majoration_charges_4 = False - elif match_arg_441.code == Collectivite_Code.Mayotte: - _ = match_arg_441.value + elif match_arg_431.code == Collectivite_Code.Mayotte: + _ = match_arg_431.value temp_multiplicateur_majoration_charges_4 = True if (((date_courante_12 >= date_of_numbers(2020,10,1)) and @@ -15620,33 +15501,33 @@ def calcul_allocation_logement_foyer(calcul_allocation_logement_foyer_in:CalculA temp_multiplicateur_majoration_charges_3 = dead_value raise EmptyError except EmptyError: - match_arg_442 = residence_6 - if match_arg_442.code == Collectivite_Code.Guadeloupe: - _ = match_arg_442.value + match_arg_432 = residence_6 + if match_arg_432.code == Collectivite_Code.Guadeloupe: + _ = match_arg_432.value temp_multiplicateur_majoration_charges_5 = True - elif match_arg_442.code == Collectivite_Code.Guyane: - _ = match_arg_442.value + elif match_arg_432.code == Collectivite_Code.Guyane: + _ = match_arg_432.value temp_multiplicateur_majoration_charges_5 = False - elif match_arg_442.code == Collectivite_Code.Martinique: - _ = match_arg_442.value + elif match_arg_432.code == Collectivite_Code.Martinique: + _ = match_arg_432.value temp_multiplicateur_majoration_charges_5 = True - elif match_arg_442.code == Collectivite_Code.LaReunion: - _ = match_arg_442.value + elif match_arg_432.code == Collectivite_Code.LaReunion: + _ = match_arg_432.value temp_multiplicateur_majoration_charges_5 = True - elif match_arg_442.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_442.value + elif match_arg_432.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_432.value temp_multiplicateur_majoration_charges_5 = True - elif match_arg_442.code == Collectivite_Code.SaintMartin: - _ = match_arg_442.value + elif match_arg_432.code == Collectivite_Code.SaintMartin: + _ = match_arg_432.value temp_multiplicateur_majoration_charges_5 = True - elif match_arg_442.code == Collectivite_Code.Metropole: - _ = match_arg_442.value + elif match_arg_432.code == Collectivite_Code.Metropole: + _ = match_arg_432.value temp_multiplicateur_majoration_charges_5 = False - elif match_arg_442.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_442.value + elif match_arg_432.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_432.value temp_multiplicateur_majoration_charges_5 = False - elif match_arg_442.code == Collectivite_Code.Mayotte: - _ = match_arg_442.value + elif match_arg_432.code == Collectivite_Code.Mayotte: + _ = match_arg_432.value temp_multiplicateur_majoration_charges_5 = True if (((date_courante_12 >= date_of_numbers(2021,10,1)) and @@ -15660,33 +15541,33 @@ def calcul_allocation_logement_foyer(calcul_allocation_logement_foyer_in:CalculA temp_multiplicateur_majoration_charges_3 = dead_value raise EmptyError except EmptyError: - match_arg_443 = residence_6 - if match_arg_443.code == Collectivite_Code.Guadeloupe: - _ = match_arg_443.value + match_arg_433 = residence_6 + if match_arg_433.code == Collectivite_Code.Guadeloupe: + _ = match_arg_433.value temp_multiplicateur_majoration_charges_6 = True - elif match_arg_443.code == Collectivite_Code.Guyane: - _ = match_arg_443.value + elif match_arg_433.code == Collectivite_Code.Guyane: + _ = match_arg_433.value temp_multiplicateur_majoration_charges_6 = False - elif match_arg_443.code == Collectivite_Code.Martinique: - _ = match_arg_443.value + elif match_arg_433.code == Collectivite_Code.Martinique: + _ = match_arg_433.value temp_multiplicateur_majoration_charges_6 = True - elif match_arg_443.code == Collectivite_Code.LaReunion: - _ = match_arg_443.value + elif match_arg_433.code == Collectivite_Code.LaReunion: + _ = match_arg_433.value temp_multiplicateur_majoration_charges_6 = True - elif match_arg_443.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_443.value + elif match_arg_433.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_433.value temp_multiplicateur_majoration_charges_6 = True - elif match_arg_443.code == Collectivite_Code.SaintMartin: - _ = match_arg_443.value + elif match_arg_433.code == Collectivite_Code.SaintMartin: + _ = match_arg_433.value temp_multiplicateur_majoration_charges_6 = True - elif match_arg_443.code == Collectivite_Code.Metropole: - _ = match_arg_443.value + elif match_arg_433.code == Collectivite_Code.Metropole: + _ = match_arg_433.value temp_multiplicateur_majoration_charges_6 = False - elif match_arg_443.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_443.value + elif match_arg_433.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_433.value temp_multiplicateur_majoration_charges_6 = False - elif match_arg_443.code == Collectivite_Code.Mayotte: - _ = match_arg_443.value + elif match_arg_433.code == Collectivite_Code.Mayotte: + _ = match_arg_433.value temp_multiplicateur_majoration_charges_6 = True if (((date_courante_12 >= date_of_numbers(2022,1,1)) and (date_courante_12 < date_of_numbers(2022,7,1))) and @@ -15698,33 +15579,33 @@ def calcul_allocation_logement_foyer(calcul_allocation_logement_foyer_in:CalculA temp_multiplicateur_majoration_charges_3 = dead_value raise EmptyError except EmptyError: - match_arg_444 = residence_6 - if match_arg_444.code == Collectivite_Code.Guadeloupe: - _ = match_arg_444.value + match_arg_434 = residence_6 + if match_arg_434.code == Collectivite_Code.Guadeloupe: + _ = match_arg_434.value temp_multiplicateur_majoration_charges_7 = True - elif match_arg_444.code == Collectivite_Code.Guyane: - _ = match_arg_444.value + elif match_arg_434.code == Collectivite_Code.Guyane: + _ = match_arg_434.value temp_multiplicateur_majoration_charges_7 = False - elif match_arg_444.code == Collectivite_Code.Martinique: - _ = match_arg_444.value + elif match_arg_434.code == Collectivite_Code.Martinique: + _ = match_arg_434.value temp_multiplicateur_majoration_charges_7 = True - elif match_arg_444.code == Collectivite_Code.LaReunion: - _ = match_arg_444.value + elif match_arg_434.code == Collectivite_Code.LaReunion: + _ = match_arg_434.value temp_multiplicateur_majoration_charges_7 = True - elif match_arg_444.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_444.value + elif match_arg_434.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_434.value temp_multiplicateur_majoration_charges_7 = True - elif match_arg_444.code == Collectivite_Code.SaintMartin: - _ = match_arg_444.value + elif match_arg_434.code == Collectivite_Code.SaintMartin: + _ = match_arg_434.value temp_multiplicateur_majoration_charges_7 = True - elif match_arg_444.code == Collectivite_Code.Metropole: - _ = match_arg_444.value + elif match_arg_434.code == Collectivite_Code.Metropole: + _ = match_arg_434.value temp_multiplicateur_majoration_charges_7 = False - elif match_arg_444.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_444.value + elif match_arg_434.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_434.value temp_multiplicateur_majoration_charges_7 = False - elif match_arg_444.code == Collectivite_Code.Mayotte: - _ = match_arg_444.value + elif match_arg_434.code == Collectivite_Code.Mayotte: + _ = match_arg_434.value temp_multiplicateur_majoration_charges_7 = True if (((date_courante_12 >= date_of_numbers(2022,7,1)) and (date_courante_12 < date_of_numbers(2023,1,1))) and @@ -15833,26 +15714,26 @@ def calcul_allocation_logement_foyer(calcul_allocation_logement_foyer_in:CalculA def temp_equivalence_loyer_2(_:Unit): try: def temp_equivalence_loyer_3(_:Unit): - match_arg_445 = situation_familiale_calcul_apl_5 - if match_arg_445.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_445.value + match_arg_435 = situation_familiale_calcul_apl_5 + if match_arg_435.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_435.value return money_of_cents_string("16941") - elif match_arg_445.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_445.value + elif match_arg_435.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_435.value return money_of_cents_string("26329") def temp_equivalence_loyer_4(_:Unit): - match_arg_446 = categorie_equivalence_loyer_d842_16 - if match_arg_446.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUS: - _ = match_arg_446.value + match_arg_436 = categorie_equivalence_loyer_d842_16 + if match_arg_436.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUS: + _ = match_arg_436.value temp_equivalence_loyer_5 = False - elif match_arg_446.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUSRehabilitee: - _ = match_arg_446.value + elif match_arg_436.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUSRehabilitee: + _ = match_arg_436.value temp_equivalence_loyer_5 = False - elif match_arg_446.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.PersonnesAgeesSelon3DeD842_16: - _ = match_arg_446.value + elif match_arg_436.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.PersonnesAgeesSelon3DeD842_16: + _ = match_arg_436.value temp_equivalence_loyer_5 = False - elif match_arg_446.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.AutresPersonnes: - _ = match_arg_446.value + elif match_arg_436.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.AutresPersonnes: + _ = match_arg_436.value temp_equivalence_loyer_5 = True return (((date_courante_12 >= date_of_numbers(2020,10,1)) and (date_courante_12 < @@ -15865,53 +15746,53 @@ def calcul_allocation_logement_foyer(calcul_allocation_logement_foyer_in:CalculA temp_equivalence_loyer_4, temp_equivalence_loyer_3) except EmptyError: - match_arg_447 = categorie_equivalence_loyer_d842_16 - if match_arg_447.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUS: - _ = match_arg_447.value + match_arg_437 = categorie_equivalence_loyer_d842_16 + if match_arg_437.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUS: + _ = match_arg_437.value temp_equivalence_loyer_6 = False - elif match_arg_447.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUSRehabilitee: - _ = match_arg_447.value + elif match_arg_437.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUSRehabilitee: + _ = match_arg_437.value temp_equivalence_loyer_6 = True - elif match_arg_447.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.PersonnesAgeesSelon3DeD842_16: - _ = match_arg_447.value + elif match_arg_437.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.PersonnesAgeesSelon3DeD842_16: + _ = match_arg_437.value temp_equivalence_loyer_6 = False - elif match_arg_447.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.AutresPersonnes: - _ = match_arg_447.value + elif match_arg_437.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.AutresPersonnes: + _ = match_arg_437.value temp_equivalence_loyer_6 = False if (((date_courante_12 >= date_of_numbers(2020,10,1)) and (date_courante_12 < date_of_numbers(2021,10,1))) and temp_equivalence_loyer_6): - match_arg_448 = situation_familiale_calcul_apl_5 - if match_arg_448.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_448.value + match_arg_438 = situation_familiale_calcul_apl_5 + if match_arg_438.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_438.value return money_of_cents_string("16941") - elif match_arg_448.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_448.value + elif match_arg_438.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_438.value return money_of_cents_string("26329") else: raise EmptyError def temp_equivalence_loyer_7(_:Unit): def temp_equivalence_loyer_8(_:Unit): - match_arg_449 = situation_familiale_calcul_apl_5 - if match_arg_449.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_449.value + match_arg_439 = situation_familiale_calcul_apl_5 + if match_arg_439.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_439.value return money_of_cents_string("20554") - elif match_arg_449.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_449.value + elif match_arg_439.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_439.value return money_of_cents_string("31939") def temp_equivalence_loyer_9(_:Unit): - match_arg_450 = categorie_equivalence_loyer_d842_16 - if match_arg_450.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUS: - _ = match_arg_450.value + match_arg_440 = categorie_equivalence_loyer_d842_16 + if match_arg_440.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUS: + _ = match_arg_440.value temp_equivalence_loyer_10 = False - elif match_arg_450.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUSRehabilitee: - _ = match_arg_450.value + elif match_arg_440.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUSRehabilitee: + _ = match_arg_440.value temp_equivalence_loyer_10 = False - elif match_arg_450.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.PersonnesAgeesSelon3DeD842_16: - _ = match_arg_450.value + elif match_arg_440.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.PersonnesAgeesSelon3DeD842_16: + _ = match_arg_440.value temp_equivalence_loyer_10 = True - elif match_arg_450.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.AutresPersonnes: - _ = match_arg_450.value + elif match_arg_440.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.AutresPersonnes: + _ = match_arg_440.value temp_equivalence_loyer_10 = False return (((date_courante_12 >= date_of_numbers(2020,10,1)) and (date_courante_12 < date_of_numbers(2021,10,1))) and @@ -15923,26 +15804,26 @@ def calcul_allocation_logement_foyer(calcul_allocation_logement_foyer_in:CalculA temp_equivalence_loyer_8) def temp_equivalence_loyer_11(_:Unit): def temp_equivalence_loyer_12(_:Unit): - match_arg_451 = situation_familiale_calcul_apl_5 - if match_arg_451.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_451.value + match_arg_441 = situation_familiale_calcul_apl_5 + if match_arg_441.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_441.value return money_of_cents_string("8379") - elif match_arg_451.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_451.value + elif match_arg_441.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_441.value return money_of_cents_string("13045") def temp_equivalence_loyer_13(_:Unit): - match_arg_452 = categorie_equivalence_loyer_d842_16 - if match_arg_452.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUS: - _ = match_arg_452.value + match_arg_442 = categorie_equivalence_loyer_d842_16 + if match_arg_442.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUS: + _ = match_arg_442.value temp_equivalence_loyer_14 = True - elif match_arg_452.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUSRehabilitee: - _ = match_arg_452.value + elif match_arg_442.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUSRehabilitee: + _ = match_arg_442.value temp_equivalence_loyer_14 = False - elif match_arg_452.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.PersonnesAgeesSelon3DeD842_16: - _ = match_arg_452.value + elif match_arg_442.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.PersonnesAgeesSelon3DeD842_16: + _ = match_arg_442.value temp_equivalence_loyer_14 = False - elif match_arg_452.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.AutresPersonnes: - _ = match_arg_452.value + elif match_arg_442.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.AutresPersonnes: + _ = match_arg_442.value temp_equivalence_loyer_14 = False return (((date_courante_12 >= date_of_numbers(2020,10,1)) and (date_courante_12 < date_of_numbers(2021,10,1))) and @@ -15955,26 +15836,26 @@ def calcul_allocation_logement_foyer(calcul_allocation_logement_foyer_in:CalculA def temp_equivalence_loyer_15(_:Unit): try: def temp_equivalence_loyer_16(_:Unit): - match_arg_453 = situation_familiale_calcul_apl_5 - if match_arg_453.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_453.value + match_arg_443 = situation_familiale_calcul_apl_5 + if match_arg_443.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_443.value return money_of_cents_string("17012") - elif match_arg_453.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_453.value + elif match_arg_443.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_443.value return money_of_cents_string("26440") def temp_equivalence_loyer_17(_:Unit): - match_arg_454 = categorie_equivalence_loyer_d842_16 - if match_arg_454.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUS: - _ = match_arg_454.value + match_arg_444 = categorie_equivalence_loyer_d842_16 + if match_arg_444.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUS: + _ = match_arg_444.value temp_equivalence_loyer_18 = False - elif match_arg_454.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUSRehabilitee: - _ = match_arg_454.value + elif match_arg_444.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUSRehabilitee: + _ = match_arg_444.value temp_equivalence_loyer_18 = False - elif match_arg_454.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.PersonnesAgeesSelon3DeD842_16: - _ = match_arg_454.value + elif match_arg_444.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.PersonnesAgeesSelon3DeD842_16: + _ = match_arg_444.value temp_equivalence_loyer_18 = False - elif match_arg_454.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.AutresPersonnes: - _ = match_arg_454.value + elif match_arg_444.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.AutresPersonnes: + _ = match_arg_444.value temp_equivalence_loyer_18 = True return (((date_courante_12 >= date_of_numbers(2021,10,1)) and (date_courante_12 < @@ -15987,53 +15868,53 @@ def calcul_allocation_logement_foyer(calcul_allocation_logement_foyer_in:CalculA temp_equivalence_loyer_17, temp_equivalence_loyer_16) except EmptyError: - match_arg_455 = categorie_equivalence_loyer_d842_16 - if match_arg_455.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUS: - _ = match_arg_455.value + match_arg_445 = categorie_equivalence_loyer_d842_16 + if match_arg_445.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUS: + _ = match_arg_445.value temp_equivalence_loyer_19 = False - elif match_arg_455.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUSRehabilitee: - _ = match_arg_455.value + elif match_arg_445.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUSRehabilitee: + _ = match_arg_445.value temp_equivalence_loyer_19 = True - elif match_arg_455.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.PersonnesAgeesSelon3DeD842_16: - _ = match_arg_455.value + elif match_arg_445.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.PersonnesAgeesSelon3DeD842_16: + _ = match_arg_445.value temp_equivalence_loyer_19 = False - elif match_arg_455.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.AutresPersonnes: - _ = match_arg_455.value + elif match_arg_445.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.AutresPersonnes: + _ = match_arg_445.value temp_equivalence_loyer_19 = False if (((date_courante_12 >= date_of_numbers(2021,10,1)) and (date_courante_12 < date_of_numbers(2022,7,1))) and temp_equivalence_loyer_19): - match_arg_456 = situation_familiale_calcul_apl_5 - if match_arg_456.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_456.value + match_arg_446 = situation_familiale_calcul_apl_5 + if match_arg_446.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_446.value return money_of_cents_string("17012") - elif match_arg_456.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_456.value + elif match_arg_446.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_446.value return money_of_cents_string("26440") else: raise EmptyError def temp_equivalence_loyer_20(_:Unit): def temp_equivalence_loyer_21(_:Unit): - match_arg_457 = situation_familiale_calcul_apl_5 - if match_arg_457.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_457.value + match_arg_447 = situation_familiale_calcul_apl_5 + if match_arg_447.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_447.value return money_of_cents_string("20640") - elif match_arg_457.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_457.value + elif match_arg_447.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_447.value return money_of_cents_string("32073") def temp_equivalence_loyer_22(_:Unit): - match_arg_458 = categorie_equivalence_loyer_d842_16 - if match_arg_458.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUS: - _ = match_arg_458.value + match_arg_448 = categorie_equivalence_loyer_d842_16 + if match_arg_448.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUS: + _ = match_arg_448.value temp_equivalence_loyer_23 = False - elif match_arg_458.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUSRehabilitee: - _ = match_arg_458.value + elif match_arg_448.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUSRehabilitee: + _ = match_arg_448.value temp_equivalence_loyer_23 = False - elif match_arg_458.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.PersonnesAgeesSelon3DeD842_16: - _ = match_arg_458.value + elif match_arg_448.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.PersonnesAgeesSelon3DeD842_16: + _ = match_arg_448.value temp_equivalence_loyer_23 = True - elif match_arg_458.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.AutresPersonnes: - _ = match_arg_458.value + elif match_arg_448.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.AutresPersonnes: + _ = match_arg_448.value temp_equivalence_loyer_23 = False return (((date_courante_12 >= date_of_numbers(2021,10,1)) and (date_courante_12 < date_of_numbers(2022,7,1))) and @@ -16045,26 +15926,26 @@ def calcul_allocation_logement_foyer(calcul_allocation_logement_foyer_in:CalculA temp_equivalence_loyer_21) def temp_equivalence_loyer_24(_:Unit): def temp_equivalence_loyer_25(_:Unit): - match_arg_459 = situation_familiale_calcul_apl_5 - if match_arg_459.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_459.value + match_arg_449 = situation_familiale_calcul_apl_5 + if match_arg_449.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_449.value return money_of_cents_string("8414") - elif match_arg_459.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_459.value + elif match_arg_449.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_449.value return money_of_cents_string("13100") def temp_equivalence_loyer_26(_:Unit): - match_arg_460 = categorie_equivalence_loyer_d842_16 - if match_arg_460.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUS: - _ = match_arg_460.value + match_arg_450 = categorie_equivalence_loyer_d842_16 + if match_arg_450.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUS: + _ = match_arg_450.value temp_equivalence_loyer_27 = True - elif match_arg_460.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUSRehabilitee: - _ = match_arg_460.value + elif match_arg_450.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUSRehabilitee: + _ = match_arg_450.value temp_equivalence_loyer_27 = False - elif match_arg_460.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.PersonnesAgeesSelon3DeD842_16: - _ = match_arg_460.value + elif match_arg_450.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.PersonnesAgeesSelon3DeD842_16: + _ = match_arg_450.value temp_equivalence_loyer_27 = False - elif match_arg_460.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.AutresPersonnes: - _ = match_arg_460.value + elif match_arg_450.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.AutresPersonnes: + _ = match_arg_450.value temp_equivalence_loyer_27 = False return (((date_courante_12 >= date_of_numbers(2021,10,1)) and (date_courante_12 < date_of_numbers(2022,7,1))) and @@ -16077,26 +15958,26 @@ def calcul_allocation_logement_foyer(calcul_allocation_logement_foyer_in:CalculA def temp_equivalence_loyer_28(_:Unit): try: def temp_equivalence_loyer_29(_:Unit): - match_arg_461 = situation_familiale_calcul_apl_5 - if match_arg_461.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_461.value + match_arg_451 = situation_familiale_calcul_apl_5 + if match_arg_451.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_451.value return money_of_cents_string("17607") - elif match_arg_461.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_461.value + elif match_arg_451.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_451.value return money_of_cents_string("27365") def temp_equivalence_loyer_30(_:Unit): - match_arg_462 = categorie_equivalence_loyer_d842_16 - if match_arg_462.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUS: - _ = match_arg_462.value + match_arg_452 = categorie_equivalence_loyer_d842_16 + if match_arg_452.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUS: + _ = match_arg_452.value temp_equivalence_loyer_31 = False - elif match_arg_462.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUSRehabilitee: - _ = match_arg_462.value + elif match_arg_452.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUSRehabilitee: + _ = match_arg_452.value temp_equivalence_loyer_31 = False - elif match_arg_462.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.PersonnesAgeesSelon3DeD842_16: - _ = match_arg_462.value + elif match_arg_452.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.PersonnesAgeesSelon3DeD842_16: + _ = match_arg_452.value temp_equivalence_loyer_31 = False - elif match_arg_462.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.AutresPersonnes: - _ = match_arg_462.value + elif match_arg_452.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.AutresPersonnes: + _ = match_arg_452.value temp_equivalence_loyer_31 = True return ((date_courante_12 >= date_of_numbers(2022,7,1)) and @@ -16108,52 +15989,52 @@ def calcul_allocation_logement_foyer(calcul_allocation_logement_foyer_in:CalculA temp_equivalence_loyer_30, temp_equivalence_loyer_29) except EmptyError: - match_arg_463 = categorie_equivalence_loyer_d842_16 - if match_arg_463.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUS: - _ = match_arg_463.value + match_arg_453 = categorie_equivalence_loyer_d842_16 + if match_arg_453.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUS: + _ = match_arg_453.value temp_equivalence_loyer_32 = False - elif match_arg_463.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUSRehabilitee: - _ = match_arg_463.value + elif match_arg_453.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUSRehabilitee: + _ = match_arg_453.value temp_equivalence_loyer_32 = True - elif match_arg_463.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.PersonnesAgeesSelon3DeD842_16: - _ = match_arg_463.value + elif match_arg_453.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.PersonnesAgeesSelon3DeD842_16: + _ = match_arg_453.value temp_equivalence_loyer_32 = False - elif match_arg_463.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.AutresPersonnes: - _ = match_arg_463.value + elif match_arg_453.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.AutresPersonnes: + _ = match_arg_453.value temp_equivalence_loyer_32 = False if ((date_courante_12 >= date_of_numbers(2022,7,1)) and temp_equivalence_loyer_32): - match_arg_464 = situation_familiale_calcul_apl_5 - if match_arg_464.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_464.value + match_arg_454 = situation_familiale_calcul_apl_5 + if match_arg_454.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_454.value return money_of_cents_string("17607") - elif match_arg_464.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_464.value + elif match_arg_454.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_454.value return money_of_cents_string("27365") else: raise EmptyError def temp_equivalence_loyer_33(_:Unit): def temp_equivalence_loyer_34(_:Unit): - match_arg_465 = situation_familiale_calcul_apl_5 - if match_arg_465.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_465.value + match_arg_455 = situation_familiale_calcul_apl_5 + if match_arg_455.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_455.value return money_of_cents_string("21362") - elif match_arg_465.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_465.value + elif match_arg_455.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_455.value return money_of_cents_string("33196") def temp_equivalence_loyer_35(_:Unit): - match_arg_466 = categorie_equivalence_loyer_d842_16 - if match_arg_466.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUS: - _ = match_arg_466.value + match_arg_456 = categorie_equivalence_loyer_d842_16 + if match_arg_456.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUS: + _ = match_arg_456.value temp_equivalence_loyer_36 = False - elif match_arg_466.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUSRehabilitee: - _ = match_arg_466.value + elif match_arg_456.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUSRehabilitee: + _ = match_arg_456.value temp_equivalence_loyer_36 = False - elif match_arg_466.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.PersonnesAgeesSelon3DeD842_16: - _ = match_arg_466.value + elif match_arg_456.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.PersonnesAgeesSelon3DeD842_16: + _ = match_arg_456.value temp_equivalence_loyer_36 = True - elif match_arg_466.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.AutresPersonnes: - _ = match_arg_466.value + elif match_arg_456.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.AutresPersonnes: + _ = match_arg_456.value temp_equivalence_loyer_36 = False return ((date_courante_12 >= date_of_numbers(2022,7,1)) and temp_equivalence_loyer_36) @@ -16164,26 +16045,26 @@ def calcul_allocation_logement_foyer(calcul_allocation_logement_foyer_in:CalculA temp_equivalence_loyer_34) def temp_equivalence_loyer_37(_:Unit): def temp_equivalence_loyer_38(_:Unit): - match_arg_467 = situation_familiale_calcul_apl_5 - if match_arg_467.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_467.value + match_arg_457 = situation_familiale_calcul_apl_5 + if match_arg_457.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_457.value return money_of_cents_string("8708") - elif match_arg_467.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_467.value + elif match_arg_457.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_457.value return money_of_cents_string("13559") def temp_equivalence_loyer_39(_:Unit): - match_arg_468 = categorie_equivalence_loyer_d842_16 - if match_arg_468.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUS: - _ = match_arg_468.value + match_arg_458 = categorie_equivalence_loyer_d842_16 + if match_arg_458.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUS: + _ = match_arg_458.value temp_equivalence_loyer_40 = True - elif match_arg_468.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUSRehabilitee: - _ = match_arg_468.value + elif match_arg_458.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.EtudiantLogeEnChambreCROUSRehabilitee: + _ = match_arg_458.value temp_equivalence_loyer_40 = False - elif match_arg_468.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.PersonnesAgeesSelon3DeD842_16: - _ = match_arg_468.value + elif match_arg_458.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.PersonnesAgeesSelon3DeD842_16: + _ = match_arg_458.value temp_equivalence_loyer_40 = False - elif match_arg_468.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.AutresPersonnes: - _ = match_arg_468.value + elif match_arg_458.code == CategorieEquivalenceLoyerAllocationLogementFoyer_Code.AutresPersonnes: + _ = match_arg_458.value temp_equivalence_loyer_40 = False return ((date_courante_12 >= date_of_numbers(2022,7,1)) and temp_equivalence_loyer_40) @@ -16240,7 +16121,7 @@ def calcul_allocation_logement_foyer(calcul_allocation_logement_foyer_in:CalculA "Prologue : aides au logement"])) calcul_equivalence_loyer_minimale_dot_date_courante_2 = temp_calcul_equivalence_loyer_minimale_dot_date_courante_2 try: - temp_calcul_equivalence_loyer_minimale_dot_ressources_menage_arrondies_2 = ressources_menage_arrondies_4 + temp_calcul_equivalence_loyer_minimale_dot_ressources_menage_arrondies_2 = ressources_menage_arrondies_7 except EmptyError: temp_calcul_equivalence_loyer_minimale_dot_ressources_menage_arrondies_2 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", @@ -16300,47 +16181,44 @@ def calcul_allocation_logement_foyer(calcul_allocation_logement_foyer_in:CalculA return False def temp_montant_forfaitaire_charges_2(_:Unit): def temp_montant_forfaitaire_charges_3(_:Unit): - if ((money_of_cents_string("3614") + + montant_13 = (money_of_cents_string("3614") + (money_of_cents_string("929") * - decimal_of_integer(nombre_personnes_a_charge_5))) > - (money_of_cents_string("3614") + + decimal_of_integer(nombre_personnes_a_charge_5))) + limite_10 = (money_of_cents_string("3614") + (money_of_cents_string("929") * - decimal_of_string("6.")))): - return (money_of_cents_string("3614") + - (money_of_cents_string("929") * - decimal_of_string("6."))) + decimal_of_string("6."))) + if (montant_13 > limite_10): + return limite_10 else: - return (money_of_cents_string("3614") + - (money_of_cents_string("929") * - decimal_of_integer(nombre_personnes_a_charge_5))) + return montant_13 def temp_montant_forfaitaire_charges_4(_:Unit): - match_arg_469 = residence_6 - if match_arg_469.code == Collectivite_Code.Guadeloupe: - _ = match_arg_469.value + match_arg_459 = residence_6 + if match_arg_459.code == Collectivite_Code.Guadeloupe: + _ = match_arg_459.value temp_montant_forfaitaire_charges_5 = True - elif match_arg_469.code == Collectivite_Code.Guyane: - _ = match_arg_469.value + elif match_arg_459.code == Collectivite_Code.Guyane: + _ = match_arg_459.value temp_montant_forfaitaire_charges_5 = False - elif match_arg_469.code == Collectivite_Code.Martinique: - _ = match_arg_469.value + elif match_arg_459.code == Collectivite_Code.Martinique: + _ = match_arg_459.value temp_montant_forfaitaire_charges_5 = True - elif match_arg_469.code == Collectivite_Code.LaReunion: - _ = match_arg_469.value + elif match_arg_459.code == Collectivite_Code.LaReunion: + _ = match_arg_459.value temp_montant_forfaitaire_charges_5 = True - elif match_arg_469.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_469.value + elif match_arg_459.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_459.value temp_montant_forfaitaire_charges_5 = True - elif match_arg_469.code == Collectivite_Code.SaintMartin: - _ = match_arg_469.value + elif match_arg_459.code == Collectivite_Code.SaintMartin: + _ = match_arg_459.value temp_montant_forfaitaire_charges_5 = True - elif match_arg_469.code == Collectivite_Code.Metropole: - _ = match_arg_469.value + elif match_arg_459.code == Collectivite_Code.Metropole: + _ = match_arg_459.value temp_montant_forfaitaire_charges_5 = False - elif match_arg_469.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_469.value + elif match_arg_459.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_459.value temp_montant_forfaitaire_charges_5 = False - elif match_arg_469.code == Collectivite_Code.Mayotte: - _ = match_arg_469.value + elif match_arg_459.code == Collectivite_Code.Mayotte: + _ = match_arg_459.value temp_montant_forfaitaire_charges_5 = True return (((date_courante_12 >= date_of_numbers(2020,1,1)) and (date_courante_12 < @@ -16354,47 +16232,44 @@ def calcul_allocation_logement_foyer(calcul_allocation_logement_foyer_in:CalculA temp_montant_forfaitaire_charges_3) def temp_montant_forfaitaire_charges_6(_:Unit): def temp_montant_forfaitaire_charges_7(_:Unit): - if ((money_of_cents_string("3625") + + montant_14 = (money_of_cents_string("3625") + (money_of_cents_string("932") * - decimal_of_integer(nombre_personnes_a_charge_5))) > - (money_of_cents_string("3625") + + decimal_of_integer(nombre_personnes_a_charge_5))) + limite_11 = (money_of_cents_string("3625") + (money_of_cents_string("932") * - decimal_of_string("6.")))): - return (money_of_cents_string("3625") + - (money_of_cents_string("932") * - decimal_of_string("6."))) + decimal_of_string("6."))) + if (montant_14 > limite_11): + return limite_11 else: - return (money_of_cents_string("3625") + - (money_of_cents_string("932") * - decimal_of_integer(nombre_personnes_a_charge_5))) + return montant_14 def temp_montant_forfaitaire_charges_8(_:Unit): - match_arg_470 = residence_6 - if match_arg_470.code == Collectivite_Code.Guadeloupe: - _ = match_arg_470.value + match_arg_460 = residence_6 + if match_arg_460.code == Collectivite_Code.Guadeloupe: + _ = match_arg_460.value temp_montant_forfaitaire_charges_9 = True - elif match_arg_470.code == Collectivite_Code.Guyane: - _ = match_arg_470.value + elif match_arg_460.code == Collectivite_Code.Guyane: + _ = match_arg_460.value temp_montant_forfaitaire_charges_9 = False - elif match_arg_470.code == Collectivite_Code.Martinique: - _ = match_arg_470.value + elif match_arg_460.code == Collectivite_Code.Martinique: + _ = match_arg_460.value temp_montant_forfaitaire_charges_9 = True - elif match_arg_470.code == Collectivite_Code.LaReunion: - _ = match_arg_470.value + elif match_arg_460.code == Collectivite_Code.LaReunion: + _ = match_arg_460.value temp_montant_forfaitaire_charges_9 = True - elif match_arg_470.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_470.value + elif match_arg_460.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_460.value temp_montant_forfaitaire_charges_9 = True - elif match_arg_470.code == Collectivite_Code.SaintMartin: - _ = match_arg_470.value + elif match_arg_460.code == Collectivite_Code.SaintMartin: + _ = match_arg_460.value temp_montant_forfaitaire_charges_9 = True - elif match_arg_470.code == Collectivite_Code.Metropole: - _ = match_arg_470.value + elif match_arg_460.code == Collectivite_Code.Metropole: + _ = match_arg_460.value temp_montant_forfaitaire_charges_9 = False - elif match_arg_470.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_470.value + elif match_arg_460.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_460.value temp_montant_forfaitaire_charges_9 = False - elif match_arg_470.code == Collectivite_Code.Mayotte: - _ = match_arg_470.value + elif match_arg_460.code == Collectivite_Code.Mayotte: + _ = match_arg_460.value temp_montant_forfaitaire_charges_9 = True return (((date_courante_12 >= date_of_numbers(2020,10,1)) and (date_courante_12 < @@ -16409,47 +16284,44 @@ def calcul_allocation_logement_foyer(calcul_allocation_logement_foyer_in:CalculA def temp_montant_forfaitaire_charges_10(_:Unit): try: def temp_montant_forfaitaire_charges_11(_:Unit): - if ((money_of_cents_string("3640") + + montant_15 = (money_of_cents_string("3640") + (money_of_cents_string("936") * - decimal_of_integer(nombre_personnes_a_charge_5))) > - (money_of_cents_string("3640") + + decimal_of_integer(nombre_personnes_a_charge_5))) + limite_12 = (money_of_cents_string("3640") + (money_of_cents_string("936") * - decimal_of_string("6.")))): - return (money_of_cents_string("3640") + - (money_of_cents_string("936") * - decimal_of_string("6."))) + decimal_of_string("6."))) + if (montant_15 > limite_12): + return limite_12 else: - return (money_of_cents_string("3640") + - (money_of_cents_string("936") * - decimal_of_integer(nombre_personnes_a_charge_5))) + return montant_15 def temp_montant_forfaitaire_charges_12(_:Unit): - match_arg_471 = residence_6 - if match_arg_471.code == Collectivite_Code.Guadeloupe: - _ = match_arg_471.value + match_arg_461 = residence_6 + if match_arg_461.code == Collectivite_Code.Guadeloupe: + _ = match_arg_461.value temp_montant_forfaitaire_charges_13 = True - elif match_arg_471.code == Collectivite_Code.Guyane: - _ = match_arg_471.value + elif match_arg_461.code == Collectivite_Code.Guyane: + _ = match_arg_461.value temp_montant_forfaitaire_charges_13 = False - elif match_arg_471.code == Collectivite_Code.Martinique: - _ = match_arg_471.value + elif match_arg_461.code == Collectivite_Code.Martinique: + _ = match_arg_461.value temp_montant_forfaitaire_charges_13 = True - elif match_arg_471.code == Collectivite_Code.LaReunion: - _ = match_arg_471.value + elif match_arg_461.code == Collectivite_Code.LaReunion: + _ = match_arg_461.value temp_montant_forfaitaire_charges_13 = True - elif match_arg_471.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_471.value + elif match_arg_461.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_461.value temp_montant_forfaitaire_charges_13 = True - elif match_arg_471.code == Collectivite_Code.SaintMartin: - _ = match_arg_471.value + elif match_arg_461.code == Collectivite_Code.SaintMartin: + _ = match_arg_461.value temp_montant_forfaitaire_charges_13 = True - elif match_arg_471.code == Collectivite_Code.Metropole: - _ = match_arg_471.value + elif match_arg_461.code == Collectivite_Code.Metropole: + _ = match_arg_461.value temp_montant_forfaitaire_charges_13 = False - elif match_arg_471.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_471.value + elif match_arg_461.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_461.value temp_montant_forfaitaire_charges_13 = False - elif match_arg_471.code == Collectivite_Code.Mayotte: - _ = match_arg_471.value + elif match_arg_461.code == Collectivite_Code.Mayotte: + _ = match_arg_461.value temp_montant_forfaitaire_charges_13 = True return (((date_courante_12 >= date_of_numbers(2021,10,1)) and @@ -16463,95 +16335,89 @@ def calcul_allocation_logement_foyer(calcul_allocation_logement_foyer_in:CalculA temp_montant_forfaitaire_charges_12, temp_montant_forfaitaire_charges_11) except EmptyError: - match_arg_472 = residence_6 - if match_arg_472.code == Collectivite_Code.Guadeloupe: - _ = match_arg_472.value + match_arg_462 = residence_6 + if match_arg_462.code == Collectivite_Code.Guadeloupe: + _ = match_arg_462.value temp_montant_forfaitaire_charges_14 = True - elif match_arg_472.code == Collectivite_Code.Guyane: - _ = match_arg_472.value + elif match_arg_462.code == Collectivite_Code.Guyane: + _ = match_arg_462.value temp_montant_forfaitaire_charges_14 = False - elif match_arg_472.code == Collectivite_Code.Martinique: - _ = match_arg_472.value + elif match_arg_462.code == Collectivite_Code.Martinique: + _ = match_arg_462.value temp_montant_forfaitaire_charges_14 = True - elif match_arg_472.code == Collectivite_Code.LaReunion: - _ = match_arg_472.value + elif match_arg_462.code == Collectivite_Code.LaReunion: + _ = match_arg_462.value temp_montant_forfaitaire_charges_14 = True - elif match_arg_472.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_472.value + elif match_arg_462.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_462.value temp_montant_forfaitaire_charges_14 = True - elif match_arg_472.code == Collectivite_Code.SaintMartin: - _ = match_arg_472.value + elif match_arg_462.code == Collectivite_Code.SaintMartin: + _ = match_arg_462.value temp_montant_forfaitaire_charges_14 = True - elif match_arg_472.code == Collectivite_Code.Metropole: - _ = match_arg_472.value + elif match_arg_462.code == Collectivite_Code.Metropole: + _ = match_arg_462.value temp_montant_forfaitaire_charges_14 = False - elif match_arg_472.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_472.value + elif match_arg_462.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_462.value temp_montant_forfaitaire_charges_14 = False - elif match_arg_472.code == Collectivite_Code.Mayotte: - _ = match_arg_472.value + elif match_arg_462.code == Collectivite_Code.Mayotte: + _ = match_arg_462.value temp_montant_forfaitaire_charges_14 = True if (((date_courante_12 >= date_of_numbers(2022,1,1)) and (date_courante_12 < date_of_numbers(2022,7,1))) and temp_montant_forfaitaire_charges_14): - if ((money_of_cents_string("3640") + + montant_16 = (money_of_cents_string("3640") + (money_of_cents_string("936") * - decimal_of_integer(nombre_personnes_a_charge_5))) > - (money_of_cents_string("3640") + + decimal_of_integer(nombre_personnes_a_charge_5))) + limite_13 = (money_of_cents_string("3640") + (money_of_cents_string("936") * - decimal_of_string("6.")))): - return (money_of_cents_string("3640") + - (money_of_cents_string("936") * - decimal_of_string("6."))) + decimal_of_string("6."))) + if (montant_16 > limite_13): + return limite_13 else: - return (money_of_cents_string("3640") + - (money_of_cents_string("936") * - decimal_of_integer(nombre_personnes_a_charge_5))) + return montant_16 else: raise EmptyError def temp_montant_forfaitaire_charges_15(_:Unit): def temp_montant_forfaitaire_charges_16(_:Unit): - if ((money_of_cents_string("3767") + + montant_17 = (money_of_cents_string("3767") + (money_of_cents_string("969") * - decimal_of_integer(nombre_personnes_a_charge_5))) > - (money_of_cents_string("3767") + + decimal_of_integer(nombre_personnes_a_charge_5))) + limite_14 = (money_of_cents_string("3767") + (money_of_cents_string("969") * - decimal_of_string("6.")))): - return (money_of_cents_string("3767") + - (money_of_cents_string("969") * - decimal_of_string("6."))) + decimal_of_string("6."))) + if (montant_17 > limite_14): + return limite_14 else: - return (money_of_cents_string("3767") + - (money_of_cents_string("969") * - decimal_of_integer(nombre_personnes_a_charge_5))) + return montant_17 def temp_montant_forfaitaire_charges_17(_:Unit): - match_arg_473 = residence_6 - if match_arg_473.code == Collectivite_Code.Guadeloupe: - _ = match_arg_473.value + match_arg_463 = residence_6 + if match_arg_463.code == Collectivite_Code.Guadeloupe: + _ = match_arg_463.value temp_montant_forfaitaire_charges_18 = True - elif match_arg_473.code == Collectivite_Code.Guyane: - _ = match_arg_473.value + elif match_arg_463.code == Collectivite_Code.Guyane: + _ = match_arg_463.value temp_montant_forfaitaire_charges_18 = False - elif match_arg_473.code == Collectivite_Code.Martinique: - _ = match_arg_473.value + elif match_arg_463.code == Collectivite_Code.Martinique: + _ = match_arg_463.value temp_montant_forfaitaire_charges_18 = True - elif match_arg_473.code == Collectivite_Code.LaReunion: - _ = match_arg_473.value + elif match_arg_463.code == Collectivite_Code.LaReunion: + _ = match_arg_463.value temp_montant_forfaitaire_charges_18 = True - elif match_arg_473.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_473.value + elif match_arg_463.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_463.value temp_montant_forfaitaire_charges_18 = True - elif match_arg_473.code == Collectivite_Code.SaintMartin: - _ = match_arg_473.value + elif match_arg_463.code == Collectivite_Code.SaintMartin: + _ = match_arg_463.value temp_montant_forfaitaire_charges_18 = True - elif match_arg_473.code == Collectivite_Code.Metropole: - _ = match_arg_473.value + elif match_arg_463.code == Collectivite_Code.Metropole: + _ = match_arg_463.value temp_montant_forfaitaire_charges_18 = False - elif match_arg_473.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_473.value + elif match_arg_463.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_463.value temp_montant_forfaitaire_charges_18 = False - elif match_arg_473.code == Collectivite_Code.Mayotte: - _ = match_arg_473.value + elif match_arg_463.code == Collectivite_Code.Mayotte: + _ = match_arg_463.value temp_montant_forfaitaire_charges_18 = True return (((date_courante_12 >= date_of_numbers(2022,7,1)) and (date_courante_12 < @@ -16569,33 +16435,33 @@ def calcul_allocation_logement_foyer(calcul_allocation_logement_foyer_in:CalculA (money_of_cents_string("969") * multiplicateur_majoration_charges)) def temp_montant_forfaitaire_charges_21(_:Unit): - match_arg_474 = residence_6 - if match_arg_474.code == Collectivite_Code.Guadeloupe: - _ = match_arg_474.value + match_arg_464 = residence_6 + if match_arg_464.code == Collectivite_Code.Guadeloupe: + _ = match_arg_464.value temp_montant_forfaitaire_charges_22 = True - elif match_arg_474.code == Collectivite_Code.Guyane: - _ = match_arg_474.value + elif match_arg_464.code == Collectivite_Code.Guyane: + _ = match_arg_464.value temp_montant_forfaitaire_charges_22 = False - elif match_arg_474.code == Collectivite_Code.Martinique: - _ = match_arg_474.value + elif match_arg_464.code == Collectivite_Code.Martinique: + _ = match_arg_464.value temp_montant_forfaitaire_charges_22 = True - elif match_arg_474.code == Collectivite_Code.LaReunion: - _ = match_arg_474.value + elif match_arg_464.code == Collectivite_Code.LaReunion: + _ = match_arg_464.value temp_montant_forfaitaire_charges_22 = True - elif match_arg_474.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_474.value + elif match_arg_464.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_464.value temp_montant_forfaitaire_charges_22 = True - elif match_arg_474.code == Collectivite_Code.SaintMartin: - _ = match_arg_474.value + elif match_arg_464.code == Collectivite_Code.SaintMartin: + _ = match_arg_464.value temp_montant_forfaitaire_charges_22 = True - elif match_arg_474.code == Collectivite_Code.Metropole: - _ = match_arg_474.value + elif match_arg_464.code == Collectivite_Code.Metropole: + _ = match_arg_464.value temp_montant_forfaitaire_charges_22 = False - elif match_arg_474.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_474.value + elif match_arg_464.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_464.value temp_montant_forfaitaire_charges_22 = False - elif match_arg_474.code == Collectivite_Code.Mayotte: - _ = match_arg_474.value + elif match_arg_464.code == Collectivite_Code.Mayotte: + _ = match_arg_464.value temp_montant_forfaitaire_charges_22 = True return ((date_courante_12 >= date_of_numbers(2023,1,1)) and @@ -16695,13 +16561,13 @@ def calcul_allocation_logement_foyer(calcul_allocation_logement_foyer_in:CalculA "Calcul du montant de l'allocation logement", "Prologue : aides au logement"])) montant_forfaitaire_charges = temp_montant_forfaitaire_charges_23 - def temp_traitement_aide_finale_minoration_forfaitaire_3(aide_finale_17:Money): + def temp_traitement_aide_finale_minoration_forfaitaire_3(aide_finale_32:Money): try: - if ((aide_finale_17 - montant_forfaitaire_d842_15) < + if ((aide_finale_32 - montant_forfaitaire_d842_15) < money_of_cents_string("0")): return money_of_cents_string("0") else: - return (aide_finale_17 - montant_forfaitaire_d842_15) + return (aide_finale_32 - montant_forfaitaire_d842_15) except EmptyError: raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", start_line=1010, @@ -16735,7 +16601,7 @@ def calcul_allocation_logement_foyer(calcul_allocation_logement_foyer_in:CalculA law_headings=["Secteur logement-foyer", "Calcul du montant de l'allocation logement", "Prologue : aides au logement"])) - depense_nette_minimale = temp_depense_nette_minimale + depense_nette_minimale_2 = temp_depense_nette_minimale try: temp_aide_finale_formule_3 = (((equivalence_loyer + montant_forfaitaire_charges) - loyer_minimal) * @@ -16752,10 +16618,10 @@ def calcul_allocation_logement_foyer(calcul_allocation_logement_foyer_in:CalculA aide_finale_formule_3 = temp_aide_finale_formule_3 def temp_abattement_depense_nette_minimale(allocation_mensuelle_5:Money): try: - if (depense_nette_minimale(allocation_mensuelle_5) < + if (depense_nette_minimale_2(allocation_mensuelle_5) < montant_minimal_depense_nette_d842_17): return (montant_minimal_depense_nette_d842_17 - - depense_nette_minimale(allocation_mensuelle_5)) + depense_nette_minimale_2(allocation_mensuelle_5)) else: return money_of_cents_string("0") except EmptyError: @@ -16767,18 +16633,16 @@ def calcul_allocation_logement_foyer(calcul_allocation_logement_foyer_in:CalculA "Calcul du montant de l'allocation logement", "Prologue : aides au logement"])) abattement_depense_nette_minimale = temp_abattement_depense_nette_minimale - def temp_traitement_aide_finale_depense_nette_minimale(aide_finale_18:Money): + def temp_traitement_aide_finale_depense_nette_minimale(aide_finale_33:Money): try: - if ((traitement_aide_finale_minoration_forfaitaire_3(aide_finale_18) - - abattement_depense_nette_minimale(traitement_aide_finale_minoration_forfaitaire_3( - aide_finale_18))) < + aide_finale_34 = traitement_aide_finale_minoration_forfaitaire_3( + aide_finale_33) + abattement = abattement_depense_nette_minimale(aide_finale_34) + if ((aide_finale_34 - abattement) < money_of_cents_string("0")): return money_of_cents_string("0") else: - return (traitement_aide_finale_minoration_forfaitaire_3( - aide_finale_18) - - abattement_depense_nette_minimale(traitement_aide_finale_minoration_forfaitaire_3( - aide_finale_18))) + return (aide_finale_34 - abattement) except EmptyError: raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", start_line=1011, @@ -16789,14 +16653,14 @@ def calcul_allocation_logement_foyer(calcul_allocation_logement_foyer_in:CalculA "Calcul du montant de l'allocation logement", "Prologue : aides au logement"])) traitement_aide_finale_depense_nette_minimale = temp_traitement_aide_finale_depense_nette_minimale - def temp_traitement_aide_finale_redevance(aide_finale_19:Money): + def temp_traitement_aide_finale_redevance(aide_finale_35:Money): try: - if (traitement_aide_finale_depense_nette_minimale(aide_finale_19) > - redevance_1): + aide_finale_36 = traitement_aide_finale_depense_nette_minimale( + aide_finale_35) + if (aide_finale_36 > redevance_1): return redevance_1 else: - return traitement_aide_finale_depense_nette_minimale( - aide_finale_19) + return aide_finale_36 except EmptyError: raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", start_line=1012, @@ -16807,22 +16671,15 @@ def calcul_allocation_logement_foyer(calcul_allocation_logement_foyer_in:CalculA "Calcul du montant de l'allocation logement", "Prologue : aides au logement"])) traitement_aide_finale_redevance = temp_traitement_aide_finale_redevance - def temp_traitement_aide_finale_contributions_sociales_arrondi_3(aide_finale_20:Money): + def temp_traitement_aide_finale_contributions_sociales_arrondi_3(aide_finale_37:Money): try: - if ((money_round(((traitement_aide_finale_redevance(aide_finale_20) - - contributions_sociales_dot_montant_3(traitement_aide_finale_redevance( - aide_finale_20))) - - money_of_cents_string("50"))) + - contributions_sociales_dot_montant_3(traitement_aide_finale_redevance( - aide_finale_20))) >= + aide_finale_38 = traitement_aide_finale_redevance(aide_finale_37) + crds_3 = contributions_sociales_dot_montant_3(aide_finale_38) + aide_finale_moins_crds_arrondie_3 = money_round(((aide_finale_38 - + crds_3) - money_of_cents_string("50"))) + if ((aide_finale_moins_crds_arrondie_3 + crds_3) >= money_of_cents_string("0")): - return (money_round(((traitement_aide_finale_redevance( - aide_finale_20) - - contributions_sociales_dot_montant_3(traitement_aide_finale_redevance( - aide_finale_20))) - - money_of_cents_string("50"))) + - contributions_sociales_dot_montant_3(traitement_aide_finale_redevance( - aide_finale_20))) + return (aide_finale_moins_crds_arrondie_3 + crds_3) else: return money_of_cents_string("0") except EmptyError: @@ -16835,10 +16692,10 @@ def calcul_allocation_logement_foyer(calcul_allocation_logement_foyer_in:CalculA "Calcul du montant de l'allocation logement", "Prologue : aides au logement"])) traitement_aide_finale_contributions_sociales_arrondi_3 = temp_traitement_aide_finale_contributions_sociales_arrondi_3 - def temp_traitement_aide_finale_montee_en_charge_saint_pierre_miquelon_1(aide_finale_21:Money): + def temp_traitement_aide_finale_montee_en_charge_saint_pierre_miquelon_1(aide_finale_39:Money): try: return montee_en_charge_saint_pierre_miquelon(traitement_aide_finale_contributions_sociales_arrondi_3( - aide_finale_21), + aide_finale_39), residence_6, date_courante_12) except EmptyError: @@ -16851,15 +16708,15 @@ def calcul_allocation_logement_foyer(calcul_allocation_logement_foyer_in:CalculA "Calcul du montant de l'allocation logement", "Prologue : aides au logement"])) traitement_aide_finale_montee_en_charge_saint_pierre_miquelon_1 = temp_traitement_aide_finale_montee_en_charge_saint_pierre_miquelon_1 - def temp_traitement_aide_finale_montant_minimal_3(aide_finale_22:Money): + def temp_traitement_aide_finale_montant_minimal_3(aide_finale_40:Money): try: - if (traitement_aide_finale_montee_en_charge_saint_pierre_miquelon_1( - aide_finale_22) < + aide_finale_41 = traitement_aide_finale_montee_en_charge_saint_pierre_miquelon_1( + aide_finale_40) + if (aide_finale_41 < montant_minimal_aide_d842_15): return money_of_cents_string("0") else: - return traitement_aide_finale_montee_en_charge_saint_pierre_miquelon_1( - aide_finale_22) + return aide_finale_41 except EmptyError: raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", start_line=1021, @@ -16992,33 +16849,33 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac def temp_multiplicateur_majoration_charges_10(_:Unit): return decimal_of_string("6.") def temp_multiplicateur_majoration_charges_11(_:Unit): - match_arg_475 = residence_7 - if match_arg_475.code == Collectivite_Code.Guadeloupe: - _ = match_arg_475.value + match_arg_465 = residence_7 + if match_arg_465.code == Collectivite_Code.Guadeloupe: + _ = match_arg_465.value temp_multiplicateur_majoration_charges_12 = True - elif match_arg_475.code == Collectivite_Code.Guyane: - _ = match_arg_475.value + elif match_arg_465.code == Collectivite_Code.Guyane: + _ = match_arg_465.value temp_multiplicateur_majoration_charges_12 = False - elif match_arg_475.code == Collectivite_Code.Martinique: - _ = match_arg_475.value + elif match_arg_465.code == Collectivite_Code.Martinique: + _ = match_arg_465.value temp_multiplicateur_majoration_charges_12 = True - elif match_arg_475.code == Collectivite_Code.LaReunion: - _ = match_arg_475.value + elif match_arg_465.code == Collectivite_Code.LaReunion: + _ = match_arg_465.value temp_multiplicateur_majoration_charges_12 = True - elif match_arg_475.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_475.value + elif match_arg_465.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_465.value temp_multiplicateur_majoration_charges_12 = True - elif match_arg_475.code == Collectivite_Code.SaintMartin: - _ = match_arg_475.value + elif match_arg_465.code == Collectivite_Code.SaintMartin: + _ = match_arg_465.value temp_multiplicateur_majoration_charges_12 = True - elif match_arg_475.code == Collectivite_Code.Metropole: - _ = match_arg_475.value + elif match_arg_465.code == Collectivite_Code.Metropole: + _ = match_arg_465.value temp_multiplicateur_majoration_charges_12 = False - elif match_arg_475.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_475.value + elif match_arg_465.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_465.value temp_multiplicateur_majoration_charges_12 = False - elif match_arg_475.code == Collectivite_Code.Mayotte: - _ = match_arg_475.value + elif match_arg_465.code == Collectivite_Code.Mayotte: + _ = match_arg_465.value temp_multiplicateur_majoration_charges_12 = True return (((date_courante_13 >= date_of_numbers(2020,1,1)) and @@ -17034,33 +16891,33 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac temp_multiplicateur_majoration_charges_11, temp_multiplicateur_majoration_charges_10) except EmptyError: - match_arg_476 = residence_7 - if match_arg_476.code == Collectivite_Code.Guadeloupe: - _ = match_arg_476.value + match_arg_466 = residence_7 + if match_arg_466.code == Collectivite_Code.Guadeloupe: + _ = match_arg_466.value temp_multiplicateur_majoration_charges_14 = True - elif match_arg_476.code == Collectivite_Code.Guyane: - _ = match_arg_476.value + elif match_arg_466.code == Collectivite_Code.Guyane: + _ = match_arg_466.value temp_multiplicateur_majoration_charges_14 = False - elif match_arg_476.code == Collectivite_Code.Martinique: - _ = match_arg_476.value + elif match_arg_466.code == Collectivite_Code.Martinique: + _ = match_arg_466.value temp_multiplicateur_majoration_charges_14 = True - elif match_arg_476.code == Collectivite_Code.LaReunion: - _ = match_arg_476.value + elif match_arg_466.code == Collectivite_Code.LaReunion: + _ = match_arg_466.value temp_multiplicateur_majoration_charges_14 = True - elif match_arg_476.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_476.value + elif match_arg_466.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_466.value temp_multiplicateur_majoration_charges_14 = True - elif match_arg_476.code == Collectivite_Code.SaintMartin: - _ = match_arg_476.value + elif match_arg_466.code == Collectivite_Code.SaintMartin: + _ = match_arg_466.value temp_multiplicateur_majoration_charges_14 = True - elif match_arg_476.code == Collectivite_Code.Metropole: - _ = match_arg_476.value + elif match_arg_466.code == Collectivite_Code.Metropole: + _ = match_arg_466.value temp_multiplicateur_majoration_charges_14 = False - elif match_arg_476.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_476.value + elif match_arg_466.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_466.value temp_multiplicateur_majoration_charges_14 = False - elif match_arg_476.code == Collectivite_Code.Mayotte: - _ = match_arg_476.value + elif match_arg_466.code == Collectivite_Code.Mayotte: + _ = match_arg_466.value temp_multiplicateur_majoration_charges_14 = True if (((date_courante_13 >= date_of_numbers(2020,10,1)) and @@ -17074,33 +16931,33 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac temp_multiplicateur_majoration_charges_13 = dead_value raise EmptyError except EmptyError: - match_arg_477 = residence_7 - if match_arg_477.code == Collectivite_Code.Guadeloupe: - _ = match_arg_477.value + match_arg_467 = residence_7 + if match_arg_467.code == Collectivite_Code.Guadeloupe: + _ = match_arg_467.value temp_multiplicateur_majoration_charges_15 = True - elif match_arg_477.code == Collectivite_Code.Guyane: - _ = match_arg_477.value + elif match_arg_467.code == Collectivite_Code.Guyane: + _ = match_arg_467.value temp_multiplicateur_majoration_charges_15 = False - elif match_arg_477.code == Collectivite_Code.Martinique: - _ = match_arg_477.value + elif match_arg_467.code == Collectivite_Code.Martinique: + _ = match_arg_467.value temp_multiplicateur_majoration_charges_15 = True - elif match_arg_477.code == Collectivite_Code.LaReunion: - _ = match_arg_477.value + elif match_arg_467.code == Collectivite_Code.LaReunion: + _ = match_arg_467.value temp_multiplicateur_majoration_charges_15 = True - elif match_arg_477.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_477.value + elif match_arg_467.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_467.value temp_multiplicateur_majoration_charges_15 = True - elif match_arg_477.code == Collectivite_Code.SaintMartin: - _ = match_arg_477.value + elif match_arg_467.code == Collectivite_Code.SaintMartin: + _ = match_arg_467.value temp_multiplicateur_majoration_charges_15 = True - elif match_arg_477.code == Collectivite_Code.Metropole: - _ = match_arg_477.value + elif match_arg_467.code == Collectivite_Code.Metropole: + _ = match_arg_467.value temp_multiplicateur_majoration_charges_15 = False - elif match_arg_477.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_477.value + elif match_arg_467.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_467.value temp_multiplicateur_majoration_charges_15 = False - elif match_arg_477.code == Collectivite_Code.Mayotte: - _ = match_arg_477.value + elif match_arg_467.code == Collectivite_Code.Mayotte: + _ = match_arg_467.value temp_multiplicateur_majoration_charges_15 = True if (((date_courante_13 >= date_of_numbers(2021,10,1)) and @@ -17114,33 +16971,33 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac temp_multiplicateur_majoration_charges_13 = dead_value raise EmptyError except EmptyError: - match_arg_478 = residence_7 - if match_arg_478.code == Collectivite_Code.Guadeloupe: - _ = match_arg_478.value + match_arg_468 = residence_7 + if match_arg_468.code == Collectivite_Code.Guadeloupe: + _ = match_arg_468.value temp_multiplicateur_majoration_charges_16 = True - elif match_arg_478.code == Collectivite_Code.Guyane: - _ = match_arg_478.value + elif match_arg_468.code == Collectivite_Code.Guyane: + _ = match_arg_468.value temp_multiplicateur_majoration_charges_16 = False - elif match_arg_478.code == Collectivite_Code.Martinique: - _ = match_arg_478.value + elif match_arg_468.code == Collectivite_Code.Martinique: + _ = match_arg_468.value temp_multiplicateur_majoration_charges_16 = True - elif match_arg_478.code == Collectivite_Code.LaReunion: - _ = match_arg_478.value + elif match_arg_468.code == Collectivite_Code.LaReunion: + _ = match_arg_468.value temp_multiplicateur_majoration_charges_16 = True - elif match_arg_478.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_478.value + elif match_arg_468.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_468.value temp_multiplicateur_majoration_charges_16 = True - elif match_arg_478.code == Collectivite_Code.SaintMartin: - _ = match_arg_478.value + elif match_arg_468.code == Collectivite_Code.SaintMartin: + _ = match_arg_468.value temp_multiplicateur_majoration_charges_16 = True - elif match_arg_478.code == Collectivite_Code.Metropole: - _ = match_arg_478.value + elif match_arg_468.code == Collectivite_Code.Metropole: + _ = match_arg_468.value temp_multiplicateur_majoration_charges_16 = False - elif match_arg_478.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_478.value + elif match_arg_468.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_468.value temp_multiplicateur_majoration_charges_16 = False - elif match_arg_478.code == Collectivite_Code.Mayotte: - _ = match_arg_478.value + elif match_arg_468.code == Collectivite_Code.Mayotte: + _ = match_arg_468.value temp_multiplicateur_majoration_charges_16 = True if (((date_courante_13 >= date_of_numbers(2022,1,1)) and (date_courante_13 < date_of_numbers(2022,7,1))) and @@ -17152,33 +17009,33 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac temp_multiplicateur_majoration_charges_13 = dead_value raise EmptyError except EmptyError: - match_arg_479 = residence_7 - if match_arg_479.code == Collectivite_Code.Guadeloupe: - _ = match_arg_479.value + match_arg_469 = residence_7 + if match_arg_469.code == Collectivite_Code.Guadeloupe: + _ = match_arg_469.value temp_multiplicateur_majoration_charges_17 = True - elif match_arg_479.code == Collectivite_Code.Guyane: - _ = match_arg_479.value + elif match_arg_469.code == Collectivite_Code.Guyane: + _ = match_arg_469.value temp_multiplicateur_majoration_charges_17 = False - elif match_arg_479.code == Collectivite_Code.Martinique: - _ = match_arg_479.value + elif match_arg_469.code == Collectivite_Code.Martinique: + _ = match_arg_469.value temp_multiplicateur_majoration_charges_17 = True - elif match_arg_479.code == Collectivite_Code.LaReunion: - _ = match_arg_479.value + elif match_arg_469.code == Collectivite_Code.LaReunion: + _ = match_arg_469.value temp_multiplicateur_majoration_charges_17 = True - elif match_arg_479.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_479.value + elif match_arg_469.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_469.value temp_multiplicateur_majoration_charges_17 = True - elif match_arg_479.code == Collectivite_Code.SaintMartin: - _ = match_arg_479.value + elif match_arg_469.code == Collectivite_Code.SaintMartin: + _ = match_arg_469.value temp_multiplicateur_majoration_charges_17 = True - elif match_arg_479.code == Collectivite_Code.Metropole: - _ = match_arg_479.value + elif match_arg_469.code == Collectivite_Code.Metropole: + _ = match_arg_469.value temp_multiplicateur_majoration_charges_17 = False - elif match_arg_479.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_479.value + elif match_arg_469.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_469.value temp_multiplicateur_majoration_charges_17 = False - elif match_arg_479.code == Collectivite_Code.Mayotte: - _ = match_arg_479.value + elif match_arg_469.code == Collectivite_Code.Mayotte: + _ = match_arg_469.value temp_multiplicateur_majoration_charges_17 = True if (((date_courante_13 >= date_of_numbers(2022,7,1)) and (date_courante_13 < date_of_numbers(2023,1,1))) and @@ -17371,33 +17228,33 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac def temp_condition_d842_11_3(_:Unit): return False def temp_condition_d842_11_3_1(_:Unit): - match_arg_480 = residence_7 - if match_arg_480.code == Collectivite_Code.Guadeloupe: - _ = match_arg_480.value + match_arg_470 = residence_7 + if match_arg_470.code == Collectivite_Code.Guadeloupe: + _ = match_arg_470.value temp_condition_d842_11_3_2 = False - elif match_arg_480.code == Collectivite_Code.Guyane: - _ = match_arg_480.value + elif match_arg_470.code == Collectivite_Code.Guyane: + _ = match_arg_470.value temp_condition_d842_11_3_2 = False - elif match_arg_480.code == Collectivite_Code.Martinique: - _ = match_arg_480.value + elif match_arg_470.code == Collectivite_Code.Martinique: + _ = match_arg_470.value temp_condition_d842_11_3_2 = False - elif match_arg_480.code == Collectivite_Code.LaReunion: - _ = match_arg_480.value + elif match_arg_470.code == Collectivite_Code.LaReunion: + _ = match_arg_470.value temp_condition_d842_11_3_2 = False - elif match_arg_480.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_480.value + elif match_arg_470.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_470.value temp_condition_d842_11_3_2 = True - elif match_arg_480.code == Collectivite_Code.SaintMartin: - _ = match_arg_480.value + elif match_arg_470.code == Collectivite_Code.SaintMartin: + _ = match_arg_470.value temp_condition_d842_11_3_2 = True - elif match_arg_480.code == Collectivite_Code.Metropole: - _ = match_arg_480.value + elif match_arg_470.code == Collectivite_Code.Metropole: + _ = match_arg_470.value temp_condition_d842_11_3_2 = False - elif match_arg_480.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_480.value + elif match_arg_470.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_470.value temp_condition_d842_11_3_2 = False - elif match_arg_480.code == Collectivite_Code.Mayotte: - _ = match_arg_480.value + elif match_arg_470.code == Collectivite_Code.Mayotte: + _ = match_arg_470.value temp_condition_d842_11_3_2 = False return (((date_courante_13 >= date_of_numbers(2019,9,1)) and @@ -17412,33 +17269,33 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac temp_condition_d842_11_3_1, temp_condition_d842_11_3) except EmptyError: - match_arg_481 = residence_7 - if match_arg_481.code == Collectivite_Code.Guadeloupe: - _ = match_arg_481.value + match_arg_471 = residence_7 + if match_arg_471.code == Collectivite_Code.Guadeloupe: + _ = match_arg_471.value temp_condition_d842_11_3_4 = False - elif match_arg_481.code == Collectivite_Code.Guyane: - _ = match_arg_481.value + elif match_arg_471.code == Collectivite_Code.Guyane: + _ = match_arg_471.value temp_condition_d842_11_3_4 = False - elif match_arg_481.code == Collectivite_Code.Martinique: - _ = match_arg_481.value + elif match_arg_471.code == Collectivite_Code.Martinique: + _ = match_arg_471.value temp_condition_d842_11_3_4 = False - elif match_arg_481.code == Collectivite_Code.LaReunion: - _ = match_arg_481.value + elif match_arg_471.code == Collectivite_Code.LaReunion: + _ = match_arg_471.value temp_condition_d842_11_3_4 = False - elif match_arg_481.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_481.value + elif match_arg_471.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_471.value temp_condition_d842_11_3_4 = True - elif match_arg_481.code == Collectivite_Code.SaintMartin: - _ = match_arg_481.value + elif match_arg_471.code == Collectivite_Code.SaintMartin: + _ = match_arg_471.value temp_condition_d842_11_3_4 = True - elif match_arg_481.code == Collectivite_Code.Metropole: - _ = match_arg_481.value + elif match_arg_471.code == Collectivite_Code.Metropole: + _ = match_arg_471.value temp_condition_d842_11_3_4 = False - elif match_arg_481.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_481.value + elif match_arg_471.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_471.value temp_condition_d842_11_3_4 = False - elif match_arg_481.code == Collectivite_Code.Mayotte: - _ = match_arg_481.value + elif match_arg_471.code == Collectivite_Code.Mayotte: + _ = match_arg_471.value temp_condition_d842_11_3_4 = False if ((date_courante_13 >= date_of_numbers(2023,4,5)) and @@ -17449,33 +17306,33 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac temp_condition_d842_11_3_3 = dead_value raise EmptyError except EmptyError: - match_arg_482 = residence_7 - if match_arg_482.code == Collectivite_Code.Guadeloupe: - _ = match_arg_482.value + match_arg_472 = residence_7 + if match_arg_472.code == Collectivite_Code.Guadeloupe: + _ = match_arg_472.value temp_condition_d842_11_3_5 = True - elif match_arg_482.code == Collectivite_Code.Guyane: - _ = match_arg_482.value + elif match_arg_472.code == Collectivite_Code.Guyane: + _ = match_arg_472.value temp_condition_d842_11_3_5 = True - elif match_arg_482.code == Collectivite_Code.Martinique: - _ = match_arg_482.value + elif match_arg_472.code == Collectivite_Code.Martinique: + _ = match_arg_472.value temp_condition_d842_11_3_5 = True - elif match_arg_482.code == Collectivite_Code.LaReunion: - _ = match_arg_482.value + elif match_arg_472.code == Collectivite_Code.LaReunion: + _ = match_arg_472.value temp_condition_d842_11_3_5 = True - elif match_arg_482.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_482.value + elif match_arg_472.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_472.value temp_condition_d842_11_3_5 = False - elif match_arg_482.code == Collectivite_Code.SaintMartin: - _ = match_arg_482.value + elif match_arg_472.code == Collectivite_Code.SaintMartin: + _ = match_arg_472.value temp_condition_d842_11_3_5 = False - elif match_arg_482.code == Collectivite_Code.Metropole: - _ = match_arg_482.value + elif match_arg_472.code == Collectivite_Code.Metropole: + _ = match_arg_472.value temp_condition_d842_11_3_5 = False - elif match_arg_482.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_482.value + elif match_arg_472.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_472.value temp_condition_d842_11_3_5 = False - elif match_arg_482.code == Collectivite_Code.Mayotte: - _ = match_arg_482.value + elif match_arg_472.code == Collectivite_Code.Mayotte: + _ = match_arg_472.value temp_condition_d842_11_3_5 = True if (((date_courante_13 >= date_of_numbers(2019,9,1)) and @@ -17488,33 +17345,33 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac temp_condition_d842_11_3_3 = dead_value raise EmptyError except EmptyError: - match_arg_483 = residence_7 - if match_arg_483.code == Collectivite_Code.Guadeloupe: - _ = match_arg_483.value + match_arg_473 = residence_7 + if match_arg_473.code == Collectivite_Code.Guadeloupe: + _ = match_arg_473.value temp_condition_d842_11_3_6 = True - elif match_arg_483.code == Collectivite_Code.Guyane: - _ = match_arg_483.value + elif match_arg_473.code == Collectivite_Code.Guyane: + _ = match_arg_473.value temp_condition_d842_11_3_6 = True - elif match_arg_483.code == Collectivite_Code.Martinique: - _ = match_arg_483.value + elif match_arg_473.code == Collectivite_Code.Martinique: + _ = match_arg_473.value temp_condition_d842_11_3_6 = True - elif match_arg_483.code == Collectivite_Code.LaReunion: - _ = match_arg_483.value + elif match_arg_473.code == Collectivite_Code.LaReunion: + _ = match_arg_473.value temp_condition_d842_11_3_6 = True - elif match_arg_483.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_483.value + elif match_arg_473.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_473.value temp_condition_d842_11_3_6 = False - elif match_arg_483.code == Collectivite_Code.SaintMartin: - _ = match_arg_483.value + elif match_arg_473.code == Collectivite_Code.SaintMartin: + _ = match_arg_473.value temp_condition_d842_11_3_6 = False - elif match_arg_483.code == Collectivite_Code.Metropole: - _ = match_arg_483.value + elif match_arg_473.code == Collectivite_Code.Metropole: + _ = match_arg_473.value temp_condition_d842_11_3_6 = False - elif match_arg_483.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_483.value + elif match_arg_473.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_473.value temp_condition_d842_11_3_6 = False - elif match_arg_483.code == Collectivite_Code.Mayotte: - _ = match_arg_483.value + elif match_arg_473.code == Collectivite_Code.Mayotte: + _ = match_arg_473.value temp_condition_d842_11_3_6 = True if ((date_courante_13 >= date_of_numbers(2023,4,5)) and (temp_condition_d842_11_3_6 and @@ -17524,44 +17381,44 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac temp_condition_d842_11_3_3 = dead_value raise EmptyError except EmptyError: - match_arg_484 = type_travaux_logement_1 - if match_arg_484.code == TypeTravauxLogementR8425_Code.ObjectifDecenceLogement: - _ = match_arg_484.value + match_arg_474 = type_travaux_logement_1 + if match_arg_474.code == TypeTravauxLogementR8425_Code.ObjectifDecenceLogement: + _ = match_arg_474.value temp_condition_d842_11_3_7 = False - elif match_arg_484.code == TypeTravauxLogementR8425_Code.PrevuDansListeR321_15: - _ = match_arg_484.value + elif match_arg_474.code == TypeTravauxLogementR8425_Code.PrevuDansListeR321_15: + _ = match_arg_474.value temp_condition_d842_11_3_7 = False - elif match_arg_484.code == TypeTravauxLogementR8425_Code.AgrandirOuRendreHabitableD331_63: - _ = match_arg_484.value + elif match_arg_474.code == TypeTravauxLogementR8425_Code.AgrandirOuRendreHabitableD331_63: + _ = match_arg_474.value temp_condition_d842_11_3_7 = True - elif match_arg_484.code == TypeTravauxLogementR8425_Code.PasDeTravaux: - _ = match_arg_484.value + elif match_arg_474.code == TypeTravauxLogementR8425_Code.PasDeTravaux: + _ = match_arg_474.value temp_condition_d842_11_3_7 = False - match_arg_485 = type_travaux_logement_1 - if match_arg_485.code == TypeTravauxLogementR8425_Code.ObjectifDecenceLogement: - _ = match_arg_485.value + match_arg_475 = type_travaux_logement_1 + if match_arg_475.code == TypeTravauxLogementR8425_Code.ObjectifDecenceLogement: + _ = match_arg_475.value temp_condition_d842_11_3_8 = True - elif match_arg_485.code == TypeTravauxLogementR8425_Code.PrevuDansListeR321_15: - _ = match_arg_485.value + elif match_arg_475.code == TypeTravauxLogementR8425_Code.PrevuDansListeR321_15: + _ = match_arg_475.value temp_condition_d842_11_3_8 = False - elif match_arg_485.code == TypeTravauxLogementR8425_Code.AgrandirOuRendreHabitableD331_63: - _ = match_arg_485.value + elif match_arg_475.code == TypeTravauxLogementR8425_Code.AgrandirOuRendreHabitableD331_63: + _ = match_arg_475.value temp_condition_d842_11_3_8 = False - elif match_arg_485.code == TypeTravauxLogementR8425_Code.PasDeTravaux: - _ = match_arg_485.value + elif match_arg_475.code == TypeTravauxLogementR8425_Code.PasDeTravaux: + _ = match_arg_475.value temp_condition_d842_11_3_8 = False - match_arg_486 = type_travaux_logement_1 - if match_arg_486.code == TypeTravauxLogementR8425_Code.ObjectifDecenceLogement: - _ = match_arg_486.value + match_arg_476 = type_travaux_logement_1 + if match_arg_476.code == TypeTravauxLogementR8425_Code.ObjectifDecenceLogement: + _ = match_arg_476.value temp_condition_d842_11_3_9 = False - elif match_arg_486.code == TypeTravauxLogementR8425_Code.PrevuDansListeR321_15: - _ = match_arg_486.value + elif match_arg_476.code == TypeTravauxLogementR8425_Code.PrevuDansListeR321_15: + _ = match_arg_476.value temp_condition_d842_11_3_9 = False - elif match_arg_486.code == TypeTravauxLogementR8425_Code.AgrandirOuRendreHabitableD331_63: - _ = match_arg_486.value + elif match_arg_476.code == TypeTravauxLogementR8425_Code.AgrandirOuRendreHabitableD331_63: + _ = match_arg_476.value temp_condition_d842_11_3_9 = False - elif match_arg_486.code == TypeTravauxLogementR8425_Code.PasDeTravaux: - _ = match_arg_486.value + elif match_arg_476.code == TypeTravauxLogementR8425_Code.PasDeTravaux: + _ = match_arg_476.value temp_condition_d842_11_3_9 = True if ((temp_condition_d842_11_3_9 or (temp_condition_d842_11_3_8 or @@ -17591,17 +17448,17 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac return False def temp_calcul_plafond_mensualite_d842_6_base_3(_:Unit): def temp_calcul_plafond_mensualite_d842_6_base_4(_:Unit): - match_arg_487 = zone_4 - if match_arg_487.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_487.value + match_arg_477 = zone_4 + if match_arg_477.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_477.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_488 = situation_familiale_calcul_apl_6 - if match_arg_488.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_488.value + match_arg_478 = situation_familiale_calcul_apl_6 + if match_arg_478.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_478.value return money_of_cents_string("31476") - elif match_arg_488.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_488.value + elif match_arg_478.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_478.value return money_of_cents_string("37933") else: if (nombre_personnes_a_charge_7 == @@ -17628,16 +17485,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("3936") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_487.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_487.value + elif match_arg_477.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_477.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_489 = situation_familiale_calcul_apl_6 - if match_arg_489.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_489.value + match_arg_479 = situation_familiale_calcul_apl_6 + if match_arg_479.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_479.value return money_of_cents_string("27614") - elif match_arg_489.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_489.value + elif match_arg_479.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_479.value return money_of_cents_string("33853") else: if (nombre_personnes_a_charge_7 == @@ -17664,16 +17521,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("3771") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_487.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_487.value + elif match_arg_477.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_477.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_490 = situation_familiale_calcul_apl_6 - if match_arg_490.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_490.value + match_arg_480 = situation_familiale_calcul_apl_6 + if match_arg_480.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_480.value return money_of_cents_string("25904") - elif match_arg_490.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_490.value + elif match_arg_480.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_480.value return money_of_cents_string("31419") else: if (nombre_personnes_a_charge_7 == @@ -17712,17 +17569,17 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac temp_calcul_plafond_mensualite_d842_6_base_4) def temp_calcul_plafond_mensualite_d842_6_base_6(_:Unit): def temp_calcul_plafond_mensualite_d842_6_base_7(_:Unit): - match_arg_491 = zone_4 - if match_arg_491.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_491.value + match_arg_481 = zone_4 + if match_arg_481.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_481.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_492 = situation_familiale_calcul_apl_6 - if match_arg_492.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_492.value + match_arg_482 = situation_familiale_calcul_apl_6 + if match_arg_482.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_482.value return money_of_cents_string("31382") - elif match_arg_492.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_492.value + elif match_arg_482.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_482.value return money_of_cents_string("37820") else: if (nombre_personnes_a_charge_7 == @@ -17749,16 +17606,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("3924") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_491.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_491.value + elif match_arg_481.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_481.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_493 = situation_familiale_calcul_apl_6 - if match_arg_493.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_493.value + match_arg_483 = situation_familiale_calcul_apl_6 + if match_arg_483.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_483.value return money_of_cents_string("27531") - elif match_arg_493.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_493.value + elif match_arg_483.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_483.value return money_of_cents_string("33751") else: if (nombre_personnes_a_charge_7 == @@ -17785,16 +17642,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("3760") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_491.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_491.value + elif match_arg_481.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_481.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_494 = situation_familiale_calcul_apl_6 - if match_arg_494.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_494.value + match_arg_484 = situation_familiale_calcul_apl_6 + if match_arg_484.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_484.value return money_of_cents_string("25826") - elif match_arg_494.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_494.value + elif match_arg_484.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_484.value return money_of_cents_string("31325") else: if (nombre_personnes_a_charge_7 == @@ -17834,17 +17691,17 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac temp_calcul_plafond_mensualite_d842_6_base_7) def temp_calcul_plafond_mensualite_d842_6_base_9(_:Unit): def temp_calcul_plafond_mensualite_d842_6_base_10(_:Unit): - match_arg_495 = zone_4 - if match_arg_495.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_495.value + match_arg_485 = zone_4 + if match_arg_485.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_485.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_496 = situation_familiale_calcul_apl_6 - if match_arg_496.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_496.value + match_arg_486 = situation_familiale_calcul_apl_6 + if match_arg_486.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_486.value return money_of_cents_string("31148") - elif match_arg_496.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_496.value + elif match_arg_486.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_486.value return money_of_cents_string("37538") else: if (nombre_personnes_a_charge_7 == @@ -17871,16 +17728,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("3895") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_495.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_495.value + elif match_arg_485.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_485.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_497 = situation_familiale_calcul_apl_6 - if match_arg_497.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_497.value + match_arg_487 = situation_familiale_calcul_apl_6 + if match_arg_487.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_487.value return money_of_cents_string("27326") - elif match_arg_497.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_497.value + elif match_arg_487.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_487.value return money_of_cents_string("33500") else: if (nombre_personnes_a_charge_7 == @@ -17907,16 +17764,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("3732") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_495.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_495.value + elif match_arg_485.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_485.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_498 = situation_familiale_calcul_apl_6 - if match_arg_498.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_498.value + match_arg_488 = situation_familiale_calcul_apl_6 + if match_arg_488.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_488.value return money_of_cents_string("25634") - elif match_arg_498.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_498.value + elif match_arg_488.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_488.value return money_of_cents_string("31092") else: if (nombre_personnes_a_charge_7 == @@ -17956,17 +17813,17 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac temp_calcul_plafond_mensualite_d842_6_base_10) def temp_calcul_plafond_mensualite_d842_6_base_12(_:Unit): def temp_calcul_plafond_mensualite_d842_6_base_13(_:Unit): - match_arg_499 = zone_4 - if match_arg_499.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_499.value + match_arg_489 = zone_4 + if match_arg_489.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_489.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_500 = situation_familiale_calcul_apl_6 - if match_arg_500.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_500.value + match_arg_490 = situation_familiale_calcul_apl_6 + if match_arg_490.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_490.value return money_of_cents_string("31123") - elif match_arg_500.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_500.value + elif match_arg_490.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_490.value return money_of_cents_string("37508") else: if (nombre_personnes_a_charge_7 == @@ -17993,16 +17850,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("3892") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_499.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_499.value + elif match_arg_489.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_489.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_501 = situation_familiale_calcul_apl_6 - if match_arg_501.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_501.value + match_arg_491 = situation_familiale_calcul_apl_6 + if match_arg_491.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_491.value return money_of_cents_string("27304") - elif match_arg_501.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_501.value + elif match_arg_491.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_491.value return money_of_cents_string("33473") else: if (nombre_personnes_a_charge_7 == @@ -18029,16 +17886,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("3729") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_499.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_499.value + elif match_arg_489.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_489.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_502 = situation_familiale_calcul_apl_6 - if match_arg_502.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_502.value + match_arg_492 = situation_familiale_calcul_apl_6 + if match_arg_492.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_492.value return money_of_cents_string("25614") - elif match_arg_502.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_502.value + elif match_arg_492.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_492.value return money_of_cents_string("31067") else: if (nombre_personnes_a_charge_7 == @@ -18078,17 +17935,17 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac temp_calcul_plafond_mensualite_d842_6_base_13) def temp_calcul_plafond_mensualite_d842_6_base_15(_:Unit): def temp_calcul_plafond_mensualite_d842_6_base_16(_:Unit): - match_arg_503 = zone_4 - if match_arg_503.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_503.value + match_arg_493 = zone_4 + if match_arg_493.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_493.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_504 = situation_familiale_calcul_apl_6 - if match_arg_504.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_504.value + match_arg_494 = situation_familiale_calcul_apl_6 + if match_arg_494.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_494.value return money_of_cents_string("30947") - elif match_arg_504.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_504.value + elif match_arg_494.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_494.value return money_of_cents_string("37295") else: if (nombre_personnes_a_charge_7 == @@ -18115,16 +17972,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("3870") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_503.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_503.value + elif match_arg_493.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_493.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_505 = situation_familiale_calcul_apl_6 - if match_arg_505.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_505.value + match_arg_495 = situation_familiale_calcul_apl_6 + if match_arg_495.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_495.value return money_of_cents_string("27149") - elif match_arg_505.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_505.value + elif match_arg_495.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_495.value return money_of_cents_string("33283") else: if (nombre_personnes_a_charge_7 == @@ -18151,16 +18008,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("3708") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_503.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_503.value + elif match_arg_493.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_493.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_506 = situation_familiale_calcul_apl_6 - if match_arg_506.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_506.value + match_arg_496 = situation_familiale_calcul_apl_6 + if match_arg_496.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_496.value return money_of_cents_string("25469") - elif match_arg_506.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_506.value + elif match_arg_496.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_496.value return money_of_cents_string("30891") else: if (nombre_personnes_a_charge_7 == @@ -18200,17 +18057,17 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac temp_calcul_plafond_mensualite_d842_6_base_16) def temp_calcul_plafond_mensualite_d842_6_base_18(_:Unit): def temp_calcul_plafond_mensualite_d842_6_base_19(_:Unit): - match_arg_507 = zone_4 - if match_arg_507.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_507.value + match_arg_497 = zone_4 + if match_arg_497.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_497.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_508 = situation_familiale_calcul_apl_6 - if match_arg_508.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_508.value + match_arg_498 = situation_familiale_calcul_apl_6 + if match_arg_498.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_498.value return money_of_cents_string("30296") - elif match_arg_508.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_508.value + elif match_arg_498.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_498.value return money_of_cents_string("36510") else: if (nombre_personnes_a_charge_7 == @@ -18237,16 +18094,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("3789") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_507.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_507.value + elif match_arg_497.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_497.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_509 = situation_familiale_calcul_apl_6 - if match_arg_509.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_509.value + match_arg_499 = situation_familiale_calcul_apl_6 + if match_arg_499.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_499.value return money_of_cents_string("26578") - elif match_arg_509.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_509.value + elif match_arg_499.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_499.value return money_of_cents_string("32582") else: if (nombre_personnes_a_charge_7 == @@ -18273,16 +18130,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("3630") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_507.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_507.value + elif match_arg_497.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_497.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_510 = situation_familiale_calcul_apl_6 - if match_arg_510.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_510.value + match_arg_500 = situation_familiale_calcul_apl_6 + if match_arg_500.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_500.value return money_of_cents_string("24933") - elif match_arg_510.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_510.value + elif match_arg_500.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_500.value return money_of_cents_string("30241") else: if (nombre_personnes_a_charge_7 == @@ -18322,17 +18179,17 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac temp_calcul_plafond_mensualite_d842_6_base_19) def temp_calcul_plafond_mensualite_d842_6_base_21(_:Unit): def temp_calcul_plafond_mensualite_d842_6_base_22(_:Unit): - match_arg_511 = zone_4 - if match_arg_511.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_511.value + match_arg_501 = zone_4 + if match_arg_501.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_501.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_512 = situation_familiale_calcul_apl_6 - if match_arg_512.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_512.value + match_arg_502 = situation_familiale_calcul_apl_6 + if match_arg_502.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_502.value return money_of_cents_string("29996") - elif match_arg_512.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_512.value + elif match_arg_502.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_502.value return money_of_cents_string("36149") else: if (nombre_personnes_a_charge_7 == @@ -18359,16 +18216,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("3751") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_511.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_511.value + elif match_arg_501.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_501.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_513 = situation_familiale_calcul_apl_6 - if match_arg_513.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_513.value + match_arg_503 = situation_familiale_calcul_apl_6 + if match_arg_503.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_503.value return money_of_cents_string("26315") - elif match_arg_513.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_513.value + elif match_arg_503.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_503.value return money_of_cents_string("32259") else: if (nombre_personnes_a_charge_7 == @@ -18395,16 +18252,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("3594") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_511.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_511.value + elif match_arg_501.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_501.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_514 = situation_familiale_calcul_apl_6 - if match_arg_514.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_514.value + match_arg_504 = situation_familiale_calcul_apl_6 + if match_arg_504.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_504.value return money_of_cents_string("24686") - elif match_arg_514.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_514.value + elif match_arg_504.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_504.value return money_of_cents_string("29942") else: if (nombre_personnes_a_charge_7 == @@ -18444,17 +18301,17 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac temp_calcul_plafond_mensualite_d842_6_base_22) def temp_calcul_plafond_mensualite_d842_6_base_24(_:Unit): def temp_calcul_plafond_mensualite_d842_6_base_25(_:Unit): - match_arg_515 = zone_4 - if match_arg_515.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_515.value + match_arg_505 = zone_4 + if match_arg_505.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_505.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_516 = situation_familiale_calcul_apl_6 - if match_arg_516.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_516.value + match_arg_506 = situation_familiale_calcul_apl_6 + if match_arg_506.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_506.value return money_of_cents_string("29670") - elif match_arg_516.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_516.value + elif match_arg_506.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_506.value return money_of_cents_string("35757") else: if (nombre_personnes_a_charge_7 == @@ -18481,16 +18338,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("3710") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_515.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_515.value + elif match_arg_505.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_505.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_517 = situation_familiale_calcul_apl_6 - if match_arg_517.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_517.value + match_arg_507 = situation_familiale_calcul_apl_6 + if match_arg_507.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_507.value return money_of_cents_string("26029") - elif match_arg_517.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_517.value + elif match_arg_507.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_507.value return money_of_cents_string("31908") else: if (nombre_personnes_a_charge_7 == @@ -18517,16 +18374,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("3555") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_515.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_515.value + elif match_arg_505.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_505.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_518 = situation_familiale_calcul_apl_6 - if match_arg_518.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_518.value + match_arg_508 = situation_familiale_calcul_apl_6 + if match_arg_508.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_508.value return money_of_cents_string("24417") - elif match_arg_518.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_518.value + elif match_arg_508.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_508.value return money_of_cents_string("29616") else: if (nombre_personnes_a_charge_7 == @@ -18566,17 +18423,17 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac temp_calcul_plafond_mensualite_d842_6_base_25) def temp_calcul_plafond_mensualite_d842_6_base_27(_:Unit): def temp_calcul_plafond_mensualite_d842_6_base_28(_:Unit): - match_arg_519 = zone_4 - if match_arg_519.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_519.value + match_arg_509 = zone_4 + if match_arg_509.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_509.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_520 = situation_familiale_calcul_apl_6 - if match_arg_520.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_520.value + match_arg_510 = situation_familiale_calcul_apl_6 + if match_arg_510.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_510.value return money_of_cents_string("29575") - elif match_arg_520.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_520.value + elif match_arg_510.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_510.value return money_of_cents_string("35642") else: if (nombre_personnes_a_charge_7 == @@ -18603,16 +18460,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("3698") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_519.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_519.value + elif match_arg_509.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_509.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_521 = situation_familiale_calcul_apl_6 - if match_arg_521.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_521.value + match_arg_511 = situation_familiale_calcul_apl_6 + if match_arg_511.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_511.value return money_of_cents_string("25946") - elif match_arg_521.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_521.value + elif match_arg_511.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_511.value return money_of_cents_string("31806") else: if (nombre_personnes_a_charge_7 == @@ -18639,16 +18496,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("3544") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_519.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_519.value + elif match_arg_509.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_509.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_522 = situation_familiale_calcul_apl_6 - if match_arg_522.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_522.value + match_arg_512 = situation_familiale_calcul_apl_6 + if match_arg_512.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_512.value return money_of_cents_string("24339") - elif match_arg_522.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_522.value + elif match_arg_512.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_512.value return money_of_cents_string("29522") else: if (nombre_personnes_a_charge_7 == @@ -18688,17 +18545,17 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac temp_calcul_plafond_mensualite_d842_6_base_28) def temp_calcul_plafond_mensualite_d842_6_base_30(_:Unit): def temp_calcul_plafond_mensualite_d842_6_base_31(_:Unit): - match_arg_523 = zone_4 - if match_arg_523.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_523.value + match_arg_513 = zone_4 + if match_arg_513.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_513.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_524 = situation_familiale_calcul_apl_6 - if match_arg_524.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_524.value + match_arg_514 = situation_familiale_calcul_apl_6 + if match_arg_514.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_514.value return money_of_cents_string("28728") - elif match_arg_524.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_524.value + elif match_arg_514.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_514.value return money_of_cents_string("34621") else: if (nombre_personnes_a_charge_7 == @@ -18725,16 +18582,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("3592") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_523.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_523.value + elif match_arg_513.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_513.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_525 = situation_familiale_calcul_apl_6 - if match_arg_525.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_525.value + match_arg_515 = situation_familiale_calcul_apl_6 + if match_arg_515.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_515.value return money_of_cents_string("25203") - elif match_arg_525.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_525.value + elif match_arg_515.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_515.value return money_of_cents_string("30895") else: if (nombre_personnes_a_charge_7 == @@ -18761,16 +18618,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("3442") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_523.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_523.value + elif match_arg_513.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_513.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_526 = situation_familiale_calcul_apl_6 - if match_arg_526.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_526.value + match_arg_516 = situation_familiale_calcul_apl_6 + if match_arg_516.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_516.value return money_of_cents_string("23642") - elif match_arg_526.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_526.value + elif match_arg_516.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_516.value return money_of_cents_string("28676") else: if (nombre_personnes_a_charge_7 == @@ -18810,17 +18667,17 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac temp_calcul_plafond_mensualite_d842_6_base_31) def temp_calcul_plafond_mensualite_d842_6_base_33(_:Unit): def temp_calcul_plafond_mensualite_d842_6_base_34(_:Unit): - match_arg_527 = zone_4 - if match_arg_527.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_527.value + match_arg_517 = zone_4 + if match_arg_517.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_517.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_528 = situation_familiale_calcul_apl_6 - if match_arg_528.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_528.value + match_arg_518 = situation_familiale_calcul_apl_6 + if match_arg_518.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_518.value return money_of_cents_string("27956") - elif match_arg_528.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_528.value + elif match_arg_518.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_518.value return money_of_cents_string("33691") else: if (nombre_personnes_a_charge_7 == @@ -18847,16 +18704,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("3496") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_527.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_527.value + elif match_arg_517.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_517.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_529 = situation_familiale_calcul_apl_6 - if match_arg_529.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_529.value + match_arg_519 = situation_familiale_calcul_apl_6 + if match_arg_519.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_519.value return money_of_cents_string("24526") - elif match_arg_529.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_529.value + elif match_arg_519.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_519.value return money_of_cents_string("30065") else: if (nombre_personnes_a_charge_7 == @@ -18883,16 +18740,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("3350") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_527.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_527.value + elif match_arg_517.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_517.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_530 = situation_familiale_calcul_apl_6 - if match_arg_530.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_530.value + match_arg_520 = situation_familiale_calcul_apl_6 + if match_arg_520.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_520.value return money_of_cents_string("23007") - elif match_arg_530.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_530.value + elif match_arg_520.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_520.value return money_of_cents_string("27906") else: if (nombre_personnes_a_charge_7 == @@ -18932,17 +18789,17 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac temp_calcul_plafond_mensualite_d842_6_base_34) def temp_calcul_plafond_mensualite_d842_6_base_36(_:Unit): def temp_calcul_plafond_mensualite_d842_6_base_37(_:Unit): - match_arg_531 = zone_4 - if match_arg_531.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_531.value + match_arg_521 = zone_4 + if match_arg_521.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_521.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_532 = situation_familiale_calcul_apl_6 - if match_arg_532.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_532.value + match_arg_522 = situation_familiale_calcul_apl_6 + if match_arg_522.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_522.value return money_of_cents_string("27195") - elif match_arg_532.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_532.value + elif match_arg_522.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_522.value return money_of_cents_string("32773") else: if (nombre_personnes_a_charge_7 == @@ -18969,16 +18826,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("3401") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_531.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_531.value + elif match_arg_521.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_521.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_533 = situation_familiale_calcul_apl_6 - if match_arg_533.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_533.value + match_arg_523 = situation_familiale_calcul_apl_6 + if match_arg_523.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_523.value return money_of_cents_string("23858") - elif match_arg_533.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_533.value + elif match_arg_523.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_523.value return money_of_cents_string("29246") else: if (nombre_personnes_a_charge_7 == @@ -19005,16 +18862,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("3259") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_531.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_531.value + elif match_arg_521.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_521.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_534 = situation_familiale_calcul_apl_6 - if match_arg_534.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_534.value + match_arg_524 = situation_familiale_calcul_apl_6 + if match_arg_524.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_524.value return money_of_cents_string("22380") - elif match_arg_534.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_534.value + elif match_arg_524.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_524.value return money_of_cents_string("27146") else: if (nombre_personnes_a_charge_7 == @@ -19054,17 +18911,17 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac temp_calcul_plafond_mensualite_d842_6_base_37) def temp_calcul_plafond_mensualite_d842_6_base_39(_:Unit): def temp_calcul_plafond_mensualite_d842_6_base_40(_:Unit): - match_arg_535 = zone_4 - if match_arg_535.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_535.value + match_arg_525 = zone_4 + if match_arg_525.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_525.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_536 = situation_familiale_calcul_apl_6 - if match_arg_536.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_536.value + match_arg_526 = situation_familiale_calcul_apl_6 + if match_arg_526.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_526.value return money_of_cents_string("26714") - elif match_arg_536.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_536.value + elif match_arg_526.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_526.value return money_of_cents_string("32194") else: if (nombre_personnes_a_charge_7 == @@ -19091,16 +18948,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("3341") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_535.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_535.value + elif match_arg_525.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_525.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_537 = situation_familiale_calcul_apl_6 - if match_arg_537.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_537.value + match_arg_527 = situation_familiale_calcul_apl_6 + if match_arg_527.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_527.value return money_of_cents_string("23436") - elif match_arg_537.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_537.value + elif match_arg_527.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_527.value return money_of_cents_string("28729") else: if (nombre_personnes_a_charge_7 == @@ -19127,16 +18984,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("3201") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_535.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_535.value + elif match_arg_525.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_525.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_538 = situation_familiale_calcul_apl_6 - if match_arg_538.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_538.value + match_arg_528 = situation_familiale_calcul_apl_6 + if match_arg_528.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_528.value return money_of_cents_string("21984") - elif match_arg_538.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_538.value + elif match_arg_528.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_528.value return money_of_cents_string("26666") else: if (nombre_personnes_a_charge_7 == @@ -19176,17 +19033,17 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac temp_calcul_plafond_mensualite_d842_6_base_40) def temp_calcul_plafond_mensualite_d842_6_base_42(_:Unit): def temp_calcul_plafond_mensualite_d842_6_base_43(_:Unit): - match_arg_539 = zone_4 - if match_arg_539.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_539.value + match_arg_529 = zone_4 + if match_arg_529.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_529.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_540 = situation_familiale_calcul_apl_6 - if match_arg_540.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_540.value + match_arg_530 = situation_familiale_calcul_apl_6 + if match_arg_530.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_530.value return money_of_cents_string("26397") - elif match_arg_540.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_540.value + elif match_arg_530.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_530.value return money_of_cents_string("31812") else: if (nombre_personnes_a_charge_7 == @@ -19213,16 +19070,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("3301") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_539.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_539.value + elif match_arg_529.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_529.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_541 = situation_familiale_calcul_apl_6 - if match_arg_541.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_541.value + match_arg_531 = situation_familiale_calcul_apl_6 + if match_arg_531.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_531.value return money_of_cents_string("23158") - elif match_arg_541.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_541.value + elif match_arg_531.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_531.value return money_of_cents_string("28388") else: if (nombre_personnes_a_charge_7 == @@ -19249,16 +19106,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("3163") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_539.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_539.value + elif match_arg_529.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_529.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_542 = situation_familiale_calcul_apl_6 - if match_arg_542.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_542.value + match_arg_532 = situation_familiale_calcul_apl_6 + if match_arg_532.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_532.value return money_of_cents_string("21723") - elif match_arg_542.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_542.value + elif match_arg_532.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_532.value return money_of_cents_string("26350") else: if (nombre_personnes_a_charge_7 == @@ -19298,17 +19155,17 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac temp_calcul_plafond_mensualite_d842_6_base_43) def temp_calcul_plafond_mensualite_d842_6_base_45(_:Unit): def temp_calcul_plafond_mensualite_d842_6_base_46(_:Unit): - match_arg_543 = zone_4 - if match_arg_543.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_543.value + match_arg_533 = zone_4 + if match_arg_533.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_533.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_544 = situation_familiale_calcul_apl_6 - if match_arg_544.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_544.value + match_arg_534 = situation_familiale_calcul_apl_6 + if match_arg_534.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_534.value return money_of_cents_string("26084") - elif match_arg_544.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_544.value + elif match_arg_534.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_534.value return money_of_cents_string("31435") else: if (nombre_personnes_a_charge_7 == @@ -19335,16 +19192,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("3262") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_543.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_543.value + elif match_arg_533.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_533.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_545 = situation_familiale_calcul_apl_6 - if match_arg_545.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_545.value + match_arg_535 = situation_familiale_calcul_apl_6 + if match_arg_535.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_535.value return money_of_cents_string("22883") - elif match_arg_545.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_545.value + elif match_arg_535.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_535.value return money_of_cents_string("28051") else: if (nombre_personnes_a_charge_7 == @@ -19371,16 +19228,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("3125") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_543.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_543.value + elif match_arg_533.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_533.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_546 = situation_familiale_calcul_apl_6 - if match_arg_546.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_546.value + match_arg_536 = situation_familiale_calcul_apl_6 + if match_arg_536.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_536.value return money_of_cents_string("21465") - elif match_arg_546.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_546.value + elif match_arg_536.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_536.value return money_of_cents_string("26038") else: if (nombre_personnes_a_charge_7 == @@ -19420,17 +19277,17 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac temp_calcul_plafond_mensualite_d842_6_base_46) def temp_calcul_plafond_mensualite_d842_6_base_48(_:Unit): def temp_calcul_plafond_mensualite_d842_6_base_49(_:Unit): - match_arg_547 = zone_4 - if match_arg_547.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_547.value + match_arg_537 = zone_4 + if match_arg_537.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_537.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_548 = situation_familiale_calcul_apl_6 - if match_arg_548.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_548.value + match_arg_538 = situation_familiale_calcul_apl_6 + if match_arg_538.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_538.value temp_calcul_plafond_mensualite_d842_6_base_50 = money_of_cents_string("171100") - elif match_arg_548.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_548.value + elif match_arg_538.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_538.value temp_calcul_plafond_mensualite_d842_6_base_50 = money_of_cents_string("206200") else: if (nombre_personnes_a_charge_7 == @@ -19457,16 +19314,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("21400") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_547.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_547.value + elif match_arg_537.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_537.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_549 = situation_familiale_calcul_apl_6 - if match_arg_549.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_549.value + match_arg_539 = situation_familiale_calcul_apl_6 + if match_arg_539.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_539.value temp_calcul_plafond_mensualite_d842_6_base_50 = money_of_cents_string("150100") - elif match_arg_549.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_549.value + elif match_arg_539.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_539.value temp_calcul_plafond_mensualite_d842_6_base_50 = money_of_cents_string("184000") else: if (nombre_personnes_a_charge_7 == @@ -19493,16 +19350,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("20500") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_547.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_547.value + elif match_arg_537.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_537.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_550 = situation_familiale_calcul_apl_6 - if match_arg_550.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_550.value + match_arg_540 = situation_familiale_calcul_apl_6 + if match_arg_540.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_540.value temp_calcul_plafond_mensualite_d842_6_base_50 = money_of_cents_string("140800") - elif match_arg_550.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_550.value + elif match_arg_540.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_540.value temp_calcul_plafond_mensualite_d842_6_base_50 = money_of_cents_string("170800") else: if (nombre_personnes_a_charge_7 == @@ -19544,17 +19401,17 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac temp_calcul_plafond_mensualite_d842_6_base_49) def temp_calcul_plafond_mensualite_d842_6_base_52(_:Unit): def temp_calcul_plafond_mensualite_d842_6_base_53(_:Unit): - match_arg_551 = zone_4 - if match_arg_551.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_551.value + match_arg_541 = zone_4 + if match_arg_541.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_541.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_552 = situation_familiale_calcul_apl_6 - if match_arg_552.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_552.value + match_arg_542 = situation_familiale_calcul_apl_6 + if match_arg_542.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_542.value temp_calcul_plafond_mensualite_d842_6_base_54 = money_of_cents_string("169100") - elif match_arg_552.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_552.value + elif match_arg_542.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_542.value temp_calcul_plafond_mensualite_d842_6_base_54 = money_of_cents_string("203800") else: if (nombre_personnes_a_charge_7 == @@ -19581,16 +19438,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("21100") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_551.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_551.value + elif match_arg_541.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_541.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_553 = situation_familiale_calcul_apl_6 - if match_arg_553.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_553.value + match_arg_543 = situation_familiale_calcul_apl_6 + if match_arg_543.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_543.value temp_calcul_plafond_mensualite_d842_6_base_54 = money_of_cents_string("148300") - elif match_arg_553.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_553.value + elif match_arg_543.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_543.value temp_calcul_plafond_mensualite_d842_6_base_54 = money_of_cents_string("181800") else: if (nombre_personnes_a_charge_7 == @@ -19617,16 +19474,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("20300") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_551.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_551.value + elif match_arg_541.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_541.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_554 = situation_familiale_calcul_apl_6 - if match_arg_554.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_554.value + match_arg_544 = situation_familiale_calcul_apl_6 + if match_arg_544.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_544.value temp_calcul_plafond_mensualite_d842_6_base_54 = money_of_cents_string("139100") - elif match_arg_554.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_554.value + elif match_arg_544.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_544.value temp_calcul_plafond_mensualite_d842_6_base_54 = money_of_cents_string("168800") else: if (nombre_personnes_a_charge_7 == @@ -19668,17 +19525,17 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac temp_calcul_plafond_mensualite_d842_6_base_53) def temp_calcul_plafond_mensualite_d842_6_base_56(_:Unit): def temp_calcul_plafond_mensualite_d842_6_base_57(_:Unit): - match_arg_555 = zone_4 - if match_arg_555.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_555.value + match_arg_545 = zone_4 + if match_arg_545.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_545.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_556 = situation_familiale_calcul_apl_6 - if match_arg_556.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_556.value + match_arg_546 = situation_familiale_calcul_apl_6 + if match_arg_546.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_546.value temp_calcul_plafond_mensualite_d842_6_base_58 = money_of_cents_string("167400") - elif match_arg_556.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_556.value + elif match_arg_546.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_546.value temp_calcul_plafond_mensualite_d842_6_base_58 = money_of_cents_string("201800") else: if (nombre_personnes_a_charge_7 == @@ -19705,16 +19562,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("20900") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_555.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_555.value + elif match_arg_545.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_545.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_557 = situation_familiale_calcul_apl_6 - if match_arg_557.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_557.value + match_arg_547 = situation_familiale_calcul_apl_6 + if match_arg_547.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_547.value temp_calcul_plafond_mensualite_d842_6_base_58 = money_of_cents_string("146800") - elif match_arg_557.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_557.value + elif match_arg_547.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_547.value temp_calcul_plafond_mensualite_d842_6_base_58 = money_of_cents_string("180000") else: if (nombre_personnes_a_charge_7 == @@ -19741,16 +19598,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("20100") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_555.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_555.value + elif match_arg_545.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_545.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_558 = situation_familiale_calcul_apl_6 - if match_arg_558.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_558.value + match_arg_548 = situation_familiale_calcul_apl_6 + if match_arg_548.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_548.value temp_calcul_plafond_mensualite_d842_6_base_58 = money_of_cents_string("137700") - elif match_arg_558.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_558.value + elif match_arg_548.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_548.value temp_calcul_plafond_mensualite_d842_6_base_58 = money_of_cents_string("167100") else: if (nombre_personnes_a_charge_7 == @@ -19792,17 +19649,17 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac temp_calcul_plafond_mensualite_d842_6_base_57) def temp_calcul_plafond_mensualite_d842_6_base_60(_:Unit): def temp_calcul_plafond_mensualite_d842_6_base_61(_:Unit): - match_arg_559 = zone_4 - if match_arg_559.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_559.value + match_arg_549 = zone_4 + if match_arg_549.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_549.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_560 = situation_familiale_calcul_apl_6 - if match_arg_560.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_560.value + match_arg_550 = situation_familiale_calcul_apl_6 + if match_arg_550.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_550.value temp_calcul_plafond_mensualite_d842_6_base_62 = money_of_cents_string("167200") - elif match_arg_560.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_560.value + elif match_arg_550.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_550.value temp_calcul_plafond_mensualite_d842_6_base_62 = money_of_cents_string("201600") else: if (nombre_personnes_a_charge_7 == @@ -19829,16 +19686,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("20900") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_559.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_559.value + elif match_arg_549.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_549.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_561 = situation_familiale_calcul_apl_6 - if match_arg_561.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_561.value + match_arg_551 = situation_familiale_calcul_apl_6 + if match_arg_551.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_551.value temp_calcul_plafond_mensualite_d842_6_base_62 = money_of_cents_string("146700") - elif match_arg_561.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_561.value + elif match_arg_551.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_551.value temp_calcul_plafond_mensualite_d842_6_base_62 = money_of_cents_string("179800") else: if (nombre_personnes_a_charge_7 == @@ -19865,16 +19722,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("20100") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_559.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_559.value + elif match_arg_549.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_549.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_562 = situation_familiale_calcul_apl_6 - if match_arg_562.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_562.value + match_arg_552 = situation_familiale_calcul_apl_6 + if match_arg_552.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_552.value temp_calcul_plafond_mensualite_d842_6_base_62 = money_of_cents_string("137600") - elif match_arg_562.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_562.value + elif match_arg_552.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_552.value temp_calcul_plafond_mensualite_d842_6_base_62 = money_of_cents_string("166900") else: if (nombre_personnes_a_charge_7 == @@ -19916,17 +19773,17 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac temp_calcul_plafond_mensualite_d842_6_base_61) def temp_calcul_plafond_mensualite_d842_6_base_64(_:Unit): def temp_calcul_plafond_mensualite_d842_6_base_65(_:Unit): - match_arg_563 = zone_4 - if match_arg_563.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_563.value + match_arg_553 = zone_4 + if match_arg_553.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_553.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_564 = situation_familiale_calcul_apl_6 - if match_arg_564.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_564.value + match_arg_554 = situation_familiale_calcul_apl_6 + if match_arg_554.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_554.value temp_calcul_plafond_mensualite_d842_6_base_66 = money_of_cents_string("163300") - elif match_arg_564.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_564.value + elif match_arg_554.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_554.value temp_calcul_plafond_mensualite_d842_6_base_66 = money_of_cents_string("196900") else: if (nombre_personnes_a_charge_7 == @@ -19953,16 +19810,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("20400") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_563.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_563.value + elif match_arg_553.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_553.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_565 = situation_familiale_calcul_apl_6 - if match_arg_565.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_565.value + match_arg_555 = situation_familiale_calcul_apl_6 + if match_arg_555.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_555.value temp_calcul_plafond_mensualite_d842_6_base_66 = money_of_cents_string("143300") - elif match_arg_565.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_565.value + elif match_arg_555.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_555.value temp_calcul_plafond_mensualite_d842_6_base_66 = money_of_cents_string("175600") else: if (nombre_personnes_a_charge_7 == @@ -19989,16 +19846,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("19600") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_563.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_563.value + elif match_arg_553.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_553.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_566 = situation_familiale_calcul_apl_6 - if match_arg_566.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_566.value + match_arg_556 = situation_familiale_calcul_apl_6 + if match_arg_556.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_556.value temp_calcul_plafond_mensualite_d842_6_base_66 = money_of_cents_string("134400") - elif match_arg_566.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_566.value + elif match_arg_556.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_556.value temp_calcul_plafond_mensualite_d842_6_base_66 = money_of_cents_string("163000") else: if (nombre_personnes_a_charge_7 == @@ -20040,17 +19897,17 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac temp_calcul_plafond_mensualite_d842_6_base_65) def temp_calcul_plafond_mensualite_d842_6_base_68(_:Unit): def temp_calcul_plafond_mensualite_d842_6_base_69(_:Unit): - match_arg_567 = zone_4 - if match_arg_567.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_567.value + match_arg_557 = zone_4 + if match_arg_557.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_557.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_568 = situation_familiale_calcul_apl_6 - if match_arg_568.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_568.value + match_arg_558 = situation_familiale_calcul_apl_6 + if match_arg_558.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_558.value temp_calcul_plafond_mensualite_d842_6_base_70 = money_of_cents_string("160400") - elif match_arg_568.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_568.value + elif match_arg_558.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_558.value temp_calcul_plafond_mensualite_d842_6_base_70 = money_of_cents_string("193400") else: if (nombre_personnes_a_charge_7 == @@ -20077,16 +19934,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("20000") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_567.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_567.value + elif match_arg_557.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_557.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_569 = situation_familiale_calcul_apl_6 - if match_arg_569.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_569.value + match_arg_559 = situation_familiale_calcul_apl_6 + if match_arg_559.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_559.value temp_calcul_plafond_mensualite_d842_6_base_70 = money_of_cents_string("140800") - elif match_arg_569.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_569.value + elif match_arg_559.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_559.value temp_calcul_plafond_mensualite_d842_6_base_70 = money_of_cents_string("172500") else: if (nombre_personnes_a_charge_7 == @@ -20113,16 +19970,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("19300") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_567.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_567.value + elif match_arg_557.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_557.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_570 = situation_familiale_calcul_apl_6 - if match_arg_570.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_570.value + match_arg_560 = situation_familiale_calcul_apl_6 + if match_arg_560.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_560.value temp_calcul_plafond_mensualite_d842_6_base_70 = money_of_cents_string("132000") - elif match_arg_570.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_570.value + elif match_arg_560.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_560.value temp_calcul_plafond_mensualite_d842_6_base_70 = money_of_cents_string("180100") else: if (nombre_personnes_a_charge_7 == @@ -20164,17 +20021,17 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac temp_calcul_plafond_mensualite_d842_6_base_69) def temp_calcul_plafond_mensualite_d842_6_base_72(_:Unit): def temp_calcul_plafond_mensualite_d842_6_base_73(_:Unit): - match_arg_571 = zone_4 - if match_arg_571.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_571.value + match_arg_561 = zone_4 + if match_arg_561.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_561.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_572 = situation_familiale_calcul_apl_6 - if match_arg_572.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_572.value + match_arg_562 = situation_familiale_calcul_apl_6 + if match_arg_562.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_562.value temp_calcul_plafond_mensualite_d842_6_base_74 = money_of_cents_string("158700") - elif match_arg_572.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_572.value + elif match_arg_562.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_562.value temp_calcul_plafond_mensualite_d842_6_base_74 = money_of_cents_string("191300") else: if (nombre_personnes_a_charge_7 == @@ -20201,16 +20058,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("19800") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_571.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_571.value + elif match_arg_561.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_561.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_573 = situation_familiale_calcul_apl_6 - if match_arg_573.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_573.value + match_arg_563 = situation_familiale_calcul_apl_6 + if match_arg_563.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_563.value temp_calcul_plafond_mensualite_d842_6_base_74 = money_of_cents_string("139300") - elif match_arg_573.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_573.value + elif match_arg_563.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_563.value temp_calcul_plafond_mensualite_d842_6_base_74 = money_of_cents_string("170600") else: if (nombre_personnes_a_charge_7 == @@ -20237,16 +20094,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac (money_of_cents_string("19100") * decimal_of_integer((nombre_personnes_a_charge_7 - integer_of_string("5"))))) - elif match_arg_571.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_571.value + elif match_arg_561.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_561.value if (nombre_personnes_a_charge_7 == integer_of_string("0")): - match_arg_574 = situation_familiale_calcul_apl_6 - if match_arg_574.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_574.value + match_arg_564 = situation_familiale_calcul_apl_6 + if match_arg_564.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_564.value temp_calcul_plafond_mensualite_d842_6_base_74 = money_of_cents_string("130600") - elif match_arg_574.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_574.value + elif match_arg_564.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_564.value temp_calcul_plafond_mensualite_d842_6_base_74 = money_of_cents_string("158400") else: if (nombre_personnes_a_charge_7 == @@ -20331,823 +20188,723 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac return False def temp_montant_forfaitaire_charges_37(_:Unit): def temp_montant_forfaitaire_charges_38(_:Unit): - match_arg_575 = situation_familiale_calcul_apl_6 - if match_arg_575.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_575.value - temp_montant_forfaitaire_charges_39 = money_of_cents_string("1858") - elif match_arg_575.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_575.value - temp_montant_forfaitaire_charges_39 = money_of_cents_string("3614") - match_arg_576 = situation_familiale_calcul_apl_6 - if match_arg_576.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_576.value - temp_montant_forfaitaire_charges_40 = money_of_cents_string("1858") - elif match_arg_576.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_576.value - temp_montant_forfaitaire_charges_40 = money_of_cents_string("3614") - if ((temp_montant_forfaitaire_charges_40 + + match_arg_565 = situation_familiale_calcul_apl_6 + if match_arg_565.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_565.value + temp_montant_34 = money_of_cents_string("1858") + elif match_arg_565.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_565.value + temp_montant_34 = money_of_cents_string("3614") + montant_18 = (temp_montant_34 + (money_of_cents_string("929") * - decimal_of_integer(nombre_personnes_a_charge_6))) > - (temp_montant_forfaitaire_charges_39 + + decimal_of_integer(nombre_personnes_a_charge_6))) + match_arg_566 = situation_familiale_calcul_apl_6 + if match_arg_566.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_566.value + temp_limite_5 = money_of_cents_string("1858") + elif match_arg_566.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_566.value + temp_limite_5 = money_of_cents_string("3614") + limite_15 = (temp_limite_5 + (money_of_cents_string("929") * - decimal_of_string("6.")))): - match_arg_577 = situation_familiale_calcul_apl_6 - if match_arg_577.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_577.value - temp_montant_forfaitaire_charges_41 = money_of_cents_string("1858") - elif match_arg_577.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_577.value - temp_montant_forfaitaire_charges_41 = money_of_cents_string("3614") - return (temp_montant_forfaitaire_charges_41 + - (money_of_cents_string("929") * - decimal_of_string("6."))) + decimal_of_string("6."))) + if (montant_18 > limite_15): + return limite_15 else: - match_arg_578 = situation_familiale_calcul_apl_6 - if match_arg_578.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_578.value - temp_montant_forfaitaire_charges_42 = money_of_cents_string("1858") - elif match_arg_578.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_578.value - temp_montant_forfaitaire_charges_42 = money_of_cents_string("3614") - return (temp_montant_forfaitaire_charges_42 + - (money_of_cents_string("929") * - decimal_of_integer(nombre_personnes_a_charge_6))) - def temp_montant_forfaitaire_charges_43(_:Unit): - match_arg_579 = residence_7 - if match_arg_579.code == Collectivite_Code.Guadeloupe: - _ = match_arg_579.value - temp_montant_forfaitaire_charges_44 = True - elif match_arg_579.code == Collectivite_Code.Guyane: - _ = match_arg_579.value - temp_montant_forfaitaire_charges_44 = False - elif match_arg_579.code == Collectivite_Code.Martinique: - _ = match_arg_579.value - temp_montant_forfaitaire_charges_44 = True - elif match_arg_579.code == Collectivite_Code.LaReunion: - _ = match_arg_579.value - temp_montant_forfaitaire_charges_44 = True - elif match_arg_579.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_579.value - temp_montant_forfaitaire_charges_44 = True - elif match_arg_579.code == Collectivite_Code.SaintMartin: - _ = match_arg_579.value - temp_montant_forfaitaire_charges_44 = True - elif match_arg_579.code == Collectivite_Code.Metropole: - _ = match_arg_579.value - temp_montant_forfaitaire_charges_44 = False - elif match_arg_579.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_579.value - temp_montant_forfaitaire_charges_44 = False - elif match_arg_579.code == Collectivite_Code.Mayotte: - _ = match_arg_579.value - temp_montant_forfaitaire_charges_44 = True + return montant_18 + def temp_montant_forfaitaire_charges_39(_:Unit): + match_arg_567 = residence_7 + if match_arg_567.code == Collectivite_Code.Guadeloupe: + _ = match_arg_567.value + temp_montant_forfaitaire_charges_40 = True + elif match_arg_567.code == Collectivite_Code.Guyane: + _ = match_arg_567.value + temp_montant_forfaitaire_charges_40 = False + elif match_arg_567.code == Collectivite_Code.Martinique: + _ = match_arg_567.value + temp_montant_forfaitaire_charges_40 = True + elif match_arg_567.code == Collectivite_Code.LaReunion: + _ = match_arg_567.value + temp_montant_forfaitaire_charges_40 = True + elif match_arg_567.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_567.value + temp_montant_forfaitaire_charges_40 = True + elif match_arg_567.code == Collectivite_Code.SaintMartin: + _ = match_arg_567.value + temp_montant_forfaitaire_charges_40 = True + elif match_arg_567.code == Collectivite_Code.Metropole: + _ = match_arg_567.value + temp_montant_forfaitaire_charges_40 = False + elif match_arg_567.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_567.value + temp_montant_forfaitaire_charges_40 = False + elif match_arg_567.code == Collectivite_Code.Mayotte: + _ = match_arg_567.value + temp_montant_forfaitaire_charges_40 = True return (((date_courante_13 >= date_of_numbers(2020,1,1)) and (date_courante_13 < date_of_numbers(2020,10,1))) and + temp_montant_forfaitaire_charges_40) + return handle_default(SourcePosition(filename="", + start_line=0, start_column=1, + end_line=0, end_column=1, + law_headings=[]), [], + temp_montant_forfaitaire_charges_39, + temp_montant_forfaitaire_charges_38) + def temp_montant_forfaitaire_charges_41(_:Unit): + def temp_montant_forfaitaire_charges_42(_:Unit): + match_arg_568 = situation_familiale_calcul_apl_6 + if match_arg_568.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_568.value + temp_montant_35 = money_of_cents_string("1864") + elif match_arg_568.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_568.value + temp_montant_35 = money_of_cents_string("3625") + montant_19 = (temp_montant_35 + + (money_of_cents_string("932") * + decimal_of_integer(nombre_personnes_a_charge_6))) + match_arg_569 = situation_familiale_calcul_apl_6 + if match_arg_569.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_569.value + temp_limite_6 = money_of_cents_string("1864") + elif match_arg_569.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_569.value + temp_limite_6 = money_of_cents_string("3625") + limite_16 = (temp_limite_6 + + (money_of_cents_string("932") * + decimal_of_string("6."))) + if (montant_19 > limite_16): + return limite_16 + else: + return montant_19 + def temp_montant_forfaitaire_charges_43(_:Unit): + match_arg_570 = residence_7 + if match_arg_570.code == Collectivite_Code.Guadeloupe: + _ = match_arg_570.value + temp_montant_forfaitaire_charges_44 = True + elif match_arg_570.code == Collectivite_Code.Guyane: + _ = match_arg_570.value + temp_montant_forfaitaire_charges_44 = False + elif match_arg_570.code == Collectivite_Code.Martinique: + _ = match_arg_570.value + temp_montant_forfaitaire_charges_44 = True + elif match_arg_570.code == Collectivite_Code.LaReunion: + _ = match_arg_570.value + temp_montant_forfaitaire_charges_44 = True + elif match_arg_570.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_570.value + temp_montant_forfaitaire_charges_44 = True + elif match_arg_570.code == Collectivite_Code.SaintMartin: + _ = match_arg_570.value + temp_montant_forfaitaire_charges_44 = True + elif match_arg_570.code == Collectivite_Code.Metropole: + _ = match_arg_570.value + temp_montant_forfaitaire_charges_44 = False + elif match_arg_570.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_570.value + temp_montant_forfaitaire_charges_44 = False + elif match_arg_570.code == Collectivite_Code.Mayotte: + _ = match_arg_570.value + temp_montant_forfaitaire_charges_44 = True + return (((date_courante_13 >= + date_of_numbers(2020,10,1)) and + (date_courante_13 < + date_of_numbers(2021,10,1))) and temp_montant_forfaitaire_charges_44) return handle_default(SourcePosition(filename="", start_line=0, start_column=1, end_line=0, end_column=1, law_headings=[]), [], temp_montant_forfaitaire_charges_43, - temp_montant_forfaitaire_charges_38) + temp_montant_forfaitaire_charges_42) def temp_montant_forfaitaire_charges_45(_:Unit): - def temp_montant_forfaitaire_charges_46(_:Unit): - match_arg_580 = situation_familiale_calcul_apl_6 - if match_arg_580.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_580.value - temp_montant_forfaitaire_charges_47 = money_of_cents_string("1864") - elif match_arg_580.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_580.value - temp_montant_forfaitaire_charges_47 = money_of_cents_string("3625") - match_arg_581 = situation_familiale_calcul_apl_6 - if match_arg_581.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_581.value - temp_montant_forfaitaire_charges_48 = money_of_cents_string("1864") - elif match_arg_581.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_581.value - temp_montant_forfaitaire_charges_48 = money_of_cents_string("3625") - if ((temp_montant_forfaitaire_charges_48 + - (money_of_cents_string("932") * - decimal_of_integer(nombre_personnes_a_charge_6))) > - (temp_montant_forfaitaire_charges_47 + - (money_of_cents_string("932") * - decimal_of_string("6.")))): - match_arg_582 = situation_familiale_calcul_apl_6 - if match_arg_582.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_582.value - temp_montant_forfaitaire_charges_49 = money_of_cents_string("1864") - elif match_arg_582.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_582.value - temp_montant_forfaitaire_charges_49 = money_of_cents_string("3625") - return (temp_montant_forfaitaire_charges_49 + - (money_of_cents_string("932") * - decimal_of_string("6."))) - else: - match_arg_583 = situation_familiale_calcul_apl_6 - if match_arg_583.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_583.value - temp_montant_forfaitaire_charges_50 = money_of_cents_string("1864") - elif match_arg_583.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_583.value - temp_montant_forfaitaire_charges_50 = money_of_cents_string("3625") - return (temp_montant_forfaitaire_charges_50 + - (money_of_cents_string("932") * - decimal_of_integer(nombre_personnes_a_charge_6))) - def temp_montant_forfaitaire_charges_51(_:Unit): - match_arg_584 = residence_7 - if match_arg_584.code == Collectivite_Code.Guadeloupe: - _ = match_arg_584.value - temp_montant_forfaitaire_charges_52 = True - elif match_arg_584.code == Collectivite_Code.Guyane: - _ = match_arg_584.value - temp_montant_forfaitaire_charges_52 = False - elif match_arg_584.code == Collectivite_Code.Martinique: - _ = match_arg_584.value - temp_montant_forfaitaire_charges_52 = True - elif match_arg_584.code == Collectivite_Code.LaReunion: - _ = match_arg_584.value - temp_montant_forfaitaire_charges_52 = True - elif match_arg_584.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_584.value - temp_montant_forfaitaire_charges_52 = True - elif match_arg_584.code == Collectivite_Code.SaintMartin: - _ = match_arg_584.value - temp_montant_forfaitaire_charges_52 = True - elif match_arg_584.code == Collectivite_Code.Metropole: - _ = match_arg_584.value - temp_montant_forfaitaire_charges_52 = False - elif match_arg_584.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_584.value - temp_montant_forfaitaire_charges_52 = False - elif match_arg_584.code == Collectivite_Code.Mayotte: - _ = match_arg_584.value - temp_montant_forfaitaire_charges_52 = True - return (((date_courante_13 >= - date_of_numbers(2020,10,1)) and - (date_courante_13 < - date_of_numbers(2021,10,1))) and - temp_montant_forfaitaire_charges_52) - return handle_default(SourcePosition(filename="", - start_line=0, start_column=1, - end_line=0, end_column=1, - law_headings=[]), [], - temp_montant_forfaitaire_charges_51, - temp_montant_forfaitaire_charges_46) - def temp_montant_forfaitaire_charges_53(_:Unit): try: - def temp_montant_forfaitaire_charges_54(_:Unit): - match_arg_585 = situation_familiale_calcul_apl_6 - if match_arg_585.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_585.value - temp_montant_forfaitaire_charges_55 = money_of_cents_string("1872") - elif match_arg_585.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_585.value - temp_montant_forfaitaire_charges_55 = money_of_cents_string("3640") - match_arg_586 = situation_familiale_calcul_apl_6 - if match_arg_586.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_586.value - temp_montant_forfaitaire_charges_56 = money_of_cents_string("1872") - elif match_arg_586.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_586.value - temp_montant_forfaitaire_charges_56 = money_of_cents_string("3640") - if ((temp_montant_forfaitaire_charges_56 + + def temp_montant_forfaitaire_charges_46(_:Unit): + match_arg_571 = situation_familiale_calcul_apl_6 + if match_arg_571.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_571.value + temp_montant_36 = money_of_cents_string("1872") + elif match_arg_571.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_571.value + temp_montant_36 = money_of_cents_string("3640") + montant_20 = (temp_montant_36 + (money_of_cents_string("936") * - decimal_of_integer(nombre_personnes_a_charge_6))) > - (temp_montant_forfaitaire_charges_55 + + decimal_of_integer(nombre_personnes_a_charge_6))) + match_arg_572 = situation_familiale_calcul_apl_6 + if match_arg_572.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_572.value + temp_limite_7 = money_of_cents_string("1872") + elif match_arg_572.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_572.value + temp_limite_7 = money_of_cents_string("3640") + limite_17 = (temp_limite_7 + (money_of_cents_string("936") * - decimal_of_string("6.")))): - match_arg_587 = situation_familiale_calcul_apl_6 - if match_arg_587.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_587.value - temp_montant_forfaitaire_charges_57 = money_of_cents_string("1872") - elif match_arg_587.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_587.value - temp_montant_forfaitaire_charges_57 = money_of_cents_string("3640") - return (temp_montant_forfaitaire_charges_57 + - (money_of_cents_string("936") * - decimal_of_string("6."))) + decimal_of_string("6."))) + if (montant_20 > limite_17): + return limite_17 else: - match_arg_588 = situation_familiale_calcul_apl_6 - if match_arg_588.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_588.value - temp_montant_forfaitaire_charges_58 = money_of_cents_string("1872") - elif match_arg_588.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_588.value - temp_montant_forfaitaire_charges_58 = money_of_cents_string("3640") - return (temp_montant_forfaitaire_charges_58 + - (money_of_cents_string("936") * - decimal_of_integer(nombre_personnes_a_charge_6))) - def temp_montant_forfaitaire_charges_59(_:Unit): - match_arg_589 = residence_7 - if match_arg_589.code == Collectivite_Code.Guadeloupe: - _ = match_arg_589.value - temp_montant_forfaitaire_charges_60 = True - elif match_arg_589.code == Collectivite_Code.Guyane: - _ = match_arg_589.value - temp_montant_forfaitaire_charges_60 = False - elif match_arg_589.code == Collectivite_Code.Martinique: - _ = match_arg_589.value - temp_montant_forfaitaire_charges_60 = True - elif match_arg_589.code == Collectivite_Code.LaReunion: - _ = match_arg_589.value - temp_montant_forfaitaire_charges_60 = True - elif match_arg_589.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_589.value - temp_montant_forfaitaire_charges_60 = True - elif match_arg_589.code == Collectivite_Code.SaintMartin: - _ = match_arg_589.value - temp_montant_forfaitaire_charges_60 = True - elif match_arg_589.code == Collectivite_Code.Metropole: - _ = match_arg_589.value - temp_montant_forfaitaire_charges_60 = False - elif match_arg_589.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_589.value - temp_montant_forfaitaire_charges_60 = False - elif match_arg_589.code == Collectivite_Code.Mayotte: - _ = match_arg_589.value - temp_montant_forfaitaire_charges_60 = True + return montant_20 + def temp_montant_forfaitaire_charges_47(_:Unit): + match_arg_573 = residence_7 + if match_arg_573.code == Collectivite_Code.Guadeloupe: + _ = match_arg_573.value + temp_montant_forfaitaire_charges_48 = True + elif match_arg_573.code == Collectivite_Code.Guyane: + _ = match_arg_573.value + temp_montant_forfaitaire_charges_48 = False + elif match_arg_573.code == Collectivite_Code.Martinique: + _ = match_arg_573.value + temp_montant_forfaitaire_charges_48 = True + elif match_arg_573.code == Collectivite_Code.LaReunion: + _ = match_arg_573.value + temp_montant_forfaitaire_charges_48 = True + elif match_arg_573.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_573.value + temp_montant_forfaitaire_charges_48 = True + elif match_arg_573.code == Collectivite_Code.SaintMartin: + _ = match_arg_573.value + temp_montant_forfaitaire_charges_48 = True + elif match_arg_573.code == Collectivite_Code.Metropole: + _ = match_arg_573.value + temp_montant_forfaitaire_charges_48 = False + elif match_arg_573.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_573.value + temp_montant_forfaitaire_charges_48 = False + elif match_arg_573.code == Collectivite_Code.Mayotte: + _ = match_arg_573.value + temp_montant_forfaitaire_charges_48 = True return (((date_courante_13 >= date_of_numbers(2021,10,1)) and (date_courante_13 < date_of_numbers(2022,1,1))) and - temp_montant_forfaitaire_charges_60) + temp_montant_forfaitaire_charges_48) return handle_default(SourcePosition(filename="", start_line=0, start_column=1, end_line=0, end_column=1, law_headings=[]), [], - temp_montant_forfaitaire_charges_59, - temp_montant_forfaitaire_charges_54) + temp_montant_forfaitaire_charges_47, + temp_montant_forfaitaire_charges_46) except EmptyError: - match_arg_590 = residence_7 - if match_arg_590.code == Collectivite_Code.Guadeloupe: - _ = match_arg_590.value - temp_montant_forfaitaire_charges_61 = True - elif match_arg_590.code == Collectivite_Code.Guyane: - _ = match_arg_590.value - temp_montant_forfaitaire_charges_61 = False - elif match_arg_590.code == Collectivite_Code.Martinique: - _ = match_arg_590.value - temp_montant_forfaitaire_charges_61 = True - elif match_arg_590.code == Collectivite_Code.LaReunion: - _ = match_arg_590.value - temp_montant_forfaitaire_charges_61 = True - elif match_arg_590.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_590.value - temp_montant_forfaitaire_charges_61 = True - elif match_arg_590.code == Collectivite_Code.SaintMartin: - _ = match_arg_590.value - temp_montant_forfaitaire_charges_61 = True - elif match_arg_590.code == Collectivite_Code.Metropole: - _ = match_arg_590.value - temp_montant_forfaitaire_charges_61 = False - elif match_arg_590.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_590.value - temp_montant_forfaitaire_charges_61 = False - elif match_arg_590.code == Collectivite_Code.Mayotte: - _ = match_arg_590.value - temp_montant_forfaitaire_charges_61 = True + match_arg_574 = residence_7 + if match_arg_574.code == Collectivite_Code.Guadeloupe: + _ = match_arg_574.value + temp_montant_forfaitaire_charges_49 = True + elif match_arg_574.code == Collectivite_Code.Guyane: + _ = match_arg_574.value + temp_montant_forfaitaire_charges_49 = False + elif match_arg_574.code == Collectivite_Code.Martinique: + _ = match_arg_574.value + temp_montant_forfaitaire_charges_49 = True + elif match_arg_574.code == Collectivite_Code.LaReunion: + _ = match_arg_574.value + temp_montant_forfaitaire_charges_49 = True + elif match_arg_574.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_574.value + temp_montant_forfaitaire_charges_49 = True + elif match_arg_574.code == Collectivite_Code.SaintMartin: + _ = match_arg_574.value + temp_montant_forfaitaire_charges_49 = True + elif match_arg_574.code == Collectivite_Code.Metropole: + _ = match_arg_574.value + temp_montant_forfaitaire_charges_49 = False + elif match_arg_574.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_574.value + temp_montant_forfaitaire_charges_49 = False + elif match_arg_574.code == Collectivite_Code.Mayotte: + _ = match_arg_574.value + temp_montant_forfaitaire_charges_49 = True if (((date_courante_13 >= date_of_numbers(2022,1,1)) and (date_courante_13 < date_of_numbers(2022,7,1))) and - temp_montant_forfaitaire_charges_61): - match_arg_591 = situation_familiale_calcul_apl_6 - if match_arg_591.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_591.value - temp_montant_forfaitaire_charges_62 = money_of_cents_string("1872") - elif match_arg_591.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_591.value - temp_montant_forfaitaire_charges_62 = money_of_cents_string("3640") - match_arg_592 = situation_familiale_calcul_apl_6 - if match_arg_592.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_592.value - temp_montant_forfaitaire_charges_63 = money_of_cents_string("1872") - elif match_arg_592.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_592.value - temp_montant_forfaitaire_charges_63 = money_of_cents_string("3640") - if ((temp_montant_forfaitaire_charges_63 + + temp_montant_forfaitaire_charges_49): + match_arg_575 = situation_familiale_calcul_apl_6 + if match_arg_575.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_575.value + temp_montant_37 = money_of_cents_string("1872") + elif match_arg_575.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_575.value + temp_montant_37 = money_of_cents_string("3640") + montant_21 = (temp_montant_37 + (money_of_cents_string("936") * - decimal_of_integer(nombre_personnes_a_charge_6))) > - (temp_montant_forfaitaire_charges_62 + + decimal_of_integer(nombre_personnes_a_charge_6))) + match_arg_576 = situation_familiale_calcul_apl_6 + if match_arg_576.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_576.value + temp_limite_8 = money_of_cents_string("1872") + elif match_arg_576.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_576.value + temp_limite_8 = money_of_cents_string("3640") + limite_18 = (temp_limite_8 + (money_of_cents_string("936") * - decimal_of_string("6.")))): - match_arg_593 = situation_familiale_calcul_apl_6 - if match_arg_593.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_593.value - temp_montant_forfaitaire_charges_64 = money_of_cents_string("1872") - elif match_arg_593.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_593.value - temp_montant_forfaitaire_charges_64 = money_of_cents_string("3640") - return (temp_montant_forfaitaire_charges_64 + - (money_of_cents_string("936") * - decimal_of_string("6."))) + decimal_of_string("6."))) + if (montant_21 > limite_18): + return limite_18 else: - match_arg_594 = situation_familiale_calcul_apl_6 - if match_arg_594.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_594.value - temp_montant_forfaitaire_charges_65 = money_of_cents_string("1872") - elif match_arg_594.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_594.value - temp_montant_forfaitaire_charges_65 = money_of_cents_string("3640") - return (temp_montant_forfaitaire_charges_65 + - (money_of_cents_string("936") * - decimal_of_integer(nombre_personnes_a_charge_6))) + return montant_21 else: raise EmptyError - def temp_montant_forfaitaire_charges_66(_:Unit): - def temp_montant_forfaitaire_charges_67(_:Unit): - match_arg_595 = situation_familiale_calcul_apl_6 - if match_arg_595.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_595.value - temp_montant_forfaitaire_charges_68 = money_of_cents_string("1938") - elif match_arg_595.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_595.value - temp_montant_forfaitaire_charges_68 = money_of_cents_string("3767") - match_arg_596 = situation_familiale_calcul_apl_6 - if match_arg_596.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_596.value - temp_montant_forfaitaire_charges_69 = money_of_cents_string("1938") - elif match_arg_596.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_596.value - temp_montant_forfaitaire_charges_69 = money_of_cents_string("3767") - if ((temp_montant_forfaitaire_charges_69 + + def temp_montant_forfaitaire_charges_50(_:Unit): + def temp_montant_forfaitaire_charges_51(_:Unit): + match_arg_577 = situation_familiale_calcul_apl_6 + if match_arg_577.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_577.value + temp_montant_38 = money_of_cents_string("1938") + elif match_arg_577.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_577.value + temp_montant_38 = money_of_cents_string("3767") + montant_22 = (temp_montant_38 + (money_of_cents_string("969") * - decimal_of_integer(nombre_personnes_a_charge_6))) > - (temp_montant_forfaitaire_charges_68 + + decimal_of_integer(nombre_personnes_a_charge_6))) + match_arg_578 = situation_familiale_calcul_apl_6 + if match_arg_578.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_578.value + temp_limite_9 = money_of_cents_string("1938") + elif match_arg_578.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_578.value + temp_limite_9 = money_of_cents_string("3767") + limite_19 = (temp_limite_9 + (money_of_cents_string("969") * - decimal_of_string("6.")))): - match_arg_597 = situation_familiale_calcul_apl_6 - if match_arg_597.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_597.value - temp_montant_forfaitaire_charges_70 = money_of_cents_string("1938") - elif match_arg_597.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_597.value - temp_montant_forfaitaire_charges_70 = money_of_cents_string("3767") - return (temp_montant_forfaitaire_charges_70 + - (money_of_cents_string("969") * - decimal_of_string("6."))) + decimal_of_string("6."))) + if (montant_22 > limite_19): + return limite_19 else: - match_arg_598 = situation_familiale_calcul_apl_6 - if match_arg_598.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_598.value - temp_montant_forfaitaire_charges_71 = money_of_cents_string("1938") - elif match_arg_598.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_598.value - temp_montant_forfaitaire_charges_71 = money_of_cents_string("3767") - return (temp_montant_forfaitaire_charges_71 + - (money_of_cents_string("969") * - decimal_of_integer(nombre_personnes_a_charge_6))) - def temp_montant_forfaitaire_charges_72(_:Unit): - match_arg_599 = residence_7 - if match_arg_599.code == Collectivite_Code.Guadeloupe: - _ = match_arg_599.value - temp_montant_forfaitaire_charges_73 = True - elif match_arg_599.code == Collectivite_Code.Guyane: - _ = match_arg_599.value - temp_montant_forfaitaire_charges_73 = False - elif match_arg_599.code == Collectivite_Code.Martinique: - _ = match_arg_599.value - temp_montant_forfaitaire_charges_73 = True - elif match_arg_599.code == Collectivite_Code.LaReunion: - _ = match_arg_599.value - temp_montant_forfaitaire_charges_73 = True - elif match_arg_599.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_599.value - temp_montant_forfaitaire_charges_73 = True - elif match_arg_599.code == Collectivite_Code.SaintMartin: - _ = match_arg_599.value - temp_montant_forfaitaire_charges_73 = True - elif match_arg_599.code == Collectivite_Code.Metropole: - _ = match_arg_599.value - temp_montant_forfaitaire_charges_73 = False - elif match_arg_599.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_599.value - temp_montant_forfaitaire_charges_73 = False - elif match_arg_599.code == Collectivite_Code.Mayotte: - _ = match_arg_599.value - temp_montant_forfaitaire_charges_73 = True + return montant_22 + def temp_montant_forfaitaire_charges_52(_:Unit): + match_arg_579 = residence_7 + if match_arg_579.code == Collectivite_Code.Guadeloupe: + _ = match_arg_579.value + temp_montant_forfaitaire_charges_53 = True + elif match_arg_579.code == Collectivite_Code.Guyane: + _ = match_arg_579.value + temp_montant_forfaitaire_charges_53 = False + elif match_arg_579.code == Collectivite_Code.Martinique: + _ = match_arg_579.value + temp_montant_forfaitaire_charges_53 = True + elif match_arg_579.code == Collectivite_Code.LaReunion: + _ = match_arg_579.value + temp_montant_forfaitaire_charges_53 = True + elif match_arg_579.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_579.value + temp_montant_forfaitaire_charges_53 = True + elif match_arg_579.code == Collectivite_Code.SaintMartin: + _ = match_arg_579.value + temp_montant_forfaitaire_charges_53 = True + elif match_arg_579.code == Collectivite_Code.Metropole: + _ = match_arg_579.value + temp_montant_forfaitaire_charges_53 = False + elif match_arg_579.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_579.value + temp_montant_forfaitaire_charges_53 = False + elif match_arg_579.code == Collectivite_Code.Mayotte: + _ = match_arg_579.value + temp_montant_forfaitaire_charges_53 = True return (((date_courante_13 >= date_of_numbers(2022,7,1)) and (date_courante_13 < date_of_numbers(2023,1,1))) and - temp_montant_forfaitaire_charges_73) + temp_montant_forfaitaire_charges_53) return handle_default(SourcePosition(filename="", start_line=0, start_column=1, end_line=0, end_column=1, law_headings=[]), [], - temp_montant_forfaitaire_charges_72, - temp_montant_forfaitaire_charges_67) - def temp_montant_forfaitaire_charges_74(_:Unit): - def temp_montant_forfaitaire_charges_75(_:Unit): - match_arg_600 = situation_familiale_calcul_apl_6 - if match_arg_600.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_600.value - temp_montant_forfaitaire_charges_76 = money_of_cents_string("1938") - elif match_arg_600.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_600.value - temp_montant_forfaitaire_charges_76 = money_of_cents_string("3767") - return (temp_montant_forfaitaire_charges_76 + + temp_montant_forfaitaire_charges_52, + temp_montant_forfaitaire_charges_51) + def temp_montant_forfaitaire_charges_54(_:Unit): + def temp_montant_forfaitaire_charges_55(_:Unit): + match_arg_580 = situation_familiale_calcul_apl_6 + if match_arg_580.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_580.value + temp_montant_forfaitaire_charges_56 = money_of_cents_string("1938") + elif match_arg_580.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_580.value + temp_montant_forfaitaire_charges_56 = money_of_cents_string("3767") + return (temp_montant_forfaitaire_charges_56 + (money_of_cents_string("969") * multiplicateur_majoration_charges_1)) - def temp_montant_forfaitaire_charges_77(_:Unit): - match_arg_601 = residence_7 - if match_arg_601.code == Collectivite_Code.Guadeloupe: - _ = match_arg_601.value - temp_montant_forfaitaire_charges_78 = True - elif match_arg_601.code == Collectivite_Code.Guyane: - _ = match_arg_601.value - temp_montant_forfaitaire_charges_78 = False - elif match_arg_601.code == Collectivite_Code.Martinique: - _ = match_arg_601.value - temp_montant_forfaitaire_charges_78 = True - elif match_arg_601.code == Collectivite_Code.LaReunion: - _ = match_arg_601.value - temp_montant_forfaitaire_charges_78 = True - elif match_arg_601.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_601.value - temp_montant_forfaitaire_charges_78 = True - elif match_arg_601.code == Collectivite_Code.SaintMartin: - _ = match_arg_601.value - temp_montant_forfaitaire_charges_78 = True - elif match_arg_601.code == Collectivite_Code.Metropole: - _ = match_arg_601.value - temp_montant_forfaitaire_charges_78 = False - elif match_arg_601.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_601.value - temp_montant_forfaitaire_charges_78 = False - elif match_arg_601.code == Collectivite_Code.Mayotte: - _ = match_arg_601.value - temp_montant_forfaitaire_charges_78 = True + def temp_montant_forfaitaire_charges_57(_:Unit): + match_arg_581 = residence_7 + if match_arg_581.code == Collectivite_Code.Guadeloupe: + _ = match_arg_581.value + temp_montant_forfaitaire_charges_58 = True + elif match_arg_581.code == Collectivite_Code.Guyane: + _ = match_arg_581.value + temp_montant_forfaitaire_charges_58 = False + elif match_arg_581.code == Collectivite_Code.Martinique: + _ = match_arg_581.value + temp_montant_forfaitaire_charges_58 = True + elif match_arg_581.code == Collectivite_Code.LaReunion: + _ = match_arg_581.value + temp_montant_forfaitaire_charges_58 = True + elif match_arg_581.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_581.value + temp_montant_forfaitaire_charges_58 = True + elif match_arg_581.code == Collectivite_Code.SaintMartin: + _ = match_arg_581.value + temp_montant_forfaitaire_charges_58 = True + elif match_arg_581.code == Collectivite_Code.Metropole: + _ = match_arg_581.value + temp_montant_forfaitaire_charges_58 = False + elif match_arg_581.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_581.value + temp_montant_forfaitaire_charges_58 = False + elif match_arg_581.code == Collectivite_Code.Mayotte: + _ = match_arg_581.value + temp_montant_forfaitaire_charges_58 = True return ((date_courante_13 >= date_of_numbers(2023,1,1)) and - (temp_montant_forfaitaire_charges_78 and + (temp_montant_forfaitaire_charges_58 and copropriete_1)) return handle_default(SourcePosition(filename="", start_line=0, start_column=1, end_line=0, end_column=1, law_headings=[]), [], - temp_montant_forfaitaire_charges_77, - temp_montant_forfaitaire_charges_75) - temp_montant_forfaitaire_charges_79 = handle_default( + temp_montant_forfaitaire_charges_57, + temp_montant_forfaitaire_charges_55) + temp_montant_forfaitaire_charges_59 = handle_default( SourcePosition(filename="", start_line=0, start_column=1, end_line=0, end_column=1, - law_headings=[]), [temp_montant_forfaitaire_charges_74, - temp_montant_forfaitaire_charges_66, - temp_montant_forfaitaire_charges_53, + law_headings=[]), [temp_montant_forfaitaire_charges_54, + temp_montant_forfaitaire_charges_50, temp_montant_forfaitaire_charges_45, + temp_montant_forfaitaire_charges_41, temp_montant_forfaitaire_charges_37], temp_montant_forfaitaire_charges_36, temp_montant_forfaitaire_charges_35) except EmptyError: - def temp_montant_forfaitaire_charges_80(_:Unit): + def temp_montant_forfaitaire_charges_60(_:Unit): raise EmptyError - def temp_montant_forfaitaire_charges_81(_:Unit): + def temp_montant_forfaitaire_charges_61(_:Unit): return False - def temp_montant_forfaitaire_charges_82(_:Unit): - def temp_montant_forfaitaire_charges_83(_:Unit): - if ((money_of_cents_string("3614") + + def temp_montant_forfaitaire_charges_62(_:Unit): + def temp_montant_forfaitaire_charges_63(_:Unit): + montant_23 = (money_of_cents_string("3614") + (money_of_cents_string("929") * - decimal_of_integer(nombre_personnes_a_charge_6))) > - (money_of_cents_string("3614") + + decimal_of_integer(nombre_personnes_a_charge_6))) + limite_20 = (money_of_cents_string("3614") + (money_of_cents_string("929") * - decimal_of_string("6.")))): - return (money_of_cents_string("3614") + - (money_of_cents_string("929") * - decimal_of_string("6."))) + decimal_of_string("6."))) + if (montant_23 > limite_20): + return limite_20 else: - return (money_of_cents_string("3614") + - (money_of_cents_string("929") * - decimal_of_integer(nombre_personnes_a_charge_6))) - def temp_montant_forfaitaire_charges_84(_:Unit): - match_arg_602 = residence_7 - if match_arg_602.code == Collectivite_Code.Guadeloupe: - _ = match_arg_602.value - temp_montant_forfaitaire_charges_85 = True - elif match_arg_602.code == Collectivite_Code.Guyane: - _ = match_arg_602.value - temp_montant_forfaitaire_charges_85 = False - elif match_arg_602.code == Collectivite_Code.Martinique: - _ = match_arg_602.value - temp_montant_forfaitaire_charges_85 = True - elif match_arg_602.code == Collectivite_Code.LaReunion: - _ = match_arg_602.value - temp_montant_forfaitaire_charges_85 = True - elif match_arg_602.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_602.value - temp_montant_forfaitaire_charges_85 = True - elif match_arg_602.code == Collectivite_Code.SaintMartin: - _ = match_arg_602.value - temp_montant_forfaitaire_charges_85 = True - elif match_arg_602.code == Collectivite_Code.Metropole: - _ = match_arg_602.value - temp_montant_forfaitaire_charges_85 = False - elif match_arg_602.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_602.value - temp_montant_forfaitaire_charges_85 = False - elif match_arg_602.code == Collectivite_Code.Mayotte: - _ = match_arg_602.value - temp_montant_forfaitaire_charges_85 = True + return montant_23 + def temp_montant_forfaitaire_charges_64(_:Unit): + match_arg_582 = residence_7 + if match_arg_582.code == Collectivite_Code.Guadeloupe: + _ = match_arg_582.value + temp_montant_forfaitaire_charges_65 = True + elif match_arg_582.code == Collectivite_Code.Guyane: + _ = match_arg_582.value + temp_montant_forfaitaire_charges_65 = False + elif match_arg_582.code == Collectivite_Code.Martinique: + _ = match_arg_582.value + temp_montant_forfaitaire_charges_65 = True + elif match_arg_582.code == Collectivite_Code.LaReunion: + _ = match_arg_582.value + temp_montant_forfaitaire_charges_65 = True + elif match_arg_582.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_582.value + temp_montant_forfaitaire_charges_65 = True + elif match_arg_582.code == Collectivite_Code.SaintMartin: + _ = match_arg_582.value + temp_montant_forfaitaire_charges_65 = True + elif match_arg_582.code == Collectivite_Code.Metropole: + _ = match_arg_582.value + temp_montant_forfaitaire_charges_65 = False + elif match_arg_582.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_582.value + temp_montant_forfaitaire_charges_65 = False + elif match_arg_582.code == Collectivite_Code.Mayotte: + _ = match_arg_582.value + temp_montant_forfaitaire_charges_65 = True return (((date_courante_13 >= date_of_numbers(2020,1,1)) and (date_courante_13 < date_of_numbers(2020,10,1))) and - temp_montant_forfaitaire_charges_85) + temp_montant_forfaitaire_charges_65) return handle_default(SourcePosition(filename="", start_line=0, start_column=1, end_line=0, end_column=1, law_headings=[]), [], - temp_montant_forfaitaire_charges_84, - temp_montant_forfaitaire_charges_83) - def temp_montant_forfaitaire_charges_86(_:Unit): - def temp_montant_forfaitaire_charges_87(_:Unit): - if ((money_of_cents_string("3625") + + temp_montant_forfaitaire_charges_64, + temp_montant_forfaitaire_charges_63) + def temp_montant_forfaitaire_charges_66(_:Unit): + def temp_montant_forfaitaire_charges_67(_:Unit): + montant_24 = (money_of_cents_string("3625") + (money_of_cents_string("932") * - decimal_of_integer(nombre_personnes_a_charge_6))) > - (money_of_cents_string("3625") + + decimal_of_integer(nombre_personnes_a_charge_6))) + limite_21 = (money_of_cents_string("3625") + (money_of_cents_string("932") * - decimal_of_string("6.")))): - return (money_of_cents_string("3625") + - (money_of_cents_string("932") * - decimal_of_string("6."))) + decimal_of_string("6."))) + if (montant_24 > limite_21): + return limite_21 else: - return (money_of_cents_string("3625") + - (money_of_cents_string("932") * - decimal_of_integer(nombre_personnes_a_charge_6))) - def temp_montant_forfaitaire_charges_88(_:Unit): - match_arg_603 = residence_7 - if match_arg_603.code == Collectivite_Code.Guadeloupe: - _ = match_arg_603.value - temp_montant_forfaitaire_charges_89 = True - elif match_arg_603.code == Collectivite_Code.Guyane: - _ = match_arg_603.value - temp_montant_forfaitaire_charges_89 = False - elif match_arg_603.code == Collectivite_Code.Martinique: - _ = match_arg_603.value - temp_montant_forfaitaire_charges_89 = True - elif match_arg_603.code == Collectivite_Code.LaReunion: - _ = match_arg_603.value - temp_montant_forfaitaire_charges_89 = True - elif match_arg_603.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_603.value - temp_montant_forfaitaire_charges_89 = True - elif match_arg_603.code == Collectivite_Code.SaintMartin: - _ = match_arg_603.value - temp_montant_forfaitaire_charges_89 = True - elif match_arg_603.code == Collectivite_Code.Metropole: - _ = match_arg_603.value - temp_montant_forfaitaire_charges_89 = False - elif match_arg_603.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_603.value - temp_montant_forfaitaire_charges_89 = False - elif match_arg_603.code == Collectivite_Code.Mayotte: - _ = match_arg_603.value - temp_montant_forfaitaire_charges_89 = True + return montant_24 + def temp_montant_forfaitaire_charges_68(_:Unit): + match_arg_583 = residence_7 + if match_arg_583.code == Collectivite_Code.Guadeloupe: + _ = match_arg_583.value + temp_montant_forfaitaire_charges_69 = True + elif match_arg_583.code == Collectivite_Code.Guyane: + _ = match_arg_583.value + temp_montant_forfaitaire_charges_69 = False + elif match_arg_583.code == Collectivite_Code.Martinique: + _ = match_arg_583.value + temp_montant_forfaitaire_charges_69 = True + elif match_arg_583.code == Collectivite_Code.LaReunion: + _ = match_arg_583.value + temp_montant_forfaitaire_charges_69 = True + elif match_arg_583.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_583.value + temp_montant_forfaitaire_charges_69 = True + elif match_arg_583.code == Collectivite_Code.SaintMartin: + _ = match_arg_583.value + temp_montant_forfaitaire_charges_69 = True + elif match_arg_583.code == Collectivite_Code.Metropole: + _ = match_arg_583.value + temp_montant_forfaitaire_charges_69 = False + elif match_arg_583.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_583.value + temp_montant_forfaitaire_charges_69 = False + elif match_arg_583.code == Collectivite_Code.Mayotte: + _ = match_arg_583.value + temp_montant_forfaitaire_charges_69 = True return (((date_courante_13 >= date_of_numbers(2020,10,1)) and (date_courante_13 < date_of_numbers(2021,10,1))) and - temp_montant_forfaitaire_charges_89) + temp_montant_forfaitaire_charges_69) return handle_default(SourcePosition(filename="", start_line=0, start_column=1, end_line=0, end_column=1, law_headings=[]), [], - temp_montant_forfaitaire_charges_88, - temp_montant_forfaitaire_charges_87) - def temp_montant_forfaitaire_charges_90(_:Unit): + temp_montant_forfaitaire_charges_68, + temp_montant_forfaitaire_charges_67) + def temp_montant_forfaitaire_charges_70(_:Unit): try: - def temp_montant_forfaitaire_charges_91(_:Unit): - if ((money_of_cents_string("3640") + + def temp_montant_forfaitaire_charges_71(_:Unit): + montant_25 = (money_of_cents_string("3640") + (money_of_cents_string("936") * - decimal_of_integer(nombre_personnes_a_charge_6))) > - (money_of_cents_string("3640") + + decimal_of_integer(nombre_personnes_a_charge_6))) + limite_22 = (money_of_cents_string("3640") + (money_of_cents_string("936") * - decimal_of_string("6.")))): - return (money_of_cents_string("3640") + - (money_of_cents_string("936") * - decimal_of_string("6."))) + decimal_of_string("6."))) + if (montant_25 > limite_22): + return limite_22 else: - return (money_of_cents_string("3640") + - (money_of_cents_string("936") * - decimal_of_integer(nombre_personnes_a_charge_6))) - def temp_montant_forfaitaire_charges_92(_:Unit): - match_arg_604 = residence_7 - if match_arg_604.code == Collectivite_Code.Guadeloupe: - _ = match_arg_604.value - temp_montant_forfaitaire_charges_93 = True - elif match_arg_604.code == Collectivite_Code.Guyane: - _ = match_arg_604.value - temp_montant_forfaitaire_charges_93 = False - elif match_arg_604.code == Collectivite_Code.Martinique: - _ = match_arg_604.value - temp_montant_forfaitaire_charges_93 = True - elif match_arg_604.code == Collectivite_Code.LaReunion: - _ = match_arg_604.value - temp_montant_forfaitaire_charges_93 = True - elif match_arg_604.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_604.value - temp_montant_forfaitaire_charges_93 = True - elif match_arg_604.code == Collectivite_Code.SaintMartin: - _ = match_arg_604.value - temp_montant_forfaitaire_charges_93 = True - elif match_arg_604.code == Collectivite_Code.Metropole: - _ = match_arg_604.value - temp_montant_forfaitaire_charges_93 = False - elif match_arg_604.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_604.value - temp_montant_forfaitaire_charges_93 = False - elif match_arg_604.code == Collectivite_Code.Mayotte: - _ = match_arg_604.value - temp_montant_forfaitaire_charges_93 = True + return montant_25 + def temp_montant_forfaitaire_charges_72(_:Unit): + match_arg_584 = residence_7 + if match_arg_584.code == Collectivite_Code.Guadeloupe: + _ = match_arg_584.value + temp_montant_forfaitaire_charges_73 = True + elif match_arg_584.code == Collectivite_Code.Guyane: + _ = match_arg_584.value + temp_montant_forfaitaire_charges_73 = False + elif match_arg_584.code == Collectivite_Code.Martinique: + _ = match_arg_584.value + temp_montant_forfaitaire_charges_73 = True + elif match_arg_584.code == Collectivite_Code.LaReunion: + _ = match_arg_584.value + temp_montant_forfaitaire_charges_73 = True + elif match_arg_584.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_584.value + temp_montant_forfaitaire_charges_73 = True + elif match_arg_584.code == Collectivite_Code.SaintMartin: + _ = match_arg_584.value + temp_montant_forfaitaire_charges_73 = True + elif match_arg_584.code == Collectivite_Code.Metropole: + _ = match_arg_584.value + temp_montant_forfaitaire_charges_73 = False + elif match_arg_584.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_584.value + temp_montant_forfaitaire_charges_73 = False + elif match_arg_584.code == Collectivite_Code.Mayotte: + _ = match_arg_584.value + temp_montant_forfaitaire_charges_73 = True return (((date_courante_13 >= date_of_numbers(2021,10,1)) and (date_courante_13 < date_of_numbers(2022,1,1))) and - temp_montant_forfaitaire_charges_93) + temp_montant_forfaitaire_charges_73) return handle_default(SourcePosition(filename="", start_line=0, start_column=1, end_line=0, end_column=1, law_headings=[]), [], - temp_montant_forfaitaire_charges_92, - temp_montant_forfaitaire_charges_91) + temp_montant_forfaitaire_charges_72, + temp_montant_forfaitaire_charges_71) except EmptyError: - match_arg_605 = residence_7 - if match_arg_605.code == Collectivite_Code.Guadeloupe: - _ = match_arg_605.value - temp_montant_forfaitaire_charges_94 = True - elif match_arg_605.code == Collectivite_Code.Guyane: - _ = match_arg_605.value - temp_montant_forfaitaire_charges_94 = False - elif match_arg_605.code == Collectivite_Code.Martinique: - _ = match_arg_605.value - temp_montant_forfaitaire_charges_94 = True - elif match_arg_605.code == Collectivite_Code.LaReunion: - _ = match_arg_605.value - temp_montant_forfaitaire_charges_94 = True - elif match_arg_605.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_605.value - temp_montant_forfaitaire_charges_94 = True - elif match_arg_605.code == Collectivite_Code.SaintMartin: - _ = match_arg_605.value - temp_montant_forfaitaire_charges_94 = True - elif match_arg_605.code == Collectivite_Code.Metropole: - _ = match_arg_605.value - temp_montant_forfaitaire_charges_94 = False - elif match_arg_605.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_605.value - temp_montant_forfaitaire_charges_94 = False - elif match_arg_605.code == Collectivite_Code.Mayotte: - _ = match_arg_605.value - temp_montant_forfaitaire_charges_94 = True + match_arg_585 = residence_7 + if match_arg_585.code == Collectivite_Code.Guadeloupe: + _ = match_arg_585.value + temp_montant_forfaitaire_charges_74 = True + elif match_arg_585.code == Collectivite_Code.Guyane: + _ = match_arg_585.value + temp_montant_forfaitaire_charges_74 = False + elif match_arg_585.code == Collectivite_Code.Martinique: + _ = match_arg_585.value + temp_montant_forfaitaire_charges_74 = True + elif match_arg_585.code == Collectivite_Code.LaReunion: + _ = match_arg_585.value + temp_montant_forfaitaire_charges_74 = True + elif match_arg_585.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_585.value + temp_montant_forfaitaire_charges_74 = True + elif match_arg_585.code == Collectivite_Code.SaintMartin: + _ = match_arg_585.value + temp_montant_forfaitaire_charges_74 = True + elif match_arg_585.code == Collectivite_Code.Metropole: + _ = match_arg_585.value + temp_montant_forfaitaire_charges_74 = False + elif match_arg_585.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_585.value + temp_montant_forfaitaire_charges_74 = False + elif match_arg_585.code == Collectivite_Code.Mayotte: + _ = match_arg_585.value + temp_montant_forfaitaire_charges_74 = True if (((date_courante_13 >= date_of_numbers(2022,1,1)) and (date_courante_13 < date_of_numbers(2022,7,1))) and - temp_montant_forfaitaire_charges_94): - if ((money_of_cents_string("3640") + + temp_montant_forfaitaire_charges_74): + montant_26 = (money_of_cents_string("3640") + (money_of_cents_string("936") * - decimal_of_integer(nombre_personnes_a_charge_6))) > - (money_of_cents_string("3640") + + decimal_of_integer(nombre_personnes_a_charge_6))) + limite_23 = (money_of_cents_string("3640") + (money_of_cents_string("936") * - decimal_of_string("6.")))): - return (money_of_cents_string("3640") + - (money_of_cents_string("936") * - decimal_of_string("6."))) + decimal_of_string("6."))) + if (montant_26 > limite_23): + return limite_23 else: - return (money_of_cents_string("3640") + - (money_of_cents_string("936") * - decimal_of_integer(nombre_personnes_a_charge_6))) + return montant_26 else: raise EmptyError - def temp_montant_forfaitaire_charges_95(_:Unit): - def temp_montant_forfaitaire_charges_96(_:Unit): - if ((money_of_cents_string("3767") + + def temp_montant_forfaitaire_charges_75(_:Unit): + def temp_montant_forfaitaire_charges_76(_:Unit): + montant_27 = (money_of_cents_string("3767") + (money_of_cents_string("969") * - decimal_of_integer(nombre_personnes_a_charge_6))) > - (money_of_cents_string("3767") + + decimal_of_integer(nombre_personnes_a_charge_6))) + limite_24 = (money_of_cents_string("3767") + (money_of_cents_string("969") * - decimal_of_string("6.")))): - return (money_of_cents_string("3767") + - (money_of_cents_string("969") * - decimal_of_string("6."))) + decimal_of_string("6."))) + if (montant_27 > limite_24): + return limite_24 else: - return (money_of_cents_string("3767") + - (money_of_cents_string("969") * - decimal_of_integer(nombre_personnes_a_charge_6))) - def temp_montant_forfaitaire_charges_97(_:Unit): - match_arg_606 = residence_7 - if match_arg_606.code == Collectivite_Code.Guadeloupe: - _ = match_arg_606.value - temp_montant_forfaitaire_charges_98 = True - elif match_arg_606.code == Collectivite_Code.Guyane: - _ = match_arg_606.value - temp_montant_forfaitaire_charges_98 = False - elif match_arg_606.code == Collectivite_Code.Martinique: - _ = match_arg_606.value - temp_montant_forfaitaire_charges_98 = True - elif match_arg_606.code == Collectivite_Code.LaReunion: - _ = match_arg_606.value - temp_montant_forfaitaire_charges_98 = True - elif match_arg_606.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_606.value - temp_montant_forfaitaire_charges_98 = True - elif match_arg_606.code == Collectivite_Code.SaintMartin: - _ = match_arg_606.value - temp_montant_forfaitaire_charges_98 = True - elif match_arg_606.code == Collectivite_Code.Metropole: - _ = match_arg_606.value - temp_montant_forfaitaire_charges_98 = False - elif match_arg_606.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_606.value - temp_montant_forfaitaire_charges_98 = False - elif match_arg_606.code == Collectivite_Code.Mayotte: - _ = match_arg_606.value - temp_montant_forfaitaire_charges_98 = True + return montant_27 + def temp_montant_forfaitaire_charges_77(_:Unit): + match_arg_586 = residence_7 + if match_arg_586.code == Collectivite_Code.Guadeloupe: + _ = match_arg_586.value + temp_montant_forfaitaire_charges_78 = True + elif match_arg_586.code == Collectivite_Code.Guyane: + _ = match_arg_586.value + temp_montant_forfaitaire_charges_78 = False + elif match_arg_586.code == Collectivite_Code.Martinique: + _ = match_arg_586.value + temp_montant_forfaitaire_charges_78 = True + elif match_arg_586.code == Collectivite_Code.LaReunion: + _ = match_arg_586.value + temp_montant_forfaitaire_charges_78 = True + elif match_arg_586.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_586.value + temp_montant_forfaitaire_charges_78 = True + elif match_arg_586.code == Collectivite_Code.SaintMartin: + _ = match_arg_586.value + temp_montant_forfaitaire_charges_78 = True + elif match_arg_586.code == Collectivite_Code.Metropole: + _ = match_arg_586.value + temp_montant_forfaitaire_charges_78 = False + elif match_arg_586.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_586.value + temp_montant_forfaitaire_charges_78 = False + elif match_arg_586.code == Collectivite_Code.Mayotte: + _ = match_arg_586.value + temp_montant_forfaitaire_charges_78 = True return (((date_courante_13 >= date_of_numbers(2022,7,1)) and (date_courante_13 < date_of_numbers(2023,1,1))) and - temp_montant_forfaitaire_charges_98) + temp_montant_forfaitaire_charges_78) return handle_default(SourcePosition(filename="", start_line=0, start_column=1, end_line=0, end_column=1, law_headings=[]), [], - temp_montant_forfaitaire_charges_97, - temp_montant_forfaitaire_charges_96) - def temp_montant_forfaitaire_charges_99(_:Unit): - def temp_montant_forfaitaire_charges_100(_:Unit): + temp_montant_forfaitaire_charges_77, + temp_montant_forfaitaire_charges_76) + def temp_montant_forfaitaire_charges_79(_:Unit): + def temp_montant_forfaitaire_charges_80(_:Unit): return (money_of_cents_string("3767") + (money_of_cents_string("969") * multiplicateur_majoration_charges_1)) - def temp_montant_forfaitaire_charges_101(_:Unit): - match_arg_607 = residence_7 - if match_arg_607.code == Collectivite_Code.Guadeloupe: - _ = match_arg_607.value - temp_montant_forfaitaire_charges_102 = True - elif match_arg_607.code == Collectivite_Code.Guyane: - _ = match_arg_607.value - temp_montant_forfaitaire_charges_102 = False - elif match_arg_607.code == Collectivite_Code.Martinique: - _ = match_arg_607.value - temp_montant_forfaitaire_charges_102 = True - elif match_arg_607.code == Collectivite_Code.LaReunion: - _ = match_arg_607.value - temp_montant_forfaitaire_charges_102 = True - elif match_arg_607.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_607.value - temp_montant_forfaitaire_charges_102 = True - elif match_arg_607.code == Collectivite_Code.SaintMartin: - _ = match_arg_607.value - temp_montant_forfaitaire_charges_102 = True - elif match_arg_607.code == Collectivite_Code.Metropole: - _ = match_arg_607.value - temp_montant_forfaitaire_charges_102 = False - elif match_arg_607.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_607.value - temp_montant_forfaitaire_charges_102 = False - elif match_arg_607.code == Collectivite_Code.Mayotte: - _ = match_arg_607.value - temp_montant_forfaitaire_charges_102 = True + def temp_montant_forfaitaire_charges_81(_:Unit): + match_arg_587 = residence_7 + if match_arg_587.code == Collectivite_Code.Guadeloupe: + _ = match_arg_587.value + temp_montant_forfaitaire_charges_82 = True + elif match_arg_587.code == Collectivite_Code.Guyane: + _ = match_arg_587.value + temp_montant_forfaitaire_charges_82 = False + elif match_arg_587.code == Collectivite_Code.Martinique: + _ = match_arg_587.value + temp_montant_forfaitaire_charges_82 = True + elif match_arg_587.code == Collectivite_Code.LaReunion: + _ = match_arg_587.value + temp_montant_forfaitaire_charges_82 = True + elif match_arg_587.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_587.value + temp_montant_forfaitaire_charges_82 = True + elif match_arg_587.code == Collectivite_Code.SaintMartin: + _ = match_arg_587.value + temp_montant_forfaitaire_charges_82 = True + elif match_arg_587.code == Collectivite_Code.Metropole: + _ = match_arg_587.value + temp_montant_forfaitaire_charges_82 = False + elif match_arg_587.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_587.value + temp_montant_forfaitaire_charges_82 = False + elif match_arg_587.code == Collectivite_Code.Mayotte: + _ = match_arg_587.value + temp_montant_forfaitaire_charges_82 = True return ((date_courante_13 >= date_of_numbers(2023,1,1)) and - temp_montant_forfaitaire_charges_102) + temp_montant_forfaitaire_charges_82) return handle_default(SourcePosition(filename="", start_line=0, start_column=1, end_line=0, end_column=1, law_headings=[]), [], - temp_montant_forfaitaire_charges_101, - temp_montant_forfaitaire_charges_100) - temp_montant_forfaitaire_charges_79 = handle_default( + temp_montant_forfaitaire_charges_81, + temp_montant_forfaitaire_charges_80) + temp_montant_forfaitaire_charges_59 = handle_default( SourcePosition(filename="", start_line=0, start_column=1, end_line=0, end_column=1, - law_headings=[]), [temp_montant_forfaitaire_charges_99, - temp_montant_forfaitaire_charges_95, - temp_montant_forfaitaire_charges_90, - temp_montant_forfaitaire_charges_86, - temp_montant_forfaitaire_charges_82], - temp_montant_forfaitaire_charges_81, - temp_montant_forfaitaire_charges_80) + law_headings=[]), [temp_montant_forfaitaire_charges_79, + temp_montant_forfaitaire_charges_75, + temp_montant_forfaitaire_charges_70, + temp_montant_forfaitaire_charges_66, + temp_montant_forfaitaire_charges_62], + temp_montant_forfaitaire_charges_61, + temp_montant_forfaitaire_charges_60) except EmptyError: - def temp_montant_forfaitaire_charges_103(_:Unit): + def temp_montant_forfaitaire_charges_83(_:Unit): raise EmptyError - def temp_montant_forfaitaire_charges_104(_:Unit): + def temp_montant_forfaitaire_charges_84(_:Unit): return False - def temp_montant_forfaitaire_charges_105(_:Unit): - def temp_montant_forfaitaire_charges_106(_:Unit): - match_arg_608 = situation_familiale_calcul_apl_6 - if match_arg_608.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_608.value - temp_montant_forfaitaire_charges_107 = money_of_cents_string("2699") - elif match_arg_608.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_608.value - temp_montant_forfaitaire_charges_107 = money_of_cents_string("5399") - return (temp_montant_forfaitaire_charges_107 + + def temp_montant_forfaitaire_charges_85(_:Unit): + def temp_montant_forfaitaire_charges_86(_:Unit): + match_arg_588 = situation_familiale_calcul_apl_6 + if match_arg_588.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_588.value + temp_montant_forfaitaire_charges_87 = money_of_cents_string("2699") + elif match_arg_588.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_588.value + temp_montant_forfaitaire_charges_87 = money_of_cents_string("5399") + return (temp_montant_forfaitaire_charges_87 + (money_of_cents_string("1224") * decimal_of_integer(nombre_personnes_a_charge_6))) - def temp_montant_forfaitaire_charges_108(_:Unit): + def temp_montant_forfaitaire_charges_88(_:Unit): return (((date_courante_13 >= date_of_numbers(2020,10,1)) and (date_courante_13 < @@ -21156,21 +20913,21 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac start_line=0, start_column=1, end_line=0, end_column=1, law_headings=[]), [], - temp_montant_forfaitaire_charges_108, - temp_montant_forfaitaire_charges_106) - def temp_montant_forfaitaire_charges_109(_:Unit): - def temp_montant_forfaitaire_charges_110(_:Unit): - match_arg_609 = situation_familiale_calcul_apl_6 - if match_arg_609.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_609.value - temp_montant_forfaitaire_charges_111 = money_of_cents_string("2710") - elif match_arg_609.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_609.value - temp_montant_forfaitaire_charges_111 = money_of_cents_string("5422") - return (temp_montant_forfaitaire_charges_111 + + temp_montant_forfaitaire_charges_88, + temp_montant_forfaitaire_charges_86) + def temp_montant_forfaitaire_charges_89(_:Unit): + def temp_montant_forfaitaire_charges_90(_:Unit): + match_arg_589 = situation_familiale_calcul_apl_6 + if match_arg_589.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_589.value + temp_montant_forfaitaire_charges_91 = money_of_cents_string("2710") + elif match_arg_589.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_589.value + temp_montant_forfaitaire_charges_91 = money_of_cents_string("5422") + return (temp_montant_forfaitaire_charges_91 + (money_of_cents_string("1229") * decimal_of_integer(nombre_personnes_a_charge_6))) - def temp_montant_forfaitaire_charges_112(_:Unit): + def temp_montant_forfaitaire_charges_92(_:Unit): return (((date_courante_13 >= date_of_numbers(2021,10,1)) and (date_courante_13 < @@ -21179,44 +20936,44 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac start_line=0, start_column=1, end_line=0, end_column=1, law_headings=[]), [], - temp_montant_forfaitaire_charges_112, - temp_montant_forfaitaire_charges_110) - def temp_montant_forfaitaire_charges_113(_:Unit): - def temp_montant_forfaitaire_charges_114(_:Unit): - match_arg_610 = situation_familiale_calcul_apl_6 - if match_arg_610.code == SituationFamilialeCalculAPL_Code.PersonneSeule: - _ = match_arg_610.value - temp_montant_forfaitaire_charges_115 = money_of_cents_string("2805") - elif match_arg_610.code == SituationFamilialeCalculAPL_Code.Couple: - _ = match_arg_610.value - temp_montant_forfaitaire_charges_115 = money_of_cents_string("5612") - return (temp_montant_forfaitaire_charges_115 + + temp_montant_forfaitaire_charges_92, + temp_montant_forfaitaire_charges_90) + def temp_montant_forfaitaire_charges_93(_:Unit): + def temp_montant_forfaitaire_charges_94(_:Unit): + match_arg_590 = situation_familiale_calcul_apl_6 + if match_arg_590.code == SituationFamilialeCalculAPL_Code.PersonneSeule: + _ = match_arg_590.value + temp_montant_forfaitaire_charges_95 = money_of_cents_string("2805") + elif match_arg_590.code == SituationFamilialeCalculAPL_Code.Couple: + _ = match_arg_590.value + temp_montant_forfaitaire_charges_95 = money_of_cents_string("5612") + return (temp_montant_forfaitaire_charges_95 + (money_of_cents_string("1272") * multiplicateur_majoration_charges_1)) - def temp_montant_forfaitaire_charges_116(_:Unit): + def temp_montant_forfaitaire_charges_96(_:Unit): return ((date_courante_13 >= date_of_numbers(2022,7,1)) and copropriete_1) return handle_default(SourcePosition(filename="", start_line=0, start_column=1, end_line=0, end_column=1, law_headings=[]), [], - temp_montant_forfaitaire_charges_116, - temp_montant_forfaitaire_charges_114) - temp_montant_forfaitaire_charges_79 = handle_default( + temp_montant_forfaitaire_charges_96, + temp_montant_forfaitaire_charges_94) + temp_montant_forfaitaire_charges_59 = handle_default( SourcePosition(filename="", start_line=0, start_column=1, end_line=0, end_column=1, - law_headings=[]), [temp_montant_forfaitaire_charges_113, - temp_montant_forfaitaire_charges_109, - temp_montant_forfaitaire_charges_105], - temp_montant_forfaitaire_charges_104, - temp_montant_forfaitaire_charges_103) + law_headings=[]), [temp_montant_forfaitaire_charges_93, + temp_montant_forfaitaire_charges_89, + temp_montant_forfaitaire_charges_85], + temp_montant_forfaitaire_charges_84, + temp_montant_forfaitaire_charges_83) except EmptyError: - def temp_montant_forfaitaire_charges_117(_:Unit): + def temp_montant_forfaitaire_charges_97(_:Unit): raise EmptyError - def temp_montant_forfaitaire_charges_118(_:Unit): + def temp_montant_forfaitaire_charges_98(_:Unit): return False - def temp_montant_forfaitaire_charges_119(_:Unit): - def temp_montant_forfaitaire_charges_120(_:Unit): + def temp_montant_forfaitaire_charges_99(_:Unit): + def temp_montant_forfaitaire_charges_100(_:Unit): if (nombre_personnes_a_charge_6 == integer_of_string("0")): return money_of_cents_string("5399") @@ -21224,7 +20981,7 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac return (money_of_cents_string("5399") + (money_of_cents_string("1224") * decimal_of_integer(nombre_personnes_a_charge_6))) - def temp_montant_forfaitaire_charges_121(_:Unit): + def temp_montant_forfaitaire_charges_101(_:Unit): return ((date_courante_13 >= date_of_numbers(2020,10,1)) and (date_courante_13 < date_of_numbers(2021,10,1))) @@ -21232,10 +20989,10 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac start_line=0, start_column=1, end_line=0, end_column=1, law_headings=[]), [], - temp_montant_forfaitaire_charges_121, - temp_montant_forfaitaire_charges_120) - def temp_montant_forfaitaire_charges_122(_:Unit): - def temp_montant_forfaitaire_charges_123(_:Unit): + temp_montant_forfaitaire_charges_101, + temp_montant_forfaitaire_charges_100) + def temp_montant_forfaitaire_charges_102(_:Unit): + def temp_montant_forfaitaire_charges_103(_:Unit): if (nombre_personnes_a_charge_6 == integer_of_string("0")): return money_of_cents_string("5422") @@ -21243,7 +21000,7 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac return (money_of_cents_string("5422") + (money_of_cents_string("1229") * multiplicateur_majoration_charges_1)) - def temp_montant_forfaitaire_charges_124(_:Unit): + def temp_montant_forfaitaire_charges_104(_:Unit): return ((date_courante_13 >= date_of_numbers(2021,10,1)) and (date_courante_13 < date_of_numbers(2022,7,1))) @@ -21251,10 +21008,10 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac start_line=0, start_column=1, end_line=0, end_column=1, law_headings=[]), [], - temp_montant_forfaitaire_charges_124, - temp_montant_forfaitaire_charges_123) - def temp_montant_forfaitaire_charges_125(_:Unit): - def temp_montant_forfaitaire_charges_126(_:Unit): + temp_montant_forfaitaire_charges_104, + temp_montant_forfaitaire_charges_103) + def temp_montant_forfaitaire_charges_105(_:Unit): + def temp_montant_forfaitaire_charges_106(_:Unit): if (nombre_personnes_a_charge_6 == integer_of_string("0")): return money_of_cents_string("5612") @@ -21262,32 +21019,32 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac return (money_of_cents_string("5612") + (money_of_cents_string("1272") * multiplicateur_majoration_charges_1)) - def temp_montant_forfaitaire_charges_127(_:Unit): + def temp_montant_forfaitaire_charges_107(_:Unit): return (date_courante_13 >= date_of_numbers(2022,7,1)) return handle_default(SourcePosition(filename="", start_line=0, start_column=1, end_line=0, end_column=1, law_headings=[]), [], - temp_montant_forfaitaire_charges_127, - temp_montant_forfaitaire_charges_126) - temp_montant_forfaitaire_charges_79 = handle_default(SourcePosition(filename="", + temp_montant_forfaitaire_charges_107, + temp_montant_forfaitaire_charges_106) + temp_montant_forfaitaire_charges_59 = handle_default(SourcePosition(filename="", start_line=0, start_column=1, end_line=0, end_column=1, - law_headings=[]), [temp_montant_forfaitaire_charges_125, - temp_montant_forfaitaire_charges_122, - temp_montant_forfaitaire_charges_119], - temp_montant_forfaitaire_charges_118, - temp_montant_forfaitaire_charges_117) + law_headings=[]), [temp_montant_forfaitaire_charges_105, + temp_montant_forfaitaire_charges_102, + temp_montant_forfaitaire_charges_99], + temp_montant_forfaitaire_charges_98, + temp_montant_forfaitaire_charges_97) except EmptyError: - temp_montant_forfaitaire_charges_79 = dead_value + temp_montant_forfaitaire_charges_59 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", start_line=883, start_column=11, end_line=883, end_column=38, law_headings=["Secteur accession à la propriété", "Calcul du montant de l'allocation logement", "Prologue : aides au logement"])) - montant_forfaitaire_charges_1 = temp_montant_forfaitaire_charges_79 + montant_forfaitaire_charges_1 = temp_montant_forfaitaire_charges_59 try: def temp_seuil_minimal_ressources_menage(_:Unit): raise EmptyError @@ -21297,18 +21054,18 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac def temp_seuil_minimal_ressources_menage_3(_:Unit): return montant_forfaitaire_d842_12 def temp_seuil_minimal_ressources_menage_4(_:Unit): - match_arg_611 = type_travaux_logement_1 - if match_arg_611.code == TypeTravauxLogementR8425_Code.ObjectifDecenceLogement: - _ = match_arg_611.value + match_arg_591 = type_travaux_logement_1 + if match_arg_591.code == TypeTravauxLogementR8425_Code.ObjectifDecenceLogement: + _ = match_arg_591.value temp_seuil_minimal_ressources_menage_5 = False - elif match_arg_611.code == TypeTravauxLogementR8425_Code.PrevuDansListeR321_15: - _ = match_arg_611.value + elif match_arg_591.code == TypeTravauxLogementR8425_Code.PrevuDansListeR321_15: + _ = match_arg_591.value temp_seuil_minimal_ressources_menage_5 = True - elif match_arg_611.code == TypeTravauxLogementR8425_Code.AgrandirOuRendreHabitableD331_63: - _ = match_arg_611.value + elif match_arg_591.code == TypeTravauxLogementR8425_Code.AgrandirOuRendreHabitableD331_63: + _ = match_arg_591.value temp_seuil_minimal_ressources_menage_5 = False - elif match_arg_611.code == TypeTravauxLogementR8425_Code.PasDeTravaux: - _ = match_arg_611.value + elif match_arg_591.code == TypeTravauxLogementR8425_Code.PasDeTravaux: + _ = match_arg_591.value temp_seuil_minimal_ressources_menage_5 = False return ((date_signature_pret_2 > date_of_numbers(1994,9,30)) and @@ -21322,44 +21079,44 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac def temp_seuil_minimal_ressources_menage_7(_:Unit): return (mensualite_principale_1 * coefficient_d842_12) def temp_seuil_minimal_ressources_menage_8(_:Unit): - match_arg_612 = type_travaux_logement_1 - if match_arg_612.code == TypeTravauxLogementR8425_Code.ObjectifDecenceLogement: - _ = match_arg_612.value + match_arg_592 = type_travaux_logement_1 + if match_arg_592.code == TypeTravauxLogementR8425_Code.ObjectifDecenceLogement: + _ = match_arg_592.value temp_seuil_minimal_ressources_menage_9 = False - elif match_arg_612.code == TypeTravauxLogementR8425_Code.PrevuDansListeR321_15: - _ = match_arg_612.value + elif match_arg_592.code == TypeTravauxLogementR8425_Code.PrevuDansListeR321_15: + _ = match_arg_592.value temp_seuil_minimal_ressources_menage_9 = False - elif match_arg_612.code == TypeTravauxLogementR8425_Code.AgrandirOuRendreHabitableD331_63: - _ = match_arg_612.value + elif match_arg_592.code == TypeTravauxLogementR8425_Code.AgrandirOuRendreHabitableD331_63: + _ = match_arg_592.value temp_seuil_minimal_ressources_menage_9 = True - elif match_arg_612.code == TypeTravauxLogementR8425_Code.PasDeTravaux: - _ = match_arg_612.value + elif match_arg_592.code == TypeTravauxLogementR8425_Code.PasDeTravaux: + _ = match_arg_592.value temp_seuil_minimal_ressources_menage_9 = False - match_arg_613 = type_travaux_logement_1 - if match_arg_613.code == TypeTravauxLogementR8425_Code.ObjectifDecenceLogement: - _ = match_arg_613.value + match_arg_593 = type_travaux_logement_1 + if match_arg_593.code == TypeTravauxLogementR8425_Code.ObjectifDecenceLogement: + _ = match_arg_593.value temp_seuil_minimal_ressources_menage_10 = True - elif match_arg_613.code == TypeTravauxLogementR8425_Code.PrevuDansListeR321_15: - _ = match_arg_613.value + elif match_arg_593.code == TypeTravauxLogementR8425_Code.PrevuDansListeR321_15: + _ = match_arg_593.value temp_seuil_minimal_ressources_menage_10 = False - elif match_arg_613.code == TypeTravauxLogementR8425_Code.AgrandirOuRendreHabitableD331_63: - _ = match_arg_613.value + elif match_arg_593.code == TypeTravauxLogementR8425_Code.AgrandirOuRendreHabitableD331_63: + _ = match_arg_593.value temp_seuil_minimal_ressources_menage_10 = False - elif match_arg_613.code == TypeTravauxLogementR8425_Code.PasDeTravaux: - _ = match_arg_613.value + elif match_arg_593.code == TypeTravauxLogementR8425_Code.PasDeTravaux: + _ = match_arg_593.value temp_seuil_minimal_ressources_menage_10 = False - match_arg_614 = type_travaux_logement_1 - if match_arg_614.code == TypeTravauxLogementR8425_Code.ObjectifDecenceLogement: - _ = match_arg_614.value + match_arg_594 = type_travaux_logement_1 + if match_arg_594.code == TypeTravauxLogementR8425_Code.ObjectifDecenceLogement: + _ = match_arg_594.value temp_seuil_minimal_ressources_menage_11 = False - elif match_arg_614.code == TypeTravauxLogementR8425_Code.PrevuDansListeR321_15: - _ = match_arg_614.value + elif match_arg_594.code == TypeTravauxLogementR8425_Code.PrevuDansListeR321_15: + _ = match_arg_594.value temp_seuil_minimal_ressources_menage_11 = False - elif match_arg_614.code == TypeTravauxLogementR8425_Code.AgrandirOuRendreHabitableD331_63: - _ = match_arg_614.value + elif match_arg_594.code == TypeTravauxLogementR8425_Code.AgrandirOuRendreHabitableD331_63: + _ = match_arg_594.value temp_seuil_minimal_ressources_menage_11 = False - elif match_arg_614.code == TypeTravauxLogementR8425_Code.PasDeTravaux: - _ = match_arg_614.value + elif match_arg_594.code == TypeTravauxLogementR8425_Code.PasDeTravaux: + _ = match_arg_594.value temp_seuil_minimal_ressources_menage_11 = True return (((date_signature_pret_2 >= date_of_numbers(1992,9,30)) and (date_signature_pret_2 <= @@ -21390,13 +21147,13 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac "Calcul du montant de l'allocation logement", "Prologue : aides au logement"])) seuil_minimal_ressources_menage = temp_seuil_minimal_ressources_menage_12 - def temp_traitement_aide_finale_minoration_forfaitaire_4(aide_finale_23:Money): + def temp_traitement_aide_finale_minoration_forfaitaire_4(aide_finale_42:Money): try: - if ((aide_finale_23 - montant_forfaitaire_d842_6) < + if ((aide_finale_42 - montant_forfaitaire_d842_6) < money_of_cents_string("0")): return money_of_cents_string("0") else: - return (aide_finale_23 - montant_forfaitaire_d842_6) + return (aide_finale_42 - montant_forfaitaire_d842_6) except EmptyError: raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", start_line=921, @@ -21474,7 +21231,7 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac law_headings=["Secteur accession à la propriété", "Calcul du montant de l'allocation logement", "Prologue : aides au logement"])) - depense_nette_minimale_1 = temp_depense_nette_minimale_1 + depense_nette_minimale_3 = temp_depense_nette_minimale_1 try: try: def temp_ressources_menage_arrondies_seuil(_:Unit): @@ -21515,33 +21272,33 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac date_calcul_2, integer_of_string("6")) def temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_2(_:Unit): - match_arg_615 = residence_7 - if match_arg_615.code == Collectivite_Code.Guadeloupe: - _ = match_arg_615.value + match_arg_595 = residence_7 + if match_arg_595.code == Collectivite_Code.Guadeloupe: + _ = match_arg_595.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_3 = True - elif match_arg_615.code == Collectivite_Code.Guyane: - _ = match_arg_615.value + elif match_arg_595.code == Collectivite_Code.Guyane: + _ = match_arg_595.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_3 = False - elif match_arg_615.code == Collectivite_Code.Martinique: - _ = match_arg_615.value + elif match_arg_595.code == Collectivite_Code.Martinique: + _ = match_arg_595.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_3 = True - elif match_arg_615.code == Collectivite_Code.LaReunion: - _ = match_arg_615.value + elif match_arg_595.code == Collectivite_Code.LaReunion: + _ = match_arg_595.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_3 = True - elif match_arg_615.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_615.value + elif match_arg_595.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_595.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_3 = True - elif match_arg_615.code == Collectivite_Code.SaintMartin: - _ = match_arg_615.value + elif match_arg_595.code == Collectivite_Code.SaintMartin: + _ = match_arg_595.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_3 = True - elif match_arg_615.code == Collectivite_Code.Metropole: - _ = match_arg_615.value + elif match_arg_595.code == Collectivite_Code.Metropole: + _ = match_arg_595.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_3 = False - elif match_arg_615.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_615.value + elif match_arg_595.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_595.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_3 = False - elif match_arg_615.code == Collectivite_Code.Mayotte: - _ = match_arg_615.value + elif match_arg_595.code == Collectivite_Code.Mayotte: + _ = match_arg_595.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_3 = True return (((date_courante_13 >= date_of_numbers(2020,1,1)) and @@ -21558,33 +21315,33 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_2, temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_1) except EmptyError: - match_arg_616 = residence_7 - if match_arg_616.code == Collectivite_Code.Guadeloupe: - _ = match_arg_616.value + match_arg_596 = residence_7 + if match_arg_596.code == Collectivite_Code.Guadeloupe: + _ = match_arg_596.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_4 = True - elif match_arg_616.code == Collectivite_Code.Guyane: - _ = match_arg_616.value + elif match_arg_596.code == Collectivite_Code.Guyane: + _ = match_arg_596.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_4 = False - elif match_arg_616.code == Collectivite_Code.Martinique: - _ = match_arg_616.value + elif match_arg_596.code == Collectivite_Code.Martinique: + _ = match_arg_596.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_4 = True - elif match_arg_616.code == Collectivite_Code.LaReunion: - _ = match_arg_616.value + elif match_arg_596.code == Collectivite_Code.LaReunion: + _ = match_arg_596.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_4 = True - elif match_arg_616.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_616.value + elif match_arg_596.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_596.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_4 = True - elif match_arg_616.code == Collectivite_Code.SaintMartin: - _ = match_arg_616.value + elif match_arg_596.code == Collectivite_Code.SaintMartin: + _ = match_arg_596.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_4 = True - elif match_arg_616.code == Collectivite_Code.Metropole: - _ = match_arg_616.value + elif match_arg_596.code == Collectivite_Code.Metropole: + _ = match_arg_596.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_4 = False - elif match_arg_616.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_616.value + elif match_arg_596.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_596.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_4 = False - elif match_arg_616.code == Collectivite_Code.Mayotte: - _ = match_arg_616.value + elif match_arg_596.code == Collectivite_Code.Mayotte: + _ = match_arg_596.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_4 = True if (((date_courante_13 >= date_of_numbers(2020,10,1)) and @@ -21599,33 +21356,33 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac else: raise EmptyError except EmptyError: - match_arg_617 = residence_7 - if match_arg_617.code == Collectivite_Code.Guadeloupe: - _ = match_arg_617.value + match_arg_597 = residence_7 + if match_arg_597.code == Collectivite_Code.Guadeloupe: + _ = match_arg_597.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_5 = True - elif match_arg_617.code == Collectivite_Code.Guyane: - _ = match_arg_617.value + elif match_arg_597.code == Collectivite_Code.Guyane: + _ = match_arg_597.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_5 = False - elif match_arg_617.code == Collectivite_Code.Martinique: - _ = match_arg_617.value + elif match_arg_597.code == Collectivite_Code.Martinique: + _ = match_arg_597.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_5 = True - elif match_arg_617.code == Collectivite_Code.LaReunion: - _ = match_arg_617.value + elif match_arg_597.code == Collectivite_Code.LaReunion: + _ = match_arg_597.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_5 = True - elif match_arg_617.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_617.value + elif match_arg_597.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_597.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_5 = True - elif match_arg_617.code == Collectivite_Code.SaintMartin: - _ = match_arg_617.value + elif match_arg_597.code == Collectivite_Code.SaintMartin: + _ = match_arg_597.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_5 = True - elif match_arg_617.code == Collectivite_Code.Metropole: - _ = match_arg_617.value + elif match_arg_597.code == Collectivite_Code.Metropole: + _ = match_arg_597.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_5 = False - elif match_arg_617.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_617.value + elif match_arg_597.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_597.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_5 = False - elif match_arg_617.code == Collectivite_Code.Mayotte: - _ = match_arg_617.value + elif match_arg_597.code == Collectivite_Code.Mayotte: + _ = match_arg_597.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_5 = True if (((date_courante_13 >= date_of_numbers(2021,10,1)) and @@ -21639,33 +21396,33 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac else: raise EmptyError except EmptyError: - match_arg_618 = residence_7 - if match_arg_618.code == Collectivite_Code.Guadeloupe: - _ = match_arg_618.value + match_arg_598 = residence_7 + if match_arg_598.code == Collectivite_Code.Guadeloupe: + _ = match_arg_598.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_6 = True - elif match_arg_618.code == Collectivite_Code.Guyane: - _ = match_arg_618.value + elif match_arg_598.code == Collectivite_Code.Guyane: + _ = match_arg_598.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_6 = False - elif match_arg_618.code == Collectivite_Code.Martinique: - _ = match_arg_618.value + elif match_arg_598.code == Collectivite_Code.Martinique: + _ = match_arg_598.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_6 = True - elif match_arg_618.code == Collectivite_Code.LaReunion: - _ = match_arg_618.value + elif match_arg_598.code == Collectivite_Code.LaReunion: + _ = match_arg_598.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_6 = True - elif match_arg_618.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_618.value + elif match_arg_598.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_598.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_6 = True - elif match_arg_618.code == Collectivite_Code.SaintMartin: - _ = match_arg_618.value + elif match_arg_598.code == Collectivite_Code.SaintMartin: + _ = match_arg_598.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_6 = True - elif match_arg_618.code == Collectivite_Code.Metropole: - _ = match_arg_618.value + elif match_arg_598.code == Collectivite_Code.Metropole: + _ = match_arg_598.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_6 = False - elif match_arg_618.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_618.value + elif match_arg_598.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_598.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_6 = False - elif match_arg_618.code == Collectivite_Code.Mayotte: - _ = match_arg_618.value + elif match_arg_598.code == Collectivite_Code.Mayotte: + _ = match_arg_598.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_6 = True if (((date_courante_13 >= date_of_numbers(2022,1,1)) and @@ -21679,33 +21436,33 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac else: raise EmptyError except EmptyError: - match_arg_619 = residence_7 - if match_arg_619.code == Collectivite_Code.Guadeloupe: - _ = match_arg_619.value + match_arg_599 = residence_7 + if match_arg_599.code == Collectivite_Code.Guadeloupe: + _ = match_arg_599.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_7 = True - elif match_arg_619.code == Collectivite_Code.Guyane: - _ = match_arg_619.value + elif match_arg_599.code == Collectivite_Code.Guyane: + _ = match_arg_599.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_7 = False - elif match_arg_619.code == Collectivite_Code.Martinique: - _ = match_arg_619.value + elif match_arg_599.code == Collectivite_Code.Martinique: + _ = match_arg_599.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_7 = True - elif match_arg_619.code == Collectivite_Code.LaReunion: - _ = match_arg_619.value + elif match_arg_599.code == Collectivite_Code.LaReunion: + _ = match_arg_599.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_7 = True - elif match_arg_619.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_619.value + elif match_arg_599.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_599.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_7 = True - elif match_arg_619.code == Collectivite_Code.SaintMartin: - _ = match_arg_619.value + elif match_arg_599.code == Collectivite_Code.SaintMartin: + _ = match_arg_599.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_7 = True - elif match_arg_619.code == Collectivite_Code.Metropole: - _ = match_arg_619.value + elif match_arg_599.code == Collectivite_Code.Metropole: + _ = match_arg_599.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_7 = False - elif match_arg_619.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_619.value + elif match_arg_599.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_599.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_7 = False - elif match_arg_619.code == Collectivite_Code.Mayotte: - _ = match_arg_619.value + elif match_arg_599.code == Collectivite_Code.Mayotte: + _ = match_arg_599.value temp_calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom_7 = True if (((date_courante_13 >= date_of_numbers(2022,7,1)) and (date_courante_13 < date_of_numbers(2023,1,1))) and @@ -21915,33 +21672,33 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac def temp_calcul_apl_logement_foyer_dot_limitation_majoration_personnes_a_charge_5(_:Unit): return True def temp_calcul_apl_logement_foyer_dot_limitation_majoration_personnes_a_charge_6(_:Unit): - match_arg_620 = residence_7 - if match_arg_620.code == Collectivite_Code.Guadeloupe: - _ = match_arg_620.value + match_arg_600 = residence_7 + if match_arg_600.code == Collectivite_Code.Guadeloupe: + _ = match_arg_600.value temp_calcul_apl_logement_foyer_dot_limitation_majoration_personnes_a_charge_7 = False - elif match_arg_620.code == Collectivite_Code.Guyane: - _ = match_arg_620.value + elif match_arg_600.code == Collectivite_Code.Guyane: + _ = match_arg_600.value temp_calcul_apl_logement_foyer_dot_limitation_majoration_personnes_a_charge_7 = False - elif match_arg_620.code == Collectivite_Code.Martinique: - _ = match_arg_620.value + elif match_arg_600.code == Collectivite_Code.Martinique: + _ = match_arg_600.value temp_calcul_apl_logement_foyer_dot_limitation_majoration_personnes_a_charge_7 = False - elif match_arg_620.code == Collectivite_Code.LaReunion: - _ = match_arg_620.value + elif match_arg_600.code == Collectivite_Code.LaReunion: + _ = match_arg_600.value temp_calcul_apl_logement_foyer_dot_limitation_majoration_personnes_a_charge_7 = False - elif match_arg_620.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_620.value + elif match_arg_600.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_600.value temp_calcul_apl_logement_foyer_dot_limitation_majoration_personnes_a_charge_7 = True - elif match_arg_620.code == Collectivite_Code.SaintMartin: - _ = match_arg_620.value + elif match_arg_600.code == Collectivite_Code.SaintMartin: + _ = match_arg_600.value temp_calcul_apl_logement_foyer_dot_limitation_majoration_personnes_a_charge_7 = True - elif match_arg_620.code == Collectivite_Code.Metropole: - _ = match_arg_620.value + elif match_arg_600.code == Collectivite_Code.Metropole: + _ = match_arg_600.value temp_calcul_apl_logement_foyer_dot_limitation_majoration_personnes_a_charge_7 = False - elif match_arg_620.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_620.value + elif match_arg_600.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_600.value temp_calcul_apl_logement_foyer_dot_limitation_majoration_personnes_a_charge_7 = False - elif match_arg_620.code == Collectivite_Code.Mayotte: - _ = match_arg_620.value + elif match_arg_600.code == Collectivite_Code.Mayotte: + _ = match_arg_600.value temp_calcul_apl_logement_foyer_dot_limitation_majoration_personnes_a_charge_7 = False return (((date_courante_13 >= date_of_numbers(2019,9,1)) and (date_courante_13 < date_of_numbers(2023,4,5))) and @@ -21952,33 +21709,33 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac temp_calcul_apl_logement_foyer_dot_limitation_majoration_personnes_a_charge_6, temp_calcul_apl_logement_foyer_dot_limitation_majoration_personnes_a_charge_5) except EmptyError: - match_arg_621 = residence_7 - if match_arg_621.code == Collectivite_Code.Guadeloupe: - _ = match_arg_621.value + match_arg_601 = residence_7 + if match_arg_601.code == Collectivite_Code.Guadeloupe: + _ = match_arg_601.value temp_calcul_apl_logement_foyer_dot_limitation_majoration_personnes_a_charge_8 = True - elif match_arg_621.code == Collectivite_Code.Guyane: - _ = match_arg_621.value + elif match_arg_601.code == Collectivite_Code.Guyane: + _ = match_arg_601.value temp_calcul_apl_logement_foyer_dot_limitation_majoration_personnes_a_charge_8 = True - elif match_arg_621.code == Collectivite_Code.Martinique: - _ = match_arg_621.value + elif match_arg_601.code == Collectivite_Code.Martinique: + _ = match_arg_601.value temp_calcul_apl_logement_foyer_dot_limitation_majoration_personnes_a_charge_8 = True - elif match_arg_621.code == Collectivite_Code.LaReunion: - _ = match_arg_621.value + elif match_arg_601.code == Collectivite_Code.LaReunion: + _ = match_arg_601.value temp_calcul_apl_logement_foyer_dot_limitation_majoration_personnes_a_charge_8 = True - elif match_arg_621.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_621.value + elif match_arg_601.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_601.value temp_calcul_apl_logement_foyer_dot_limitation_majoration_personnes_a_charge_8 = False - elif match_arg_621.code == Collectivite_Code.SaintMartin: - _ = match_arg_621.value + elif match_arg_601.code == Collectivite_Code.SaintMartin: + _ = match_arg_601.value temp_calcul_apl_logement_foyer_dot_limitation_majoration_personnes_a_charge_8 = False - elif match_arg_621.code == Collectivite_Code.Metropole: - _ = match_arg_621.value + elif match_arg_601.code == Collectivite_Code.Metropole: + _ = match_arg_601.value temp_calcul_apl_logement_foyer_dot_limitation_majoration_personnes_a_charge_8 = False - elif match_arg_621.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_621.value + elif match_arg_601.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_601.value temp_calcul_apl_logement_foyer_dot_limitation_majoration_personnes_a_charge_8 = False - elif match_arg_621.code == Collectivite_Code.Mayotte: - _ = match_arg_621.value + elif match_arg_601.code == Collectivite_Code.Mayotte: + _ = match_arg_601.value temp_calcul_apl_logement_foyer_dot_limitation_majoration_personnes_a_charge_8 = True if (((date_courante_13 >= date_of_numbers(2019,9,1)) and (date_courante_13 < date_of_numbers(2023,4,5))) and @@ -22038,15 +21795,15 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac try: try: def temp_plafond_mensualite_d842_6(_:Unit): - if (calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom( - date_signature_pret_2, nombre_personnes_a_charge_6) < - calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom( - date_entree_logement_1, nombre_personnes_a_charge_6)): - return calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom( - date_entree_logement_1, nombre_personnes_a_charge_6) + plafond_signature_1 = calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom( + date_signature_pret_2, nombre_personnes_a_charge_6) + plafond_entree_1 = calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom( + date_entree_logement_1, nombre_personnes_a_charge_6) + if (plafond_signature_1 < + plafond_entree_1): + return plafond_entree_1 else: - return calcul_plafond_mensualite_d842_6_avec_limitation_dom_tom( - date_signature_pret_2, nombre_personnes_a_charge_6) + return plafond_signature_1 def temp_plafond_mensualite_d842_6_1(_:Unit): return local_habite_premiere_fois_beneficiaire_1 temp_plafond_mensualite_d842_6_2 = handle_default(SourcePosition(filename="", @@ -22092,10 +21849,11 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac coefficient_prise_en_charge_1 = temp_coefficient_prise_en_charge_1 def temp_abattement_depense_nette_minimale_1(allocation_mensuelle_7:Money): try: - if (depense_nette_minimale_1(allocation_mensuelle_7) < + depense_nette_minimale_4 = depense_nette_minimale_3(allocation_mensuelle_7) + if (depense_nette_minimale_4 < seuil_minimal_depense_nette_minimale): return (seuil_minimal_depense_nette_minimale - - depense_nette_minimale_1(allocation_mensuelle_7)) + depense_nette_minimale_4) else: return money_of_cents_string("0") except EmptyError: @@ -22122,17 +21880,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac "Calcul du montant de l'allocation logement", "Prologue : aides au logement"])) mensualite_eligible_1 = temp_mensualite_eligible_1 - def temp_traitement_aide_finale_depense_nette_minimale_1(aide_finale_24:Money): + def temp_traitement_aide_finale_depense_nette_minimale_1(aide_finale_43:Money): try: - if (traitement_aide_finale_minoration_forfaitaire_4(aide_finale_24) < - abattement_depense_nette_minimale_1(traitement_aide_finale_minoration_forfaitaire_4( - aide_finale_24))): + aide_finale_44 = traitement_aide_finale_minoration_forfaitaire_4( + aide_finale_43) + abattement_1 = abattement_depense_nette_minimale_1(aide_finale_44) + if (aide_finale_44 < + abattement_1): return money_of_cents_string("0") else: - return (traitement_aide_finale_minoration_forfaitaire_4( - aide_finale_24) - - abattement_depense_nette_minimale_1(traitement_aide_finale_minoration_forfaitaire_4( - aide_finale_24))) + return (aide_finale_44 - abattement_1) except EmptyError: raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", start_line=922, @@ -22155,23 +21912,16 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac "Calcul du montant de l'allocation logement", "Prologue : aides au logement"])) aide_finale_formule_4 = temp_aide_finale_formule_4 - def temp_traitement_aide_finale_contributions_sociales_arrondi_4(aide_finale_25:Money): + def temp_traitement_aide_finale_contributions_sociales_arrondi_4(aide_finale_45:Money): try: - if ((money_round(((traitement_aide_finale_depense_nette_minimale_1( - aide_finale_25) - - contributions_sociales_dot_montant_4(traitement_aide_finale_depense_nette_minimale_1( - aide_finale_25))) - - money_of_cents_string("50"))) + - contributions_sociales_dot_montant_4(traitement_aide_finale_depense_nette_minimale_1( - aide_finale_25))) >= + aide_finale_46 = traitement_aide_finale_depense_nette_minimale_1( + aide_finale_45) + crds_4 = contributions_sociales_dot_montant_4(aide_finale_46) + aide_finale_moins_crds_arrondie_4 = money_round(((aide_finale_46 - + crds_4) - money_of_cents_string("50"))) + if ((aide_finale_moins_crds_arrondie_4 + crds_4) >= money_of_cents_string("0")): - return (money_round(((traitement_aide_finale_depense_nette_minimale_1( - aide_finale_25) - - contributions_sociales_dot_montant_4(traitement_aide_finale_depense_nette_minimale_1( - aide_finale_25))) - - money_of_cents_string("50"))) + - contributions_sociales_dot_montant_4(traitement_aide_finale_depense_nette_minimale_1( - aide_finale_25))) + return (aide_finale_moins_crds_arrondie_4 + crds_4) else: return money_of_cents_string("0") except EmptyError: @@ -22183,10 +21933,10 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac "Calcul du montant de l'allocation logement", "Prologue : aides au logement"])) traitement_aide_finale_contributions_sociales_arrondi_4 = temp_traitement_aide_finale_contributions_sociales_arrondi_4 - def temp_traitement_aide_finale_montee_en_charge_saint_pierre_miquelon_2(aide_finale_26:Money): + def temp_traitement_aide_finale_montee_en_charge_saint_pierre_miquelon_2(aide_finale_47:Money): try: return montee_en_charge_saint_pierre_miquelon(traitement_aide_finale_contributions_sociales_arrondi_4( - aide_finale_26), + aide_finale_47), residence_7, date_courante_13) except EmptyError: @@ -22198,15 +21948,15 @@ def calcul_allocation_logement_accession_propriete(calcul_allocation_logement_ac "Calcul du montant de l'allocation logement", "Prologue : aides au logement"])) traitement_aide_finale_montee_en_charge_saint_pierre_miquelon_2 = temp_traitement_aide_finale_montee_en_charge_saint_pierre_miquelon_2 - def temp_traitement_aide_finale_montant_minimal_4(aide_finale_27:Money): + def temp_traitement_aide_finale_montant_minimal_4(aide_finale_48:Money): try: - if (traitement_aide_finale_montee_en_charge_saint_pierre_miquelon_2( - aide_finale_27) < + aide_finale_49 = traitement_aide_finale_montee_en_charge_saint_pierre_miquelon_2( + aide_finale_48) + if (aide_finale_49 < montant_minimal_aide_d842_6): return money_of_cents_string("0") else: - return traitement_aide_finale_montee_en_charge_saint_pierre_miquelon_2( - aide_finale_27) + return aide_finale_49 except EmptyError: raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", start_line=931, @@ -22267,19 +22017,19 @@ def eligibilite_aides_personnelle_logement(eligibilite_aides_personnelle_logemen "Prologue : aides au logement"])) seuil_l822_3_parts_usufruit = temp_seuil_l822_3_parts_usufruit try: - match_arg_622 = menage.logement.usufruit - if match_arg_622.code == ParentOuAutre_Code.DemandeurOuConjointOuParentOuViaPartsSocietes: - parts = match_arg_622.value + match_arg_602 = menage.logement.usufruit + if match_arg_602.code == ParentOuAutre_Code.DemandeurOuConjointOuParentOuViaPartsSocietes: + parts = match_arg_602.value temp_usufruit_ou_propriete_famille = True - elif match_arg_622.code == ParentOuAutre_Code.Autre: - _ = match_arg_622.value + elif match_arg_602.code == ParentOuAutre_Code.Autre: + _ = match_arg_602.value temp_usufruit_ou_propriete_famille = False - match_arg_623 = menage.logement.proprietaire - if match_arg_623.code == ParentOuAutre_Code.DemandeurOuConjointOuParentOuViaPartsSocietes: - parts_1 = match_arg_623.value + match_arg_603 = menage.logement.proprietaire + if match_arg_603.code == ParentOuAutre_Code.DemandeurOuConjointOuParentOuViaPartsSocietes: + parts_1 = match_arg_603.value temp_usufruit_ou_propriete_famille_1 = True - elif match_arg_623.code == ParentOuAutre_Code.Autre: - _ = match_arg_623.value + elif match_arg_603.code == ParentOuAutre_Code.Autre: + _ = match_arg_603.value temp_usufruit_ou_propriete_famille_1 = False temp_usufruit_ou_propriete_famille_2 = (temp_usufruit_ou_propriete_famille_1 or temp_usufruit_ou_propriete_famille) @@ -22293,24 +22043,24 @@ def eligibilite_aides_personnelle_logement(eligibilite_aides_personnelle_logemen "Prologue : aides au logement"])) usufruit_ou_propriete_famille = temp_usufruit_ou_propriete_famille_2 try: - match_arg_624 = menage.situation_familiale - if match_arg_624.code == SituationFamiliale_Code.Celibataire: - _ = match_arg_624.value + match_arg_604 = menage.situation_familiale + if match_arg_604.code == SituationFamiliale_Code.Celibataire: + _ = match_arg_604.value temp_nombre_personnes_logement = integer_of_string("1") - elif match_arg_624.code == SituationFamiliale_Code.Maries: - _ = match_arg_624.value + elif match_arg_604.code == SituationFamiliale_Code.Maries: + _ = match_arg_604.value temp_nombre_personnes_logement = integer_of_string("2") - elif match_arg_624.code == SituationFamiliale_Code.Pacses: - _ = match_arg_624.value + elif match_arg_604.code == SituationFamiliale_Code.Pacses: + _ = match_arg_604.value temp_nombre_personnes_logement = integer_of_string("2") - elif match_arg_624.code == SituationFamiliale_Code.Concubins: - _ = match_arg_624.value + elif match_arg_604.code == SituationFamiliale_Code.Concubins: + _ = match_arg_604.value temp_nombre_personnes_logement = integer_of_string("2") - elif match_arg_624.code == SituationFamiliale_Code.CelibataireSepareDeFait: - _ = match_arg_624.value + elif match_arg_604.code == SituationFamiliale_Code.CelibataireSepareDeFait: + _ = match_arg_604.value temp_nombre_personnes_logement = integer_of_string("1") - elif match_arg_624.code == SituationFamiliale_Code.ConcubinageDontSepareDeFait: - _ = match_arg_624.value + elif match_arg_604.code == SituationFamiliale_Code.ConcubinageDontSepareDeFait: + _ = match_arg_604.value temp_nombre_personnes_logement = integer_of_string("2") temp_nombre_personnes_logement_1 = ((temp_nombre_personnes_logement + menage.nombre_autres_occupants_logement) + @@ -22330,33 +22080,33 @@ def eligibilite_aides_personnelle_logement(eligibilite_aides_personnelle_logemen def temp_septieme_alinea_l823_1_applicable(_:Unit): return False def temp_septieme_alinea_l823_1_applicable_1(_:Unit): - match_arg_625 = menage.residence - if match_arg_625.code == Collectivite_Code.Guadeloupe: - _ = match_arg_625.value + match_arg_605 = menage.residence + if match_arg_605.code == Collectivite_Code.Guadeloupe: + _ = match_arg_605.value return False - elif match_arg_625.code == Collectivite_Code.Guyane: - _ = match_arg_625.value + elif match_arg_605.code == Collectivite_Code.Guyane: + _ = match_arg_605.value return False - elif match_arg_625.code == Collectivite_Code.Martinique: - _ = match_arg_625.value + elif match_arg_605.code == Collectivite_Code.Martinique: + _ = match_arg_605.value return False - elif match_arg_625.code == Collectivite_Code.LaReunion: - _ = match_arg_625.value + elif match_arg_605.code == Collectivite_Code.LaReunion: + _ = match_arg_605.value return False - elif match_arg_625.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_625.value + elif match_arg_605.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_605.value return False - elif match_arg_625.code == Collectivite_Code.SaintMartin: - _ = match_arg_625.value + elif match_arg_605.code == Collectivite_Code.SaintMartin: + _ = match_arg_605.value return False - elif match_arg_625.code == Collectivite_Code.Metropole: - _ = match_arg_625.value + elif match_arg_605.code == Collectivite_Code.Metropole: + _ = match_arg_605.value return False - elif match_arg_625.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_625.value + elif match_arg_605.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_605.value return False - elif match_arg_625.code == Collectivite_Code.Mayotte: - _ = match_arg_625.value + elif match_arg_605.code == Collectivite_Code.Mayotte: + _ = match_arg_605.value return True temp_septieme_alinea_l823_1_applicable_2 = handle_default( SourcePosition(filename="", start_line=0, start_column=1, @@ -22470,41 +22220,41 @@ def eligibilite_aides_personnelle_logement(eligibilite_aides_personnelle_logemen try: try: def temp_condition_nationalite(_:Unit): - match_arg_626 = demandeur.nationalite - if match_arg_626.code == Nationalite_Code.Francaise: - _ = match_arg_626.value + match_arg_606 = demandeur.nationalite + if match_arg_606.code == Nationalite_Code.Francaise: + _ = match_arg_606.value return False - elif match_arg_626.code == Nationalite_Code.Etrangere: - conditions = match_arg_626.value + elif match_arg_606.code == Nationalite_Code.Etrangere: + conditions = match_arg_606.value return conditions.satisfait_art_4_ordonnance_2002_mayotte def temp_condition_nationalite_1(_:Unit): - match_arg_627 = menage.residence - if match_arg_627.code == Collectivite_Code.Guadeloupe: - _ = match_arg_627.value + match_arg_607 = menage.residence + if match_arg_607.code == Collectivite_Code.Guadeloupe: + _ = match_arg_607.value return False - elif match_arg_627.code == Collectivite_Code.Guyane: - _ = match_arg_627.value + elif match_arg_607.code == Collectivite_Code.Guyane: + _ = match_arg_607.value return False - elif match_arg_627.code == Collectivite_Code.Martinique: - _ = match_arg_627.value + elif match_arg_607.code == Collectivite_Code.Martinique: + _ = match_arg_607.value return False - elif match_arg_627.code == Collectivite_Code.LaReunion: - _ = match_arg_627.value + elif match_arg_607.code == Collectivite_Code.LaReunion: + _ = match_arg_607.value return False - elif match_arg_627.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_627.value + elif match_arg_607.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_607.value return False - elif match_arg_627.code == Collectivite_Code.SaintMartin: - _ = match_arg_627.value + elif match_arg_607.code == Collectivite_Code.SaintMartin: + _ = match_arg_607.value return False - elif match_arg_627.code == Collectivite_Code.Metropole: - _ = match_arg_627.value + elif match_arg_607.code == Collectivite_Code.Metropole: + _ = match_arg_607.value return False - elif match_arg_627.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_627.value + elif match_arg_607.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_607.value return False - elif match_arg_627.code == Collectivite_Code.Mayotte: - _ = match_arg_627.value + elif match_arg_607.code == Collectivite_Code.Mayotte: + _ = match_arg_607.value return True temp_condition_nationalite_2 = handle_default(SourcePosition(filename="", start_line=0, @@ -22514,12 +22264,12 @@ def eligibilite_aides_personnelle_logement(eligibilite_aides_personnelle_logemen temp_condition_nationalite_1, temp_condition_nationalite) except EmptyError: - match_arg_628 = demandeur.nationalite - if match_arg_628.code == Nationalite_Code.Francaise: - _ = match_arg_628.value + match_arg_608 = demandeur.nationalite + if match_arg_608.code == Nationalite_Code.Francaise: + _ = match_arg_608.value temp_condition_nationalite_2 = True - elif match_arg_628.code == Nationalite_Code.Etrangere: - conditions_1 = match_arg_628.value + elif match_arg_608.code == Nationalite_Code.Etrangere: + conditions_1 = match_arg_608.value temp_condition_nationalite_2 = conditions_1.satisfait_conditions_l512_2_code_securite_sociale except EmptyError: temp_condition_nationalite_2 = dead_value @@ -22645,12 +22395,12 @@ def eligibilite_aides_personnelle_logement(eligibilite_aides_personnelle_logemen def temp_condition_logement_location_tiers(_:Unit): return True def temp_condition_logement_location_tiers_1(_:Unit): - match_arg_629 = menage.logement.loue_ou_sous_loue_a_des_tiers - if match_arg_629.code == LoueOuSousLoueADesTiers_Code.Non: - _ = match_arg_629.value + match_arg_609 = menage.logement.loue_ou_sous_loue_a_des_tiers + if match_arg_609.code == LoueOuSousLoueADesTiers_Code.Non: + _ = match_arg_609.value return True - elif match_arg_629.code == LoueOuSousLoueADesTiers_Code.Oui: - personne = match_arg_629.value + elif match_arg_609.code == LoueOuSousLoueADesTiers_Code.Oui: + personne = match_arg_609.value try: temp_condition_logement_location_tiers_2 = personne.date_naissance_personne_sous_location except EmptyError: @@ -22706,12 +22456,12 @@ def eligibilite_aides_personnelle_logement(eligibilite_aides_personnelle_logemen temp_condition_logement_location_tiers_1, temp_condition_logement_location_tiers) except EmptyError: - match_arg_630 = menage.logement.loue_ou_sous_loue_a_des_tiers - if match_arg_630.code == LoueOuSousLoueADesTiers_Code.Non: - _ = match_arg_630.value + match_arg_610 = menage.logement.loue_ou_sous_loue_a_des_tiers + if match_arg_610.code == LoueOuSousLoueADesTiers_Code.Non: + _ = match_arg_610.value temp_condition_logement_location_tiers_6 = True - elif match_arg_630.code == LoueOuSousLoueADesTiers_Code.Oui: - _ = match_arg_630.value + elif match_arg_610.code == LoueOuSousLoueADesTiers_Code.Oui: + _ = match_arg_610.value temp_condition_logement_location_tiers_6 = False if temp_condition_logement_location_tiers_6: temp_condition_logement_location_tiers_5 = False @@ -22757,33 +22507,33 @@ def eligibilite_aides_personnelle_logement(eligibilite_aides_personnelle_logemen def temp_prestations_familiales_dot_age_l512_3_2_1(_:Unit): return duration_of_numbers(22,0,0) def temp_prestations_familiales_dot_age_l512_3_2_2(_:Unit): - match_arg_631 = menage.residence - if match_arg_631.code == Collectivite_Code.Guadeloupe: - _ = match_arg_631.value + match_arg_611 = menage.residence + if match_arg_611.code == Collectivite_Code.Guadeloupe: + _ = match_arg_611.value temp_prestations_familiales_dot_age_l512_3_2_3 = False - elif match_arg_631.code == Collectivite_Code.Guyane: - _ = match_arg_631.value + elif match_arg_611.code == Collectivite_Code.Guyane: + _ = match_arg_611.value temp_prestations_familiales_dot_age_l512_3_2_3 = False - elif match_arg_631.code == Collectivite_Code.Martinique: - _ = match_arg_631.value + elif match_arg_611.code == Collectivite_Code.Martinique: + _ = match_arg_611.value temp_prestations_familiales_dot_age_l512_3_2_3 = False - elif match_arg_631.code == Collectivite_Code.LaReunion: - _ = match_arg_631.value + elif match_arg_611.code == Collectivite_Code.LaReunion: + _ = match_arg_611.value temp_prestations_familiales_dot_age_l512_3_2_3 = False - elif match_arg_631.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_631.value + elif match_arg_611.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_611.value temp_prestations_familiales_dot_age_l512_3_2_3 = True - elif match_arg_631.code == Collectivite_Code.SaintMartin: - _ = match_arg_631.value + elif match_arg_611.code == Collectivite_Code.SaintMartin: + _ = match_arg_611.value temp_prestations_familiales_dot_age_l512_3_2_3 = True - elif match_arg_631.code == Collectivite_Code.Metropole: - _ = match_arg_631.value + elif match_arg_611.code == Collectivite_Code.Metropole: + _ = match_arg_611.value temp_prestations_familiales_dot_age_l512_3_2_3 = False - elif match_arg_631.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_631.value + elif match_arg_611.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_611.value temp_prestations_familiales_dot_age_l512_3_2_3 = False - elif match_arg_631.code == Collectivite_Code.Mayotte: - _ = match_arg_631.value + elif match_arg_611.code == Collectivite_Code.Mayotte: + _ = match_arg_611.value temp_prestations_familiales_dot_age_l512_3_2_3 = False return ((date_courante_14 >= date_entree_vigueur_differee_cch_1) and @@ -22795,33 +22545,33 @@ def eligibilite_aides_personnelle_logement(eligibilite_aides_personnelle_logemen temp_prestations_familiales_dot_age_l512_3_2_2, temp_prestations_familiales_dot_age_l512_3_2_1) except EmptyError: - match_arg_632 = menage.residence - if match_arg_632.code == Collectivite_Code.Guadeloupe: - _ = match_arg_632.value + match_arg_612 = menage.residence + if match_arg_612.code == Collectivite_Code.Guadeloupe: + _ = match_arg_612.value temp_prestations_familiales_dot_age_l512_3_2_4 = True - elif match_arg_632.code == Collectivite_Code.Guyane: - _ = match_arg_632.value + elif match_arg_612.code == Collectivite_Code.Guyane: + _ = match_arg_612.value temp_prestations_familiales_dot_age_l512_3_2_4 = True - elif match_arg_632.code == Collectivite_Code.Martinique: - _ = match_arg_632.value + elif match_arg_612.code == Collectivite_Code.Martinique: + _ = match_arg_612.value temp_prestations_familiales_dot_age_l512_3_2_4 = True - elif match_arg_632.code == Collectivite_Code.LaReunion: - _ = match_arg_632.value + elif match_arg_612.code == Collectivite_Code.LaReunion: + _ = match_arg_612.value temp_prestations_familiales_dot_age_l512_3_2_4 = True - elif match_arg_632.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_632.value + elif match_arg_612.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_612.value temp_prestations_familiales_dot_age_l512_3_2_4 = False - elif match_arg_632.code == Collectivite_Code.SaintMartin: - _ = match_arg_632.value + elif match_arg_612.code == Collectivite_Code.SaintMartin: + _ = match_arg_612.value temp_prestations_familiales_dot_age_l512_3_2_4 = False - elif match_arg_632.code == Collectivite_Code.Metropole: - _ = match_arg_632.value + elif match_arg_612.code == Collectivite_Code.Metropole: + _ = match_arg_612.value temp_prestations_familiales_dot_age_l512_3_2_4 = False - elif match_arg_632.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_632.value + elif match_arg_612.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_612.value temp_prestations_familiales_dot_age_l512_3_2_4 = False - elif match_arg_632.code == Collectivite_Code.Mayotte: - _ = match_arg_632.value + elif match_arg_612.code == Collectivite_Code.Mayotte: + _ = match_arg_612.value temp_prestations_familiales_dot_age_l512_3_2_4 = True if temp_prestations_familiales_dot_age_l512_3_2_4: return duration_of_numbers(22,0,0) @@ -22892,19 +22642,19 @@ def eligibilite_aides_personnelle_logement(eligibilite_aides_personnelle_logemen def temp_condition_logement_mode_occupation(_:Unit): return True def temp_condition_logement_mode_occupation_1(_:Unit): - match_arg_633 = menage.logement.usufruit - if match_arg_633.code == ParentOuAutre_Code.DemandeurOuConjointOuParentOuViaPartsSocietes: - parts_2 = match_arg_633.value + match_arg_613 = menage.logement.usufruit + if match_arg_613.code == ParentOuAutre_Code.DemandeurOuConjointOuParentOuViaPartsSocietes: + parts_2 = match_arg_613.value temp_condition_logement_mode_occupation_2 = parts_2 - elif match_arg_633.code == ParentOuAutre_Code.Autre: - _ = match_arg_633.value + elif match_arg_613.code == ParentOuAutre_Code.Autre: + _ = match_arg_613.value temp_condition_logement_mode_occupation_2 = decimal_of_string("0.") - match_arg_634 = menage.logement.proprietaire - if match_arg_634.code == ParentOuAutre_Code.DemandeurOuConjointOuParentOuViaPartsSocietes: - parts_3 = match_arg_634.value + match_arg_614 = menage.logement.proprietaire + if match_arg_614.code == ParentOuAutre_Code.DemandeurOuConjointOuParentOuViaPartsSocietes: + parts_3 = match_arg_614.value temp_condition_logement_mode_occupation_3 = parts_3 - elif match_arg_634.code == ParentOuAutre_Code.Autre: - _ = match_arg_634.value + elif match_arg_614.code == ParentOuAutre_Code.Autre: + _ = match_arg_614.value temp_condition_logement_mode_occupation_3 = decimal_of_string("0.") return (usufruit_ou_propriete_famille and ((temp_condition_logement_mode_occupation_3 < @@ -22918,21 +22668,21 @@ def eligibilite_aides_personnelle_logement(eligibilite_aides_personnelle_logemen temp_condition_logement_mode_occupation_1, temp_condition_logement_mode_occupation) except EmptyError: - match_arg_635 = menage.logement.mode_occupation - if match_arg_635.code == ModeOccupation_Code.Locataire: - _ = match_arg_635.value + match_arg_615 = menage.logement.mode_occupation + if match_arg_615.code == ModeOccupation_Code.Locataire: + _ = match_arg_615.value temp_condition_logement_mode_occupation_5 = usufruit_ou_propriete_famille - elif match_arg_635.code == ModeOccupation_Code.ResidentLogementFoyer: - _ = match_arg_635.value + elif match_arg_615.code == ModeOccupation_Code.ResidentLogementFoyer: + _ = match_arg_615.value temp_condition_logement_mode_occupation_5 = False - elif match_arg_635.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: - _ = match_arg_635.value + elif match_arg_615.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + _ = match_arg_615.value temp_condition_logement_mode_occupation_5 = False - elif match_arg_635.code == ModeOccupation_Code.SousLocataire: - _ = match_arg_635.value + elif match_arg_615.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_615.value temp_condition_logement_mode_occupation_5 = False - elif match_arg_635.code == ModeOccupation_Code.LocationAccession: - _ = match_arg_635.value + elif match_arg_615.code == ModeOccupation_Code.LocationAccession: + _ = match_arg_615.value temp_condition_logement_mode_occupation_5 = False if temp_condition_logement_mode_occupation_5: temp_condition_logement_mode_occupation_4 = False @@ -22940,21 +22690,21 @@ def eligibilite_aides_personnelle_logement(eligibilite_aides_personnelle_logemen temp_condition_logement_mode_occupation_4 = dead_value raise EmptyError except EmptyError: - match_arg_636 = menage.logement.mode_occupation - if match_arg_636.code == ModeOccupation_Code.Locataire: - _ = match_arg_636.value + match_arg_616 = menage.logement.mode_occupation + if match_arg_616.code == ModeOccupation_Code.Locataire: + _ = match_arg_616.value temp_condition_logement_mode_occupation_6 = True - elif match_arg_636.code == ModeOccupation_Code.ResidentLogementFoyer: - _ = match_arg_636.value + elif match_arg_616.code == ModeOccupation_Code.ResidentLogementFoyer: + _ = match_arg_616.value temp_condition_logement_mode_occupation_6 = True - elif match_arg_636.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: - _ = match_arg_636.value + elif match_arg_616.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + _ = match_arg_616.value temp_condition_logement_mode_occupation_6 = menage.logement.residence_principale - elif match_arg_636.code == ModeOccupation_Code.SousLocataire: - _ = match_arg_636.value + elif match_arg_616.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_616.value temp_condition_logement_mode_occupation_6 = True - elif match_arg_636.code == ModeOccupation_Code.LocationAccession: - _ = match_arg_636.value + elif match_arg_616.code == ModeOccupation_Code.LocationAccession: + _ = match_arg_616.value temp_condition_logement_mode_occupation_6 = True if temp_condition_logement_mode_occupation_6: temp_condition_logement_mode_occupation_4 = True @@ -23006,60 +22756,39 @@ def eligibilite_aides_personnelle_logement(eligibilite_aides_personnelle_logemen temp_condition_logement_surface = dead_value raise EmptyError except EmptyError: - match_arg_637 = menage.situation_familiale - if match_arg_637.code == SituationFamiliale_Code.Celibataire: - _ = match_arg_637.value - temp_condition_logement_surface_4 = integer_of_string("9") - elif match_arg_637.code == SituationFamiliale_Code.Maries: - _ = match_arg_637.value - temp_condition_logement_surface_4 = integer_of_string("16") - elif match_arg_637.code == SituationFamiliale_Code.Pacses: - _ = match_arg_637.value - temp_condition_logement_surface_4 = integer_of_string("16") - elif match_arg_637.code == SituationFamiliale_Code.Concubins: - _ = match_arg_637.value - temp_condition_logement_surface_4 = integer_of_string("16") - elif match_arg_637.code == SituationFamiliale_Code.CelibataireSepareDeFait: - _ = match_arg_637.value - temp_condition_logement_surface_4 = integer_of_string("9") - elif match_arg_637.code == SituationFamiliale_Code.ConcubinageDontSepareDeFait: - _ = match_arg_637.value - temp_condition_logement_surface_4 = integer_of_string("16") - if (((temp_condition_logement_surface_4 + - ((menage.nombre_autres_occupants_logement + - list_length(menage.personnes_a_charge)) * - integer_of_string("9"))) >= - integer_of_string("70")) and - (nombre_personnes_logement >= - integer_of_string("8"))): - temp_condition_logement_surface_5 = (menage.logement.surface_m_carres >= - integer_of_string("70")) - else: - match_arg_638 = menage.situation_familiale - if match_arg_638.code == SituationFamiliale_Code.Celibataire: - _ = match_arg_638.value - temp_condition_logement_surface_6 = integer_of_string("9") - elif match_arg_638.code == SituationFamiliale_Code.Maries: - _ = match_arg_638.value - temp_condition_logement_surface_6 = integer_of_string("16") - elif match_arg_638.code == SituationFamiliale_Code.Pacses: - _ = match_arg_638.value - temp_condition_logement_surface_6 = integer_of_string("16") - elif match_arg_638.code == SituationFamiliale_Code.Concubins: - _ = match_arg_638.value - temp_condition_logement_surface_6 = integer_of_string("16") - elif match_arg_638.code == SituationFamiliale_Code.CelibataireSepareDeFait: - _ = match_arg_638.value - temp_condition_logement_surface_6 = integer_of_string("9") - elif match_arg_638.code == SituationFamiliale_Code.ConcubinageDontSepareDeFait: - _ = match_arg_638.value - temp_condition_logement_surface_6 = integer_of_string("16") - temp_condition_logement_surface_5 = (menage.logement.surface_m_carres >= - (temp_condition_logement_surface_6 + - ((menage.nombre_autres_occupants_logement + - list_length(menage.personnes_a_charge)) * - integer_of_string("9")))) - if temp_condition_logement_surface_5: + def temp_condition_logement_surface_4(condition_logement_surface_minimale_sans_seuil_m_carres:Integer): + if ((condition_logement_surface_minimale_sans_seuil_m_carres >= + integer_of_string("70")) and + (nombre_personnes_logement >= + integer_of_string("8"))): + return (menage.logement.surface_m_carres >= + integer_of_string("70")) + else: + return (menage.logement.surface_m_carres >= + condition_logement_surface_minimale_sans_seuil_m_carres) + match_arg_617 = menage.situation_familiale + if match_arg_617.code == SituationFamiliale_Code.Celibataire: + _ = match_arg_617.value + temp_condition_logement_surface_5 = integer_of_string("9") + elif match_arg_617.code == SituationFamiliale_Code.Maries: + _ = match_arg_617.value + temp_condition_logement_surface_5 = integer_of_string("16") + elif match_arg_617.code == SituationFamiliale_Code.Pacses: + _ = match_arg_617.value + temp_condition_logement_surface_5 = integer_of_string("16") + elif match_arg_617.code == SituationFamiliale_Code.Concubins: + _ = match_arg_617.value + temp_condition_logement_surface_5 = integer_of_string("16") + elif match_arg_617.code == SituationFamiliale_Code.CelibataireSepareDeFait: + _ = match_arg_617.value + temp_condition_logement_surface_5 = integer_of_string("9") + elif match_arg_617.code == SituationFamiliale_Code.ConcubinageDontSepareDeFait: + _ = match_arg_617.value + temp_condition_logement_surface_5 = integer_of_string("16") + if temp_condition_logement_surface_4((temp_condition_logement_surface_5 + + ((menage.nombre_autres_occupants_logement + + list_length(menage.personnes_a_charge)) * + integer_of_string("9")))): temp_condition_logement_surface = True else: temp_condition_logement_surface = dead_value @@ -23161,12 +22890,12 @@ def eligibilite_aides_personnelle_logement(eligibilite_aides_personnelle_logemen def temp_condition_2_r823_4_1(_:Unit): return True def temp_condition_2_r823_4_2(_:Unit): - match_arg_639 = personne_a_charge - if match_arg_639.code == PersonneACharge_Code.EnfantACharge: - enfant_2 = match_arg_639.value + match_arg_618 = personne_a_charge + if match_arg_618.code == PersonneACharge_Code.EnfantACharge: + enfant_2 = match_arg_618.value return False - elif match_arg_639.code == PersonneACharge_Code.AutrePersonneACharge: - parent = match_arg_639.value + elif match_arg_618.code == PersonneACharge_Code.AutrePersonneACharge: + parent = match_arg_618.value try: temp_condition_2_r823_4_3 = parent.date_naissance except EmptyError: @@ -23284,54 +23013,54 @@ def eligibilite_aides_personnelle_logement(eligibilite_aides_personnelle_logemen def temp_prise_en_compte_personne_a_charge_4(_:Unit): return False def temp_prise_en_compte_personne_a_charge_5(_:Unit): - match_arg_640 = personne_a_charge_1 - if match_arg_640.code == PersonneACharge_Code.EnfantACharge: - enfant_3 = match_arg_640.value - match_arg_641 = enfant_3.obligation_scolaire - if match_arg_641.code == SituationObligationScolaire_Code.Avant: - _ = match_arg_641.value + match_arg_619 = personne_a_charge_1 + if match_arg_619.code == PersonneACharge_Code.EnfantACharge: + enfant_3 = match_arg_619.value + match_arg_620 = enfant_3.obligation_scolaire + if match_arg_620.code == SituationObligationScolaire_Code.Avant: + _ = match_arg_620.value temp_prise_en_compte_personne_a_charge_6 = False - elif match_arg_641.code == SituationObligationScolaire_Code.Pendant: - _ = match_arg_641.value + elif match_arg_620.code == SituationObligationScolaire_Code.Pendant: + _ = match_arg_620.value temp_prise_en_compte_personne_a_charge_6 = False - elif match_arg_641.code == SituationObligationScolaire_Code.Apres: - _ = match_arg_641.value + elif match_arg_620.code == SituationObligationScolaire_Code.Apres: + _ = match_arg_620.value temp_prise_en_compte_personne_a_charge_6 = True temp_prise_en_compte_personne_a_charge_7 = (temp_prise_en_compte_personne_a_charge_6 and (((enfant_3.date_de_naissance + prestations_familiales_dot_age_l512_3_2_1) > date_courante_14) and enfant_3.etudes_apprentissage_stage_formation_pro_impossibilite_travail)) - elif match_arg_640.code == PersonneACharge_Code.AutrePersonneACharge: - _ = match_arg_640.value + elif match_arg_619.code == PersonneACharge_Code.AutrePersonneACharge: + _ = match_arg_619.value temp_prise_en_compte_personne_a_charge_7 = False - match_arg_642 = menage.residence - if match_arg_642.code == Collectivite_Code.Guadeloupe: - _ = match_arg_642.value + match_arg_621 = menage.residence + if match_arg_621.code == Collectivite_Code.Guadeloupe: + _ = match_arg_621.value temp_prise_en_compte_personne_a_charge_8 = False - elif match_arg_642.code == Collectivite_Code.Guyane: - _ = match_arg_642.value + elif match_arg_621.code == Collectivite_Code.Guyane: + _ = match_arg_621.value temp_prise_en_compte_personne_a_charge_8 = False - elif match_arg_642.code == Collectivite_Code.Martinique: - _ = match_arg_642.value + elif match_arg_621.code == Collectivite_Code.Martinique: + _ = match_arg_621.value temp_prise_en_compte_personne_a_charge_8 = False - elif match_arg_642.code == Collectivite_Code.LaReunion: - _ = match_arg_642.value + elif match_arg_621.code == Collectivite_Code.LaReunion: + _ = match_arg_621.value temp_prise_en_compte_personne_a_charge_8 = False - elif match_arg_642.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_642.value + elif match_arg_621.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_621.value temp_prise_en_compte_personne_a_charge_8 = True - elif match_arg_642.code == Collectivite_Code.SaintMartin: - _ = match_arg_642.value + elif match_arg_621.code == Collectivite_Code.SaintMartin: + _ = match_arg_621.value temp_prise_en_compte_personne_a_charge_8 = True - elif match_arg_642.code == Collectivite_Code.Metropole: - _ = match_arg_642.value + elif match_arg_621.code == Collectivite_Code.Metropole: + _ = match_arg_621.value temp_prise_en_compte_personne_a_charge_8 = False - elif match_arg_642.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_642.value + elif match_arg_621.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_621.value temp_prise_en_compte_personne_a_charge_8 = False - elif match_arg_642.code == Collectivite_Code.Mayotte: - _ = match_arg_642.value + elif match_arg_621.code == Collectivite_Code.Mayotte: + _ = match_arg_621.value temp_prise_en_compte_personne_a_charge_8 = False return (temp_prise_en_compte_personne_a_charge_8 and temp_prise_en_compte_personne_a_charge_7) @@ -23343,54 +23072,54 @@ def eligibilite_aides_personnelle_logement(eligibilite_aides_personnelle_logemen temp_prise_en_compte_personne_a_charge_5, temp_prise_en_compte_personne_a_charge_4) except EmptyError: - match_arg_643 = personne_a_charge_1 - if match_arg_643.code == PersonneACharge_Code.EnfantACharge: - enfant_4 = match_arg_643.value - match_arg_644 = enfant_4.obligation_scolaire - if match_arg_644.code == SituationObligationScolaire_Code.Avant: - _ = match_arg_644.value + match_arg_622 = personne_a_charge_1 + if match_arg_622.code == PersonneACharge_Code.EnfantACharge: + enfant_4 = match_arg_622.value + match_arg_623 = enfant_4.obligation_scolaire + if match_arg_623.code == SituationObligationScolaire_Code.Avant: + _ = match_arg_623.value temp_prise_en_compte_personne_a_charge_9 = False - elif match_arg_644.code == SituationObligationScolaire_Code.Pendant: - _ = match_arg_644.value + elif match_arg_623.code == SituationObligationScolaire_Code.Pendant: + _ = match_arg_623.value temp_prise_en_compte_personne_a_charge_9 = False - elif match_arg_644.code == SituationObligationScolaire_Code.Apres: - _ = match_arg_644.value + elif match_arg_623.code == SituationObligationScolaire_Code.Apres: + _ = match_arg_623.value temp_prise_en_compte_personne_a_charge_9 = True temp_prise_en_compte_personne_a_charge_10 = (temp_prise_en_compte_personne_a_charge_9 and (((enfant_4.date_de_naissance + prestations_familiales_dot_age_l512_3_2_1) > date_courante_14) and enfant_4.etudes_apprentissage_stage_formation_pro_impossibilite_travail)) - elif match_arg_643.code == PersonneACharge_Code.AutrePersonneACharge: - _ = match_arg_643.value + elif match_arg_622.code == PersonneACharge_Code.AutrePersonneACharge: + _ = match_arg_622.value temp_prise_en_compte_personne_a_charge_10 = False - match_arg_645 = menage.residence - if match_arg_645.code == Collectivite_Code.Guadeloupe: - _ = match_arg_645.value + match_arg_624 = menage.residence + if match_arg_624.code == Collectivite_Code.Guadeloupe: + _ = match_arg_624.value temp_prise_en_compte_personne_a_charge_11 = True - elif match_arg_645.code == Collectivite_Code.Guyane: - _ = match_arg_645.value + elif match_arg_624.code == Collectivite_Code.Guyane: + _ = match_arg_624.value temp_prise_en_compte_personne_a_charge_11 = True - elif match_arg_645.code == Collectivite_Code.Martinique: - _ = match_arg_645.value + elif match_arg_624.code == Collectivite_Code.Martinique: + _ = match_arg_624.value temp_prise_en_compte_personne_a_charge_11 = True - elif match_arg_645.code == Collectivite_Code.LaReunion: - _ = match_arg_645.value + elif match_arg_624.code == Collectivite_Code.LaReunion: + _ = match_arg_624.value temp_prise_en_compte_personne_a_charge_11 = True - elif match_arg_645.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_645.value + elif match_arg_624.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_624.value temp_prise_en_compte_personne_a_charge_11 = False - elif match_arg_645.code == Collectivite_Code.SaintMartin: - _ = match_arg_645.value + elif match_arg_624.code == Collectivite_Code.SaintMartin: + _ = match_arg_624.value temp_prise_en_compte_personne_a_charge_11 = False - elif match_arg_645.code == Collectivite_Code.Metropole: - _ = match_arg_645.value + elif match_arg_624.code == Collectivite_Code.Metropole: + _ = match_arg_624.value temp_prise_en_compte_personne_a_charge_11 = False - elif match_arg_645.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_645.value + elif match_arg_624.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_624.value temp_prise_en_compte_personne_a_charge_11 = False - elif match_arg_645.code == Collectivite_Code.Mayotte: - _ = match_arg_645.value + elif match_arg_624.code == Collectivite_Code.Mayotte: + _ = match_arg_624.value temp_prise_en_compte_personne_a_charge_11 = True if (temp_prise_en_compte_personne_a_charge_11 and temp_prise_en_compte_personne_a_charge_10): @@ -23398,18 +23127,18 @@ def eligibilite_aides_personnelle_logement(eligibilite_aides_personnelle_logemen else: raise EmptyError except EmptyError: - match_arg_646 = personne_a_charge_1 - if match_arg_646.code == PersonneACharge_Code.EnfantACharge: - enfant_5 = match_arg_646.value - match_arg_647 = enfant_5.nationalite - if match_arg_647.code == Nationalite_Code.Francaise: - _ = match_arg_647.value + match_arg_625 = personne_a_charge_1 + if match_arg_625.code == PersonneACharge_Code.EnfantACharge: + enfant_5 = match_arg_625.value + match_arg_626 = enfant_5.nationalite + if match_arg_626.code == Nationalite_Code.Francaise: + _ = match_arg_626.value temp_prise_en_compte_personne_a_charge_12 = False - elif match_arg_647.code == Nationalite_Code.Etrangere: - conditions_2 = match_arg_647.value + elif match_arg_626.code == Nationalite_Code.Etrangere: + conditions_2 = match_arg_626.value temp_prise_en_compte_personne_a_charge_12 = not conditions_2.satisfait_conditions_l512_2_code_securite_sociale - elif match_arg_646.code == PersonneACharge_Code.AutrePersonneACharge: - _ = match_arg_646.value + elif match_arg_625.code == PersonneACharge_Code.AutrePersonneACharge: + _ = match_arg_625.value temp_prise_en_compte_personne_a_charge_12 = False if (septieme_alinea_l823_1_applicable and temp_prise_en_compte_personne_a_charge_12): @@ -23417,17 +23146,17 @@ def eligibilite_aides_personnelle_logement(eligibilite_aides_personnelle_logemen else: raise EmptyError except EmptyError: - match_arg_648 = personne_a_charge_1 - if match_arg_648.code == PersonneACharge_Code.EnfantACharge: - enfant_6 = match_arg_648.value + match_arg_627 = personne_a_charge_1 + if match_arg_627.code == PersonneACharge_Code.EnfantACharge: + enfant_6 = match_arg_627.value temp_prise_en_compte_personne_a_charge_13 = prestations_familiales_dot_droit_ouvert( EnfantPrestationsFamiliales(identifiant = enfant_6.identifiant, obligation_scolaire = enfant_6.obligation_scolaire, remuneration_mensuelle = enfant_6.remuneration_mensuelle, date_de_naissance = enfant_6.date_de_naissance, a_deja_ouvert_droit_aux_allocations_familiales = enfant_6.a_deja_ouvert_droit_aux_allocations_familiales)) - elif match_arg_648.code == PersonneACharge_Code.AutrePersonneACharge: - parent_1 = match_arg_648.value + elif match_arg_627.code == PersonneACharge_Code.AutrePersonneACharge: + parent_1 = match_arg_627.value temp_prise_en_compte_personne_a_charge_13 = False if temp_prise_en_compte_personne_a_charge_13: return True @@ -23438,41 +23167,41 @@ def eligibilite_aides_personnelle_logement(eligibilite_aides_personnelle_logemen def temp_prise_en_compte_personne_a_charge_15(_:Unit): return True def temp_prise_en_compte_personne_a_charge_16(_:Unit): - match_arg_649 = personne_a_charge_1 - if match_arg_649.code == PersonneACharge_Code.EnfantACharge: - enfant_7 = match_arg_649.value + match_arg_628 = personne_a_charge_1 + if match_arg_628.code == PersonneACharge_Code.EnfantACharge: + enfant_7 = match_arg_628.value return False - elif match_arg_649.code == PersonneACharge_Code.AutrePersonneACharge: - parent_2 = match_arg_649.value - match_arg_650 = parent_2.parente - if match_arg_650.code == Parente_Code.Ascendant: - _ = match_arg_650.value + elif match_arg_628.code == PersonneACharge_Code.AutrePersonneACharge: + parent_2 = match_arg_628.value + match_arg_629 = parent_2.parente + if match_arg_629.code == Parente_Code.Ascendant: + _ = match_arg_629.value temp_prise_en_compte_personne_a_charge_17 = False - elif match_arg_650.code == Parente_Code.Descendant: - _ = match_arg_650.value + elif match_arg_629.code == Parente_Code.Descendant: + _ = match_arg_629.value temp_prise_en_compte_personne_a_charge_17 = False - elif match_arg_650.code == Parente_Code.CollateralDeuxiemeTroisiemeDegre: - _ = match_arg_650.value + elif match_arg_629.code == Parente_Code.CollateralDeuxiemeTroisiemeDegre: + _ = match_arg_629.value temp_prise_en_compte_personne_a_charge_17 = True - match_arg_651 = parent_2.parente - if match_arg_651.code == Parente_Code.Ascendant: - _ = match_arg_651.value + match_arg_630 = parent_2.parente + if match_arg_630.code == Parente_Code.Ascendant: + _ = match_arg_630.value temp_prise_en_compte_personne_a_charge_18 = False - elif match_arg_651.code == Parente_Code.Descendant: - _ = match_arg_651.value + elif match_arg_630.code == Parente_Code.Descendant: + _ = match_arg_630.value temp_prise_en_compte_personne_a_charge_18 = True - elif match_arg_651.code == Parente_Code.CollateralDeuxiemeTroisiemeDegre: - _ = match_arg_651.value + elif match_arg_630.code == Parente_Code.CollateralDeuxiemeTroisiemeDegre: + _ = match_arg_630.value temp_prise_en_compte_personne_a_charge_18 = False - match_arg_652 = parent_2.parente - if match_arg_652.code == Parente_Code.Ascendant: - _ = match_arg_652.value + match_arg_631 = parent_2.parente + if match_arg_631.code == Parente_Code.Ascendant: + _ = match_arg_631.value temp_prise_en_compte_personne_a_charge_19 = True - elif match_arg_652.code == Parente_Code.Descendant: - _ = match_arg_652.value + elif match_arg_631.code == Parente_Code.Descendant: + _ = match_arg_631.value temp_prise_en_compte_personne_a_charge_19 = False - elif match_arg_652.code == Parente_Code.CollateralDeuxiemeTroisiemeDegre: - _ = match_arg_652.value + elif match_arg_631.code == Parente_Code.CollateralDeuxiemeTroisiemeDegre: + _ = match_arg_631.value temp_prise_en_compte_personne_a_charge_19 = False return ((temp_prise_en_compte_personne_a_charge_19 or (temp_prise_en_compte_personne_a_charge_18 or @@ -23523,32 +23252,32 @@ def eligibilite_aides_personnelle_logement(eligibilite_aides_personnelle_logemen personnes_a_charge_prises_en_compte = temp_personnes_a_charge_prises_en_compte_1 try: def temp_coefficents_enfants_garde_alternee_pris_en_compte(personne_a_charge_3:PersonneACharge): - match_arg_653 = personne_a_charge_3 - if match_arg_653.code == PersonneACharge_Code.EnfantACharge: - enfant_8 = match_arg_653.value - match_arg_654 = enfant_8.situation_garde_alternee - if match_arg_654.code == SituationGardeAlternee_Code.PasDeGardeAlternee: - _ = match_arg_654.value + match_arg_632 = personne_a_charge_3 + if match_arg_632.code == PersonneACharge_Code.EnfantACharge: + enfant_8 = match_arg_632.value + match_arg_633 = enfant_8.situation_garde_alternee + if match_arg_633.code == SituationGardeAlternee_Code.PasDeGardeAlternee: + _ = match_arg_633.value return False - elif match_arg_654.code == SituationGardeAlternee_Code.GardeAlterneeCoefficientPriseEnCharge: - _ = match_arg_654.value + elif match_arg_633.code == SituationGardeAlternee_Code.GardeAlterneeCoefficientPriseEnCharge: + _ = match_arg_633.value return True - elif match_arg_653.code == PersonneACharge_Code.AutrePersonneACharge: - _ = match_arg_653.value + elif match_arg_632.code == PersonneACharge_Code.AutrePersonneACharge: + _ = match_arg_632.value return False def temp_coefficents_enfants_garde_alternee_pris_en_compte_1(personne_a_charge_4:PersonneACharge): - match_arg_655 = personne_a_charge_4 - if match_arg_655.code == PersonneACharge_Code.EnfantACharge: - enfant_9 = match_arg_655.value - match_arg_656 = enfant_9.situation_garde_alternee - if match_arg_656.code == SituationGardeAlternee_Code.PasDeGardeAlternee: - _ = match_arg_656.value + match_arg_634 = personne_a_charge_4 + if match_arg_634.code == PersonneACharge_Code.EnfantACharge: + enfant_9 = match_arg_634.value + match_arg_635 = enfant_9.situation_garde_alternee + if match_arg_635.code == SituationGardeAlternee_Code.PasDeGardeAlternee: + _ = match_arg_635.value return decimal_of_string("0.") - elif match_arg_656.code == SituationGardeAlternee_Code.GardeAlterneeCoefficientPriseEnCharge: - coeff = match_arg_656.value + elif match_arg_635.code == SituationGardeAlternee_Code.GardeAlterneeCoefficientPriseEnCharge: + coeff = match_arg_635.value return coeff - elif match_arg_655.code == PersonneACharge_Code.AutrePersonneACharge: - _ = match_arg_655.value + elif match_arg_634.code == PersonneACharge_Code.AutrePersonneACharge: + _ = match_arg_634.value return decimal_of_string("0.") temp_coefficents_enfants_garde_alternee_pris_en_compte_2 = list_map(temp_coefficents_enfants_garde_alternee_pris_en_compte_1, list_filter(temp_coefficents_enfants_garde_alternee_pris_en_compte, @@ -23581,7 +23310,7 @@ def eligibilite_aides_personnelle_logement(eligibilite_aides_personnelle_logemen def calcul_allocation_logement_locatif(calcul_allocation_logement_locatif_in:CalculAllocationLogementLocatifIn): loyer_principal = calcul_allocation_logement_locatif_in.loyer_principal_in - ressources_menage_arrondies_5 = calcul_allocation_logement_locatif_in.ressources_menage_arrondies_in + ressources_menage_arrondies_8 = calcul_allocation_logement_locatif_in.ressources_menage_arrondies_in beneficiaire_aide_adulte_ou_enfant_handicapes_1 = calcul_allocation_logement_locatif_in.beneficiaire_aide_adulte_ou_enfant_handicapes_in date_courante_15 = calcul_allocation_logement_locatif_in.date_courante_in nombre_personnes_a_charge_10 = calcul_allocation_logement_locatif_in.nombre_personnes_a_charge_in @@ -23612,7 +23341,7 @@ def calcul_allocation_logement_locatif(calcul_allocation_logement_locatif_in:Cal "Code de la construction et de l'habitation"])) calcul_apl_locatif_dot_loyer_principal_base = temp_calcul_apl_locatif_dot_loyer_principal_base try: - temp_calcul_apl_locatif_dot_ressources_menage_arrondies = ressources_menage_arrondies_5 + temp_calcul_apl_locatif_dot_ressources_menage_arrondies = ressources_menage_arrondies_8 except EmptyError: temp_calcul_apl_locatif_dot_ressources_menage_arrondies = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", @@ -23884,29 +23613,29 @@ def calcul_allocation_logement_locatif(calcul_allocation_logement_locatif_in:Cal "Prologue : aides au logement"])) plafond_loyer_d823_16_2_1 = temp_plafond_loyer_d823_16_2_97 try: - temp_montant_forfaitaire_charges_d823_16_93 = calcul_apl_locatif_dot_montant_forfaitaire_charges_d823_16 + temp_montant_forfaitaire_charges_d823_16_73 = calcul_apl_locatif_dot_montant_forfaitaire_charges_d823_16 except EmptyError: - temp_montant_forfaitaire_charges_d823_16_93 = dead_value + temp_montant_forfaitaire_charges_d823_16_73 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", start_line=840, start_column=12, end_line=840, end_column=47, law_headings=["Secteur locatif", "Calcul du montant de l'allocation logement", "Prologue : aides au logement"])) - montant_forfaitaire_charges_d823_16_1 = temp_montant_forfaitaire_charges_d823_16_93 - def temp_traitement_aide_finale(aide_finale_28:Money): + montant_forfaitaire_charges_d823_16_1 = temp_montant_forfaitaire_charges_d823_16_73 + def temp_traitement_aide_finale(aide_finale_50:Money): try: try: def temp_traitement_aide_finale_1(_:Unit): - return aide_finale_28 + return aide_finale_50 def temp_traitement_aide_finale_2(_:Unit): - match_arg_657 = changement_logement_d842_4 - if match_arg_657.code == ChangementLogementD8424_Code.Changement: - infos = match_arg_657.value + match_arg_636 = changement_logement_d842_4 + if match_arg_636.code == ChangementLogementD8424_Code.Changement: + infos = match_arg_636.value return (loyer_principal >= infos.ancien_loyer_principal) - elif match_arg_657.code == ChangementLogementD8424_Code.PasDeChangement: - _ = match_arg_657.value + elif match_arg_636.code == ChangementLogementD8424_Code.PasDeChangement: + _ = match_arg_636.value return False return handle_default(SourcePosition(filename="", start_line=0, start_column=1, @@ -23916,7 +23645,7 @@ def calcul_allocation_logement_locatif(calcul_allocation_logement_locatif_in:Cal temp_traitement_aide_finale_1) except EmptyError: return calcul_apl_locatif_dot_traitement_aide_finale_montant_minimal( - aide_finale_28) + aide_finale_50) except EmptyError: raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", start_line=838, @@ -23929,23 +23658,23 @@ def calcul_allocation_logement_locatif(calcul_allocation_logement_locatif_in:Cal try: try: def temp_aide_finale_formule_5(_:Unit): - match_arg_658 = changement_logement_d842_4 - if match_arg_658.code == ChangementLogementD8424_Code.Changement: - infos_1 = match_arg_658.value + match_arg_637 = changement_logement_d842_4 + if match_arg_637.code == ChangementLogementD8424_Code.Changement: + infos_1 = match_arg_637.value return (loyer_principal - (infos_1.ancien_loyer_principal - infos_1.ancienne_allocation_logement)) - elif match_arg_658.code == ChangementLogementD8424_Code.PasDeChangement: - _ = match_arg_658.value + elif match_arg_637.code == ChangementLogementD8424_Code.PasDeChangement: + _ = match_arg_637.value return money_of_cents_string("0") def temp_aide_finale_formule_6(_:Unit): - match_arg_659 = changement_logement_d842_4 - if match_arg_659.code == ChangementLogementD8424_Code.Changement: - infos_2 = match_arg_659.value + match_arg_638 = changement_logement_d842_4 + if match_arg_638.code == ChangementLogementD8424_Code.Changement: + infos_2 = match_arg_638.value return (loyer_principal >= infos_2.ancien_loyer_principal) - elif match_arg_659.code == ChangementLogementD8424_Code.PasDeChangement: - _ = match_arg_659.value + elif match_arg_638.code == ChangementLogementD8424_Code.PasDeChangement: + _ = match_arg_638.value return False temp_aide_finale_formule_7 = handle_default(SourcePosition(filename="", start_line=0, @@ -23983,25 +23712,25 @@ def calcul_aide_personnalisee_logement(calcul_aide_personnalisee_logement_in:Cal date_courante_16 = calcul_aide_personnalisee_logement_in.date_courante_in residence_9 = calcul_aide_personnalisee_logement_in.residence_in try: - match_arg_660 = mode_occupation_1 - if match_arg_660.code == ModeOccupation_Code.Locataire: - location = match_arg_660.value + match_arg_639 = mode_occupation_1 + if match_arg_639.code == ModeOccupation_Code.Locataire: + location = match_arg_639.value temp_categorie_calcul_apl = CategorieCalculAPL(CategorieCalculAPL_Code.Location, location) - elif match_arg_660.code == ModeOccupation_Code.ResidentLogementFoyer: - logementfoyer = match_arg_660.value + elif match_arg_639.code == ModeOccupation_Code.ResidentLogementFoyer: + logementfoyer = match_arg_639.value temp_categorie_calcul_apl = CategorieCalculAPL(CategorieCalculAPL_Code.LogementFoyer, logementfoyer) - elif match_arg_660.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: - proprietaire = match_arg_660.value + elif match_arg_639.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + proprietaire = match_arg_639.value temp_categorie_calcul_apl = CategorieCalculAPL(CategorieCalculAPL_Code.AccessionPropriete, proprietaire) - elif match_arg_660.code == ModeOccupation_Code.SousLocataire: - location_1 = match_arg_660.value + elif match_arg_639.code == ModeOccupation_Code.SousLocataire: + location_1 = match_arg_639.value temp_categorie_calcul_apl = CategorieCalculAPL(CategorieCalculAPL_Code.Location, location_1) - elif match_arg_660.code == ModeOccupation_Code.LocationAccession: - proprietaire_1 = match_arg_660.value + elif match_arg_639.code == ModeOccupation_Code.LocationAccession: + proprietaire_1 = match_arg_639.value temp_categorie_calcul_apl = CategorieCalculAPL(CategorieCalculAPL_Code.AccessionPropriete, proprietaire_1) except EmptyError: @@ -24028,29 +23757,29 @@ def calcul_aide_personnalisee_logement(calcul_aide_personnalisee_logement_in:Cal "Prologue : aides au logement"])) ressources_menage_avec_arrondi = temp_ressources_menage_avec_arrondi try: - match_arg_661 = situation_familiale - if match_arg_661.code == SituationFamiliale_Code.Celibataire: - _ = match_arg_661.value + match_arg_640 = situation_familiale + if match_arg_640.code == SituationFamiliale_Code.Celibataire: + _ = match_arg_640.value temp_situation_familiale_calcul_apl = SituationFamilialeCalculAPL(SituationFamilialeCalculAPL_Code.PersonneSeule, Unit()) - elif match_arg_661.code == SituationFamiliale_Code.Maries: - _ = match_arg_661.value + elif match_arg_640.code == SituationFamiliale_Code.Maries: + _ = match_arg_640.value temp_situation_familiale_calcul_apl = SituationFamilialeCalculAPL(SituationFamilialeCalculAPL_Code.Couple, Unit()) - elif match_arg_661.code == SituationFamiliale_Code.Pacses: - _ = match_arg_661.value + elif match_arg_640.code == SituationFamiliale_Code.Pacses: + _ = match_arg_640.value temp_situation_familiale_calcul_apl = SituationFamilialeCalculAPL(SituationFamilialeCalculAPL_Code.Couple, Unit()) - elif match_arg_661.code == SituationFamiliale_Code.Concubins: - _ = match_arg_661.value + elif match_arg_640.code == SituationFamiliale_Code.Concubins: + _ = match_arg_640.value temp_situation_familiale_calcul_apl = SituationFamilialeCalculAPL(SituationFamilialeCalculAPL_Code.Couple, Unit()) - elif match_arg_661.code == SituationFamiliale_Code.CelibataireSepareDeFait: - _ = match_arg_661.value + elif match_arg_640.code == SituationFamiliale_Code.CelibataireSepareDeFait: + _ = match_arg_640.value temp_situation_familiale_calcul_apl = SituationFamilialeCalculAPL(SituationFamilialeCalculAPL_Code.PersonneSeule, Unit()) - elif match_arg_661.code == SituationFamiliale_Code.ConcubinageDontSepareDeFait: - _ = match_arg_661.value + elif match_arg_640.code == SituationFamiliale_Code.ConcubinageDontSepareDeFait: + _ = match_arg_640.value temp_situation_familiale_calcul_apl = SituationFamilialeCalculAPL(SituationFamilialeCalculAPL_Code.Couple, Unit()) except EmptyError: @@ -24064,18 +23793,28 @@ def calcul_aide_personnalisee_logement(calcul_aide_personnalisee_logement_in:Cal "Prologue : aides au logement"])) situation_familiale_calcul_apl_8 = temp_situation_familiale_calcul_apl try: - match_arg_662 = categorie_calcul_apl - if match_arg_662.code == CategorieCalculAPL_Code.Location: - location_2 = match_arg_662.value + match_arg_641 = categorie_calcul_apl + if match_arg_641.code == CategorieCalculAPL_Code.Location: + location_2 = match_arg_641.value + def temp_traitement_formule(result_19:CalculAidePersonnaliseeLogementLocatif): + def temp_traitement_formule_1(param0:Money): + return result_19.traitement_aide_finale(param0) + return CalculAidePersonnaliseeLogementLocatif(montant_forfaitaire_charges_d823_16 = result_19.montant_forfaitaire_charges_d823_16, + plafond_loyer_d823_16_2 = result_19.plafond_loyer_d823_16_2, + participation_minimale = result_19.participation_minimale, + taux_composition_familiale = result_19.taux_composition_familiale, + participation_personnelle = result_19.participation_personnelle, + aide_finale_formule = result_19.aide_finale_formule, + traitement_aide_finale = temp_traitement_formule_1) try: - temp_sous_calcul_traitement = residence_9 + temp_traitement_formule_2 = location_2.loyer_principal except EmptyError: - temp_sous_calcul_traitement = dead_value + temp_traitement_formule_2 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1464, - start_column=25, - end_line=1464, - end_column=34, + start_line=1450, + start_column=31, + end_line=1450, + end_column=55, law_headings=["Article D823-9", "Section 1 : Calcul, liquidation et versement des aides", "Chapitre III : Modalités de liquidation et de versement", @@ -24084,194 +23823,9 @@ def calcul_aide_personnalisee_logement(calcul_aide_personnalisee_logement_in:Cal "Partie réglementaire", "Code de la construction et de l'habitation"])) try: - temp_sous_calcul_traitement_1 = location_2.logement_meuble_d842_2 + temp_traitement_formule_3 = ressources_menage_avec_arrondi except EmptyError: - temp_sous_calcul_traitement_1 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1463, - start_column=38, - end_line=1463, - end_column=69, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - match_arg_663 = location_2.bailleur - if match_arg_663.code == TypeBailleur_Code.BailleurSocial: - bailleur = match_arg_663.value - temp_sous_calcul_traitement_2 = bailleur.reduction_loyer_solidarite_percue - elif match_arg_663.code == TypeBailleur_Code.BailleurPriveAvecConventionnementSocial: - _ = match_arg_663.value - temp_sous_calcul_traitement_2 = money_of_cents_string("0") - elif match_arg_663.code == TypeBailleur_Code.BailleurPrive: - _ = match_arg_663.value - temp_sous_calcul_traitement_2 = money_of_cents_string("0") - except EmptyError: - temp_sous_calcul_traitement_2 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1459, - start_column=16, - end_line=1462, - end_column=39, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_3 = location_2.colocation - except EmptyError: - temp_sous_calcul_traitement_3 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1454, - start_column=26, - end_line=1454, - end_column=45, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_4 = type_aide_2 - except EmptyError: - temp_sous_calcul_traitement_4 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1457, - start_column=25, - end_line=1457, - end_column=34, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_5 = location_2.agees_ou_handicap_adultes_hebergees_onereux_particuliers - except EmptyError: - temp_sous_calcul_traitement_5 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1456, - start_column=15, - end_line=1456, - end_column=80, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_6 = location_2.logement_est_chambre - except EmptyError: - temp_sous_calcul_traitement_6 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1453, - start_column=36, - end_line=1453, - end_column=65, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_7 = zone_6 - except EmptyError: - temp_sous_calcul_traitement_7 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1447, - start_column=20, - end_line=1447, - end_column=24, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_8 = situation_familiale_calcul_apl_8 - except EmptyError: - temp_sous_calcul_traitement_8 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1449, - start_column=46, - end_line=1449, - end_column=76, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_9 = nombre_personnes_a_charge_11 - except EmptyError: - temp_sous_calcul_traitement_9 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1446, - start_column=41, - end_line=1446, - end_column=66, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_10 = date_courante_16 - except EmptyError: - temp_sous_calcul_traitement_10 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1448, - start_column=29, - end_line=1448, - end_column=42, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_11 = location_2.beneficiaire_aide_adulte_ou_enfant_handicapes - except EmptyError: - temp_sous_calcul_traitement_11 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1452, - start_column=15, - end_line=1452, - end_column=69, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_12 = ressources_menage_avec_arrondi - except EmptyError: - temp_sous_calcul_traitement_12 = dead_value + temp_traitement_formule_3 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", start_line=1445, start_column=43, @@ -24285,297 +23839,14 @@ def calcul_aide_personnalisee_logement(calcul_aide_personnalisee_logement_in:Cal "Partie réglementaire", "Code de la construction et de l'habitation"])) try: - temp_sous_calcul_traitement_13 = location_2.loyer_principal + temp_traitement_formule_4 = location_2.beneficiaire_aide_adulte_ou_enfant_handicapes except EmptyError: - temp_sous_calcul_traitement_13 = dead_value + temp_traitement_formule_4 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1450, - start_column=31, - end_line=1450, - end_column=55, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - def temp_sous_calcul_traitement_14(param0:Money): - try: - temp_sous_calcul_traitement_15 = location_2.loyer_principal - except EmptyError: - temp_sous_calcul_traitement_15 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1450, - start_column=31, - end_line=1450, - end_column=55, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_16 = ressources_menage_avec_arrondi - except EmptyError: - temp_sous_calcul_traitement_16 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1445, - start_column=43, - end_line=1445, - end_column=60, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_17 = location_2.beneficiaire_aide_adulte_ou_enfant_handicapes - except EmptyError: - temp_sous_calcul_traitement_17 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1452, - start_column=15, - end_line=1452, - end_column=69, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_18 = date_courante_16 - except EmptyError: - temp_sous_calcul_traitement_18 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1448, - start_column=29, - end_line=1448, - end_column=42, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_19 = nombre_personnes_a_charge_11 - except EmptyError: - temp_sous_calcul_traitement_19 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1446, - start_column=41, - end_line=1446, - end_column=66, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_20 = situation_familiale_calcul_apl_8 - except EmptyError: - temp_sous_calcul_traitement_20 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1449, - start_column=46, - end_line=1449, - end_column=76, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_21 = zone_6 - except EmptyError: - temp_sous_calcul_traitement_21 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1447, - start_column=20, - end_line=1447, - end_column=24, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_22 = location_2.logement_est_chambre - except EmptyError: - temp_sous_calcul_traitement_22 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1453, - start_column=36, - end_line=1453, - end_column=65, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_23 = location_2.agees_ou_handicap_adultes_hebergees_onereux_particuliers - except EmptyError: - temp_sous_calcul_traitement_23 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1456, - start_column=15, - end_line=1456, - end_column=80, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_24 = type_aide_2 - except EmptyError: - temp_sous_calcul_traitement_24 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1457, - start_column=25, - end_line=1457, - end_column=34, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_25 = location_2.colocation - except EmptyError: - temp_sous_calcul_traitement_25 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1454, - start_column=26, - end_line=1454, - end_column=45, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - match_arg_664 = location_2.bailleur - if match_arg_664.code == TypeBailleur_Code.BailleurSocial: - bailleur_1 = match_arg_664.value - temp_sous_calcul_traitement_26 = bailleur_1.reduction_loyer_solidarite_percue - elif match_arg_664.code == TypeBailleur_Code.BailleurPriveAvecConventionnementSocial: - _ = match_arg_664.value - temp_sous_calcul_traitement_26 = money_of_cents_string("0") - elif match_arg_664.code == TypeBailleur_Code.BailleurPrive: - _ = match_arg_664.value - temp_sous_calcul_traitement_26 = money_of_cents_string("0") - except EmptyError: - temp_sous_calcul_traitement_26 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1459, - start_column=16, - end_line=1462, - end_column=39, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_27 = location_2.logement_meuble_d842_2 - except EmptyError: - temp_sous_calcul_traitement_27 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1463, - start_column=38, - end_line=1463, - end_column=69, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_28 = residence_9 - except EmptyError: - temp_sous_calcul_traitement_28 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1464, - start_column=25, - end_line=1464, - end_column=34, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - return calcul_aide_personnalisee_logement_locatif(CalculAidePersonnaliseeLogementLocatifIn(loyer_principal_base_in = temp_sous_calcul_traitement_15, - ressources_menage_arrondies_in = temp_sous_calcul_traitement_16, - beneficiaire_aide_adulte_ou_enfant_handicapes_in = temp_sous_calcul_traitement_17, - date_courante_in = temp_sous_calcul_traitement_18, - nombre_personnes_a_charge_in = temp_sous_calcul_traitement_19, - situation_familiale_calcul_apl_in = temp_sous_calcul_traitement_20, - zone_in = temp_sous_calcul_traitement_21, - logement_est_chambre_in = temp_sous_calcul_traitement_22, - agees_ou_handicap_adultes_hebergees_onereux_particuliers_in = temp_sous_calcul_traitement_23, - type_aide_in = temp_sous_calcul_traitement_24, - colocation_in = temp_sous_calcul_traitement_25, - reduction_loyer_solidarite_in = temp_sous_calcul_traitement_26, - logement_meuble_d842_2_in = temp_sous_calcul_traitement_27, - residence_in = temp_sous_calcul_traitement_28)).traitement_aide_finale( - param0) - temp_sous_calcul_traitement_29 = TraitementFormuleAideFinale(aide_finale_formule = calcul_aide_personnalisee_logement_locatif( - CalculAidePersonnaliseeLogementLocatifIn(loyer_principal_base_in = temp_sous_calcul_traitement_13, - ressources_menage_arrondies_in = temp_sous_calcul_traitement_12, - beneficiaire_aide_adulte_ou_enfant_handicapes_in = temp_sous_calcul_traitement_11, - date_courante_in = temp_sous_calcul_traitement_10, - nombre_personnes_a_charge_in = temp_sous_calcul_traitement_9, - situation_familiale_calcul_apl_in = temp_sous_calcul_traitement_8, - zone_in = temp_sous_calcul_traitement_7, - logement_est_chambre_in = temp_sous_calcul_traitement_6, - agees_ou_handicap_adultes_hebergees_onereux_particuliers_in = temp_sous_calcul_traitement_5, - type_aide_in = temp_sous_calcul_traitement_4, - colocation_in = temp_sous_calcul_traitement_3, - reduction_loyer_solidarite_in = temp_sous_calcul_traitement_2, - logement_meuble_d842_2_in = temp_sous_calcul_traitement_1, - residence_in = temp_sous_calcul_traitement)).aide_finale_formule, - traitement_aide_finale = temp_sous_calcul_traitement_14) - elif match_arg_662.code == CategorieCalculAPL_Code.AccessionPropriete: - proprietaire_2 = match_arg_662.value - try: - temp_sous_calcul_traitement_30 = residence_9 - except EmptyError: - temp_sous_calcul_traitement_30 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1515, - start_column=26, - end_line=1515, - end_column=35, + start_line=1452, + start_column=15, + end_line=1452, + end_column=69, law_headings=["Article D823-9", "Section 1 : Calcul, liquidation et versement des aides", "Chapitre III : Modalités de liquidation et de versement", @@ -24584,14 +23855,14 @@ def calcul_aide_personnalisee_logement(calcul_aide_personnalisee_logement_in:Cal "Partie réglementaire", "Code de la construction et de l'habitation"])) try: - temp_sous_calcul_traitement_31 = date_courante_16 + temp_traitement_formule_5 = date_courante_16 except EmptyError: - temp_sous_calcul_traitement_31 = dead_value + temp_traitement_formule_5 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1503, - start_column=30, - end_line=1503, - end_column=43, + start_line=1448, + start_column=29, + end_line=1448, + end_column=42, law_headings=["Article D823-9", "Section 1 : Calcul, liquidation et versement des aides", "Chapitre III : Modalités de liquidation et de versement", @@ -24600,109 +23871,13 @@ def calcul_aide_personnalisee_logement(calcul_aide_personnalisee_logement_in:Cal "Partie réglementaire", "Code de la construction et de l'habitation"])) try: - temp_sous_calcul_traitement_32 = proprietaire_2.anciennete_logement + temp_traitement_formule_6 = nombre_personnes_a_charge_11 except EmptyError: - temp_sous_calcul_traitement_32 = dead_value + temp_traitement_formule_6 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1514, - start_column=36, - end_line=1514, - end_column=68, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_33 = proprietaire_2.pret.type_pret - except EmptyError: - temp_sous_calcul_traitement_33 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1513, - start_column=26, - end_line=1513, - end_column=53, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_34 = zone_6 - except EmptyError: - temp_sous_calcul_traitement_34 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1502, - start_column=21, - end_line=1502, - end_column=25, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_35 = proprietaire_2.situation_r822_11_13_17 - except EmptyError: - temp_sous_calcul_traitement_35 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1512, - start_column=40, - end_line=1512, - end_column=76, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_36 = proprietaire_2.copropriete - except EmptyError: - temp_sous_calcul_traitement_36 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1511, - start_column=28, - end_line=1511, - end_column=52, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_37 = proprietaire_2.date_entree_logement - except EmptyError: - temp_sous_calcul_traitement_37 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1510, - start_column=37, - end_line=1510, - end_column=70, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_38 = proprietaire_2.local_habite_premiere_fois_beneficiaire - except EmptyError: - temp_sous_calcul_traitement_38 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1509, - start_column=14, - end_line=1509, + start_line=1446, + start_column=41, + end_line=1446, end_column=66, law_headings=["Article D823-9", "Section 1 : Calcul, liquidation et versement des aides", @@ -24712,14 +23887,14 @@ def calcul_aide_personnalisee_logement(calcul_aide_personnalisee_logement_in:Cal "Partie réglementaire", "Code de la construction et de l'habitation"])) try: - temp_sous_calcul_traitement_39 = proprietaire_2.pret.date_signature + temp_traitement_formule_7 = situation_familiale_calcul_apl_8 except EmptyError: - temp_sous_calcul_traitement_39 = dead_value + temp_traitement_formule_7 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1507, - start_column=36, - end_line=1507, - end_column=68, + start_line=1449, + start_column=46, + end_line=1449, + end_column=76, law_headings=["Article D823-9", "Section 1 : Calcul, liquidation et versement des aides", "Chapitre III : Modalités de liquidation et de versement", @@ -24728,13 +23903,45 @@ def calcul_aide_personnalisee_logement(calcul_aide_personnalisee_logement_in:Cal "Partie réglementaire", "Code de la construction et de l'habitation"])) try: - temp_sous_calcul_traitement_40 = proprietaire_2.type_travaux_logement_d832_15 + temp_traitement_formule_8 = zone_6 except EmptyError: - temp_sous_calcul_traitement_40 = dead_value + temp_traitement_formule_8 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1506, - start_column=38, - end_line=1506, + start_line=1447, + start_column=20, + end_line=1447, + end_column=24, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_9 = location_2.logement_est_chambre + except EmptyError: + temp_traitement_formule_9 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1453, + start_column=36, + end_line=1453, + end_column=65, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_10 = location_2.agees_ou_handicap_adultes_hebergees_onereux_particuliers + except EmptyError: + temp_traitement_formule_10 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1456, + start_column=15, + end_line=1456, end_column=80, law_headings=["Article D823-9", "Section 1 : Calcul, liquidation et versement des aides", @@ -24744,14 +23951,14 @@ def calcul_aide_personnalisee_logement(calcul_aide_personnalisee_logement_in:Cal "Partie réglementaire", "Code de la construction et de l'habitation"])) try: - temp_sous_calcul_traitement_41 = situation_familiale_calcul_apl_8 + temp_traitement_formule_11 = type_aide_2 except EmptyError: - temp_sous_calcul_traitement_41 = dead_value + temp_traitement_formule_11 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1504, - start_column=47, - end_line=1504, - end_column=77, + start_line=1457, + start_column=25, + end_line=1457, + end_column=34, law_headings=["Article D823-9", "Section 1 : Calcul, liquidation et versement des aides", "Chapitre III : Modalités de liquidation et de versement", @@ -24760,14 +23967,14 @@ def calcul_aide_personnalisee_logement(calcul_aide_personnalisee_logement_in:Cal "Partie réglementaire", "Code de la construction et de l'habitation"])) try: - temp_sous_calcul_traitement_42 = nombre_personnes_a_charge_11 + temp_traitement_formule_12 = location_2.colocation except EmptyError: - temp_sous_calcul_traitement_42 = dead_value + temp_traitement_formule_12 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1501, - start_column=42, - end_line=1501, - end_column=67, + start_line=1454, + start_column=26, + end_line=1454, + end_column=45, law_headings=["Article D823-9", "Section 1 : Calcul, liquidation et versement des aides", "Chapitre III : Modalités de liquidation et de versement", @@ -24776,9 +23983,109 @@ def calcul_aide_personnalisee_logement(calcul_aide_personnalisee_logement_in:Cal "Partie réglementaire", "Code de la construction et de l'habitation"])) try: - temp_sous_calcul_traitement_43 = ressources_menage_avec_arrondi + match_arg_642 = location_2.bailleur + if match_arg_642.code == TypeBailleur_Code.BailleurSocial: + bailleur = match_arg_642.value + temp_traitement_formule_13 = bailleur.reduction_loyer_solidarite_percue + elif match_arg_642.code == TypeBailleur_Code.BailleurPriveAvecConventionnementSocial: + _ = match_arg_642.value + temp_traitement_formule_13 = money_of_cents_string("0") + elif match_arg_642.code == TypeBailleur_Code.BailleurPrive: + _ = match_arg_642.value + temp_traitement_formule_13 = money_of_cents_string("0") except EmptyError: - temp_sous_calcul_traitement_43 = dead_value + temp_traitement_formule_13 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1459, + start_column=16, + end_line=1462, + end_column=39, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_14 = location_2.logement_meuble_d842_2 + except EmptyError: + temp_traitement_formule_14 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1463, + start_column=38, + end_line=1463, + end_column=69, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_15 = residence_9 + except EmptyError: + temp_traitement_formule_15 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1464, + start_column=25, + end_line=1464, + end_column=34, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + traitement_formule = temp_traitement_formule(calcul_aide_personnalisee_logement_locatif( + CalculAidePersonnaliseeLogementLocatifIn(loyer_principal_base_in = temp_traitement_formule_2, + ressources_menage_arrondies_in = temp_traitement_formule_3, + beneficiaire_aide_adulte_ou_enfant_handicapes_in = temp_traitement_formule_4, + date_courante_in = temp_traitement_formule_5, + nombre_personnes_a_charge_in = temp_traitement_formule_6, + situation_familiale_calcul_apl_in = temp_traitement_formule_7, + zone_in = temp_traitement_formule_8, + logement_est_chambre_in = temp_traitement_formule_9, + agees_ou_handicap_adultes_hebergees_onereux_particuliers_in = temp_traitement_formule_10, + type_aide_in = temp_traitement_formule_11, + colocation_in = temp_traitement_formule_12, + reduction_loyer_solidarite_in = temp_traitement_formule_13, + logement_meuble_d842_2_in = temp_traitement_formule_14, + residence_in = temp_traitement_formule_15))) + temp_sous_calcul_traitement = TraitementFormuleAideFinale(aide_finale_formule = traitement_formule.aide_finale_formule, + traitement_aide_finale = traitement_formule.traitement_aide_finale) + elif match_arg_641.code == CategorieCalculAPL_Code.AccessionPropriete: + proprietaire_2 = match_arg_641.value + def temp_traitement_formule_16(result_20:CalculAidePersonnaliseeLogementAccessionPropriete): + def temp_traitement_formule_17(param0_1:Money): + return result_20.traitement_aide_finale(param0_1) + return CalculAidePersonnaliseeLogementAccessionPropriete(mensualite_eligible = result_20.mensualite_eligible, + mensualite_minimale = result_20.mensualite_minimale, + coefficient_prise_en_charge_d832_10 = result_20.coefficient_prise_en_charge_d832_10, + aide_finale_formule = result_20.aide_finale_formule, + traitement_aide_finale = temp_traitement_formule_17) + try: + temp_traitement_formule_18 = proprietaire_2.mensualite_principale + except EmptyError: + temp_traitement_formule_18 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1505, + start_column=38, + end_line=1505, + end_column=72, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_19 = ressources_menage_avec_arrondi + except EmptyError: + temp_traitement_formule_19 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", start_line=1500, start_column=44, @@ -24792,313 +24099,46 @@ def calcul_aide_personnalisee_logement(calcul_aide_personnalisee_logement_in:Cal "Partie réglementaire", "Code de la construction et de l'habitation"])) try: - temp_sous_calcul_traitement_44 = proprietaire_2.mensualite_principale + temp_traitement_formule_20 = nombre_personnes_a_charge_11 except EmptyError: - temp_sous_calcul_traitement_44 = dead_value + temp_traitement_formule_20 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1505, + start_line=1501, + start_column=42, + end_line=1501, + end_column=67, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_21 = situation_familiale_calcul_apl_8 + except EmptyError: + temp_traitement_formule_21 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1504, + start_column=47, + end_line=1504, + end_column=77, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_22 = proprietaire_2.type_travaux_logement_d832_15 + except EmptyError: + temp_traitement_formule_22 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1506, start_column=38, - end_line=1505, - end_column=72, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - def temp_sous_calcul_traitement_45(param0_1:Money): - try: - temp_sous_calcul_traitement_46 = proprietaire_2.mensualite_principale - except EmptyError: - temp_sous_calcul_traitement_46 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1505, - start_column=38, - end_line=1505, - end_column=72, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_47 = ressources_menage_avec_arrondi - except EmptyError: - temp_sous_calcul_traitement_47 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1500, - start_column=44, - end_line=1500, - end_column=61, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_48 = nombre_personnes_a_charge_11 - except EmptyError: - temp_sous_calcul_traitement_48 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1501, - start_column=42, - end_line=1501, - end_column=67, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_49 = situation_familiale_calcul_apl_8 - except EmptyError: - temp_sous_calcul_traitement_49 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1504, - start_column=47, - end_line=1504, - end_column=77, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_50 = proprietaire_2.type_travaux_logement_d832_15 - except EmptyError: - temp_sous_calcul_traitement_50 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1506, - start_column=38, - end_line=1506, - end_column=80, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_51 = proprietaire_2.pret.date_signature - except EmptyError: - temp_sous_calcul_traitement_51 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1507, - start_column=36, - end_line=1507, - end_column=68, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_52 = proprietaire_2.local_habite_premiere_fois_beneficiaire - except EmptyError: - temp_sous_calcul_traitement_52 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1509, - start_column=14, - end_line=1509, - end_column=66, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_53 = proprietaire_2.date_entree_logement - except EmptyError: - temp_sous_calcul_traitement_53 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1510, - start_column=37, - end_line=1510, - end_column=70, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_54 = proprietaire_2.copropriete - except EmptyError: - temp_sous_calcul_traitement_54 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1511, - start_column=28, - end_line=1511, - end_column=52, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_55 = proprietaire_2.situation_r822_11_13_17 - except EmptyError: - temp_sous_calcul_traitement_55 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1512, - start_column=40, - end_line=1512, - end_column=76, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_56 = zone_6 - except EmptyError: - temp_sous_calcul_traitement_56 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1502, - start_column=21, - end_line=1502, - end_column=25, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_57 = proprietaire_2.pret.type_pret - except EmptyError: - temp_sous_calcul_traitement_57 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1513, - start_column=26, - end_line=1513, - end_column=53, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_58 = proprietaire_2.anciennete_logement - except EmptyError: - temp_sous_calcul_traitement_58 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1514, - start_column=36, - end_line=1514, - end_column=68, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_59 = date_courante_16 - except EmptyError: - temp_sous_calcul_traitement_59 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1503, - start_column=30, - end_line=1503, - end_column=43, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_60 = residence_9 - except EmptyError: - temp_sous_calcul_traitement_60 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1515, - start_column=26, - end_line=1515, - end_column=35, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - return calcul_aide_personnalisee_logement_accession_propriete( - CalculAidePersonnaliseeLogementAccessionProprieteIn(mensualite_principale_in = temp_sous_calcul_traitement_46, - ressources_menage_arrondies_in = temp_sous_calcul_traitement_47, - nombre_personnes_a_charge_in = temp_sous_calcul_traitement_48, - situation_familiale_calcul_apl_in = temp_sous_calcul_traitement_49, - type_travaux_logement_in = temp_sous_calcul_traitement_50, - date_signature_pret_in = temp_sous_calcul_traitement_51, - local_habite_premiere_fois_beneficiaire_in = temp_sous_calcul_traitement_52, - date_entree_logement_in = temp_sous_calcul_traitement_53, - copropriete_in = temp_sous_calcul_traitement_54, - situation_r822_11_13_17_in = temp_sous_calcul_traitement_55, - zone_in = temp_sous_calcul_traitement_56, - type_pret_in = temp_sous_calcul_traitement_57, - anciennete_logement_in = temp_sous_calcul_traitement_58, - date_courante_in = temp_sous_calcul_traitement_59, - residence_in = temp_sous_calcul_traitement_60)).traitement_aide_finale( - param0_1) - temp_sous_calcul_traitement_29 = TraitementFormuleAideFinale(aide_finale_formule = calcul_aide_personnalisee_logement_accession_propriete( - CalculAidePersonnaliseeLogementAccessionProprieteIn(mensualite_principale_in = temp_sous_calcul_traitement_44, - ressources_menage_arrondies_in = temp_sous_calcul_traitement_43, - nombre_personnes_a_charge_in = temp_sous_calcul_traitement_42, - situation_familiale_calcul_apl_in = temp_sous_calcul_traitement_41, - type_travaux_logement_in = temp_sous_calcul_traitement_40, - date_signature_pret_in = temp_sous_calcul_traitement_39, - local_habite_premiere_fois_beneficiaire_in = temp_sous_calcul_traitement_38, - date_entree_logement_in = temp_sous_calcul_traitement_37, - copropriete_in = temp_sous_calcul_traitement_36, - situation_r822_11_13_17_in = temp_sous_calcul_traitement_35, - zone_in = temp_sous_calcul_traitement_34, - type_pret_in = temp_sous_calcul_traitement_33, - anciennete_logement_in = temp_sous_calcul_traitement_32, - date_courante_in = temp_sous_calcul_traitement_31, - residence_in = temp_sous_calcul_traitement_30)).aide_finale_formule, - traitement_aide_finale = temp_sous_calcul_traitement_45) - elif match_arg_662.code == CategorieCalculAPL_Code.LogementFoyer: - logement_foyer_ = match_arg_662.value - def temp_sous_calcul_traitement_61(_:Unit): - raise EmptyError - def temp_sous_calcul_traitement_62(_:Unit): - raise EmptyError - def temp_sous_calcul_traitement_63(_:Unit): - raise EmptyError - try: - temp_sous_calcul_traitement_64 = logement_foyer_.redevance - except EmptyError: - temp_sous_calcul_traitement_64 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1485, - start_column=25, - end_line=1485, - end_column=50, + end_line=1506, + end_column=80, law_headings=["Article D823-9", "Section 1 : Calcul, liquidation et versement des aides", "Chapitre III : Modalités de liquidation et de versement", @@ -25107,14 +24147,14 @@ def calcul_aide_personnalisee_logement(calcul_aide_personnalisee_logement_in:Cal "Partie réglementaire", "Code de la construction et de l'habitation"])) try: - temp_sous_calcul_traitement_65 = date_courante_16 + temp_traitement_formule_23 = proprietaire_2.pret.date_signature except EmptyError: - temp_sous_calcul_traitement_65 = dead_value + temp_traitement_formule_23 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1483, - start_column=29, - end_line=1483, - end_column=42, + start_line=1507, + start_column=36, + end_line=1507, + end_column=68, law_headings=["Article D823-9", "Section 1 : Calcul, liquidation et versement des aides", "Chapitre III : Modalités de liquidation et de versement", @@ -25123,45 +24163,13 @@ def calcul_aide_personnalisee_logement(calcul_aide_personnalisee_logement_in:Cal "Partie réglementaire", "Code de la construction et de l'habitation"])) try: - temp_sous_calcul_traitement_66 = zone_6 + temp_traitement_formule_24 = proprietaire_2.local_habite_premiere_fois_beneficiaire except EmptyError: - temp_sous_calcul_traitement_66 = dead_value + temp_traitement_formule_24 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1481, - start_column=20, - end_line=1481, - end_column=24, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_67 = situation_familiale_calcul_apl_8 - except EmptyError: - temp_sous_calcul_traitement_67 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1484, - start_column=46, - end_line=1484, - end_column=76, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_68 = nombre_personnes_a_charge_11 - except EmptyError: - temp_sous_calcul_traitement_68 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1478, - start_column=41, - end_line=1478, + start_line=1509, + start_column=14, + end_line=1509, end_column=66, law_headings=["Article D823-9", "Section 1 : Calcul, liquidation et versement des aides", @@ -25171,30 +24179,14 @@ def calcul_aide_personnalisee_logement(calcul_aide_personnalisee_logement_in:Cal "Partie réglementaire", "Code de la construction et de l'habitation"])) try: - temp_sous_calcul_traitement_69 = ressources_menage_avec_arrondi + temp_traitement_formule_25 = proprietaire_2.date_entree_logement except EmptyError: - temp_sous_calcul_traitement_69 = dead_value + temp_traitement_formule_25 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1477, - start_column=43, - end_line=1477, - end_column=60, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_70 = logement_foyer_.date_conventionnement - except EmptyError: - temp_sous_calcul_traitement_70 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1487, + start_line=1510, start_column=37, - end_line=1487, - end_column=74, + end_line=1510, + end_column=70, law_headings=["Article D823-9", "Section 1 : Calcul, liquidation et versement des aides", "Chapitre III : Modalités de liquidation et de versement", @@ -25203,14 +24195,14 @@ def calcul_aide_personnalisee_logement(calcul_aide_personnalisee_logement_in:Cal "Partie réglementaire", "Code de la construction et de l'habitation"])) try: - temp_sous_calcul_traitement_71 = logement_foyer_.type + temp_traitement_formule_26 = proprietaire_2.copropriete except EmptyError: - temp_sous_calcul_traitement_71 = dead_value + temp_traitement_formule_26 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1486, - start_column=35, - end_line=1486, - end_column=55, + start_line=1511, + start_column=28, + end_line=1511, + end_column=52, law_headings=["Article D823-9", "Section 1 : Calcul, liquidation et versement des aides", "Chapitre III : Modalités de liquidation et de versement", @@ -25219,9 +24211,153 @@ def calcul_aide_personnalisee_logement(calcul_aide_personnalisee_logement_in:Cal "Partie réglementaire", "Code de la construction et de l'habitation"])) try: - temp_sous_calcul_traitement_72 = logement_foyer_.logement_foyer_jeunes_travailleurs + temp_traitement_formule_27 = proprietaire_2.situation_r822_11_13_17 except EmptyError: - temp_sous_calcul_traitement_72 = dead_value + temp_traitement_formule_27 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1512, + start_column=40, + end_line=1512, + end_column=76, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_28 = zone_6 + except EmptyError: + temp_traitement_formule_28 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1502, + start_column=21, + end_line=1502, + end_column=25, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_29 = proprietaire_2.pret.type_pret + except EmptyError: + temp_traitement_formule_29 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1513, + start_column=26, + end_line=1513, + end_column=53, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_30 = proprietaire_2.anciennete_logement + except EmptyError: + temp_traitement_formule_30 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1514, + start_column=36, + end_line=1514, + end_column=68, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_31 = date_courante_16 + except EmptyError: + temp_traitement_formule_31 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1503, + start_column=30, + end_line=1503, + end_column=43, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_32 = residence_9 + except EmptyError: + temp_traitement_formule_32 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1515, + start_column=26, + end_line=1515, + end_column=35, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + traitement_formule_1 = temp_traitement_formule_16(calcul_aide_personnalisee_logement_accession_propriete( + CalculAidePersonnaliseeLogementAccessionProprieteIn(mensualite_principale_in = temp_traitement_formule_18, + ressources_menage_arrondies_in = temp_traitement_formule_19, + nombre_personnes_a_charge_in = temp_traitement_formule_20, + situation_familiale_calcul_apl_in = temp_traitement_formule_21, + type_travaux_logement_in = temp_traitement_formule_22, + date_signature_pret_in = temp_traitement_formule_23, + local_habite_premiere_fois_beneficiaire_in = temp_traitement_formule_24, + date_entree_logement_in = temp_traitement_formule_25, + copropriete_in = temp_traitement_formule_26, + situation_r822_11_13_17_in = temp_traitement_formule_27, + zone_in = temp_traitement_formule_28, + type_pret_in = temp_traitement_formule_29, + anciennete_logement_in = temp_traitement_formule_30, + date_courante_in = temp_traitement_formule_31, + residence_in = temp_traitement_formule_32))) + temp_sous_calcul_traitement = TraitementFormuleAideFinale(aide_finale_formule = traitement_formule_1.aide_finale_formule, + traitement_aide_finale = traitement_formule_1.traitement_aide_finale) + elif match_arg_641.code == CategorieCalculAPL_Code.LogementFoyer: + logement_foyer_ = match_arg_641.value + def temp_traitement_formule_33(result_21:CalculAidePersonnaliseeLogementFoyer): + def temp_traitement_formule_34(param0_2:Money): + return result_21.traitement_aide_finale(param0_2) + return CalculAidePersonnaliseeLogementFoyer(coefficient_multiplicateur_d832_25 = result_21.coefficient_multiplicateur_d832_25, + coefficient_r_d832_25 = result_21.coefficient_r_d832_25, + n_nombre_parts_d832_25 = result_21.n_nombre_parts_d832_25, + equivalence_loyer_eligible = result_21.equivalence_loyer_eligible, + plafond_equivalence_loyer_eligible = result_21.plafond_equivalence_loyer_eligible, + equivalence_loyer_minimale = result_21.equivalence_loyer_minimale, + coefficient_prise_en_charge_d832_25 = result_21.coefficient_prise_en_charge_d832_25, + aide_finale_formule = result_21.aide_finale_formule, + traitement_aide_finale = temp_traitement_formule_34) + try: + temp_traitement_formule_35 = residence_9 + except EmptyError: + temp_traitement_formule_35 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1482, + start_column=25, + end_line=1482, + end_column=34, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_36 = logement_foyer_.logement_foyer_jeunes_travailleurs + except EmptyError: + temp_traitement_formule_36 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", start_line=1480, start_column=13, @@ -25235,14 +24371,14 @@ def calcul_aide_personnalisee_logement(calcul_aide_personnalisee_logement_in:Cal "Partie réglementaire", "Code de la construction et de l'habitation"])) try: - temp_sous_calcul_traitement_73 = residence_9 + temp_traitement_formule_37 = logement_foyer_.type except EmptyError: - temp_sous_calcul_traitement_73 = dead_value + temp_traitement_formule_37 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1482, - start_column=25, - end_line=1482, - end_column=34, + start_line=1486, + start_column=35, + end_line=1486, + end_column=55, law_headings=["Article D823-9", "Section 1 : Calcul, liquidation et versement des aides", "Chapitre III : Modalités de liquidation et de versement", @@ -25250,204 +24386,142 @@ def calcul_aide_personnalisee_logement(calcul_aide_personnalisee_logement_in:Cal "Livre VIII : Aides personnelles au logement", "Partie réglementaire", "Code de la construction et de l'habitation"])) - def temp_sous_calcul_traitement_74(param0_2:Money): - try: - temp_sous_calcul_traitement_75 = residence_9 - except EmptyError: - temp_sous_calcul_traitement_75 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1482, - start_column=25, - end_line=1482, - end_column=34, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_76 = logement_foyer_.logement_foyer_jeunes_travailleurs - except EmptyError: - temp_sous_calcul_traitement_76 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1480, - start_column=13, - end_line=1480, - end_column=63, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_77 = logement_foyer_.type - except EmptyError: - temp_sous_calcul_traitement_77 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1486, - start_column=35, - end_line=1486, - end_column=55, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_78 = logement_foyer_.date_conventionnement - except EmptyError: - temp_sous_calcul_traitement_78 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1487, - start_column=37, - end_line=1487, - end_column=74, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_79 = ressources_menage_avec_arrondi - except EmptyError: - temp_sous_calcul_traitement_79 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1477, - start_column=43, - end_line=1477, - end_column=60, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_80 = nombre_personnes_a_charge_11 - except EmptyError: - temp_sous_calcul_traitement_80 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1478, - start_column=41, - end_line=1478, - end_column=66, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_81 = situation_familiale_calcul_apl_8 - except EmptyError: - temp_sous_calcul_traitement_81 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1484, - start_column=46, - end_line=1484, - end_column=76, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_82 = zone_6 - except EmptyError: - temp_sous_calcul_traitement_82 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1481, - start_column=20, - end_line=1481, - end_column=24, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_83 = date_courante_16 - except EmptyError: - temp_sous_calcul_traitement_83 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1483, - start_column=29, - end_line=1483, - end_column=42, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_84 = logement_foyer_.redevance - except EmptyError: - temp_sous_calcul_traitement_84 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1485, - start_column=25, - end_line=1485, - end_column=50, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - def temp_sous_calcul_traitement_85(_:Unit): - raise EmptyError - def temp_sous_calcul_traitement_86(_:Unit): - raise EmptyError - def temp_sous_calcul_traitement_87(_:Unit): - raise EmptyError - return calcul_aide_personnalisee_logement_foyer(CalculAidePersonnaliseeLogementFoyerIn(residence_in = temp_sous_calcul_traitement_75, - logement_foyer_jeunes_travailleurs_in = temp_sous_calcul_traitement_76, - type_logement_foyer_in = temp_sous_calcul_traitement_77, - date_conventionnement_in = temp_sous_calcul_traitement_78, - ressources_menage_arrondies_in = temp_sous_calcul_traitement_79, - nombre_personnes_a_charge_in = temp_sous_calcul_traitement_80, - situation_familiale_calcul_apl_in = temp_sous_calcul_traitement_81, - zone_in = temp_sous_calcul_traitement_82, - date_courante_in = temp_sous_calcul_traitement_83, - redevance_in = temp_sous_calcul_traitement_84, - condition_2_du_832_25_in = temp_sous_calcul_traitement_85, - limitation_majoration_personnes_a_charge_in = temp_sous_calcul_traitement_86, - n_nombre_parts_d832_25_in = temp_sous_calcul_traitement_87)).traitement_aide_finale( - param0_2) - temp_sous_calcul_traitement_29 = TraitementFormuleAideFinale(aide_finale_formule = calcul_aide_personnalisee_logement_foyer( - CalculAidePersonnaliseeLogementFoyerIn(residence_in = temp_sous_calcul_traitement_73, - logement_foyer_jeunes_travailleurs_in = temp_sous_calcul_traitement_72, - type_logement_foyer_in = temp_sous_calcul_traitement_71, - date_conventionnement_in = temp_sous_calcul_traitement_70, - ressources_menage_arrondies_in = temp_sous_calcul_traitement_69, - nombre_personnes_a_charge_in = temp_sous_calcul_traitement_68, - situation_familiale_calcul_apl_in = temp_sous_calcul_traitement_67, - zone_in = temp_sous_calcul_traitement_66, - date_courante_in = temp_sous_calcul_traitement_65, - redevance_in = temp_sous_calcul_traitement_64, - condition_2_du_832_25_in = temp_sous_calcul_traitement_63, - limitation_majoration_personnes_a_charge_in = temp_sous_calcul_traitement_62, - n_nombre_parts_d832_25_in = temp_sous_calcul_traitement_61)).aide_finale_formule, - traitement_aide_finale = temp_sous_calcul_traitement_74) + try: + temp_traitement_formule_38 = logement_foyer_.date_conventionnement + except EmptyError: + temp_traitement_formule_38 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1487, + start_column=37, + end_line=1487, + end_column=74, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_39 = ressources_menage_avec_arrondi + except EmptyError: + temp_traitement_formule_39 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1477, + start_column=43, + end_line=1477, + end_column=60, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_40 = nombre_personnes_a_charge_11 + except EmptyError: + temp_traitement_formule_40 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1478, + start_column=41, + end_line=1478, + end_column=66, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_41 = situation_familiale_calcul_apl_8 + except EmptyError: + temp_traitement_formule_41 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1484, + start_column=46, + end_line=1484, + end_column=76, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_42 = zone_6 + except EmptyError: + temp_traitement_formule_42 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1481, + start_column=20, + end_line=1481, + end_column=24, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_43 = date_courante_16 + except EmptyError: + temp_traitement_formule_43 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1483, + start_column=29, + end_line=1483, + end_column=42, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_44 = logement_foyer_.redevance + except EmptyError: + temp_traitement_formule_44 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1485, + start_column=25, + end_line=1485, + end_column=50, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + def temp_traitement_formule_45(_:Unit): + raise EmptyError + def temp_traitement_formule_46(_:Unit): + raise EmptyError + def temp_traitement_formule_47(_:Unit): + raise EmptyError + traitement_formule_2 = temp_traitement_formule_33(calcul_aide_personnalisee_logement_foyer( + CalculAidePersonnaliseeLogementFoyerIn(residence_in = temp_traitement_formule_35, + logement_foyer_jeunes_travailleurs_in = temp_traitement_formule_36, + type_logement_foyer_in = temp_traitement_formule_37, + date_conventionnement_in = temp_traitement_formule_38, + ressources_menage_arrondies_in = temp_traitement_formule_39, + nombre_personnes_a_charge_in = temp_traitement_formule_40, + situation_familiale_calcul_apl_in = temp_traitement_formule_41, + zone_in = temp_traitement_formule_42, + date_courante_in = temp_traitement_formule_43, + redevance_in = temp_traitement_formule_44, + condition_2_du_832_25_in = temp_traitement_formule_45, + limitation_majoration_personnes_a_charge_in = temp_traitement_formule_46, + n_nombre_parts_d832_25_in = temp_traitement_formule_47))) + temp_sous_calcul_traitement = TraitementFormuleAideFinale(aide_finale_formule = traitement_formule_2.aide_finale_formule, + traitement_aide_finale = traitement_formule_2.traitement_aide_finale) except EmptyError: - temp_sous_calcul_traitement_29 = dead_value + temp_sous_calcul_traitement = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", start_line=792, start_column=11, end_line=792, end_column=33, @@ -25455,7 +24529,7 @@ def calcul_aide_personnalisee_logement(calcul_aide_personnalisee_logement_in:Cal "Calcul du montant de l'aide personnalisée au logement", "Déclarations des champs d'application", "Prologue : aides au logement"])) - sous_calcul_traitement = temp_sous_calcul_traitement_29 + sous_calcul_traitement = temp_sous_calcul_traitement def temp_traitement_aide_finale_3(arg:Money): try: return sous_calcul_traitement.traitement_aide_finale(arg) @@ -25508,12 +24582,12 @@ def eligibilite_prime_de_demenagement(eligibilite_prime_de_demenagement_in:Eligi return True def temp_condition_rang_enfant_1(_:Unit): def temp_condition_rang_enfant_2(personne_a_charge_5:PersonneACharge): - match_arg_665 = personne_a_charge_5 - if match_arg_665.code == PersonneACharge_Code.EnfantACharge: - _ = match_arg_665.value + match_arg_643 = personne_a_charge_5 + if match_arg_643.code == PersonneACharge_Code.EnfantACharge: + _ = match_arg_643.value return True - elif match_arg_665.code == PersonneACharge_Code.AutrePersonneACharge: - _ = match_arg_665.value + elif match_arg_643.code == PersonneACharge_Code.AutrePersonneACharge: + _ = match_arg_643.value return False return ((list_length(list_filter(temp_condition_rang_enfant_2, menage_1.personnes_a_charge)) + @@ -25566,8 +24640,8 @@ def eligibilite_prime_de_demenagement(eligibilite_prime_de_demenagement_in:Eligi "Déclarations des champs d'application", "Prologue : aides au logement"])) base_mensuelle_allocations_familiales_dot_date_courante = temp_base_mensuelle_allocations_familiales_dot_date_courante - result_19 = base_mensuelle_allocations_familiales(BaseMensuelleAllocationsFamilialesIn(date_courante_in = base_mensuelle_allocations_familiales_dot_date_courante)) - base_mensuelle_allocations_familiales_dot_montant = result_19.montant + result_22 = base_mensuelle_allocations_familiales(BaseMensuelleAllocationsFamilialesIn(date_courante_in = base_mensuelle_allocations_familiales_dot_date_courante)) + base_mensuelle_allocations_familiales_dot_montant = result_22.montant try: temp_eligibilite_apl_dot_menage = menage_1 except EmptyError: @@ -25610,40 +24684,40 @@ def eligibilite_prime_de_demenagement(eligibilite_prime_de_demenagement_in:Eligi def temp_eligibilite_apl_dot_date_entree_vigueur_differee_cch(_:Unit): raise EmptyError eligibilite_apl_dot_date_entree_vigueur_differee_cch = temp_eligibilite_apl_dot_date_entree_vigueur_differee_cch - result_20 = eligibilite_aides_personnelle_logement(EligibiliteAidesPersonnelleLogementIn(menage_in = eligibilite_apl_dot_menage, + result_23 = eligibilite_aides_personnelle_logement(EligibiliteAidesPersonnelleLogementIn(menage_in = eligibilite_apl_dot_menage, demandeur_in = eligibilite_apl_dot_demandeur, date_courante_in = eligibilite_apl_dot_date_courante, condition_logement_residence_principale_in = eligibilite_apl_dot_condition_logement_residence_principale, condition_logement_surface_in = eligibilite_apl_dot_condition_logement_surface, date_entree_vigueur_differee_cch_in = eligibilite_apl_dot_date_entree_vigueur_differee_cch)) - eligibilite_apl_dot_date_courante_1 = result_20.date_courante - eligibilite_apl_dot_eligibilite = result_20.eligibilite - eligibilite_apl_dot_nombre_personnes_a_charge_prises_en_compte = result_20.nombre_personnes_a_charge_prises_en_compte - eligibilite_apl_dot_coefficents_enfants_garde_alternee_pris_en_compte = result_20.coefficents_enfants_garde_alternee_pris_en_compte - eligibilite_apl_dot_condition_2_r823_4 = result_20.condition_2_r823_4 + eligibilite_apl_dot_date_courante_1 = result_23.date_courante + eligibilite_apl_dot_eligibilite = result_23.eligibilite + eligibilite_apl_dot_nombre_personnes_a_charge_prises_en_compte = result_23.nombre_personnes_a_charge_prises_en_compte + eligibilite_apl_dot_coefficents_enfants_garde_alternee_pris_en_compte = result_23.coefficents_enfants_garde_alternee_pris_en_compte + eligibilite_apl_dot_condition_2_r823_4 = result_23.condition_2_r823_4 try: try: def temp_condition_periode_demenagement(_:Unit): return True def temp_condition_periode_demenagement_1(_:Unit): - match_arg_666 = informations.date_naissance_troisieme_enfant_ou_dernier_si_plus - if match_arg_666.code == DateNaissanceTroisiemeOuDernierPlusEnfant_Code.MoinsDeTroisEnfants: - _ = match_arg_666.value + match_arg_644 = informations.date_naissance_troisieme_enfant_ou_dernier_si_plus + if match_arg_644.code == DateNaissanceTroisiemeOuDernierPlusEnfant_Code.MoinsDeTroisEnfants: + _ = match_arg_644.value return False - elif match_arg_666.code == DateNaissanceTroisiemeOuDernierPlusEnfant_Code.PlusDeTroisEnfants: - date_naissance_ou_grossesse = match_arg_666.value - match_arg_667 = date_naissance_ou_grossesse - if match_arg_667.code == DateDeNaissanceOuMoisDeGrossesse_Code.DateDeNaissance: - date_naissance_2 = match_arg_667.value + elif match_arg_644.code == DateNaissanceTroisiemeOuDernierPlusEnfant_Code.PlusDeTroisEnfants: + date_naissance_ou_grossesse = match_arg_644.value + match_arg_645 = date_naissance_ou_grossesse + if match_arg_645.code == DateDeNaissanceOuMoisDeGrossesse_Code.DateDeNaissance: + date_naissance_2 = match_arg_645.value return (date_courante_17 <= (first_day_of_month((date_naissance_2 + duration_of_numbers(2,0,0))) + duration_of_numbers(0,0,-1))) - elif match_arg_667.code == DateDeNaissanceOuMoisDeGrossesse_Code.AvantPremierJourMoisCivilTroisiemeMoisDeGrossesse: - _ = match_arg_667.value + elif match_arg_645.code == DateDeNaissanceOuMoisDeGrossesse_Code.AvantPremierJourMoisCivilTroisiemeMoisDeGrossesse: + _ = match_arg_645.value return False - elif match_arg_667.code == DateDeNaissanceOuMoisDeGrossesse_Code.ApresPremierJourMoisCivilTroisiemeMoisDeGrossesse: - _ = match_arg_667.value + elif match_arg_645.code == DateDeNaissanceOuMoisDeGrossesse_Code.ApresPremierJourMoisCivilTroisiemeMoisDeGrossesse: + _ = match_arg_645.value return True temp_condition_periode_demenagement_2 = handle_default(SourcePosition(filename="", start_line=0, @@ -25666,23 +24740,23 @@ def eligibilite_prime_de_demenagement(eligibilite_prime_de_demenagement_in:Eligi try: def temp_plafond_d823_22(_:Unit): def temp_plafond_d823_22_1(personne_a_charge_6:PersonneACharge): - match_arg_668 = personne_a_charge_6 - if match_arg_668.code == PersonneACharge_Code.EnfantACharge: - _ = match_arg_668.value + match_arg_646 = personne_a_charge_6 + if match_arg_646.code == PersonneACharge_Code.EnfantACharge: + _ = match_arg_646.value return True - elif match_arg_668.code == PersonneACharge_Code.AutrePersonneACharge: - _ = match_arg_668.value + elif match_arg_646.code == PersonneACharge_Code.AutrePersonneACharge: + _ = match_arg_646.value return False if (list_length(list_filter(temp_plafond_d823_22_1, menage_1.personnes_a_charge)) > integer_of_string("3")): def temp_plafond_d823_22_2(personne_a_charge_7:PersonneACharge): - match_arg_669 = personne_a_charge_7 - if match_arg_669.code == PersonneACharge_Code.EnfantACharge: - _ = match_arg_669.value + match_arg_647 = personne_a_charge_7 + if match_arg_647.code == PersonneACharge_Code.EnfantACharge: + _ = match_arg_647.value return True - elif match_arg_669.code == PersonneACharge_Code.AutrePersonneACharge: - _ = match_arg_669.value + elif match_arg_647.code == PersonneACharge_Code.AutrePersonneACharge: + _ = match_arg_647.value return False temp_plafond_d823_22_3 = (base_mensuelle_allocations_familiales_dot_montant * (decimal_of_integer((list_length(list_filter(temp_plafond_d823_22_2, @@ -25717,33 +24791,33 @@ def eligibilite_prime_de_demenagement(eligibilite_prime_de_demenagement_in:Eligi def temp_eligibilite_3(_:Unit): return False def temp_eligibilite_4(_:Unit): - match_arg_670 = menage_1.residence - if match_arg_670.code == Collectivite_Code.Guadeloupe: - _ = match_arg_670.value + match_arg_648 = menage_1.residence + if match_arg_648.code == Collectivite_Code.Guadeloupe: + _ = match_arg_648.value temp_eligibilite_5 = False - elif match_arg_670.code == Collectivite_Code.Guyane: - _ = match_arg_670.value + elif match_arg_648.code == Collectivite_Code.Guyane: + _ = match_arg_648.value temp_eligibilite_5 = False - elif match_arg_670.code == Collectivite_Code.Martinique: - _ = match_arg_670.value + elif match_arg_648.code == Collectivite_Code.Martinique: + _ = match_arg_648.value temp_eligibilite_5 = False - elif match_arg_670.code == Collectivite_Code.LaReunion: - _ = match_arg_670.value + elif match_arg_648.code == Collectivite_Code.LaReunion: + _ = match_arg_648.value temp_eligibilite_5 = False - elif match_arg_670.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_670.value + elif match_arg_648.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_648.value temp_eligibilite_5 = False - elif match_arg_670.code == Collectivite_Code.SaintMartin: - _ = match_arg_670.value + elif match_arg_648.code == Collectivite_Code.SaintMartin: + _ = match_arg_648.value temp_eligibilite_5 = False - elif match_arg_670.code == Collectivite_Code.Metropole: - _ = match_arg_670.value + elif match_arg_648.code == Collectivite_Code.Metropole: + _ = match_arg_648.value temp_eligibilite_5 = False - elif match_arg_670.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_670.value + elif match_arg_648.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_648.value temp_eligibilite_5 = False - elif match_arg_670.code == Collectivite_Code.Mayotte: - _ = match_arg_670.value + elif match_arg_648.code == Collectivite_Code.Mayotte: + _ = match_arg_648.value temp_eligibilite_5 = True return ((date_courante_17 >= date_of_numbers(2022,1,1)) and @@ -25756,33 +24830,33 @@ def eligibilite_prime_de_demenagement(eligibilite_prime_de_demenagement_in:Eligi temp_eligibilite_4, temp_eligibilite_3) except EmptyError: - match_arg_671 = menage_1.residence - if match_arg_671.code == Collectivite_Code.Guadeloupe: - _ = match_arg_671.value + match_arg_649 = menage_1.residence + if match_arg_649.code == Collectivite_Code.Guadeloupe: + _ = match_arg_649.value temp_eligibilite_7 = False - elif match_arg_671.code == Collectivite_Code.Guyane: - _ = match_arg_671.value + elif match_arg_649.code == Collectivite_Code.Guyane: + _ = match_arg_649.value temp_eligibilite_7 = False - elif match_arg_671.code == Collectivite_Code.Martinique: - _ = match_arg_671.value + elif match_arg_649.code == Collectivite_Code.Martinique: + _ = match_arg_649.value temp_eligibilite_7 = False - elif match_arg_671.code == Collectivite_Code.LaReunion: - _ = match_arg_671.value + elif match_arg_649.code == Collectivite_Code.LaReunion: + _ = match_arg_649.value temp_eligibilite_7 = False - elif match_arg_671.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_671.value + elif match_arg_649.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_649.value temp_eligibilite_7 = False - elif match_arg_671.code == Collectivite_Code.SaintMartin: - _ = match_arg_671.value + elif match_arg_649.code == Collectivite_Code.SaintMartin: + _ = match_arg_649.value temp_eligibilite_7 = False - elif match_arg_671.code == Collectivite_Code.Metropole: - _ = match_arg_671.value + elif match_arg_649.code == Collectivite_Code.Metropole: + _ = match_arg_649.value temp_eligibilite_7 = False - elif match_arg_671.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_671.value + elif match_arg_649.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_649.value temp_eligibilite_7 = True - elif match_arg_671.code == Collectivite_Code.Mayotte: - _ = match_arg_671.value + elif match_arg_649.code == Collectivite_Code.Mayotte: + _ = match_arg_649.value temp_eligibilite_7 = False if ((date_courante_17 >= date_of_numbers(2022,1,1)) and @@ -25792,33 +24866,33 @@ def eligibilite_prime_de_demenagement(eligibilite_prime_de_demenagement_in:Eligi temp_eligibilite_6 = dead_value raise EmptyError except EmptyError: - match_arg_672 = menage_1.residence - if match_arg_672.code == Collectivite_Code.Guadeloupe: - _ = match_arg_672.value + match_arg_650 = menage_1.residence + if match_arg_650.code == Collectivite_Code.Guadeloupe: + _ = match_arg_650.value temp_eligibilite_8 = False - elif match_arg_672.code == Collectivite_Code.Guyane: - _ = match_arg_672.value + elif match_arg_650.code == Collectivite_Code.Guyane: + _ = match_arg_650.value temp_eligibilite_8 = False - elif match_arg_672.code == Collectivite_Code.Martinique: - _ = match_arg_672.value + elif match_arg_650.code == Collectivite_Code.Martinique: + _ = match_arg_650.value temp_eligibilite_8 = False - elif match_arg_672.code == Collectivite_Code.LaReunion: - _ = match_arg_672.value + elif match_arg_650.code == Collectivite_Code.LaReunion: + _ = match_arg_650.value temp_eligibilite_8 = False - elif match_arg_672.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_672.value + elif match_arg_650.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_650.value temp_eligibilite_8 = False - elif match_arg_672.code == Collectivite_Code.SaintMartin: - _ = match_arg_672.value + elif match_arg_650.code == Collectivite_Code.SaintMartin: + _ = match_arg_650.value temp_eligibilite_8 = False - elif match_arg_672.code == Collectivite_Code.Metropole: - _ = match_arg_672.value + elif match_arg_650.code == Collectivite_Code.Metropole: + _ = match_arg_650.value temp_eligibilite_8 = False - elif match_arg_672.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_672.value + elif match_arg_650.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_650.value temp_eligibilite_8 = False - elif match_arg_672.code == Collectivite_Code.Mayotte: - _ = match_arg_672.value + elif match_arg_650.code == Collectivite_Code.Mayotte: + _ = match_arg_650.value temp_eligibilite_8 = True if temp_eligibilite_8: temp_eligibilite_6 = False @@ -25909,13 +24983,13 @@ def eligibilite_allocation_logement(eligibilite_allocation_logement_in:Eligibili def temp_prestations_familiales_dot_age_l512_3_2_5(_:Unit): raise EmptyError prestations_familiales_dot_age_l512_3_2_2 = temp_prestations_familiales_dot_age_l512_3_2_5 - result_21 = eligibilite_prestations_familiales(EligibilitePrestationsFamilialesIn(date_courante_in = prestations_familiales_dot_date_courante_1, + result_24 = eligibilite_prestations_familiales(EligibilitePrestationsFamilialesIn(date_courante_in = prestations_familiales_dot_date_courante_1, residence_in = prestations_familiales_dot_residence_1, age_l512_3_2_in = prestations_familiales_dot_age_l512_3_2_2)) - prestations_familiales_dot_age_l512_3_2_3 = result_21.age_l512_3_2 - prestations_familiales_dot_droit_ouvert_1 = result_21.droit_ouvert - prestations_familiales_dot_conditions_hors_age_1 = result_21.conditions_hors_age - prestations_familiales_dot_regime_outre_mer_l751_1_1 = result_21.regime_outre_mer_l751_1 + prestations_familiales_dot_age_l512_3_2_3 = result_24.age_l512_3_2 + prestations_familiales_dot_droit_ouvert_1 = result_24.droit_ouvert + prestations_familiales_dot_conditions_hors_age_1 = result_24.conditions_hors_age + prestations_familiales_dot_regime_outre_mer_l751_1_1 = result_24.regime_outre_mer_l751_1 try: try: try: @@ -25923,33 +24997,33 @@ def eligibilite_allocation_logement(eligibilite_allocation_logement_in:Eligibili def temp_l_841_1_6_applicable(_:Unit): return False def temp_l_841_1_6_applicable_1(_:Unit): - match_arg_673 = menage_2.residence - if match_arg_673.code == Collectivite_Code.Guadeloupe: - _ = match_arg_673.value + match_arg_651 = menage_2.residence + if match_arg_651.code == Collectivite_Code.Guadeloupe: + _ = match_arg_651.value return False - elif match_arg_673.code == Collectivite_Code.Guyane: - _ = match_arg_673.value + elif match_arg_651.code == Collectivite_Code.Guyane: + _ = match_arg_651.value return False - elif match_arg_673.code == Collectivite_Code.Martinique: - _ = match_arg_673.value + elif match_arg_651.code == Collectivite_Code.Martinique: + _ = match_arg_651.value return False - elif match_arg_673.code == Collectivite_Code.LaReunion: - _ = match_arg_673.value + elif match_arg_651.code == Collectivite_Code.LaReunion: + _ = match_arg_651.value return False - elif match_arg_673.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_673.value + elif match_arg_651.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_651.value return True - elif match_arg_673.code == Collectivite_Code.SaintMartin: - _ = match_arg_673.value + elif match_arg_651.code == Collectivite_Code.SaintMartin: + _ = match_arg_651.value return True - elif match_arg_673.code == Collectivite_Code.Metropole: - _ = match_arg_673.value + elif match_arg_651.code == Collectivite_Code.Metropole: + _ = match_arg_651.value return False - elif match_arg_673.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_673.value + elif match_arg_651.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_651.value return False - elif match_arg_673.code == Collectivite_Code.Mayotte: - _ = match_arg_673.value + elif match_arg_651.code == Collectivite_Code.Mayotte: + _ = match_arg_651.value return False temp_l_841_1_6_applicable_2 = handle_default(SourcePosition(filename="", start_line=0, @@ -25959,33 +25033,33 @@ def eligibilite_allocation_logement(eligibilite_allocation_logement_in:Eligibili temp_l_841_1_6_applicable_1, temp_l_841_1_6_applicable) except EmptyError: - match_arg_674 = menage_2.residence - if match_arg_674.code == Collectivite_Code.Guadeloupe: - _ = match_arg_674.value + match_arg_652 = menage_2.residence + if match_arg_652.code == Collectivite_Code.Guadeloupe: + _ = match_arg_652.value temp_l_841_1_6_applicable_3 = True - elif match_arg_674.code == Collectivite_Code.Guyane: - _ = match_arg_674.value + elif match_arg_652.code == Collectivite_Code.Guyane: + _ = match_arg_652.value temp_l_841_1_6_applicable_3 = True - elif match_arg_674.code == Collectivite_Code.Martinique: - _ = match_arg_674.value + elif match_arg_652.code == Collectivite_Code.Martinique: + _ = match_arg_652.value temp_l_841_1_6_applicable_3 = True - elif match_arg_674.code == Collectivite_Code.LaReunion: - _ = match_arg_674.value + elif match_arg_652.code == Collectivite_Code.LaReunion: + _ = match_arg_652.value temp_l_841_1_6_applicable_3 = True - elif match_arg_674.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_674.value + elif match_arg_652.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_652.value temp_l_841_1_6_applicable_3 = False - elif match_arg_674.code == Collectivite_Code.SaintMartin: - _ = match_arg_674.value + elif match_arg_652.code == Collectivite_Code.SaintMartin: + _ = match_arg_652.value temp_l_841_1_6_applicable_3 = False - elif match_arg_674.code == Collectivite_Code.Metropole: - _ = match_arg_674.value + elif match_arg_652.code == Collectivite_Code.Metropole: + _ = match_arg_652.value temp_l_841_1_6_applicable_3 = False - elif match_arg_674.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_674.value + elif match_arg_652.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_652.value temp_l_841_1_6_applicable_3 = False - elif match_arg_674.code == Collectivite_Code.Mayotte: - _ = match_arg_674.value + elif match_arg_652.code == Collectivite_Code.Mayotte: + _ = match_arg_652.value temp_l_841_1_6_applicable_3 = True if temp_l_841_1_6_applicable_3: temp_l_841_1_6_applicable_2 = False @@ -26012,33 +25086,33 @@ def eligibilite_allocation_logement(eligibilite_allocation_logement_in:Eligibili def temp_l_841_1_2_applicable(_:Unit): return False def temp_l_841_1_2_applicable_1(_:Unit): - match_arg_675 = menage_2.residence - if match_arg_675.code == Collectivite_Code.Guadeloupe: - _ = match_arg_675.value + match_arg_653 = menage_2.residence + if match_arg_653.code == Collectivite_Code.Guadeloupe: + _ = match_arg_653.value return False - elif match_arg_675.code == Collectivite_Code.Guyane: - _ = match_arg_675.value + elif match_arg_653.code == Collectivite_Code.Guyane: + _ = match_arg_653.value return False - elif match_arg_675.code == Collectivite_Code.Martinique: - _ = match_arg_675.value + elif match_arg_653.code == Collectivite_Code.Martinique: + _ = match_arg_653.value return False - elif match_arg_675.code == Collectivite_Code.LaReunion: - _ = match_arg_675.value + elif match_arg_653.code == Collectivite_Code.LaReunion: + _ = match_arg_653.value return False - elif match_arg_675.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_675.value + elif match_arg_653.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_653.value return True - elif match_arg_675.code == Collectivite_Code.SaintMartin: - _ = match_arg_675.value + elif match_arg_653.code == Collectivite_Code.SaintMartin: + _ = match_arg_653.value return True - elif match_arg_675.code == Collectivite_Code.Metropole: - _ = match_arg_675.value + elif match_arg_653.code == Collectivite_Code.Metropole: + _ = match_arg_653.value return False - elif match_arg_675.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_675.value + elif match_arg_653.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_653.value return False - elif match_arg_675.code == Collectivite_Code.Mayotte: - _ = match_arg_675.value + elif match_arg_653.code == Collectivite_Code.Mayotte: + _ = match_arg_653.value return False temp_l_841_1_2_applicable_2 = handle_default(SourcePosition(filename="", start_line=0, @@ -26048,33 +25122,33 @@ def eligibilite_allocation_logement(eligibilite_allocation_logement_in:Eligibili temp_l_841_1_2_applicable_1, temp_l_841_1_2_applicable) except EmptyError: - match_arg_676 = menage_2.residence - if match_arg_676.code == Collectivite_Code.Guadeloupe: - _ = match_arg_676.value + match_arg_654 = menage_2.residence + if match_arg_654.code == Collectivite_Code.Guadeloupe: + _ = match_arg_654.value temp_l_841_1_2_applicable_3 = True - elif match_arg_676.code == Collectivite_Code.Guyane: - _ = match_arg_676.value + elif match_arg_654.code == Collectivite_Code.Guyane: + _ = match_arg_654.value temp_l_841_1_2_applicable_3 = True - elif match_arg_676.code == Collectivite_Code.Martinique: - _ = match_arg_676.value + elif match_arg_654.code == Collectivite_Code.Martinique: + _ = match_arg_654.value temp_l_841_1_2_applicable_3 = True - elif match_arg_676.code == Collectivite_Code.LaReunion: - _ = match_arg_676.value + elif match_arg_654.code == Collectivite_Code.LaReunion: + _ = match_arg_654.value temp_l_841_1_2_applicable_3 = True - elif match_arg_676.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_676.value + elif match_arg_654.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_654.value temp_l_841_1_2_applicable_3 = False - elif match_arg_676.code == Collectivite_Code.SaintMartin: - _ = match_arg_676.value + elif match_arg_654.code == Collectivite_Code.SaintMartin: + _ = match_arg_654.value temp_l_841_1_2_applicable_3 = False - elif match_arg_676.code == Collectivite_Code.Metropole: - _ = match_arg_676.value + elif match_arg_654.code == Collectivite_Code.Metropole: + _ = match_arg_654.value temp_l_841_1_2_applicable_3 = False - elif match_arg_676.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_676.value + elif match_arg_654.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_654.value temp_l_841_1_2_applicable_3 = False - elif match_arg_676.code == Collectivite_Code.Mayotte: - _ = match_arg_676.value + elif match_arg_654.code == Collectivite_Code.Mayotte: + _ = match_arg_654.value temp_l_841_1_2_applicable_3 = True if temp_l_841_1_2_applicable_3: temp_l_841_1_2_applicable_2 = False @@ -26101,33 +25175,33 @@ def eligibilite_allocation_logement(eligibilite_allocation_logement_in:Eligibili def temp_l_841_1_1_applicable(_:Unit): return False def temp_l_841_1_1_applicable_1(_:Unit): - match_arg_677 = menage_2.residence - if match_arg_677.code == Collectivite_Code.Guadeloupe: - _ = match_arg_677.value + match_arg_655 = menage_2.residence + if match_arg_655.code == Collectivite_Code.Guadeloupe: + _ = match_arg_655.value return False - elif match_arg_677.code == Collectivite_Code.Guyane: - _ = match_arg_677.value + elif match_arg_655.code == Collectivite_Code.Guyane: + _ = match_arg_655.value return False - elif match_arg_677.code == Collectivite_Code.Martinique: - _ = match_arg_677.value + elif match_arg_655.code == Collectivite_Code.Martinique: + _ = match_arg_655.value return False - elif match_arg_677.code == Collectivite_Code.LaReunion: - _ = match_arg_677.value + elif match_arg_655.code == Collectivite_Code.LaReunion: + _ = match_arg_655.value return False - elif match_arg_677.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_677.value + elif match_arg_655.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_655.value return True - elif match_arg_677.code == Collectivite_Code.SaintMartin: - _ = match_arg_677.value + elif match_arg_655.code == Collectivite_Code.SaintMartin: + _ = match_arg_655.value return True - elif match_arg_677.code == Collectivite_Code.Metropole: - _ = match_arg_677.value + elif match_arg_655.code == Collectivite_Code.Metropole: + _ = match_arg_655.value return False - elif match_arg_677.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_677.value + elif match_arg_655.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_655.value return False - elif match_arg_677.code == Collectivite_Code.Mayotte: - _ = match_arg_677.value + elif match_arg_655.code == Collectivite_Code.Mayotte: + _ = match_arg_655.value return False temp_l_841_1_1_applicable_2 = handle_default(SourcePosition(filename="", start_line=0, @@ -26137,33 +25211,33 @@ def eligibilite_allocation_logement(eligibilite_allocation_logement_in:Eligibili temp_l_841_1_1_applicable_1, temp_l_841_1_1_applicable) except EmptyError: - match_arg_678 = menage_2.residence - if match_arg_678.code == Collectivite_Code.Guadeloupe: - _ = match_arg_678.value + match_arg_656 = menage_2.residence + if match_arg_656.code == Collectivite_Code.Guadeloupe: + _ = match_arg_656.value temp_l_841_1_1_applicable_3 = True - elif match_arg_678.code == Collectivite_Code.Guyane: - _ = match_arg_678.value + elif match_arg_656.code == Collectivite_Code.Guyane: + _ = match_arg_656.value temp_l_841_1_1_applicable_3 = True - elif match_arg_678.code == Collectivite_Code.Martinique: - _ = match_arg_678.value + elif match_arg_656.code == Collectivite_Code.Martinique: + _ = match_arg_656.value temp_l_841_1_1_applicable_3 = True - elif match_arg_678.code == Collectivite_Code.LaReunion: - _ = match_arg_678.value + elif match_arg_656.code == Collectivite_Code.LaReunion: + _ = match_arg_656.value temp_l_841_1_1_applicable_3 = True - elif match_arg_678.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_678.value + elif match_arg_656.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_656.value temp_l_841_1_1_applicable_3 = False - elif match_arg_678.code == Collectivite_Code.SaintMartin: - _ = match_arg_678.value + elif match_arg_656.code == Collectivite_Code.SaintMartin: + _ = match_arg_656.value temp_l_841_1_1_applicable_3 = False - elif match_arg_678.code == Collectivite_Code.Metropole: - _ = match_arg_678.value + elif match_arg_656.code == Collectivite_Code.Metropole: + _ = match_arg_656.value temp_l_841_1_1_applicable_3 = False - elif match_arg_678.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_678.value + elif match_arg_656.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_656.value temp_l_841_1_1_applicable_3 = False - elif match_arg_678.code == Collectivite_Code.Mayotte: - _ = match_arg_678.value + elif match_arg_656.code == Collectivite_Code.Mayotte: + _ = match_arg_656.value temp_l_841_1_1_applicable_3 = True if temp_l_841_1_1_applicable_3: temp_l_841_1_1_applicable_2 = False @@ -26191,42 +25265,42 @@ def eligibilite_allocation_logement(eligibilite_allocation_logement_in:Eligibili def temp_condition_accession_propriete(_:Unit): return True def temp_condition_accession_propriete_1(_:Unit): - match_arg_679 = menage_2.logement.mode_occupation - if match_arg_679.code == ModeOccupation_Code.Locataire: - _ = match_arg_679.value + match_arg_657 = menage_2.logement.mode_occupation + if match_arg_657.code == ModeOccupation_Code.Locataire: + _ = match_arg_657.value return False - elif match_arg_679.code == ModeOccupation_Code.ResidentLogementFoyer: - _ = match_arg_679.value + elif match_arg_657.code == ModeOccupation_Code.ResidentLogementFoyer: + _ = match_arg_657.value return False - elif match_arg_679.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: - proprietaire_3 = match_arg_679.value - match_arg_680 = proprietaire_3.type_travaux_logement_r842_5 - if match_arg_680.code == TypeTravauxLogementR8425_Code.ObjectifDecenceLogement: - _ = match_arg_680.value + elif match_arg_657.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + proprietaire_3 = match_arg_657.value + match_arg_658 = proprietaire_3.type_travaux_logement_r842_5 + if match_arg_658.code == TypeTravauxLogementR8425_Code.ObjectifDecenceLogement: + _ = match_arg_658.value temp_condition_accession_propriete_2 = False - elif match_arg_680.code == TypeTravauxLogementR8425_Code.PrevuDansListeR321_15: - _ = match_arg_680.value + elif match_arg_658.code == TypeTravauxLogementR8425_Code.PrevuDansListeR321_15: + _ = match_arg_658.value temp_condition_accession_propriete_2 = False - elif match_arg_680.code == TypeTravauxLogementR8425_Code.AgrandirOuRendreHabitableD331_63: - _ = match_arg_680.value + elif match_arg_658.code == TypeTravauxLogementR8425_Code.AgrandirOuRendreHabitableD331_63: + _ = match_arg_658.value temp_condition_accession_propriete_2 = True - elif match_arg_680.code == TypeTravauxLogementR8425_Code.PasDeTravaux: - _ = match_arg_680.value + elif match_arg_658.code == TypeTravauxLogementR8425_Code.PasDeTravaux: + _ = match_arg_658.value temp_condition_accession_propriete_2 = False - match_arg_681 = proprietaire_3.pret.titulaire_pret - if match_arg_681.code == TitulairePret_Code.Demandeur: - _ = match_arg_681.value + match_arg_659 = proprietaire_3.pret.titulaire_pret + if match_arg_659.code == TitulairePret_Code.Demandeur: + _ = match_arg_659.value temp_condition_accession_propriete_3 = True - elif match_arg_681.code == TitulairePret_Code.VendeurQuandDemandeurAContratLocationAccession: - _ = match_arg_681.value + elif match_arg_659.code == TitulairePret_Code.VendeurQuandDemandeurAContratLocationAccession: + _ = match_arg_659.value temp_condition_accession_propriete_3 = False return (temp_condition_accession_propriete_3 and temp_condition_accession_propriete_2) - elif match_arg_679.code == ModeOccupation_Code.SousLocataire: - _ = match_arg_679.value + elif match_arg_657.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_657.value return False - elif match_arg_679.code == ModeOccupation_Code.LocationAccession: - _ = match_arg_679.value + elif match_arg_657.code == ModeOccupation_Code.LocationAccession: + _ = match_arg_657.value return False temp_condition_accession_propriete_4 = handle_default( SourcePosition(filename="", start_line=0, @@ -26235,42 +25309,42 @@ def eligibilite_allocation_logement(eligibilite_allocation_logement_in:Eligibili temp_condition_accession_propriete_1, temp_condition_accession_propriete) except EmptyError: - match_arg_682 = menage_2.logement.mode_occupation - if match_arg_682.code == ModeOccupation_Code.Locataire: - _ = match_arg_682.value + match_arg_660 = menage_2.logement.mode_occupation + if match_arg_660.code == ModeOccupation_Code.Locataire: + _ = match_arg_660.value temp_condition_accession_propriete_5 = False - elif match_arg_682.code == ModeOccupation_Code.ResidentLogementFoyer: - _ = match_arg_682.value + elif match_arg_660.code == ModeOccupation_Code.ResidentLogementFoyer: + _ = match_arg_660.value temp_condition_accession_propriete_5 = False - elif match_arg_682.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: - proprietaire_4 = match_arg_682.value - match_arg_683 = proprietaire_4.type_travaux_logement_r842_5 - if match_arg_683.code == TypeTravauxLogementR8425_Code.ObjectifDecenceLogement: - _ = match_arg_683.value + elif match_arg_660.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + proprietaire_4 = match_arg_660.value + match_arg_661 = proprietaire_4.type_travaux_logement_r842_5 + if match_arg_661.code == TypeTravauxLogementR8425_Code.ObjectifDecenceLogement: + _ = match_arg_661.value temp_condition_accession_propriete_6 = False - elif match_arg_683.code == TypeTravauxLogementR8425_Code.PrevuDansListeR321_15: - _ = match_arg_683.value + elif match_arg_661.code == TypeTravauxLogementR8425_Code.PrevuDansListeR321_15: + _ = match_arg_661.value temp_condition_accession_propriete_6 = True - elif match_arg_683.code == TypeTravauxLogementR8425_Code.AgrandirOuRendreHabitableD331_63: - _ = match_arg_683.value + elif match_arg_661.code == TypeTravauxLogementR8425_Code.AgrandirOuRendreHabitableD331_63: + _ = match_arg_661.value temp_condition_accession_propriete_6 = False - elif match_arg_683.code == TypeTravauxLogementR8425_Code.PasDeTravaux: - _ = match_arg_683.value + elif match_arg_661.code == TypeTravauxLogementR8425_Code.PasDeTravaux: + _ = match_arg_661.value temp_condition_accession_propriete_6 = False - match_arg_684 = proprietaire_4.pret.titulaire_pret - if match_arg_684.code == TitulairePret_Code.Demandeur: - _ = match_arg_684.value + match_arg_662 = proprietaire_4.pret.titulaire_pret + if match_arg_662.code == TitulairePret_Code.Demandeur: + _ = match_arg_662.value temp_condition_accession_propriete_7 = True - elif match_arg_684.code == TitulairePret_Code.VendeurQuandDemandeurAContratLocationAccession: - _ = match_arg_684.value + elif match_arg_662.code == TitulairePret_Code.VendeurQuandDemandeurAContratLocationAccession: + _ = match_arg_662.value temp_condition_accession_propriete_7 = False temp_condition_accession_propriete_5 = (temp_condition_accession_propriete_7 and temp_condition_accession_propriete_6) - elif match_arg_682.code == ModeOccupation_Code.SousLocataire: - _ = match_arg_682.value + elif match_arg_660.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_660.value temp_condition_accession_propriete_5 = False - elif match_arg_682.code == ModeOccupation_Code.LocationAccession: - _ = match_arg_682.value + elif match_arg_660.code == ModeOccupation_Code.LocationAccession: + _ = match_arg_660.value temp_condition_accession_propriete_5 = False if temp_condition_accession_propriete_5: temp_condition_accession_propriete_4 = True @@ -26278,56 +25352,56 @@ def eligibilite_allocation_logement(eligibilite_allocation_logement_in:Eligibili temp_condition_accession_propriete_4 = dead_value raise EmptyError except EmptyError: - match_arg_685 = menage_2.logement.mode_occupation - if match_arg_685.code == ModeOccupation_Code.Locataire: - _ = match_arg_685.value + match_arg_663 = menage_2.logement.mode_occupation + if match_arg_663.code == ModeOccupation_Code.Locataire: + _ = match_arg_663.value temp_condition_accession_propriete_8 = False - elif match_arg_685.code == ModeOccupation_Code.ResidentLogementFoyer: - _ = match_arg_685.value + elif match_arg_663.code == ModeOccupation_Code.ResidentLogementFoyer: + _ = match_arg_663.value temp_condition_accession_propriete_8 = False - elif match_arg_685.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: - proprietaire_5 = match_arg_685.value - match_arg_686 = proprietaire_5.type_travaux_logement_r842_5 - if match_arg_686.code == TypeTravauxLogementR8425_Code.ObjectifDecenceLogement: - _ = match_arg_686.value + elif match_arg_663.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + proprietaire_5 = match_arg_663.value + match_arg_664 = proprietaire_5.type_travaux_logement_r842_5 + if match_arg_664.code == TypeTravauxLogementR8425_Code.ObjectifDecenceLogement: + _ = match_arg_664.value temp_condition_accession_propriete_9 = True - elif match_arg_686.code == TypeTravauxLogementR8425_Code.PrevuDansListeR321_15: - _ = match_arg_686.value + elif match_arg_664.code == TypeTravauxLogementR8425_Code.PrevuDansListeR321_15: + _ = match_arg_664.value temp_condition_accession_propriete_9 = False - elif match_arg_686.code == TypeTravauxLogementR8425_Code.AgrandirOuRendreHabitableD331_63: - _ = match_arg_686.value + elif match_arg_664.code == TypeTravauxLogementR8425_Code.AgrandirOuRendreHabitableD331_63: + _ = match_arg_664.value temp_condition_accession_propriete_9 = False - elif match_arg_686.code == TypeTravauxLogementR8425_Code.PasDeTravaux: - _ = match_arg_686.value + elif match_arg_664.code == TypeTravauxLogementR8425_Code.PasDeTravaux: + _ = match_arg_664.value temp_condition_accession_propriete_9 = False - match_arg_687 = proprietaire_5.type_travaux_logement_r842_5 - if match_arg_687.code == TypeTravauxLogementR8425_Code.ObjectifDecenceLogement: - _ = match_arg_687.value + match_arg_665 = proprietaire_5.type_travaux_logement_r842_5 + if match_arg_665.code == TypeTravauxLogementR8425_Code.ObjectifDecenceLogement: + _ = match_arg_665.value temp_condition_accession_propriete_10 = False - elif match_arg_687.code == TypeTravauxLogementR8425_Code.PrevuDansListeR321_15: - _ = match_arg_687.value + elif match_arg_665.code == TypeTravauxLogementR8425_Code.PrevuDansListeR321_15: + _ = match_arg_665.value temp_condition_accession_propriete_10 = False - elif match_arg_687.code == TypeTravauxLogementR8425_Code.AgrandirOuRendreHabitableD331_63: - _ = match_arg_687.value + elif match_arg_665.code == TypeTravauxLogementR8425_Code.AgrandirOuRendreHabitableD331_63: + _ = match_arg_665.value temp_condition_accession_propriete_10 = False - elif match_arg_687.code == TypeTravauxLogementR8425_Code.PasDeTravaux: - _ = match_arg_687.value + elif match_arg_665.code == TypeTravauxLogementR8425_Code.PasDeTravaux: + _ = match_arg_665.value temp_condition_accession_propriete_10 = True - match_arg_688 = proprietaire_5.pret.titulaire_pret - if match_arg_688.code == TitulairePret_Code.Demandeur: - _ = match_arg_688.value + match_arg_666 = proprietaire_5.pret.titulaire_pret + if match_arg_666.code == TitulairePret_Code.Demandeur: + _ = match_arg_666.value temp_condition_accession_propriete_11 = True - elif match_arg_688.code == TitulairePret_Code.VendeurQuandDemandeurAContratLocationAccession: - _ = match_arg_688.value + elif match_arg_666.code == TitulairePret_Code.VendeurQuandDemandeurAContratLocationAccession: + _ = match_arg_666.value temp_condition_accession_propriete_11 = False temp_condition_accession_propriete_8 = (temp_condition_accession_propriete_11 and (temp_condition_accession_propriete_10 or temp_condition_accession_propriete_9)) - elif match_arg_685.code == ModeOccupation_Code.SousLocataire: - _ = match_arg_685.value + elif match_arg_663.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_663.value temp_condition_accession_propriete_8 = False - elif match_arg_685.code == ModeOccupation_Code.LocationAccession: - _ = match_arg_685.value + elif match_arg_663.code == ModeOccupation_Code.LocationAccession: + _ = match_arg_663.value temp_condition_accession_propriete_8 = False if temp_condition_accession_propriete_8: temp_condition_accession_propriete_4 = True @@ -26335,21 +25409,21 @@ def eligibilite_allocation_logement(eligibilite_allocation_logement_in:Eligibili temp_condition_accession_propriete_4 = dead_value raise EmptyError except EmptyError: - match_arg_689 = menage_2.logement.mode_occupation - if match_arg_689.code == ModeOccupation_Code.Locataire: - _ = match_arg_689.value + match_arg_667 = menage_2.logement.mode_occupation + if match_arg_667.code == ModeOccupation_Code.Locataire: + _ = match_arg_667.value temp_condition_accession_propriete_12 = True - elif match_arg_689.code == ModeOccupation_Code.ResidentLogementFoyer: - _ = match_arg_689.value + elif match_arg_667.code == ModeOccupation_Code.ResidentLogementFoyer: + _ = match_arg_667.value temp_condition_accession_propriete_12 = True - elif match_arg_689.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: - _ = match_arg_689.value + elif match_arg_667.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + _ = match_arg_667.value temp_condition_accession_propriete_12 = False - elif match_arg_689.code == ModeOccupation_Code.SousLocataire: - _ = match_arg_689.value + elif match_arg_667.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_667.value temp_condition_accession_propriete_12 = True - elif match_arg_689.code == ModeOccupation_Code.LocationAccession: - _ = match_arg_689.value + elif match_arg_667.code == ModeOccupation_Code.LocationAccession: + _ = match_arg_667.value temp_condition_accession_propriete_12 = True if temp_condition_accession_propriete_12: temp_condition_accession_propriete_4 = True @@ -26368,21 +25442,21 @@ def eligibilite_allocation_logement(eligibilite_allocation_logement_in:Eligibili "Prologue : aides au logement"])) condition_accession_propriete = temp_condition_accession_propriete_4 try: - match_arg_690 = menage_2.logement.mode_occupation - if match_arg_690.code == ModeOccupation_Code.Locataire: - _ = match_arg_690.value + match_arg_668 = menage_2.logement.mode_occupation + if match_arg_668.code == ModeOccupation_Code.Locataire: + _ = match_arg_668.value temp___18 = False - elif match_arg_690.code == ModeOccupation_Code.ResidentLogementFoyer: - _ = match_arg_690.value + elif match_arg_668.code == ModeOccupation_Code.ResidentLogementFoyer: + _ = match_arg_668.value temp___18 = False - elif match_arg_690.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: - _ = match_arg_690.value + elif match_arg_668.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + _ = match_arg_668.value temp___18 = True - elif match_arg_690.code == ModeOccupation_Code.SousLocataire: - _ = match_arg_690.value + elif match_arg_668.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_668.value temp___18 = False - elif match_arg_690.code == ModeOccupation_Code.LocationAccession: - _ = match_arg_690.value + elif match_arg_668.code == ModeOccupation_Code.LocationAccession: + _ = match_arg_668.value temp___18 = False temp___19 = not (demandeur_2.personne_hebergee_centre_soin_l_L162_22_3_securite_sociale and (temp___18 or @@ -26447,21 +25521,21 @@ def eligibilite_allocation_logement(eligibilite_allocation_logement_in:Eligibili def temp_eligibilite_commune_dot_condition_logement_residence_principale_1(_:Unit): return True def temp_eligibilite_commune_dot_condition_logement_residence_principale_2(_:Unit): - match_arg_691 = menage_2.logement.mode_occupation - if match_arg_691.code == ModeOccupation_Code.Locataire: - _ = match_arg_691.value + match_arg_669 = menage_2.logement.mode_occupation + if match_arg_669.code == ModeOccupation_Code.Locataire: + _ = match_arg_669.value return False - elif match_arg_691.code == ModeOccupation_Code.ResidentLogementFoyer: - logement_foyer = match_arg_691.value + elif match_arg_669.code == ModeOccupation_Code.ResidentLogementFoyer: + logement_foyer = match_arg_669.value return logement_foyer.construit_application_loi_1957_12_III - elif match_arg_691.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: - _ = match_arg_691.value + elif match_arg_669.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + _ = match_arg_669.value return False - elif match_arg_691.code == ModeOccupation_Code.SousLocataire: - _ = match_arg_691.value + elif match_arg_669.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_669.value return False - elif match_arg_691.code == ModeOccupation_Code.LocationAccession: - _ = match_arg_691.value + elif match_arg_669.code == ModeOccupation_Code.LocationAccession: + _ = match_arg_669.value return False return handle_default(SourcePosition(filename="", start_line=0, start_column=1, end_line=0, end_column=1, @@ -26473,21 +25547,21 @@ def eligibilite_allocation_logement(eligibilite_allocation_logement_in:Eligibili def temp_eligibilite_commune_dot_condition_logement_surface_1(_:Unit): return True def temp_eligibilite_commune_dot_condition_logement_surface_2(_:Unit): - match_arg_692 = menage_2.logement.mode_occupation - if match_arg_692.code == ModeOccupation_Code.Locataire: - _ = match_arg_692.value + match_arg_670 = menage_2.logement.mode_occupation + if match_arg_670.code == ModeOccupation_Code.Locataire: + _ = match_arg_670.value return False - elif match_arg_692.code == ModeOccupation_Code.ResidentLogementFoyer: - logement_foyer_1 = match_arg_692.value + elif match_arg_670.code == ModeOccupation_Code.ResidentLogementFoyer: + logement_foyer_1 = match_arg_670.value return logement_foyer_1.construit_application_loi_1957_12_III - elif match_arg_692.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: - _ = match_arg_692.value + elif match_arg_670.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + _ = match_arg_670.value return False - elif match_arg_692.code == ModeOccupation_Code.SousLocataire: - _ = match_arg_692.value + elif match_arg_670.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_670.value return False - elif match_arg_692.code == ModeOccupation_Code.LocationAccession: - _ = match_arg_692.value + elif match_arg_670.code == ModeOccupation_Code.LocationAccession: + _ = match_arg_670.value return False return handle_default(SourcePosition(filename="", start_line=0, start_column=1, end_line=0, end_column=1, @@ -26498,17 +25572,17 @@ def eligibilite_allocation_logement(eligibilite_allocation_logement_in:Eligibili def temp_eligibilite_commune_dot_date_entree_vigueur_differee_cch(_:Unit): raise EmptyError eligibilite_commune_dot_date_entree_vigueur_differee_cch = temp_eligibilite_commune_dot_date_entree_vigueur_differee_cch - result_22 = eligibilite_aides_personnelle_logement(EligibiliteAidesPersonnelleLogementIn(menage_in = eligibilite_commune_dot_menage, + result_25 = eligibilite_aides_personnelle_logement(EligibiliteAidesPersonnelleLogementIn(menage_in = eligibilite_commune_dot_menage, demandeur_in = eligibilite_commune_dot_demandeur, date_courante_in = eligibilite_commune_dot_date_courante, condition_logement_residence_principale_in = eligibilite_commune_dot_condition_logement_residence_principale, condition_logement_surface_in = eligibilite_commune_dot_condition_logement_surface, date_entree_vigueur_differee_cch_in = eligibilite_commune_dot_date_entree_vigueur_differee_cch)) - eligibilite_commune_dot_date_courante_1 = result_22.date_courante - eligibilite_commune_dot_eligibilite = result_22.eligibilite - eligibilite_commune_dot_nombre_personnes_a_charge_prises_en_compte = result_22.nombre_personnes_a_charge_prises_en_compte - eligibilite_commune_dot_coefficents_enfants_garde_alternee_pris_en_compte = result_22.coefficents_enfants_garde_alternee_pris_en_compte - eligibilite_commune_dot_condition_2_r823_4 = result_22.condition_2_r823_4 + eligibilite_commune_dot_date_courante_1 = result_25.date_courante + eligibilite_commune_dot_eligibilite = result_25.eligibilite + eligibilite_commune_dot_nombre_personnes_a_charge_prises_en_compte = result_25.nombre_personnes_a_charge_prises_en_compte + eligibilite_commune_dot_coefficents_enfants_garde_alternee_pris_en_compte = result_25.coefficents_enfants_garde_alternee_pris_en_compte + eligibilite_commune_dot_condition_2_r823_4 = result_25.condition_2_r823_4 try: temp_coefficents_enfants_garde_alternee_pris_en_compte_3 = eligibilite_commune_dot_coefficents_enfants_garde_alternee_pris_en_compte except EmptyError: @@ -26562,33 +25636,33 @@ def eligibilite_allocation_logement(eligibilite_allocation_logement_in:Eligibili def temp_eligibilite_allocation_logement_familiale(_:Unit): return True def temp_eligibilite_allocation_logement_familiale_1(_:Unit): - match_arg_693 = menage_2.residence - if match_arg_693.code == Collectivite_Code.Guadeloupe: - _ = match_arg_693.value + match_arg_671 = menage_2.residence + if match_arg_671.code == Collectivite_Code.Guadeloupe: + _ = match_arg_671.value temp_eligibilite_allocation_logement_familiale_2 = False - elif match_arg_693.code == Collectivite_Code.Guyane: - _ = match_arg_693.value + elif match_arg_671.code == Collectivite_Code.Guyane: + _ = match_arg_671.value temp_eligibilite_allocation_logement_familiale_2 = False - elif match_arg_693.code == Collectivite_Code.Martinique: - _ = match_arg_693.value + elif match_arg_671.code == Collectivite_Code.Martinique: + _ = match_arg_671.value temp_eligibilite_allocation_logement_familiale_2 = False - elif match_arg_693.code == Collectivite_Code.LaReunion: - _ = match_arg_693.value + elif match_arg_671.code == Collectivite_Code.LaReunion: + _ = match_arg_671.value temp_eligibilite_allocation_logement_familiale_2 = False - elif match_arg_693.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_693.value + elif match_arg_671.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_671.value temp_eligibilite_allocation_logement_familiale_2 = True - elif match_arg_693.code == Collectivite_Code.SaintMartin: - _ = match_arg_693.value + elif match_arg_671.code == Collectivite_Code.SaintMartin: + _ = match_arg_671.value temp_eligibilite_allocation_logement_familiale_2 = True - elif match_arg_693.code == Collectivite_Code.Metropole: - _ = match_arg_693.value + elif match_arg_671.code == Collectivite_Code.Metropole: + _ = match_arg_671.value temp_eligibilite_allocation_logement_familiale_2 = False - elif match_arg_693.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_693.value + elif match_arg_671.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_671.value temp_eligibilite_allocation_logement_familiale_2 = False - elif match_arg_693.code == Collectivite_Code.Mayotte: - _ = match_arg_693.value + elif match_arg_671.code == Collectivite_Code.Mayotte: + _ = match_arg_671.value temp_eligibilite_allocation_logement_familiale_2 = False return (temp_eligibilite_allocation_logement_familiale_2 and demandeur_2.est_non_salarie_agricole_l781_8_l_781_46_code_rural) @@ -26602,45 +25676,45 @@ def eligibilite_allocation_logement(eligibilite_allocation_logement_in:Eligibili temp_eligibilite_allocation_logement_familiale) except EmptyError: def temp_eligibilite_allocation_logement_familiale_4(personne_a_charge_8:PersonneACharge): - match_arg_694 = personne_a_charge_8 - if match_arg_694.code == PersonneACharge_Code.EnfantACharge: - enfant_10 = match_arg_694.value + match_arg_672 = personne_a_charge_8 + if match_arg_672.code == PersonneACharge_Code.EnfantACharge: + enfant_10 = match_arg_672.value return prestations_familiales_dot_droit_ouvert_1( EnfantPrestationsFamiliales(identifiant = enfant_10.identifiant, obligation_scolaire = enfant_10.obligation_scolaire, remuneration_mensuelle = enfant_10.remuneration_mensuelle, date_de_naissance = enfant_10.date_de_naissance, a_deja_ouvert_droit_aux_allocations_familiales = enfant_10.a_deja_ouvert_droit_aux_allocations_familiales)) - elif match_arg_694.code == PersonneACharge_Code.AutrePersonneACharge: - _ = match_arg_694.value + elif match_arg_672.code == PersonneACharge_Code.AutrePersonneACharge: + _ = match_arg_672.value return False - match_arg_695 = menage_2.residence - if match_arg_695.code == Collectivite_Code.Guadeloupe: - _ = match_arg_695.value + match_arg_673 = menage_2.residence + if match_arg_673.code == Collectivite_Code.Guadeloupe: + _ = match_arg_673.value temp_eligibilite_allocation_logement_familiale_5 = False - elif match_arg_695.code == Collectivite_Code.Guyane: - _ = match_arg_695.value + elif match_arg_673.code == Collectivite_Code.Guyane: + _ = match_arg_673.value temp_eligibilite_allocation_logement_familiale_5 = False - elif match_arg_695.code == Collectivite_Code.Martinique: - _ = match_arg_695.value + elif match_arg_673.code == Collectivite_Code.Martinique: + _ = match_arg_673.value temp_eligibilite_allocation_logement_familiale_5 = False - elif match_arg_695.code == Collectivite_Code.LaReunion: - _ = match_arg_695.value + elif match_arg_673.code == Collectivite_Code.LaReunion: + _ = match_arg_673.value temp_eligibilite_allocation_logement_familiale_5 = False - elif match_arg_695.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_695.value + elif match_arg_673.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_673.value temp_eligibilite_allocation_logement_familiale_5 = True - elif match_arg_695.code == Collectivite_Code.SaintMartin: - _ = match_arg_695.value + elif match_arg_673.code == Collectivite_Code.SaintMartin: + _ = match_arg_673.value temp_eligibilite_allocation_logement_familiale_5 = True - elif match_arg_695.code == Collectivite_Code.Metropole: - _ = match_arg_695.value + elif match_arg_673.code == Collectivite_Code.Metropole: + _ = match_arg_673.value temp_eligibilite_allocation_logement_familiale_5 = False - elif match_arg_695.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_695.value + elif match_arg_673.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_673.value temp_eligibilite_allocation_logement_familiale_5 = False - elif match_arg_695.code == Collectivite_Code.Mayotte: - _ = match_arg_695.value + elif match_arg_673.code == Collectivite_Code.Mayotte: + _ = match_arg_673.value temp_eligibilite_allocation_logement_familiale_5 = False if (temp_eligibilite_allocation_logement_familiale_5 and (list_length(list_filter(temp_eligibilite_allocation_logement_familiale_4, @@ -26651,33 +25725,33 @@ def eligibilite_allocation_logement(eligibilite_allocation_logement_in:Eligibili temp_eligibilite_allocation_logement_familiale_3 = dead_value raise EmptyError except EmptyError: - match_arg_696 = menage_2.residence - if match_arg_696.code == Collectivite_Code.Guadeloupe: - _ = match_arg_696.value + match_arg_674 = menage_2.residence + if match_arg_674.code == Collectivite_Code.Guadeloupe: + _ = match_arg_674.value temp_eligibilite_allocation_logement_familiale_6 = True - elif match_arg_696.code == Collectivite_Code.Guyane: - _ = match_arg_696.value + elif match_arg_674.code == Collectivite_Code.Guyane: + _ = match_arg_674.value temp_eligibilite_allocation_logement_familiale_6 = True - elif match_arg_696.code == Collectivite_Code.Martinique: - _ = match_arg_696.value + elif match_arg_674.code == Collectivite_Code.Martinique: + _ = match_arg_674.value temp_eligibilite_allocation_logement_familiale_6 = True - elif match_arg_696.code == Collectivite_Code.LaReunion: - _ = match_arg_696.value + elif match_arg_674.code == Collectivite_Code.LaReunion: + _ = match_arg_674.value temp_eligibilite_allocation_logement_familiale_6 = True - elif match_arg_696.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_696.value + elif match_arg_674.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_674.value temp_eligibilite_allocation_logement_familiale_6 = False - elif match_arg_696.code == Collectivite_Code.SaintMartin: - _ = match_arg_696.value + elif match_arg_674.code == Collectivite_Code.SaintMartin: + _ = match_arg_674.value temp_eligibilite_allocation_logement_familiale_6 = False - elif match_arg_696.code == Collectivite_Code.Metropole: - _ = match_arg_696.value + elif match_arg_674.code == Collectivite_Code.Metropole: + _ = match_arg_674.value temp_eligibilite_allocation_logement_familiale_6 = False - elif match_arg_696.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_696.value + elif match_arg_674.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_674.value temp_eligibilite_allocation_logement_familiale_6 = False - elif match_arg_696.code == Collectivite_Code.Mayotte: - _ = match_arg_696.value + elif match_arg_674.code == Collectivite_Code.Mayotte: + _ = match_arg_674.value temp_eligibilite_allocation_logement_familiale_6 = True if (temp_eligibilite_allocation_logement_familiale_6 and demandeur_2.est_non_salarie_agricole_l781_8_l_781_46_code_rural): @@ -26687,45 +25761,45 @@ def eligibilite_allocation_logement(eligibilite_allocation_logement_in:Eligibili raise EmptyError except EmptyError: def temp_eligibilite_allocation_logement_familiale_7(personne_a_charge_9:PersonneACharge): - match_arg_697 = personne_a_charge_9 - if match_arg_697.code == PersonneACharge_Code.EnfantACharge: - enfant_11 = match_arg_697.value + match_arg_675 = personne_a_charge_9 + if match_arg_675.code == PersonneACharge_Code.EnfantACharge: + enfant_11 = match_arg_675.value return prestations_familiales_dot_droit_ouvert_1( EnfantPrestationsFamiliales(identifiant = enfant_11.identifiant, obligation_scolaire = enfant_11.obligation_scolaire, remuneration_mensuelle = enfant_11.remuneration_mensuelle, date_de_naissance = enfant_11.date_de_naissance, a_deja_ouvert_droit_aux_allocations_familiales = enfant_11.a_deja_ouvert_droit_aux_allocations_familiales)) - elif match_arg_697.code == PersonneACharge_Code.AutrePersonneACharge: - _ = match_arg_697.value + elif match_arg_675.code == PersonneACharge_Code.AutrePersonneACharge: + _ = match_arg_675.value return False - match_arg_698 = menage_2.residence - if match_arg_698.code == Collectivite_Code.Guadeloupe: - _ = match_arg_698.value + match_arg_676 = menage_2.residence + if match_arg_676.code == Collectivite_Code.Guadeloupe: + _ = match_arg_676.value temp_eligibilite_allocation_logement_familiale_8 = True - elif match_arg_698.code == Collectivite_Code.Guyane: - _ = match_arg_698.value + elif match_arg_676.code == Collectivite_Code.Guyane: + _ = match_arg_676.value temp_eligibilite_allocation_logement_familiale_8 = True - elif match_arg_698.code == Collectivite_Code.Martinique: - _ = match_arg_698.value + elif match_arg_676.code == Collectivite_Code.Martinique: + _ = match_arg_676.value temp_eligibilite_allocation_logement_familiale_8 = True - elif match_arg_698.code == Collectivite_Code.LaReunion: - _ = match_arg_698.value + elif match_arg_676.code == Collectivite_Code.LaReunion: + _ = match_arg_676.value temp_eligibilite_allocation_logement_familiale_8 = True - elif match_arg_698.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_698.value + elif match_arg_676.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_676.value temp_eligibilite_allocation_logement_familiale_8 = False - elif match_arg_698.code == Collectivite_Code.SaintMartin: - _ = match_arg_698.value + elif match_arg_676.code == Collectivite_Code.SaintMartin: + _ = match_arg_676.value temp_eligibilite_allocation_logement_familiale_8 = False - elif match_arg_698.code == Collectivite_Code.Metropole: - _ = match_arg_698.value + elif match_arg_676.code == Collectivite_Code.Metropole: + _ = match_arg_676.value temp_eligibilite_allocation_logement_familiale_8 = False - elif match_arg_698.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_698.value + elif match_arg_676.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_676.value temp_eligibilite_allocation_logement_familiale_8 = False - elif match_arg_698.code == Collectivite_Code.Mayotte: - _ = match_arg_698.value + elif match_arg_676.code == Collectivite_Code.Mayotte: + _ = match_arg_676.value temp_eligibilite_allocation_logement_familiale_8 = True if (temp_eligibilite_allocation_logement_familiale_8 and (list_length(list_filter(temp_eligibilite_allocation_logement_familiale_7, @@ -26736,26 +25810,26 @@ def eligibilite_allocation_logement(eligibilite_allocation_logement_in:Eligibili temp_eligibilite_allocation_logement_familiale_3 = dead_value raise EmptyError except EmptyError: - match_arg_699 = menage_2.situation_familiale - if match_arg_699.code == SituationFamiliale_Code.Celibataire: - _ = match_arg_699.value + match_arg_677 = menage_2.situation_familiale + if match_arg_677.code == SituationFamiliale_Code.Celibataire: + _ = match_arg_677.value temp_eligibilite_allocation_logement_familiale_9 = ((list_length(menage_2.personnes_a_charge) == integer_of_string("0")) and menage_2.enfant_a_naitre_apres_quatrieme_mois_grossesse) - elif match_arg_699.code == SituationFamiliale_Code.Maries: - _ = match_arg_699.value + elif match_arg_677.code == SituationFamiliale_Code.Maries: + _ = match_arg_677.value temp_eligibilite_allocation_logement_familiale_9 = False - elif match_arg_699.code == SituationFamiliale_Code.Pacses: - _ = match_arg_699.value + elif match_arg_677.code == SituationFamiliale_Code.Pacses: + _ = match_arg_677.value temp_eligibilite_allocation_logement_familiale_9 = False - elif match_arg_699.code == SituationFamiliale_Code.Concubins: - _ = match_arg_699.value + elif match_arg_677.code == SituationFamiliale_Code.Concubins: + _ = match_arg_677.value temp_eligibilite_allocation_logement_familiale_9 = False - elif match_arg_699.code == SituationFamiliale_Code.CelibataireSepareDeFait: - _ = match_arg_699.value + elif match_arg_677.code == SituationFamiliale_Code.CelibataireSepareDeFait: + _ = match_arg_677.value temp_eligibilite_allocation_logement_familiale_9 = False - elif match_arg_699.code == SituationFamiliale_Code.ConcubinageDontSepareDeFait: - _ = match_arg_699.value + elif match_arg_677.code == SituationFamiliale_Code.ConcubinageDontSepareDeFait: + _ = match_arg_677.value temp_eligibilite_allocation_logement_familiale_9 = False if (l_841_1_6_applicable and temp_eligibilite_allocation_logement_familiale_9): @@ -26765,12 +25839,12 @@ def eligibilite_allocation_logement(eligibilite_allocation_logement_in:Eligibili raise EmptyError except EmptyError: def temp_eligibilite_allocation_logement_familiale_10(personne_a_charge_10:PersonneACharge): - match_arg_700 = personne_a_charge_10 - if match_arg_700.code == PersonneACharge_Code.EnfantACharge: - enfant_12 = match_arg_700.value + match_arg_678 = personne_a_charge_10 + if match_arg_678.code == PersonneACharge_Code.EnfantACharge: + enfant_12 = match_arg_678.value return False - elif match_arg_700.code == PersonneACharge_Code.AutrePersonneACharge: - parent_3 = match_arg_700.value + elif match_arg_678.code == PersonneACharge_Code.AutrePersonneACharge: + parent_3 = match_arg_678.value return (parent_3.ascendant_descendant_collateral_deuxieme_troisieme_degre and parent_3.incapacite_80_pourcent_ou_restriction_emploi) if (list_length(list_filter(temp_eligibilite_allocation_logement_familiale_10, @@ -26792,38 +25866,38 @@ def eligibilite_allocation_logement(eligibilite_allocation_logement_in:Eligibili temp_eligibilite_allocation_logement_familiale_3 = dead_value raise EmptyError except EmptyError: - match_arg_701 = menage_2.situation_familiale - if match_arg_701.code == SituationFamiliale_Code.Celibataire: - _ = match_arg_701.value + match_arg_679 = menage_2.situation_familiale + if match_arg_679.code == SituationFamiliale_Code.Celibataire: + _ = match_arg_679.value temp_eligibilite_allocation_logement_familiale_12 = False - elif match_arg_701.code == SituationFamiliale_Code.Maries: - date_mariage = match_arg_701.value + elif match_arg_679.code == SituationFamiliale_Code.Maries: + date_mariage = match_arg_679.value temp_eligibilite_allocation_logement_familiale_12 = (date_courante_18 <= (date_mariage + duree_l841_1_3)) - elif match_arg_701.code == SituationFamiliale_Code.Pacses: - _ = match_arg_701.value + elif match_arg_679.code == SituationFamiliale_Code.Pacses: + _ = match_arg_679.value temp_eligibilite_allocation_logement_familiale_12 = False - elif match_arg_701.code == SituationFamiliale_Code.Concubins: - _ = match_arg_701.value + elif match_arg_679.code == SituationFamiliale_Code.Concubins: + _ = match_arg_679.value temp_eligibilite_allocation_logement_familiale_12 = False - elif match_arg_701.code == SituationFamiliale_Code.CelibataireSepareDeFait: - _ = match_arg_701.value + elif match_arg_679.code == SituationFamiliale_Code.CelibataireSepareDeFait: + _ = match_arg_679.value temp_eligibilite_allocation_logement_familiale_12 = False - elif match_arg_701.code == SituationFamiliale_Code.ConcubinageDontSepareDeFait: - _ = match_arg_701.value + elif match_arg_679.code == SituationFamiliale_Code.ConcubinageDontSepareDeFait: + _ = match_arg_679.value temp_eligibilite_allocation_logement_familiale_12 = False def temp_eligibilite_allocation_logement_familiale_13(personne_a_charge_12:PersonneACharge): - match_arg_702 = personne_a_charge_12 - if match_arg_702.code == PersonneACharge_Code.EnfantACharge: - enfant_13 = match_arg_702.value + match_arg_680 = personne_a_charge_12 + if match_arg_680.code == PersonneACharge_Code.EnfantACharge: + enfant_13 = match_arg_680.value return not prestations_familiales_dot_droit_ouvert_1( EnfantPrestationsFamiliales(identifiant = enfant_13.identifiant, obligation_scolaire = enfant_13.obligation_scolaire, remuneration_mensuelle = enfant_13.remuneration_mensuelle, date_de_naissance = enfant_13.date_de_naissance, a_deja_ouvert_droit_aux_allocations_familiales = enfant_13.a_deja_ouvert_droit_aux_allocations_familiales)) - elif match_arg_702.code == PersonneACharge_Code.AutrePersonneACharge: - _ = match_arg_702.value + elif match_arg_680.code == PersonneACharge_Code.AutrePersonneACharge: + _ = match_arg_680.value return False if ((list_length(list_filter(temp_eligibilite_allocation_logement_familiale_13, menage_2.personnes_a_charge)) == @@ -26835,17 +25909,17 @@ def eligibilite_allocation_logement(eligibilite_allocation_logement_in:Eligibili raise EmptyError except EmptyError: def temp_eligibilite_allocation_logement_familiale_14(personne_a_charge_13:PersonneACharge): - match_arg_703 = personne_a_charge_13 - if match_arg_703.code == PersonneACharge_Code.EnfantACharge: - enfant_14 = match_arg_703.value + match_arg_681 = personne_a_charge_13 + if match_arg_681.code == PersonneACharge_Code.EnfantACharge: + enfant_14 = match_arg_681.value return prestations_familiales_dot_droit_ouvert_1( EnfantPrestationsFamiliales(identifiant = enfant_14.identifiant, obligation_scolaire = enfant_14.obligation_scolaire, remuneration_mensuelle = enfant_14.remuneration_mensuelle, date_de_naissance = enfant_14.date_de_naissance, a_deja_ouvert_droit_aux_allocations_familiales = enfant_14.a_deja_ouvert_droit_aux_allocations_familiales)) - elif match_arg_703.code == PersonneACharge_Code.AutrePersonneACharge: - _ = match_arg_703.value + elif match_arg_681.code == PersonneACharge_Code.AutrePersonneACharge: + _ = match_arg_681.value return False if (l_841_1_2_applicable and (list_length(list_filter(temp_eligibilite_allocation_logement_familiale_14, @@ -26919,33 +25993,33 @@ def eligibilite_allocation_logement(eligibilite_allocation_logement_in:Eligibili return TypeEligibiliteAllocationLogement(TypeEligibiliteAllocationLogement_Code.PasEligible, Unit()) def temp_eligibilite_l841_2_7(_:Unit): - match_arg_704 = menage_2.residence - if match_arg_704.code == Collectivite_Code.Guadeloupe: - _ = match_arg_704.value + match_arg_682 = menage_2.residence + if match_arg_682.code == Collectivite_Code.Guadeloupe: + _ = match_arg_682.value temp_eligibilite_l841_2_8 = False - elif match_arg_704.code == Collectivite_Code.Guyane: - _ = match_arg_704.value + elif match_arg_682.code == Collectivite_Code.Guyane: + _ = match_arg_682.value temp_eligibilite_l841_2_8 = False - elif match_arg_704.code == Collectivite_Code.Martinique: - _ = match_arg_704.value + elif match_arg_682.code == Collectivite_Code.Martinique: + _ = match_arg_682.value temp_eligibilite_l841_2_8 = False - elif match_arg_704.code == Collectivite_Code.LaReunion: - _ = match_arg_704.value + elif match_arg_682.code == Collectivite_Code.LaReunion: + _ = match_arg_682.value temp_eligibilite_l841_2_8 = False - elif match_arg_704.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_704.value + elif match_arg_682.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_682.value temp_eligibilite_l841_2_8 = False - elif match_arg_704.code == Collectivite_Code.SaintMartin: - _ = match_arg_704.value + elif match_arg_682.code == Collectivite_Code.SaintMartin: + _ = match_arg_682.value temp_eligibilite_l841_2_8 = False - elif match_arg_704.code == Collectivite_Code.Metropole: - _ = match_arg_704.value + elif match_arg_682.code == Collectivite_Code.Metropole: + _ = match_arg_682.value temp_eligibilite_l841_2_8 = False - elif match_arg_704.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_704.value + elif match_arg_682.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_682.value temp_eligibilite_l841_2_8 = False - elif match_arg_704.code == Collectivite_Code.Mayotte: - _ = match_arg_704.value + elif match_arg_682.code == Collectivite_Code.Mayotte: + _ = match_arg_682.value temp_eligibilite_l841_2_8 = True return (temp_eligibilite_l841_2_8 and demandeur_2.magistrat_fonctionnaire_centre_interets_materiels_familiaux_hors_mayotte) @@ -26956,61 +26030,61 @@ def eligibilite_allocation_logement(eligibilite_allocation_logement_in:Eligibili temp_eligibilite_l841_2_7, temp_eligibilite_l841_2_6) except EmptyError: - match_arg_705 = menage_2.logement.mode_occupation - if match_arg_705.code == ModeOccupation_Code.Locataire: - _ = match_arg_705.value + match_arg_683 = menage_2.logement.mode_occupation + if match_arg_683.code == ModeOccupation_Code.Locataire: + _ = match_arg_683.value temp_eligibilite_l841_2_9 = False - elif match_arg_705.code == ModeOccupation_Code.ResidentLogementFoyer: - _ = match_arg_705.value + elif match_arg_683.code == ModeOccupation_Code.ResidentLogementFoyer: + _ = match_arg_683.value temp_eligibilite_l841_2_9 = False - elif match_arg_705.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: - proprietaire_6 = match_arg_705.value - match_arg_706 = proprietaire_6.pret.accord_financement_representant_Etat_outre_mer - if match_arg_706.code == AccordFinancementRepresentantEtatOutreMer_Code.Accord: - date_accord = match_arg_706.value + elif match_arg_683.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + proprietaire_6 = match_arg_683.value + match_arg_684 = proprietaire_6.pret.accord_financement_representant_Etat_outre_mer + if match_arg_684.code == AccordFinancementRepresentantEtatOutreMer_Code.Accord: + date_accord = match_arg_684.value temp_eligibilite_l841_2_10 = (date_accord <= date_of_numbers(2018,12,31)) - elif match_arg_706.code == AccordFinancementRepresentantEtatOutreMer_Code.PasdAccord: - _ = match_arg_706.value + elif match_arg_684.code == AccordFinancementRepresentantEtatOutreMer_Code.PasdAccord: + _ = match_arg_684.value temp_eligibilite_l841_2_10 = False temp_eligibilite_l841_2_9 = ((proprietaire_6.pret.date_signature > date_of_numbers(2017,12,31)) or ((proprietaire_6.pret.date_signature > date_of_numbers(2019,12,31)) and temp_eligibilite_l841_2_10)) - elif match_arg_705.code == ModeOccupation_Code.SousLocataire: - _ = match_arg_705.value + elif match_arg_683.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_683.value temp_eligibilite_l841_2_9 = False - elif match_arg_705.code == ModeOccupation_Code.LocationAccession: - _ = match_arg_705.value + elif match_arg_683.code == ModeOccupation_Code.LocationAccession: + _ = match_arg_683.value temp_eligibilite_l841_2_9 = False - match_arg_707 = menage_2.residence - if match_arg_707.code == Collectivite_Code.Guadeloupe: - _ = match_arg_707.value + match_arg_685 = menage_2.residence + if match_arg_685.code == Collectivite_Code.Guadeloupe: + _ = match_arg_685.value temp_eligibilite_l841_2_11 = True - elif match_arg_707.code == Collectivite_Code.Guyane: - _ = match_arg_707.value + elif match_arg_685.code == Collectivite_Code.Guyane: + _ = match_arg_685.value temp_eligibilite_l841_2_11 = True - elif match_arg_707.code == Collectivite_Code.Martinique: - _ = match_arg_707.value + elif match_arg_685.code == Collectivite_Code.Martinique: + _ = match_arg_685.value temp_eligibilite_l841_2_11 = True - elif match_arg_707.code == Collectivite_Code.LaReunion: - _ = match_arg_707.value + elif match_arg_685.code == Collectivite_Code.LaReunion: + _ = match_arg_685.value temp_eligibilite_l841_2_11 = True - elif match_arg_707.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_707.value + elif match_arg_685.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_685.value temp_eligibilite_l841_2_11 = False - elif match_arg_707.code == Collectivite_Code.SaintMartin: - _ = match_arg_707.value + elif match_arg_685.code == Collectivite_Code.SaintMartin: + _ = match_arg_685.value temp_eligibilite_l841_2_11 = False - elif match_arg_707.code == Collectivite_Code.Metropole: - _ = match_arg_707.value + elif match_arg_685.code == Collectivite_Code.Metropole: + _ = match_arg_685.value temp_eligibilite_l841_2_11 = False - elif match_arg_707.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_707.value + elif match_arg_685.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_685.value temp_eligibilite_l841_2_11 = False - elif match_arg_707.code == Collectivite_Code.Mayotte: - _ = match_arg_707.value + elif match_arg_685.code == Collectivite_Code.Mayotte: + _ = match_arg_685.value temp_eligibilite_l841_2_11 = True if (temp_eligibilite_l841_2_11 and temp_eligibilite_l841_2_9): @@ -27019,22 +26093,22 @@ def eligibilite_allocation_logement(eligibilite_allocation_logement_in:Eligibili else: raise EmptyError except EmptyError: - match_arg_708 = menage_2.logement.mode_occupation - if match_arg_708.code == ModeOccupation_Code.Locataire: - _ = match_arg_708.value + match_arg_686 = menage_2.logement.mode_occupation + if match_arg_686.code == ModeOccupation_Code.Locataire: + _ = match_arg_686.value temp_eligibilite_l841_2_12 = False - elif match_arg_708.code == ModeOccupation_Code.ResidentLogementFoyer: - _ = match_arg_708.value + elif match_arg_686.code == ModeOccupation_Code.ResidentLogementFoyer: + _ = match_arg_686.value temp_eligibilite_l841_2_12 = False - elif match_arg_708.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: - proprietaire_7 = match_arg_708.value + elif match_arg_686.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + proprietaire_7 = match_arg_686.value temp_eligibilite_l841_2_12 = (proprietaire_7.pret.date_signature > date_of_numbers(2017,12,31)) - elif match_arg_708.code == ModeOccupation_Code.SousLocataire: - _ = match_arg_708.value + elif match_arg_686.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_686.value temp_eligibilite_l841_2_12 = False - elif match_arg_708.code == ModeOccupation_Code.LocationAccession: - _ = match_arg_708.value + elif match_arg_686.code == ModeOccupation_Code.LocationAccession: + _ = match_arg_686.value temp_eligibilite_l841_2_12 = False if temp_eligibilite_l841_2_12: return TypeEligibiliteAllocationLogement(TypeEligibiliteAllocationLogement_Code.PasEligible, @@ -27073,44 +26147,44 @@ def eligibilite_aide_personnalisee_logement(eligibilite_aide_personnalisee_logem def temp_caracteristiques_pret_l831_1_1_1(_:Unit): return True def temp_caracteristiques_pret_l831_1_1_2(_:Unit): - match_arg_709 = pret.type_pret - if match_arg_709.code == TypePret_Code.D331_32: - _ = match_arg_709.value + match_arg_687 = pret.type_pret + if match_arg_687.code == TypePret_Code.D331_32: + _ = match_arg_687.value temp_caracteristiques_pret_l831_1_1_3 = False - elif match_arg_709.code == TypePret_Code.D331_63_64: - _ = match_arg_709.value + elif match_arg_687.code == TypePret_Code.D331_63_64: + _ = match_arg_687.value temp_caracteristiques_pret_l831_1_1_3 = False - elif match_arg_709.code == TypePret_Code.D331_59_8: - _ = match_arg_709.value + elif match_arg_687.code == TypePret_Code.D331_59_8: + _ = match_arg_687.value temp_caracteristiques_pret_l831_1_1_3 = False - elif match_arg_709.code == TypePret_Code.D331_76_1: - _ = match_arg_709.value + elif match_arg_687.code == TypePret_Code.D331_76_1: + _ = match_arg_687.value temp_caracteristiques_pret_l831_1_1_3 = True - elif match_arg_709.code == TypePret_Code.Autre: - _ = match_arg_709.value + elif match_arg_687.code == TypePret_Code.Autre: + _ = match_arg_687.value temp_caracteristiques_pret_l831_1_1_3 = False - match_arg_710 = pret.type_pret - if match_arg_710.code == TypePret_Code.D331_32: - _ = match_arg_710.value + match_arg_688 = pret.type_pret + if match_arg_688.code == TypePret_Code.D331_32: + _ = match_arg_688.value temp_caracteristiques_pret_l831_1_1_4 = False - elif match_arg_710.code == TypePret_Code.D331_63_64: - _ = match_arg_710.value + elif match_arg_688.code == TypePret_Code.D331_63_64: + _ = match_arg_688.value temp_caracteristiques_pret_l831_1_1_4 = False - elif match_arg_710.code == TypePret_Code.D331_59_8: - _ = match_arg_710.value + elif match_arg_688.code == TypePret_Code.D331_59_8: + _ = match_arg_688.value temp_caracteristiques_pret_l831_1_1_4 = True - elif match_arg_710.code == TypePret_Code.D331_76_1: - _ = match_arg_710.value + elif match_arg_688.code == TypePret_Code.D331_76_1: + _ = match_arg_688.value temp_caracteristiques_pret_l831_1_1_4 = False - elif match_arg_710.code == TypePret_Code.Autre: - _ = match_arg_710.value + elif match_arg_688.code == TypePret_Code.Autre: + _ = match_arg_688.value temp_caracteristiques_pret_l831_1_1_4 = False - match_arg_711 = pret.titulaire_pret - if match_arg_711.code == TitulairePret_Code.Demandeur: - _ = match_arg_711.value + match_arg_689 = pret.titulaire_pret + if match_arg_689.code == TitulairePret_Code.Demandeur: + _ = match_arg_689.value temp_caracteristiques_pret_l831_1_1_5 = False - elif match_arg_711.code == TitulairePret_Code.VendeurQuandDemandeurAContratLocationAccession: - _ = match_arg_711.value + elif match_arg_689.code == TitulairePret_Code.VendeurQuandDemandeurAContratLocationAccession: + _ = match_arg_689.value temp_caracteristiques_pret_l831_1_1_5 = True return (temp_caracteristiques_pret_l831_1_1_5 and (temp_caracteristiques_pret_l831_1_1_4 or @@ -27122,44 +26196,44 @@ def eligibilite_aide_personnalisee_logement(eligibilite_aide_personnalisee_logem temp_caracteristiques_pret_l831_1_1_2, temp_caracteristiques_pret_l831_1_1_1) except EmptyError: - match_arg_712 = pret.type_pret - if match_arg_712.code == TypePret_Code.D331_32: - _ = match_arg_712.value + match_arg_690 = pret.type_pret + if match_arg_690.code == TypePret_Code.D331_32: + _ = match_arg_690.value temp_caracteristiques_pret_l831_1_1_6 = False - elif match_arg_712.code == TypePret_Code.D331_63_64: - _ = match_arg_712.value + elif match_arg_690.code == TypePret_Code.D331_63_64: + _ = match_arg_690.value temp_caracteristiques_pret_l831_1_1_6 = True - elif match_arg_712.code == TypePret_Code.D331_59_8: - _ = match_arg_712.value + elif match_arg_690.code == TypePret_Code.D331_59_8: + _ = match_arg_690.value temp_caracteristiques_pret_l831_1_1_6 = False - elif match_arg_712.code == TypePret_Code.D331_76_1: - _ = match_arg_712.value + elif match_arg_690.code == TypePret_Code.D331_76_1: + _ = match_arg_690.value temp_caracteristiques_pret_l831_1_1_6 = False - elif match_arg_712.code == TypePret_Code.Autre: - _ = match_arg_712.value + elif match_arg_690.code == TypePret_Code.Autre: + _ = match_arg_690.value temp_caracteristiques_pret_l831_1_1_6 = False - match_arg_713 = pret.type_pret - if match_arg_713.code == TypePret_Code.D331_32: - _ = match_arg_713.value + match_arg_691 = pret.type_pret + if match_arg_691.code == TypePret_Code.D331_32: + _ = match_arg_691.value temp_caracteristiques_pret_l831_1_1_7 = True - elif match_arg_713.code == TypePret_Code.D331_63_64: - _ = match_arg_713.value + elif match_arg_691.code == TypePret_Code.D331_63_64: + _ = match_arg_691.value temp_caracteristiques_pret_l831_1_1_7 = False - elif match_arg_713.code == TypePret_Code.D331_59_8: - _ = match_arg_713.value + elif match_arg_691.code == TypePret_Code.D331_59_8: + _ = match_arg_691.value temp_caracteristiques_pret_l831_1_1_7 = False - elif match_arg_713.code == TypePret_Code.D331_76_1: - _ = match_arg_713.value + elif match_arg_691.code == TypePret_Code.D331_76_1: + _ = match_arg_691.value temp_caracteristiques_pret_l831_1_1_7 = False - elif match_arg_713.code == TypePret_Code.Autre: - _ = match_arg_713.value + elif match_arg_691.code == TypePret_Code.Autre: + _ = match_arg_691.value temp_caracteristiques_pret_l831_1_1_7 = False - match_arg_714 = pret.titulaire_pret - if match_arg_714.code == TitulairePret_Code.Demandeur: - _ = match_arg_714.value + match_arg_692 = pret.titulaire_pret + if match_arg_692.code == TitulairePret_Code.Demandeur: + _ = match_arg_692.value temp_caracteristiques_pret_l831_1_1_8 = True - elif match_arg_714.code == TitulairePret_Code.VendeurQuandDemandeurAContratLocationAccession: - _ = match_arg_714.value + elif match_arg_692.code == TitulairePret_Code.VendeurQuandDemandeurAContratLocationAccession: + _ = match_arg_692.value temp_caracteristiques_pret_l831_1_1_8 = False if (temp_caracteristiques_pret_l831_1_1_8 and (temp_caracteristiques_pret_l831_1_1_7 or @@ -27233,21 +26307,21 @@ def eligibilite_aide_personnalisee_logement(eligibilite_aide_personnalisee_logem def temp_eligibilite_commune_dot_date_entree_vigueur_differee_cch_2(_:Unit): return date_of_numbers(2021,5,1) def temp_eligibilite_commune_dot_date_entree_vigueur_differee_cch_3(_:Unit): - match_arg_715 = menage_3.logement.mode_occupation - if match_arg_715.code == ModeOccupation_Code.Locataire: - _ = match_arg_715.value + match_arg_693 = menage_3.logement.mode_occupation + if match_arg_693.code == ModeOccupation_Code.Locataire: + _ = match_arg_693.value return False - elif match_arg_715.code == ModeOccupation_Code.ResidentLogementFoyer: - _ = match_arg_715.value + elif match_arg_693.code == ModeOccupation_Code.ResidentLogementFoyer: + _ = match_arg_693.value return False - elif match_arg_715.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: - _ = match_arg_715.value + elif match_arg_693.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + _ = match_arg_693.value return True - elif match_arg_715.code == ModeOccupation_Code.SousLocataire: - _ = match_arg_715.value + elif match_arg_693.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_693.value return False - elif match_arg_715.code == ModeOccupation_Code.LocationAccession: - _ = match_arg_715.value + elif match_arg_693.code == ModeOccupation_Code.LocationAccession: + _ = match_arg_693.value return False return handle_default(SourcePosition(filename="", start_line=0, start_column=1, end_line=0, end_column=1, @@ -27255,31 +26329,31 @@ def eligibilite_aide_personnalisee_logement(eligibilite_aide_personnalisee_logem temp_eligibilite_commune_dot_date_entree_vigueur_differee_cch_3, temp_eligibilite_commune_dot_date_entree_vigueur_differee_cch_2) eligibilite_commune_dot_date_entree_vigueur_differee_cch_1 = temp_eligibilite_commune_dot_date_entree_vigueur_differee_cch_1 - result_23 = eligibilite_aides_personnelle_logement(EligibiliteAidesPersonnelleLogementIn(menage_in = eligibilite_commune_dot_menage_1, + result_26 = eligibilite_aides_personnelle_logement(EligibiliteAidesPersonnelleLogementIn(menage_in = eligibilite_commune_dot_menage_1, demandeur_in = eligibilite_commune_dot_demandeur_1, date_courante_in = eligibilite_commune_dot_date_courante_2, condition_logement_residence_principale_in = eligibilite_commune_dot_condition_logement_residence_principale_1, condition_logement_surface_in = eligibilite_commune_dot_condition_logement_surface_1, date_entree_vigueur_differee_cch_in = eligibilite_commune_dot_date_entree_vigueur_differee_cch_1)) - eligibilite_commune_dot_date_courante_3 = result_23.date_courante - eligibilite_commune_dot_eligibilite_1 = result_23.eligibilite - eligibilite_commune_dot_nombre_personnes_a_charge_prises_en_compte_1 = result_23.nombre_personnes_a_charge_prises_en_compte - eligibilite_commune_dot_coefficents_enfants_garde_alternee_pris_en_compte_1 = result_23.coefficents_enfants_garde_alternee_pris_en_compte - eligibilite_commune_dot_condition_2_r823_4_1 = result_23.condition_2_r823_4 + eligibilite_commune_dot_date_courante_3 = result_26.date_courante + eligibilite_commune_dot_eligibilite_1 = result_26.eligibilite + eligibilite_commune_dot_nombre_personnes_a_charge_prises_en_compte_1 = result_26.nombre_personnes_a_charge_prises_en_compte + eligibilite_commune_dot_coefficents_enfants_garde_alternee_pris_en_compte_1 = result_26.coefficents_enfants_garde_alternee_pris_en_compte + eligibilite_commune_dot_condition_2_r823_4_1 = result_26.condition_2_r823_4 try: try: def temp_logement_situe_commune_desequilibre_l831_2(_:Unit): return True def temp_logement_situe_commune_desequilibre_l831_2_1(_:Unit): - match_arg_716 = menage_3.logement.zone - if match_arg_716.code == ZoneDHabitation_Code.Zone1: - _ = match_arg_716.value + match_arg_694 = menage_3.logement.zone + if match_arg_694.code == ZoneDHabitation_Code.Zone1: + _ = match_arg_694.value temp_logement_situe_commune_desequilibre_l831_2_2 = False - elif match_arg_716.code == ZoneDHabitation_Code.Zone2: - _ = match_arg_716.value + elif match_arg_694.code == ZoneDHabitation_Code.Zone2: + _ = match_arg_694.value temp_logement_situe_commune_desequilibre_l831_2_2 = False - elif match_arg_716.code == ZoneDHabitation_Code.Zone3: - _ = match_arg_716.value + elif match_arg_694.code == ZoneDHabitation_Code.Zone3: + _ = match_arg_694.value temp_logement_situe_commune_desequilibre_l831_2_2 = True return ((date_courante_19 >= date_of_numbers(2019,10,1)) and temp_logement_situe_commune_desequilibre_l831_2_2) @@ -27310,21 +26384,21 @@ def eligibilite_aide_personnalisee_logement(eligibilite_aide_personnalisee_logem def temp_condition_logement_bailleur_3(_:Unit): return True def temp_condition_logement_bailleur_4(_:Unit): - match_arg_717 = menage_3.logement.mode_occupation - if match_arg_717.code == ModeOccupation_Code.Locataire: - _ = match_arg_717.value + match_arg_695 = menage_3.logement.mode_occupation + if match_arg_695.code == ModeOccupation_Code.Locataire: + _ = match_arg_695.value return False - elif match_arg_717.code == ModeOccupation_Code.ResidentLogementFoyer: - _ = match_arg_717.value + elif match_arg_695.code == ModeOccupation_Code.ResidentLogementFoyer: + _ = match_arg_695.value return False - elif match_arg_717.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: - _ = match_arg_717.value + elif match_arg_695.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + _ = match_arg_695.value return False - elif match_arg_717.code == ModeOccupation_Code.SousLocataire: - _ = match_arg_717.value + elif match_arg_695.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_695.value return False - elif match_arg_717.code == ModeOccupation_Code.LocationAccession: - propriete = match_arg_717.value + elif match_arg_695.code == ModeOccupation_Code.LocationAccession: + propriete = match_arg_695.value return caracteristiques_pret_l831_1_6(propriete.pret) return handle_default(SourcePosition(filename="", start_line=0, start_column=1, @@ -27333,52 +26407,52 @@ def eligibilite_aide_personnalisee_logement(eligibilite_aide_personnalisee_logem temp_condition_logement_bailleur_4, temp_condition_logement_bailleur_3) except EmptyError: - match_arg_718 = menage_3.logement.mode_occupation - if match_arg_718.code == ModeOccupation_Code.Locataire: - location_3 = match_arg_718.value - match_arg_719 = location_3.bailleur - if match_arg_719.code == TypeBailleur_Code.BailleurSocial: - convention = match_arg_719.value + match_arg_696 = menage_3.logement.mode_occupation + if match_arg_696.code == ModeOccupation_Code.Locataire: + location_3 = match_arg_696.value + match_arg_697 = location_3.bailleur + if match_arg_697.code == TypeBailleur_Code.BailleurSocial: + convention = match_arg_697.value temp_condition_logement_bailleur_5 = convention.conventionne_livre_III_titre_V_chap_III - elif match_arg_719.code == TypeBailleur_Code.BailleurPriveAvecConventionnementSocial: - convention_1 = match_arg_719.value + elif match_arg_697.code == TypeBailleur_Code.BailleurPriveAvecConventionnementSocial: + convention_1 = match_arg_697.value temp_condition_logement_bailleur_5 = convention_1.conventionne_livre_III_titre_II_chap_I_sec_3 - elif match_arg_719.code == TypeBailleur_Code.BailleurPrive: - _ = match_arg_719.value + elif match_arg_697.code == TypeBailleur_Code.BailleurPrive: + _ = match_arg_697.value temp_condition_logement_bailleur_5 = False - elif match_arg_718.code == ModeOccupation_Code.ResidentLogementFoyer: - _ = match_arg_718.value + elif match_arg_696.code == ModeOccupation_Code.ResidentLogementFoyer: + _ = match_arg_696.value temp_condition_logement_bailleur_5 = False - elif match_arg_718.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: - _ = match_arg_718.value + elif match_arg_696.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + _ = match_arg_696.value temp_condition_logement_bailleur_5 = False - elif match_arg_718.code == ModeOccupation_Code.SousLocataire: - _ = match_arg_718.value + elif match_arg_696.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_696.value temp_condition_logement_bailleur_5 = False - elif match_arg_718.code == ModeOccupation_Code.LocationAccession: - _ = match_arg_718.value + elif match_arg_696.code == ModeOccupation_Code.LocationAccession: + _ = match_arg_696.value temp_condition_logement_bailleur_5 = False if temp_condition_logement_bailleur_5: return True else: raise EmptyError except EmptyError: - match_arg_720 = menage_3.logement.mode_occupation - if match_arg_720.code == ModeOccupation_Code.Locataire: - _ = match_arg_720.value + match_arg_698 = menage_3.logement.mode_occupation + if match_arg_698.code == ModeOccupation_Code.Locataire: + _ = match_arg_698.value temp_condition_logement_bailleur_6 = False - elif match_arg_720.code == ModeOccupation_Code.ResidentLogementFoyer: - _ = match_arg_720.value + elif match_arg_698.code == ModeOccupation_Code.ResidentLogementFoyer: + _ = match_arg_698.value temp_condition_logement_bailleur_6 = False - elif match_arg_720.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: - propriete_1 = match_arg_720.value + elif match_arg_698.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + propriete_1 = match_arg_698.value temp_condition_logement_bailleur_6 = caracteristiques_pret_l831_1_1( propriete_1.pret) - elif match_arg_720.code == ModeOccupation_Code.SousLocataire: - _ = match_arg_720.value + elif match_arg_698.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_698.value temp_condition_logement_bailleur_6 = False - elif match_arg_720.code == ModeOccupation_Code.LocationAccession: - _ = match_arg_720.value + elif match_arg_698.code == ModeOccupation_Code.LocationAccession: + _ = match_arg_698.value temp_condition_logement_bailleur_6 = False if temp_condition_logement_bailleur_6: return True @@ -27390,61 +26464,61 @@ def eligibilite_aide_personnalisee_logement(eligibilite_aide_personnalisee_logem def temp_condition_logement_bailleur_8(_:Unit): return False def temp_condition_logement_bailleur_9(_:Unit): - match_arg_721 = menage_3.logement.mode_occupation - if match_arg_721.code == ModeOccupation_Code.Locataire: - _ = match_arg_721.value + match_arg_699 = menage_3.logement.mode_occupation + if match_arg_699.code == ModeOccupation_Code.Locataire: + _ = match_arg_699.value temp_condition_logement_bailleur_10 = False - elif match_arg_721.code == ModeOccupation_Code.ResidentLogementFoyer: - logement_foyer_2 = match_arg_721.value - match_arg_722 = logement_foyer_2.type - if match_arg_722.code == TypeLogementFoyer_Code.LogementPersonnesAgeesOuHandicapees: - _ = match_arg_722.value + elif match_arg_699.code == ModeOccupation_Code.ResidentLogementFoyer: + logement_foyer_2 = match_arg_699.value + match_arg_700 = logement_foyer_2.type + if match_arg_700.code == TypeLogementFoyer_Code.LogementPersonnesAgeesOuHandicapees: + _ = match_arg_700.value temp_condition_logement_bailleur_10 = False - elif match_arg_722.code == TypeLogementFoyer_Code.ResidenceSociale: - _ = match_arg_722.value + elif match_arg_700.code == TypeLogementFoyer_Code.ResidenceSociale: + _ = match_arg_700.value temp_condition_logement_bailleur_10 = False - elif match_arg_722.code == TypeLogementFoyer_Code.FoyerJeunesTravailleursOuMigrantsConventionneL353_2Avant1995: - _ = match_arg_722.value + elif match_arg_700.code == TypeLogementFoyer_Code.FoyerJeunesTravailleursOuMigrantsConventionneL353_2Avant1995: + _ = match_arg_700.value temp_condition_logement_bailleur_10 = True - elif match_arg_722.code == TypeLogementFoyer_Code.Autre: - _ = match_arg_722.value + elif match_arg_700.code == TypeLogementFoyer_Code.Autre: + _ = match_arg_700.value temp_condition_logement_bailleur_10 = False - elif match_arg_721.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: - _ = match_arg_721.value + elif match_arg_699.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + _ = match_arg_699.value temp_condition_logement_bailleur_10 = False - elif match_arg_721.code == ModeOccupation_Code.SousLocataire: - _ = match_arg_721.value + elif match_arg_699.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_699.value temp_condition_logement_bailleur_10 = False - elif match_arg_721.code == ModeOccupation_Code.LocationAccession: - _ = match_arg_721.value + elif match_arg_699.code == ModeOccupation_Code.LocationAccession: + _ = match_arg_699.value temp_condition_logement_bailleur_10 = False - match_arg_723 = menage_3.residence - if match_arg_723.code == Collectivite_Code.Guadeloupe: - _ = match_arg_723.value + match_arg_701 = menage_3.residence + if match_arg_701.code == Collectivite_Code.Guadeloupe: + _ = match_arg_701.value temp_condition_logement_bailleur_11 = True - elif match_arg_723.code == Collectivite_Code.Guyane: - _ = match_arg_723.value + elif match_arg_701.code == Collectivite_Code.Guyane: + _ = match_arg_701.value temp_condition_logement_bailleur_11 = True - elif match_arg_723.code == Collectivite_Code.Martinique: - _ = match_arg_723.value + elif match_arg_701.code == Collectivite_Code.Martinique: + _ = match_arg_701.value temp_condition_logement_bailleur_11 = True - elif match_arg_723.code == Collectivite_Code.LaReunion: - _ = match_arg_723.value + elif match_arg_701.code == Collectivite_Code.LaReunion: + _ = match_arg_701.value temp_condition_logement_bailleur_11 = True - elif match_arg_723.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_723.value + elif match_arg_701.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_701.value temp_condition_logement_bailleur_11 = False - elif match_arg_723.code == Collectivite_Code.SaintMartin: - _ = match_arg_723.value + elif match_arg_701.code == Collectivite_Code.SaintMartin: + _ = match_arg_701.value temp_condition_logement_bailleur_11 = False - elif match_arg_723.code == Collectivite_Code.Metropole: - _ = match_arg_723.value + elif match_arg_701.code == Collectivite_Code.Metropole: + _ = match_arg_701.value temp_condition_logement_bailleur_11 = False - elif match_arg_723.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_723.value + elif match_arg_701.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_701.value temp_condition_logement_bailleur_11 = False - elif match_arg_723.code == Collectivite_Code.Mayotte: - _ = match_arg_723.value + elif match_arg_701.code == Collectivite_Code.Mayotte: + _ = match_arg_701.value temp_condition_logement_bailleur_11 = True return (((date_courante_19 >= date_of_numbers(2023,4,5)) and @@ -27457,33 +26531,33 @@ def eligibilite_aide_personnalisee_logement(eligibilite_aide_personnalisee_logem temp_condition_logement_bailleur_9, temp_condition_logement_bailleur_8) except EmptyError: - match_arg_724 = menage_3.logement.mode_occupation - if match_arg_724.code == ModeOccupation_Code.Locataire: - _ = match_arg_724.value + match_arg_702 = menage_3.logement.mode_occupation + if match_arg_702.code == ModeOccupation_Code.Locataire: + _ = match_arg_702.value temp_condition_logement_bailleur_12 = False - elif match_arg_724.code == ModeOccupation_Code.ResidentLogementFoyer: - logement_foyer_3 = match_arg_724.value - match_arg_725 = logement_foyer_3.type - if match_arg_725.code == TypeLogementFoyer_Code.LogementPersonnesAgeesOuHandicapees: - _ = match_arg_725.value + elif match_arg_702.code == ModeOccupation_Code.ResidentLogementFoyer: + logement_foyer_3 = match_arg_702.value + match_arg_703 = logement_foyer_3.type + if match_arg_703.code == TypeLogementFoyer_Code.LogementPersonnesAgeesOuHandicapees: + _ = match_arg_703.value temp_condition_logement_bailleur_12 = False - elif match_arg_725.code == TypeLogementFoyer_Code.ResidenceSociale: - _ = match_arg_725.value + elif match_arg_703.code == TypeLogementFoyer_Code.ResidenceSociale: + _ = match_arg_703.value temp_condition_logement_bailleur_12 = False - elif match_arg_725.code == TypeLogementFoyer_Code.FoyerJeunesTravailleursOuMigrantsConventionneL353_2Avant1995: - _ = match_arg_725.value + elif match_arg_703.code == TypeLogementFoyer_Code.FoyerJeunesTravailleursOuMigrantsConventionneL353_2Avant1995: + _ = match_arg_703.value temp_condition_logement_bailleur_12 = False - elif match_arg_725.code == TypeLogementFoyer_Code.Autre: - _ = match_arg_725.value + elif match_arg_703.code == TypeLogementFoyer_Code.Autre: + _ = match_arg_703.value temp_condition_logement_bailleur_12 = True - elif match_arg_724.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: - _ = match_arg_724.value + elif match_arg_702.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + _ = match_arg_702.value temp_condition_logement_bailleur_12 = False - elif match_arg_724.code == ModeOccupation_Code.SousLocataire: - _ = match_arg_724.value + elif match_arg_702.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_702.value temp_condition_logement_bailleur_12 = False - elif match_arg_724.code == ModeOccupation_Code.LocationAccession: - _ = match_arg_724.value + elif match_arg_702.code == ModeOccupation_Code.LocationAccession: + _ = match_arg_702.value temp_condition_logement_bailleur_12 = False if temp_condition_logement_bailleur_12: return False @@ -27495,21 +26569,21 @@ def eligibilite_aide_personnalisee_logement(eligibilite_aide_personnalisee_logem def temp_condition_logement_bailleur_13(_:Unit): return True def temp_condition_logement_bailleur_14(_:Unit): - match_arg_726 = menage_3.logement.mode_occupation - if match_arg_726.code == ModeOccupation_Code.Locataire: - _ = match_arg_726.value + match_arg_704 = menage_3.logement.mode_occupation + if match_arg_704.code == ModeOccupation_Code.Locataire: + _ = match_arg_704.value return False - elif match_arg_726.code == ModeOccupation_Code.ResidentLogementFoyer: - logement_foyer_4 = match_arg_726.value + elif match_arg_704.code == ModeOccupation_Code.ResidentLogementFoyer: + logement_foyer_4 = match_arg_704.value return logement_foyer_4.remplit_conditions_r832_21 - elif match_arg_726.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: - _ = match_arg_726.value + elif match_arg_704.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + _ = match_arg_704.value return False - elif match_arg_726.code == ModeOccupation_Code.SousLocataire: - _ = match_arg_726.value + elif match_arg_704.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_704.value return False - elif match_arg_726.code == ModeOccupation_Code.LocationAccession: - _ = match_arg_726.value + elif match_arg_704.code == ModeOccupation_Code.LocationAccession: + _ = match_arg_704.value return False return handle_default(SourcePosition(filename="", start_line=0, start_column=1, @@ -27518,49 +26592,49 @@ def eligibilite_aide_personnalisee_logement(eligibilite_aide_personnalisee_logem temp_condition_logement_bailleur_14, temp_condition_logement_bailleur_13) except EmptyError: - match_arg_727 = menage_3.logement.mode_occupation - if match_arg_727.code == ModeOccupation_Code.Locataire: - _ = match_arg_727.value + match_arg_705 = menage_3.logement.mode_occupation + if match_arg_705.code == ModeOccupation_Code.Locataire: + _ = match_arg_705.value temp_condition_logement_bailleur_15 = False - elif match_arg_727.code == ModeOccupation_Code.ResidentLogementFoyer: - location_4 = match_arg_727.value + elif match_arg_705.code == ModeOccupation_Code.ResidentLogementFoyer: + location_4 = match_arg_705.value temp_condition_logement_bailleur_15 = location_4.conventionne_selon_regles_drom - elif match_arg_727.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: - _ = match_arg_727.value + elif match_arg_705.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + _ = match_arg_705.value temp_condition_logement_bailleur_15 = False - elif match_arg_727.code == ModeOccupation_Code.SousLocataire: - _ = match_arg_727.value + elif match_arg_705.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_705.value temp_condition_logement_bailleur_15 = False - elif match_arg_727.code == ModeOccupation_Code.LocationAccession: - _ = match_arg_727.value + elif match_arg_705.code == ModeOccupation_Code.LocationAccession: + _ = match_arg_705.value temp_condition_logement_bailleur_15 = False - match_arg_728 = menage_3.residence - if match_arg_728.code == Collectivite_Code.Guadeloupe: - _ = match_arg_728.value + match_arg_706 = menage_3.residence + if match_arg_706.code == Collectivite_Code.Guadeloupe: + _ = match_arg_706.value temp_condition_logement_bailleur_16 = True - elif match_arg_728.code == Collectivite_Code.Guyane: - _ = match_arg_728.value + elif match_arg_706.code == Collectivite_Code.Guyane: + _ = match_arg_706.value temp_condition_logement_bailleur_16 = True - elif match_arg_728.code == Collectivite_Code.Martinique: - _ = match_arg_728.value + elif match_arg_706.code == Collectivite_Code.Martinique: + _ = match_arg_706.value temp_condition_logement_bailleur_16 = True - elif match_arg_728.code == Collectivite_Code.LaReunion: - _ = match_arg_728.value + elif match_arg_706.code == Collectivite_Code.LaReunion: + _ = match_arg_706.value temp_condition_logement_bailleur_16 = True - elif match_arg_728.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_728.value + elif match_arg_706.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_706.value temp_condition_logement_bailleur_16 = False - elif match_arg_728.code == Collectivite_Code.SaintMartin: - _ = match_arg_728.value + elif match_arg_706.code == Collectivite_Code.SaintMartin: + _ = match_arg_706.value temp_condition_logement_bailleur_16 = False - elif match_arg_728.code == Collectivite_Code.Metropole: - _ = match_arg_728.value + elif match_arg_706.code == Collectivite_Code.Metropole: + _ = match_arg_706.value temp_condition_logement_bailleur_16 = False - elif match_arg_728.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_728.value + elif match_arg_706.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_706.value temp_condition_logement_bailleur_16 = False - elif match_arg_728.code == Collectivite_Code.Mayotte: - _ = match_arg_728.value + elif match_arg_706.code == Collectivite_Code.Mayotte: + _ = match_arg_706.value temp_condition_logement_bailleur_16 = True if (temp_condition_logement_bailleur_16 and temp_condition_logement_bailleur_15): @@ -27568,21 +26642,21 @@ def eligibilite_aide_personnalisee_logement(eligibilite_aide_personnalisee_logem else: raise EmptyError except EmptyError: - match_arg_729 = menage_3.logement.mode_occupation - if match_arg_729.code == ModeOccupation_Code.Locataire: - _ = match_arg_729.value + match_arg_707 = menage_3.logement.mode_occupation + if match_arg_707.code == ModeOccupation_Code.Locataire: + _ = match_arg_707.value temp_condition_logement_bailleur_17 = False - elif match_arg_729.code == ModeOccupation_Code.ResidentLogementFoyer: - location_5 = match_arg_729.value + elif match_arg_707.code == ModeOccupation_Code.ResidentLogementFoyer: + location_5 = match_arg_707.value temp_condition_logement_bailleur_17 = location_5.conventionne_livre_III_titre_V_chap_III - elif match_arg_729.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: - _ = match_arg_729.value + elif match_arg_707.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + _ = match_arg_707.value temp_condition_logement_bailleur_17 = False - elif match_arg_729.code == ModeOccupation_Code.SousLocataire: - _ = match_arg_729.value + elif match_arg_707.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_707.value temp_condition_logement_bailleur_17 = False - elif match_arg_729.code == ModeOccupation_Code.LocationAccession: - _ = match_arg_729.value + elif match_arg_707.code == ModeOccupation_Code.LocationAccession: + _ = match_arg_707.value temp_condition_logement_bailleur_17 = False if temp_condition_logement_bailleur_17: return True @@ -27634,21 +26708,21 @@ def eligibilite_aide_personnalisee_logement(eligibilite_aide_personnalisee_logem def temp_condition_logement_pret(_:Unit): return True def temp_condition_logement_pret_1(_:Unit): - match_arg_730 = menage_3.logement.mode_occupation - if match_arg_730.code == ModeOccupation_Code.Locataire: - _ = match_arg_730.value + match_arg_708 = menage_3.logement.mode_occupation + if match_arg_708.code == ModeOccupation_Code.Locataire: + _ = match_arg_708.value return False - elif match_arg_730.code == ModeOccupation_Code.ResidentLogementFoyer: - _ = match_arg_730.value + elif match_arg_708.code == ModeOccupation_Code.ResidentLogementFoyer: + _ = match_arg_708.value return False - elif match_arg_730.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: - propriete_2 = match_arg_730.value - match_arg_731 = propriete_2.anciennete_logement - if match_arg_731.code == NeufOuAncien_Code.Neuf: - _ = match_arg_731.value + elif match_arg_708.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + propriete_2 = match_arg_708.value + match_arg_709 = propriete_2.anciennete_logement + if match_arg_709.code == NeufOuAncien_Code.Neuf: + _ = match_arg_709.value temp_condition_logement_pret_2 = False - elif match_arg_731.code == NeufOuAncien_Code.Ancien: - _ = match_arg_731.value + elif match_arg_709.code == NeufOuAncien_Code.Ancien: + _ = match_arg_709.value temp_condition_logement_pret_2 = True return ((propriete_2.pret.date_signature >= date_of_numbers(2018,1,1)) and @@ -27656,17 +26730,17 @@ def eligibilite_aide_personnalisee_logement(eligibilite_aide_personnalisee_logem date_of_numbers(2020,1,1)) and (temp_condition_logement_pret_2 and logement_situe_commune_desequilibre_l831_2))) - elif match_arg_730.code == ModeOccupation_Code.SousLocataire: - _ = match_arg_730.value + elif match_arg_708.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_708.value return False - elif match_arg_730.code == ModeOccupation_Code.LocationAccession: - propriete_3 = match_arg_730.value - match_arg_732 = propriete_3.anciennete_logement - if match_arg_732.code == NeufOuAncien_Code.Neuf: - _ = match_arg_732.value + elif match_arg_708.code == ModeOccupation_Code.LocationAccession: + propriete_3 = match_arg_708.value + match_arg_710 = propriete_3.anciennete_logement + if match_arg_710.code == NeufOuAncien_Code.Neuf: + _ = match_arg_710.value temp_condition_logement_pret_3 = False - elif match_arg_732.code == NeufOuAncien_Code.Ancien: - _ = match_arg_732.value + elif match_arg_710.code == NeufOuAncien_Code.Ancien: + _ = match_arg_710.value temp_condition_logement_pret_3 = True return ((propriete_3.pret.date_signature >= date_of_numbers(2018,1,1)) and @@ -27682,22 +26756,22 @@ def eligibilite_aide_personnalisee_logement(eligibilite_aide_personnalisee_logem temp_condition_logement_pret_1, temp_condition_logement_pret) except EmptyError: - match_arg_733 = menage_3.logement.mode_occupation - if match_arg_733.code == ModeOccupation_Code.Locataire: - _ = match_arg_733.value + match_arg_711 = menage_3.logement.mode_occupation + if match_arg_711.code == ModeOccupation_Code.Locataire: + _ = match_arg_711.value temp_condition_logement_pret_5 = False - elif match_arg_733.code == ModeOccupation_Code.ResidentLogementFoyer: - _ = match_arg_733.value + elif match_arg_711.code == ModeOccupation_Code.ResidentLogementFoyer: + _ = match_arg_711.value temp_condition_logement_pret_5 = False - elif match_arg_733.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: - propriete_4 = match_arg_733.value + elif match_arg_711.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + propriete_4 = match_arg_711.value temp_condition_logement_pret_5 = (propriete_4.pret.date_signature >= date_of_numbers(2017,12,31)) - elif match_arg_733.code == ModeOccupation_Code.SousLocataire: - _ = match_arg_733.value + elif match_arg_711.code == ModeOccupation_Code.SousLocataire: + _ = match_arg_711.value temp_condition_logement_pret_5 = False - elif match_arg_733.code == ModeOccupation_Code.LocationAccession: - propriete_5 = match_arg_733.value + elif match_arg_711.code == ModeOccupation_Code.LocationAccession: + propriete_5 = match_arg_711.value temp_condition_logement_pret_5 = (propriete_5.pret.date_signature >= date_of_numbers(2017,12,31)) if temp_condition_logement_pret_5: @@ -27724,33 +26798,33 @@ def eligibilite_aide_personnalisee_logement(eligibilite_aide_personnalisee_logem def temp_eligibilite_9(_:Unit): return False def temp_eligibilite_10(_:Unit): - match_arg_734 = menage_3.residence - if match_arg_734.code == Collectivite_Code.Guadeloupe: - _ = match_arg_734.value + match_arg_712 = menage_3.residence + if match_arg_712.code == Collectivite_Code.Guadeloupe: + _ = match_arg_712.value temp_eligibilite_11 = False - elif match_arg_734.code == Collectivite_Code.Guyane: - _ = match_arg_734.value + elif match_arg_712.code == Collectivite_Code.Guyane: + _ = match_arg_712.value temp_eligibilite_11 = False - elif match_arg_734.code == Collectivite_Code.Martinique: - _ = match_arg_734.value + elif match_arg_712.code == Collectivite_Code.Martinique: + _ = match_arg_712.value temp_eligibilite_11 = False - elif match_arg_734.code == Collectivite_Code.LaReunion: - _ = match_arg_734.value + elif match_arg_712.code == Collectivite_Code.LaReunion: + _ = match_arg_712.value temp_eligibilite_11 = False - elif match_arg_734.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_734.value + elif match_arg_712.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_712.value temp_eligibilite_11 = False - elif match_arg_734.code == Collectivite_Code.SaintMartin: - _ = match_arg_734.value + elif match_arg_712.code == Collectivite_Code.SaintMartin: + _ = match_arg_712.value temp_eligibilite_11 = False - elif match_arg_734.code == Collectivite_Code.Metropole: - _ = match_arg_734.value + elif match_arg_712.code == Collectivite_Code.Metropole: + _ = match_arg_712.value temp_eligibilite_11 = False - elif match_arg_734.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_734.value + elif match_arg_712.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_712.value temp_eligibilite_11 = True - elif match_arg_734.code == Collectivite_Code.Mayotte: - _ = match_arg_734.value + elif match_arg_712.code == Collectivite_Code.Mayotte: + _ = match_arg_712.value temp_eligibilite_11 = False return ((date_courante_19 >= date_of_numbers(2021,1,1)) and temp_eligibilite_11) @@ -27795,25 +26869,25 @@ def calcul_allocation_logement(calcul_allocation_logement_in:CalculAllocationLog type_aide_3 = calcul_allocation_logement_in.type_aide_in residence_10 = calcul_allocation_logement_in.residence_in try: - match_arg_735 = mode_occupation_2 - if match_arg_735.code == ModeOccupation_Code.Locataire: - location_6 = match_arg_735.value + match_arg_713 = mode_occupation_2 + if match_arg_713.code == ModeOccupation_Code.Locataire: + location_6 = match_arg_713.value temp_categorie_calcul_apl_1 = CategorieCalculAPL(CategorieCalculAPL_Code.Location, location_6) - elif match_arg_735.code == ModeOccupation_Code.ResidentLogementFoyer: - logementfoyer_1 = match_arg_735.value + elif match_arg_713.code == ModeOccupation_Code.ResidentLogementFoyer: + logementfoyer_1 = match_arg_713.value temp_categorie_calcul_apl_1 = CategorieCalculAPL(CategorieCalculAPL_Code.LogementFoyer, logementfoyer_1) - elif match_arg_735.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: - proprietaire_8 = match_arg_735.value + elif match_arg_713.code == ModeOccupation_Code.AccessionProprieteLocalUsageExclusifHabitation: + proprietaire_8 = match_arg_713.value temp_categorie_calcul_apl_1 = CategorieCalculAPL(CategorieCalculAPL_Code.AccessionPropriete, proprietaire_8) - elif match_arg_735.code == ModeOccupation_Code.SousLocataire: - location_7 = match_arg_735.value + elif match_arg_713.code == ModeOccupation_Code.SousLocataire: + location_7 = match_arg_713.value temp_categorie_calcul_apl_1 = CategorieCalculAPL(CategorieCalculAPL_Code.Location, location_7) - elif match_arg_735.code == ModeOccupation_Code.LocationAccession: - proprietaire_9 = match_arg_735.value + elif match_arg_713.code == ModeOccupation_Code.LocationAccession: + proprietaire_9 = match_arg_713.value temp_categorie_calcul_apl_1 = CategorieCalculAPL(CategorieCalculAPL_Code.AccessionPropriete, proprietaire_9) except EmptyError: @@ -27842,29 +26916,29 @@ def calcul_allocation_logement(calcul_allocation_logement_in:CalculAllocationLog "Prologue : aides au logement"])) ressources_menage_avec_arrondi_1 = temp_ressources_menage_avec_arrondi_1 try: - match_arg_736 = situation_familiale_1 - if match_arg_736.code == SituationFamiliale_Code.Celibataire: - _ = match_arg_736.value + match_arg_714 = situation_familiale_1 + if match_arg_714.code == SituationFamiliale_Code.Celibataire: + _ = match_arg_714.value temp_situation_familiale_calcul_apl_1 = SituationFamilialeCalculAPL(SituationFamilialeCalculAPL_Code.PersonneSeule, Unit()) - elif match_arg_736.code == SituationFamiliale_Code.Maries: - _ = match_arg_736.value + elif match_arg_714.code == SituationFamiliale_Code.Maries: + _ = match_arg_714.value temp_situation_familiale_calcul_apl_1 = SituationFamilialeCalculAPL(SituationFamilialeCalculAPL_Code.Couple, Unit()) - elif match_arg_736.code == SituationFamiliale_Code.Pacses: - _ = match_arg_736.value + elif match_arg_714.code == SituationFamiliale_Code.Pacses: + _ = match_arg_714.value temp_situation_familiale_calcul_apl_1 = SituationFamilialeCalculAPL(SituationFamilialeCalculAPL_Code.Couple, Unit()) - elif match_arg_736.code == SituationFamiliale_Code.Concubins: - _ = match_arg_736.value + elif match_arg_714.code == SituationFamiliale_Code.Concubins: + _ = match_arg_714.value temp_situation_familiale_calcul_apl_1 = SituationFamilialeCalculAPL(SituationFamilialeCalculAPL_Code.Couple, Unit()) - elif match_arg_736.code == SituationFamiliale_Code.CelibataireSepareDeFait: - _ = match_arg_736.value + elif match_arg_714.code == SituationFamiliale_Code.CelibataireSepareDeFait: + _ = match_arg_714.value temp_situation_familiale_calcul_apl_1 = SituationFamilialeCalculAPL(SituationFamilialeCalculAPL_Code.PersonneSeule, Unit()) - elif match_arg_736.code == SituationFamiliale_Code.ConcubinageDontSepareDeFait: - _ = match_arg_736.value + elif match_arg_714.code == SituationFamiliale_Code.ConcubinageDontSepareDeFait: + _ = match_arg_714.value temp_situation_familiale_calcul_apl_1 = SituationFamilialeCalculAPL(SituationFamilialeCalculAPL_Code.Couple, Unit()) except EmptyError: @@ -27880,28 +26954,37 @@ def calcul_allocation_logement(calcul_allocation_logement_in:CalculAllocationLog situation_familiale_calcul_apl_9 = temp_situation_familiale_calcul_apl_1 try: try: - def temp_sous_calcul_traitement_88(_:Unit): - match_arg_737 = categorie_calcul_apl_1 - if match_arg_737.code == CategorieCalculAPL_Code.Location: - _ = match_arg_737.value + def temp_sous_calcul_traitement_1(_:Unit): + match_arg_715 = categorie_calcul_apl_1 + if match_arg_715.code == CategorieCalculAPL_Code.Location: + _ = match_arg_715.value return TraitementFormuleAideFinale(aide_finale_formule = money_of_cents_string("0"), traitement_aide_finale = traitement_nul_tout_le_temps) - elif match_arg_737.code == CategorieCalculAPL_Code.AccessionPropriete: - _ = match_arg_737.value + elif match_arg_715.code == CategorieCalculAPL_Code.AccessionPropriete: + _ = match_arg_715.value return TraitementFormuleAideFinale(aide_finale_formule = money_of_cents_string("0"), traitement_aide_finale = traitement_nul_tout_le_temps) - elif match_arg_737.code == CategorieCalculAPL_Code.LogementFoyer: - logement_foyer__1 = match_arg_737.value + elif match_arg_715.code == CategorieCalculAPL_Code.LogementFoyer: + logement_foyer__1 = match_arg_715.value + def temp_traitement_formule_48(result_27:CalculAllocationLogementLocatif): + def temp_traitement_formule_49(param0_3:Money): + return result_27.traitement_aide_finale(param0_3) + return CalculAllocationLogementLocatif(aide_finale_formule = result_27.aide_finale_formule, + traitement_aide_finale = temp_traitement_formule_49, + montant_forfaitaire_charges_d823_16 = result_27.montant_forfaitaire_charges_d823_16, + plafond_loyer_d823_16_2 = result_27.plafond_loyer_d823_16_2, + participation_minimale = result_27.participation_minimale, + taux_composition_familiale = result_27.taux_composition_familiale, + participation_personnelle = result_27.participation_personnelle) try: - temp_sous_calcul_traitement_89 = ChangementLogementD8424(ChangementLogementD8424_Code.PasDeChangement, - Unit()) + temp_traitement_formule_50 = logement_foyer__1.redevance except EmptyError: - temp_sous_calcul_traitement_89 = dead_value + temp_traitement_formule_50 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=6547, - start_column=42, - end_line=6547, - end_column=57, + start_line=6526, + start_column=31, + end_line=6526, + end_column=56, law_headings=["Article D863-7", "Sous-section III : Modalités de liquidation et de versement", "Section II : Dispositions communes aux aides personnelles au logement", @@ -27910,201 +26993,9 @@ def calcul_allocation_logement(calcul_allocation_logement_in:CalculAllocationLog "Partie réglementaire", "Code de la construction et de l'habitation"])) try: - temp_sous_calcul_traitement_90 = residence_10 + temp_traitement_formule_51 = ressources_menage_avec_arrondi_1 except EmptyError: - temp_sous_calcul_traitement_90 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=6519, - start_column=25, - end_line=6519, - end_column=34, - law_headings=["Article D863-7", - "Sous-section III : Modalités de liquidation et de versement", - "Section II : Dispositions communes aux aides personnelles au logement", - "Chapitre III : Saint-Pierre-et-Miquelon", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_91 = logement_foyer__1.logement_meuble_d842_2 - except EmptyError: - temp_sous_calcul_traitement_91 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=6546, - start_column=38, - end_line=6546, - end_column=76, - law_headings=["Article D863-7", - "Sous-section III : Modalités de liquidation et de versement", - "Section II : Dispositions communes aux aides personnelles au logement", - "Chapitre III : Saint-Pierre-et-Miquelon", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_92 = money_of_cents_string("0") - except EmptyError: - temp_sous_calcul_traitement_92 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=6545, - start_column=42, - end_line=6545, - end_column=45, - law_headings=["Article D863-7", - "Sous-section III : Modalités de liquidation et de versement", - "Section II : Dispositions communes aux aides personnelles au logement", - "Chapitre III : Saint-Pierre-et-Miquelon", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_93 = logement_foyer__1.colocation - except EmptyError: - temp_sous_calcul_traitement_93 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=6537, - start_column=26, - end_line=6537, - end_column=52, - law_headings=["Article D863-7", - "Sous-section III : Modalités de liquidation et de versement", - "Section II : Dispositions communes aux aides personnelles au logement", - "Chapitre III : Saint-Pierre-et-Miquelon", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_94 = type_aide_3 - except EmptyError: - temp_sous_calcul_traitement_94 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=6541, - start_column=25, - end_line=6541, - end_column=34, - law_headings=["Article D863-7", - "Sous-section III : Modalités de liquidation et de versement", - "Section II : Dispositions communes aux aides personnelles au logement", - "Chapitre III : Saint-Pierre-et-Miquelon", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_95 = False - except EmptyError: - temp_sous_calcul_traitement_95 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=6540, - start_column=72, - end_line=6540, - end_column=76, - law_headings=["Article D863-7", - "Sous-section III : Modalités de liquidation et de versement", - "Section II : Dispositions communes aux aides personnelles au logement", - "Chapitre III : Saint-Pierre-et-Miquelon", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_96 = logement_foyer__1.logement_est_chambre - except EmptyError: - temp_sous_calcul_traitement_96 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=6536, - start_column=36, - end_line=6536, - end_column=72, - law_headings=["Article D863-7", - "Sous-section III : Modalités de liquidation et de versement", - "Section II : Dispositions communes aux aides personnelles au logement", - "Chapitre III : Saint-Pierre-et-Miquelon", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_97 = zone_7 - except EmptyError: - temp_sous_calcul_traitement_97 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=6522, - start_column=20, - end_line=6522, - end_column=24, - law_headings=["Article D863-7", - "Sous-section III : Modalités de liquidation et de versement", - "Section II : Dispositions communes aux aides personnelles au logement", - "Chapitre III : Saint-Pierre-et-Miquelon", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_98 = situation_familiale_calcul_apl_9 - except EmptyError: - temp_sous_calcul_traitement_98 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=6524, - start_column=46, - end_line=6524, - end_column=76, - law_headings=["Article D863-7", - "Sous-section III : Modalités de liquidation et de versement", - "Section II : Dispositions communes aux aides personnelles au logement", - "Chapitre III : Saint-Pierre-et-Miquelon", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_99 = nombre_personnes_a_charge_12 - except EmptyError: - temp_sous_calcul_traitement_99 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=6521, - start_column=41, - end_line=6521, - end_column=66, - law_headings=["Article D863-7", - "Sous-section III : Modalités de liquidation et de versement", - "Section II : Dispositions communes aux aides personnelles au logement", - "Chapitre III : Saint-Pierre-et-Miquelon", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_100 = date_courante_20 - except EmptyError: - temp_sous_calcul_traitement_100 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=6523, - start_column=29, - end_line=6523, - end_column=42, - law_headings=["Article D863-7", - "Sous-section III : Modalités de liquidation et de versement", - "Section II : Dispositions communes aux aides personnelles au logement", - "Chapitre III : Saint-Pierre-et-Miquelon", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_101 = logement_foyer__1.beneficiaire_aide_adulte_ou_enfant_handicapes - except EmptyError: - temp_sous_calcul_traitement_101 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=6528, - start_column=15, - end_line=6528, - end_column=76, - law_headings=["Article D863-7", - "Sous-section III : Modalités de liquidation et de versement", - "Section II : Dispositions communes aux aides personnelles au logement", - "Chapitre III : Saint-Pierre-et-Miquelon", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_102 = ressources_menage_avec_arrondi_1 - except EmptyError: - temp_sous_calcul_traitement_102 = dead_value + temp_traitement_formule_51 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", start_line=6520, start_column=43, @@ -28118,14 +27009,14 @@ def calcul_allocation_logement(calcul_allocation_logement_in:CalculAllocationLog "Partie réglementaire", "Code de la construction et de l'habitation"])) try: - temp_sous_calcul_traitement_103 = logement_foyer__1.redevance + temp_traitement_formule_52 = logement_foyer__1.beneficiaire_aide_adulte_ou_enfant_handicapes except EmptyError: - temp_sous_calcul_traitement_103 = dead_value + temp_traitement_formule_52 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=6526, - start_column=31, - end_line=6526, - end_column=56, + start_line=6528, + start_column=15, + end_line=6528, + end_column=76, law_headings=["Article D863-7", "Sous-section III : Modalités de liquidation et de versement", "Section II : Dispositions communes aux aides personnelles au logement", @@ -28133,342 +27024,288 @@ def calcul_allocation_logement(calcul_allocation_logement_in:CalculAllocationLog "Livre VIII : Aides personnelles au logement", "Partie réglementaire", "Code de la construction et de l'habitation"])) - def temp_sous_calcul_traitement_104(param0_3:Money): - try: - temp_sous_calcul_traitement_105 = logement_foyer__1.redevance - except EmptyError: - temp_sous_calcul_traitement_105 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=6526, - start_column=31, - end_line=6526, - end_column=56, - law_headings=["Article D863-7", - "Sous-section III : Modalités de liquidation et de versement", - "Section II : Dispositions communes aux aides personnelles au logement", - "Chapitre III : Saint-Pierre-et-Miquelon", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_106 = ressources_menage_avec_arrondi_1 - except EmptyError: - temp_sous_calcul_traitement_106 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=6520, - start_column=43, - end_line=6520, - end_column=60, - law_headings=["Article D863-7", - "Sous-section III : Modalités de liquidation et de versement", - "Section II : Dispositions communes aux aides personnelles au logement", - "Chapitre III : Saint-Pierre-et-Miquelon", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_107 = logement_foyer__1.beneficiaire_aide_adulte_ou_enfant_handicapes - except EmptyError: - temp_sous_calcul_traitement_107 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=6528, - start_column=15, - end_line=6528, - end_column=76, - law_headings=["Article D863-7", - "Sous-section III : Modalités de liquidation et de versement", - "Section II : Dispositions communes aux aides personnelles au logement", - "Chapitre III : Saint-Pierre-et-Miquelon", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_108 = date_courante_20 - except EmptyError: - temp_sous_calcul_traitement_108 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=6523, - start_column=29, - end_line=6523, - end_column=42, - law_headings=["Article D863-7", - "Sous-section III : Modalités de liquidation et de versement", - "Section II : Dispositions communes aux aides personnelles au logement", - "Chapitre III : Saint-Pierre-et-Miquelon", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_109 = nombre_personnes_a_charge_12 - except EmptyError: - temp_sous_calcul_traitement_109 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=6521, - start_column=41, - end_line=6521, - end_column=66, - law_headings=["Article D863-7", - "Sous-section III : Modalités de liquidation et de versement", - "Section II : Dispositions communes aux aides personnelles au logement", - "Chapitre III : Saint-Pierre-et-Miquelon", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_110 = situation_familiale_calcul_apl_9 - except EmptyError: - temp_sous_calcul_traitement_110 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=6524, - start_column=46, - end_line=6524, - end_column=76, - law_headings=["Article D863-7", - "Sous-section III : Modalités de liquidation et de versement", - "Section II : Dispositions communes aux aides personnelles au logement", - "Chapitre III : Saint-Pierre-et-Miquelon", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_111 = zone_7 - except EmptyError: - temp_sous_calcul_traitement_111 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=6522, - start_column=20, - end_line=6522, - end_column=24, - law_headings=["Article D863-7", - "Sous-section III : Modalités de liquidation et de versement", - "Section II : Dispositions communes aux aides personnelles au logement", - "Chapitre III : Saint-Pierre-et-Miquelon", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_112 = logement_foyer__1.logement_est_chambre - except EmptyError: - temp_sous_calcul_traitement_112 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=6536, - start_column=36, - end_line=6536, - end_column=72, - law_headings=["Article D863-7", - "Sous-section III : Modalités de liquidation et de versement", - "Section II : Dispositions communes aux aides personnelles au logement", - "Chapitre III : Saint-Pierre-et-Miquelon", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_113 = False - except EmptyError: - temp_sous_calcul_traitement_113 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=6540, - start_column=72, - end_line=6540, - end_column=76, - law_headings=["Article D863-7", - "Sous-section III : Modalités de liquidation et de versement", - "Section II : Dispositions communes aux aides personnelles au logement", - "Chapitre III : Saint-Pierre-et-Miquelon", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_114 = type_aide_3 - except EmptyError: - temp_sous_calcul_traitement_114 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=6541, - start_column=25, - end_line=6541, - end_column=34, - law_headings=["Article D863-7", - "Sous-section III : Modalités de liquidation et de versement", - "Section II : Dispositions communes aux aides personnelles au logement", - "Chapitre III : Saint-Pierre-et-Miquelon", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_115 = logement_foyer__1.colocation - except EmptyError: - temp_sous_calcul_traitement_115 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=6537, - start_column=26, - end_line=6537, - end_column=52, - law_headings=["Article D863-7", - "Sous-section III : Modalités de liquidation et de versement", - "Section II : Dispositions communes aux aides personnelles au logement", - "Chapitre III : Saint-Pierre-et-Miquelon", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_116 = money_of_cents_string("0") - except EmptyError: - temp_sous_calcul_traitement_116 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=6545, - start_column=42, - end_line=6545, - end_column=45, - law_headings=["Article D863-7", - "Sous-section III : Modalités de liquidation et de versement", - "Section II : Dispositions communes aux aides personnelles au logement", - "Chapitre III : Saint-Pierre-et-Miquelon", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_117 = logement_foyer__1.logement_meuble_d842_2 - except EmptyError: - temp_sous_calcul_traitement_117 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=6546, - start_column=38, - end_line=6546, - end_column=76, - law_headings=["Article D863-7", - "Sous-section III : Modalités de liquidation et de versement", - "Section II : Dispositions communes aux aides personnelles au logement", - "Chapitre III : Saint-Pierre-et-Miquelon", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_118 = residence_10 - except EmptyError: - temp_sous_calcul_traitement_118 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=6519, - start_column=25, - end_line=6519, - end_column=34, - law_headings=["Article D863-7", - "Sous-section III : Modalités de liquidation et de versement", - "Section II : Dispositions communes aux aides personnelles au logement", - "Chapitre III : Saint-Pierre-et-Miquelon", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_119 = ChangementLogementD8424(ChangementLogementD8424_Code.PasDeChangement, - Unit()) - except EmptyError: - temp_sous_calcul_traitement_119 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=6547, - start_column=42, - end_line=6547, - end_column=57, - law_headings=["Article D863-7", - "Sous-section III : Modalités de liquidation et de versement", - "Section II : Dispositions communes aux aides personnelles au logement", - "Chapitre III : Saint-Pierre-et-Miquelon", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - return calcul_allocation_logement_locatif(CalculAllocationLogementLocatifIn(loyer_principal_in = temp_sous_calcul_traitement_105, - ressources_menage_arrondies_in = temp_sous_calcul_traitement_106, - beneficiaire_aide_adulte_ou_enfant_handicapes_in = temp_sous_calcul_traitement_107, - date_courante_in = temp_sous_calcul_traitement_108, - nombre_personnes_a_charge_in = temp_sous_calcul_traitement_109, - situation_familiale_calcul_apl_in = temp_sous_calcul_traitement_110, - zone_in = temp_sous_calcul_traitement_111, - logement_est_chambre_in = temp_sous_calcul_traitement_112, - agees_ou_handicap_adultes_hebergees_onereux_particuliers_in = temp_sous_calcul_traitement_113, - type_aide_in = temp_sous_calcul_traitement_114, - colocation_in = temp_sous_calcul_traitement_115, - reduction_loyer_solidarite_in = temp_sous_calcul_traitement_116, - logement_meuble_d842_2_in = temp_sous_calcul_traitement_117, - residence_in = temp_sous_calcul_traitement_118, - changement_logement_d842_4_in = temp_sous_calcul_traitement_119)).traitement_aide_finale( - param0_3) - return TraitementFormuleAideFinale(aide_finale_formule = calcul_allocation_logement_locatif( - CalculAllocationLogementLocatifIn(loyer_principal_in = temp_sous_calcul_traitement_103, - ressources_menage_arrondies_in = temp_sous_calcul_traitement_102, - beneficiaire_aide_adulte_ou_enfant_handicapes_in = temp_sous_calcul_traitement_101, - date_courante_in = temp_sous_calcul_traitement_100, - nombre_personnes_a_charge_in = temp_sous_calcul_traitement_99, - situation_familiale_calcul_apl_in = temp_sous_calcul_traitement_98, - zone_in = temp_sous_calcul_traitement_97, - logement_est_chambre_in = temp_sous_calcul_traitement_96, - agees_ou_handicap_adultes_hebergees_onereux_particuliers_in = temp_sous_calcul_traitement_95, - type_aide_in = temp_sous_calcul_traitement_94, - colocation_in = temp_sous_calcul_traitement_93, - reduction_loyer_solidarite_in = temp_sous_calcul_traitement_92, - logement_meuble_d842_2_in = temp_sous_calcul_traitement_91, - residence_in = temp_sous_calcul_traitement_90, - changement_logement_d842_4_in = temp_sous_calcul_traitement_89)).aide_finale_formule, - traitement_aide_finale = temp_sous_calcul_traitement_104) - def temp_sous_calcul_traitement_120(_:Unit): - match_arg_738 = categorie_calcul_apl_1 - if match_arg_738.code == CategorieCalculAPL_Code.Location: - _ = match_arg_738.value - temp_sous_calcul_traitement_121 = False - elif match_arg_738.code == CategorieCalculAPL_Code.AccessionPropriete: - _ = match_arg_738.value - temp_sous_calcul_traitement_121 = False - elif match_arg_738.code == CategorieCalculAPL_Code.LogementFoyer: - _ = match_arg_738.value - temp_sous_calcul_traitement_121 = True - match_arg_739 = residence_10 - if match_arg_739.code == Collectivite_Code.Guadeloupe: - _ = match_arg_739.value - temp_sous_calcul_traitement_122 = False - elif match_arg_739.code == Collectivite_Code.Guyane: - _ = match_arg_739.value - temp_sous_calcul_traitement_122 = False - elif match_arg_739.code == Collectivite_Code.Martinique: - _ = match_arg_739.value - temp_sous_calcul_traitement_122 = False - elif match_arg_739.code == Collectivite_Code.LaReunion: - _ = match_arg_739.value - temp_sous_calcul_traitement_122 = False - elif match_arg_739.code == Collectivite_Code.SaintBarthelemy: - _ = match_arg_739.value - temp_sous_calcul_traitement_122 = False - elif match_arg_739.code == Collectivite_Code.SaintMartin: - _ = match_arg_739.value - temp_sous_calcul_traitement_122 = False - elif match_arg_739.code == Collectivite_Code.Metropole: - _ = match_arg_739.value - temp_sous_calcul_traitement_122 = False - elif match_arg_739.code == Collectivite_Code.SaintPierreEtMiquelon: - _ = match_arg_739.value - temp_sous_calcul_traitement_122 = True - elif match_arg_739.code == Collectivite_Code.Mayotte: - _ = match_arg_739.value - temp_sous_calcul_traitement_122 = False - return (temp_sous_calcul_traitement_122 and - temp_sous_calcul_traitement_121) - temp_sous_calcul_traitement_123 = handle_default(SourcePosition(filename="", - start_line=0, - start_column=1, - end_line=0, end_column=1, - law_headings=[]), [], - temp_sous_calcul_traitement_120, - temp_sous_calcul_traitement_88) + try: + temp_traitement_formule_53 = date_courante_20 + except EmptyError: + temp_traitement_formule_53 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=6523, + start_column=29, + end_line=6523, + end_column=42, + law_headings=["Article D863-7", + "Sous-section III : Modalités de liquidation et de versement", + "Section II : Dispositions communes aux aides personnelles au logement", + "Chapitre III : Saint-Pierre-et-Miquelon", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_54 = nombre_personnes_a_charge_12 + except EmptyError: + temp_traitement_formule_54 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=6521, + start_column=41, + end_line=6521, + end_column=66, + law_headings=["Article D863-7", + "Sous-section III : Modalités de liquidation et de versement", + "Section II : Dispositions communes aux aides personnelles au logement", + "Chapitre III : Saint-Pierre-et-Miquelon", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_55 = situation_familiale_calcul_apl_9 + except EmptyError: + temp_traitement_formule_55 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=6524, + start_column=46, + end_line=6524, + end_column=76, + law_headings=["Article D863-7", + "Sous-section III : Modalités de liquidation et de versement", + "Section II : Dispositions communes aux aides personnelles au logement", + "Chapitre III : Saint-Pierre-et-Miquelon", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_56 = zone_7 + except EmptyError: + temp_traitement_formule_56 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=6522, + start_column=20, + end_line=6522, + end_column=24, + law_headings=["Article D863-7", + "Sous-section III : Modalités de liquidation et de versement", + "Section II : Dispositions communes aux aides personnelles au logement", + "Chapitre III : Saint-Pierre-et-Miquelon", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_57 = logement_foyer__1.logement_est_chambre + except EmptyError: + temp_traitement_formule_57 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=6536, + start_column=36, + end_line=6536, + end_column=72, + law_headings=["Article D863-7", + "Sous-section III : Modalités de liquidation et de versement", + "Section II : Dispositions communes aux aides personnelles au logement", + "Chapitre III : Saint-Pierre-et-Miquelon", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_58 = False + except EmptyError: + temp_traitement_formule_58 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=6540, + start_column=72, + end_line=6540, + end_column=76, + law_headings=["Article D863-7", + "Sous-section III : Modalités de liquidation et de versement", + "Section II : Dispositions communes aux aides personnelles au logement", + "Chapitre III : Saint-Pierre-et-Miquelon", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_59 = type_aide_3 + except EmptyError: + temp_traitement_formule_59 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=6541, + start_column=25, + end_line=6541, + end_column=34, + law_headings=["Article D863-7", + "Sous-section III : Modalités de liquidation et de versement", + "Section II : Dispositions communes aux aides personnelles au logement", + "Chapitre III : Saint-Pierre-et-Miquelon", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_60 = logement_foyer__1.colocation + except EmptyError: + temp_traitement_formule_60 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=6537, + start_column=26, + end_line=6537, + end_column=52, + law_headings=["Article D863-7", + "Sous-section III : Modalités de liquidation et de versement", + "Section II : Dispositions communes aux aides personnelles au logement", + "Chapitre III : Saint-Pierre-et-Miquelon", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_61 = money_of_cents_string("0") + except EmptyError: + temp_traitement_formule_61 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=6545, + start_column=42, + end_line=6545, + end_column=45, + law_headings=["Article D863-7", + "Sous-section III : Modalités de liquidation et de versement", + "Section II : Dispositions communes aux aides personnelles au logement", + "Chapitre III : Saint-Pierre-et-Miquelon", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_62 = logement_foyer__1.logement_meuble_d842_2 + except EmptyError: + temp_traitement_formule_62 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=6546, + start_column=38, + end_line=6546, + end_column=76, + law_headings=["Article D863-7", + "Sous-section III : Modalités de liquidation et de versement", + "Section II : Dispositions communes aux aides personnelles au logement", + "Chapitre III : Saint-Pierre-et-Miquelon", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_63 = residence_10 + except EmptyError: + temp_traitement_formule_63 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=6519, + start_column=25, + end_line=6519, + end_column=34, + law_headings=["Article D863-7", + "Sous-section III : Modalités de liquidation et de versement", + "Section II : Dispositions communes aux aides personnelles au logement", + "Chapitre III : Saint-Pierre-et-Miquelon", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_64 = ChangementLogementD8424(ChangementLogementD8424_Code.PasDeChangement, + Unit()) + except EmptyError: + temp_traitement_formule_64 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=6547, + start_column=42, + end_line=6547, + end_column=57, + law_headings=["Article D863-7", + "Sous-section III : Modalités de liquidation et de versement", + "Section II : Dispositions communes aux aides personnelles au logement", + "Chapitre III : Saint-Pierre-et-Miquelon", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + traitement_formule_3 = temp_traitement_formule_48( + calcul_allocation_logement_locatif(CalculAllocationLogementLocatifIn(loyer_principal_in = temp_traitement_formule_50, + ressources_menage_arrondies_in = temp_traitement_formule_51, + beneficiaire_aide_adulte_ou_enfant_handicapes_in = temp_traitement_formule_52, + date_courante_in = temp_traitement_formule_53, + nombre_personnes_a_charge_in = temp_traitement_formule_54, + situation_familiale_calcul_apl_in = temp_traitement_formule_55, + zone_in = temp_traitement_formule_56, + logement_est_chambre_in = temp_traitement_formule_57, + agees_ou_handicap_adultes_hebergees_onereux_particuliers_in = temp_traitement_formule_58, + type_aide_in = temp_traitement_formule_59, + colocation_in = temp_traitement_formule_60, + reduction_loyer_solidarite_in = temp_traitement_formule_61, + logement_meuble_d842_2_in = temp_traitement_formule_62, + residence_in = temp_traitement_formule_63, + changement_logement_d842_4_in = temp_traitement_formule_64))) + return TraitementFormuleAideFinale(aide_finale_formule = traitement_formule_3.aide_finale_formule, + traitement_aide_finale = traitement_formule_3.traitement_aide_finale) + def temp_sous_calcul_traitement_2(_:Unit): + match_arg_716 = categorie_calcul_apl_1 + if match_arg_716.code == CategorieCalculAPL_Code.Location: + _ = match_arg_716.value + temp_sous_calcul_traitement_3 = False + elif match_arg_716.code == CategorieCalculAPL_Code.AccessionPropriete: + _ = match_arg_716.value + temp_sous_calcul_traitement_3 = False + elif match_arg_716.code == CategorieCalculAPL_Code.LogementFoyer: + _ = match_arg_716.value + temp_sous_calcul_traitement_3 = True + match_arg_717 = residence_10 + if match_arg_717.code == Collectivite_Code.Guadeloupe: + _ = match_arg_717.value + temp_sous_calcul_traitement_4 = False + elif match_arg_717.code == Collectivite_Code.Guyane: + _ = match_arg_717.value + temp_sous_calcul_traitement_4 = False + elif match_arg_717.code == Collectivite_Code.Martinique: + _ = match_arg_717.value + temp_sous_calcul_traitement_4 = False + elif match_arg_717.code == Collectivite_Code.LaReunion: + _ = match_arg_717.value + temp_sous_calcul_traitement_4 = False + elif match_arg_717.code == Collectivite_Code.SaintBarthelemy: + _ = match_arg_717.value + temp_sous_calcul_traitement_4 = False + elif match_arg_717.code == Collectivite_Code.SaintMartin: + _ = match_arg_717.value + temp_sous_calcul_traitement_4 = False + elif match_arg_717.code == Collectivite_Code.Metropole: + _ = match_arg_717.value + temp_sous_calcul_traitement_4 = False + elif match_arg_717.code == Collectivite_Code.SaintPierreEtMiquelon: + _ = match_arg_717.value + temp_sous_calcul_traitement_4 = True + elif match_arg_717.code == Collectivite_Code.Mayotte: + _ = match_arg_717.value + temp_sous_calcul_traitement_4 = False + return (temp_sous_calcul_traitement_4 and + temp_sous_calcul_traitement_3) + temp_sous_calcul_traitement_5 = handle_default(SourcePosition(filename="", + start_line=0, + start_column=1, + end_line=0, end_column=1, + law_headings=[]), [], + temp_sous_calcul_traitement_2, + temp_sous_calcul_traitement_1) except EmptyError: - match_arg_740 = categorie_calcul_apl_1 - if match_arg_740.code == CategorieCalculAPL_Code.Location: - location_8 = match_arg_740.value + match_arg_718 = categorie_calcul_apl_1 + if match_arg_718.code == CategorieCalculAPL_Code.Location: + location_8 = match_arg_718.value + def temp_traitement_formule_65(result_28:CalculAllocationLogementLocatif): + def temp_traitement_formule_66(param0_4:Money): + return result_28.traitement_aide_finale(param0_4) + return CalculAllocationLogementLocatif(aide_finale_formule = result_28.aide_finale_formule, + traitement_aide_finale = temp_traitement_formule_66, + montant_forfaitaire_charges_d823_16 = result_28.montant_forfaitaire_charges_d823_16, + plafond_loyer_d823_16_2 = result_28.plafond_loyer_d823_16_2, + participation_minimale = result_28.participation_minimale, + taux_composition_familiale = result_28.taux_composition_familiale, + participation_personnelle = result_28.participation_personnelle) try: - temp_sous_calcul_traitement_124 = location_8.changement_logement_d842_4 + temp_traitement_formule_67 = location_8.loyer_principal except EmptyError: - temp_sous_calcul_traitement_124 = dead_value + temp_traitement_formule_67 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1554, - start_column=42, - end_line=1554, - end_column=77, + start_line=1540, + start_column=31, + end_line=1540, + end_column=55, law_headings=["Article D823-9", "Section 1 : Calcul, liquidation et versement des aides", "Chapitre III : Modalités de liquidation et de versement", @@ -28477,210 +27314,9 @@ def calcul_allocation_logement(calcul_allocation_logement_in:CalculAllocationLog "Partie réglementaire", "Code de la construction et de l'habitation"])) try: - temp_sous_calcul_traitement_125 = residence_10 + temp_traitement_formule_68 = ressources_menage_avec_arrondi_1 except EmptyError: - temp_sous_calcul_traitement_125 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1534, - start_column=25, - end_line=1534, - end_column=34, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_126 = location_8.logement_meuble_d842_2 - except EmptyError: - temp_sous_calcul_traitement_126 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1553, - start_column=38, - end_line=1553, - end_column=69, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - match_arg_741 = location_8.bailleur - if match_arg_741.code == TypeBailleur_Code.BailleurSocial: - bailleur_2 = match_arg_741.value - temp_sous_calcul_traitement_127 = bailleur_2.reduction_loyer_solidarite_percue - elif match_arg_741.code == TypeBailleur_Code.BailleurPriveAvecConventionnementSocial: - _ = match_arg_741.value - temp_sous_calcul_traitement_127 = money_of_cents_string("0") - elif match_arg_741.code == TypeBailleur_Code.BailleurPrive: - _ = match_arg_741.value - temp_sous_calcul_traitement_127 = money_of_cents_string("0") - except EmptyError: - temp_sous_calcul_traitement_127 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1549, - start_column=16, - end_line=1552, - end_column=39, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_128 = location_8.colocation - except EmptyError: - temp_sous_calcul_traitement_128 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1544, - start_column=26, - end_line=1544, - end_column=45, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_129 = type_aide_3 - except EmptyError: - temp_sous_calcul_traitement_129 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1547, - start_column=25, - end_line=1547, - end_column=34, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_130 = location_8.agees_ou_handicap_adultes_hebergees_onereux_particuliers - except EmptyError: - temp_sous_calcul_traitement_130 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1546, - start_column=15, - end_line=1546, - end_column=80, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_131 = location_8.logement_est_chambre - except EmptyError: - temp_sous_calcul_traitement_131 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1543, - start_column=36, - end_line=1543, - end_column=65, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_132 = zone_7 - except EmptyError: - temp_sous_calcul_traitement_132 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1537, - start_column=20, - end_line=1537, - end_column=24, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_133 = situation_familiale_calcul_apl_9 - except EmptyError: - temp_sous_calcul_traitement_133 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1539, - start_column=46, - end_line=1539, - end_column=76, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_134 = nombre_personnes_a_charge_12 - except EmptyError: - temp_sous_calcul_traitement_134 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1536, - start_column=41, - end_line=1536, - end_column=66, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_135 = date_courante_20 - except EmptyError: - temp_sous_calcul_traitement_135 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1538, - start_column=29, - end_line=1538, - end_column=42, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_136 = location_8.beneficiaire_aide_adulte_ou_enfant_handicapes - except EmptyError: - temp_sous_calcul_traitement_136 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1542, - start_column=15, - end_line=1542, - end_column=69, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_137 = ressources_menage_avec_arrondi_1 - except EmptyError: - temp_sous_calcul_traitement_137 = dead_value + temp_traitement_formule_68 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", start_line=1535, start_column=43, @@ -28694,315 +27330,14 @@ def calcul_allocation_logement(calcul_allocation_logement_in:CalculAllocationLog "Partie réglementaire", "Code de la construction et de l'habitation"])) try: - temp_sous_calcul_traitement_138 = location_8.loyer_principal + temp_traitement_formule_69 = location_8.beneficiaire_aide_adulte_ou_enfant_handicapes except EmptyError: - temp_sous_calcul_traitement_138 = dead_value + temp_traitement_formule_69 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1540, - start_column=31, - end_line=1540, - end_column=55, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - def temp_sous_calcul_traitement_139(param0_4:Money): - try: - temp_sous_calcul_traitement_140 = location_8.loyer_principal - except EmptyError: - temp_sous_calcul_traitement_140 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1540, - start_column=31, - end_line=1540, - end_column=55, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_141 = ressources_menage_avec_arrondi_1 - except EmptyError: - temp_sous_calcul_traitement_141 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1535, - start_column=43, - end_line=1535, - end_column=60, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_142 = location_8.beneficiaire_aide_adulte_ou_enfant_handicapes - except EmptyError: - temp_sous_calcul_traitement_142 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1542, - start_column=15, - end_line=1542, - end_column=69, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_143 = date_courante_20 - except EmptyError: - temp_sous_calcul_traitement_143 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1538, - start_column=29, - end_line=1538, - end_column=42, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_144 = nombre_personnes_a_charge_12 - except EmptyError: - temp_sous_calcul_traitement_144 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1536, - start_column=41, - end_line=1536, - end_column=66, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_145 = situation_familiale_calcul_apl_9 - except EmptyError: - temp_sous_calcul_traitement_145 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1539, - start_column=46, - end_line=1539, - end_column=76, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_146 = zone_7 - except EmptyError: - temp_sous_calcul_traitement_146 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1537, - start_column=20, - end_line=1537, - end_column=24, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_147 = location_8.logement_est_chambre - except EmptyError: - temp_sous_calcul_traitement_147 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1543, - start_column=36, - end_line=1543, - end_column=65, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_148 = location_8.agees_ou_handicap_adultes_hebergees_onereux_particuliers - except EmptyError: - temp_sous_calcul_traitement_148 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1546, - start_column=15, - end_line=1546, - end_column=80, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_149 = type_aide_3 - except EmptyError: - temp_sous_calcul_traitement_149 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1547, - start_column=25, - end_line=1547, - end_column=34, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_150 = location_8.colocation - except EmptyError: - temp_sous_calcul_traitement_150 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1544, - start_column=26, - end_line=1544, - end_column=45, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - match_arg_742 = location_8.bailleur - if match_arg_742.code == TypeBailleur_Code.BailleurSocial: - bailleur_3 = match_arg_742.value - temp_sous_calcul_traitement_151 = bailleur_3.reduction_loyer_solidarite_percue - elif match_arg_742.code == TypeBailleur_Code.BailleurPriveAvecConventionnementSocial: - _ = match_arg_742.value - temp_sous_calcul_traitement_151 = money_of_cents_string("0") - elif match_arg_742.code == TypeBailleur_Code.BailleurPrive: - _ = match_arg_742.value - temp_sous_calcul_traitement_151 = money_of_cents_string("0") - except EmptyError: - temp_sous_calcul_traitement_151 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1549, - start_column=16, - end_line=1552, - end_column=39, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_152 = location_8.logement_meuble_d842_2 - except EmptyError: - temp_sous_calcul_traitement_152 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1553, - start_column=38, - end_line=1553, - end_column=69, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_153 = residence_10 - except EmptyError: - temp_sous_calcul_traitement_153 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1534, - start_column=25, - end_line=1534, - end_column=34, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_154 = location_8.changement_logement_d842_4 - except EmptyError: - temp_sous_calcul_traitement_154 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1554, - start_column=42, - end_line=1554, - end_column=77, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - return calcul_allocation_logement_locatif(CalculAllocationLogementLocatifIn(loyer_principal_in = temp_sous_calcul_traitement_140, - ressources_menage_arrondies_in = temp_sous_calcul_traitement_141, - beneficiaire_aide_adulte_ou_enfant_handicapes_in = temp_sous_calcul_traitement_142, - date_courante_in = temp_sous_calcul_traitement_143, - nombre_personnes_a_charge_in = temp_sous_calcul_traitement_144, - situation_familiale_calcul_apl_in = temp_sous_calcul_traitement_145, - zone_in = temp_sous_calcul_traitement_146, - logement_est_chambre_in = temp_sous_calcul_traitement_147, - agees_ou_handicap_adultes_hebergees_onereux_particuliers_in = temp_sous_calcul_traitement_148, - type_aide_in = temp_sous_calcul_traitement_149, - colocation_in = temp_sous_calcul_traitement_150, - reduction_loyer_solidarite_in = temp_sous_calcul_traitement_151, - logement_meuble_d842_2_in = temp_sous_calcul_traitement_152, - residence_in = temp_sous_calcul_traitement_153, - changement_logement_d842_4_in = temp_sous_calcul_traitement_154)).traitement_aide_finale( - param0_4) - temp_sous_calcul_traitement_123 = TraitementFormuleAideFinale(aide_finale_formule = calcul_allocation_logement_locatif( - CalculAllocationLogementLocatifIn(loyer_principal_in = temp_sous_calcul_traitement_138, - ressources_menage_arrondies_in = temp_sous_calcul_traitement_137, - beneficiaire_aide_adulte_ou_enfant_handicapes_in = temp_sous_calcul_traitement_136, - date_courante_in = temp_sous_calcul_traitement_135, - nombre_personnes_a_charge_in = temp_sous_calcul_traitement_134, - situation_familiale_calcul_apl_in = temp_sous_calcul_traitement_133, - zone_in = temp_sous_calcul_traitement_132, - logement_est_chambre_in = temp_sous_calcul_traitement_131, - agees_ou_handicap_adultes_hebergees_onereux_particuliers_in = temp_sous_calcul_traitement_130, - type_aide_in = temp_sous_calcul_traitement_129, - colocation_in = temp_sous_calcul_traitement_128, - reduction_loyer_solidarite_in = temp_sous_calcul_traitement_127, - logement_meuble_d842_2_in = temp_sous_calcul_traitement_126, - residence_in = temp_sous_calcul_traitement_125, - changement_logement_d842_4_in = temp_sous_calcul_traitement_124)).aide_finale_formule, - traitement_aide_finale = temp_sous_calcul_traitement_139) - elif match_arg_740.code == CategorieCalculAPL_Code.AccessionPropriete: - proprietaire_10 = match_arg_740.value - try: - temp_sous_calcul_traitement_155 = proprietaire_10.operations_logement_evolutifs_sociaux_accession_propriete_aidee_Etat - except EmptyError: - temp_sous_calcul_traitement_155 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1596, - start_column=11, - end_line=1597, - end_column=81, + start_line=1542, + start_column=15, + end_line=1542, + end_column=69, law_headings=["Article D823-9", "Section 1 : Calcul, liquidation et versement des aides", "Chapitre III : Modalités de liquidation et de versement", @@ -29011,14 +27346,14 @@ def calcul_allocation_logement(calcul_allocation_logement_in:CalculAllocationLog "Partie réglementaire", "Code de la construction et de l'habitation"])) try: - temp_sous_calcul_traitement_156 = proprietaire_10.copropriete + temp_traitement_formule_70 = date_courante_20 except EmptyError: - temp_sous_calcul_traitement_156 = dead_value + temp_traitement_formule_70 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1607, - start_column=28, - end_line=1607, - end_column=52, + start_line=1538, + start_column=29, + end_line=1538, + end_column=42, law_headings=["Article D823-9", "Section 1 : Calcul, liquidation et versement des aides", "Chapitre III : Modalités de liquidation et de versement", @@ -29027,45 +27362,13 @@ def calcul_allocation_logement(calcul_allocation_logement_in:CalculAllocationLog "Partie réglementaire", "Code de la construction et de l'habitation"])) try: - temp_sous_calcul_traitement_157 = proprietaire_10.charges_mensuelles_pret + temp_traitement_formule_71 = nombre_personnes_a_charge_12 except EmptyError: - temp_sous_calcul_traitement_157 = dead_value + temp_traitement_formule_71 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1601, - start_column=40, - end_line=1601, - end_column=76, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_158 = proprietaire_10.date_entree_logement - except EmptyError: - temp_sous_calcul_traitement_158 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1606, - start_column=37, - end_line=1606, - end_column=70, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_159 = proprietaire_10.local_habite_premiere_fois_beneficiaire - except EmptyError: - temp_sous_calcul_traitement_159 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1605, - start_column=14, - end_line=1605, + start_line=1536, + start_column=41, + end_line=1536, end_column=66, law_headings=["Article D823-9", "Section 1 : Calcul, liquidation et versement des aides", @@ -29075,45 +27378,13 @@ def calcul_allocation_logement(calcul_allocation_logement_in:CalculAllocationLog "Partie réglementaire", "Code de la construction et de l'habitation"])) try: - temp_sous_calcul_traitement_160 = proprietaire_10.type_travaux_logement_r842_5 + temp_traitement_formule_72 = situation_familiale_calcul_apl_9 except EmptyError: - temp_sous_calcul_traitement_160 = dead_value + temp_traitement_formule_72 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1602, - start_column=38, - end_line=1602, - end_column=79, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_161 = proprietaire_10.pret.date_signature - except EmptyError: - temp_sous_calcul_traitement_161 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1603, - start_column=36, - end_line=1603, - end_column=68, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_162 = proprietaire_10.situation_r822_11_13_17 - except EmptyError: - temp_sous_calcul_traitement_162 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1608, - start_column=40, - end_line=1608, + start_line=1539, + start_column=46, + end_line=1539, end_column=76, law_headings=["Article D823-9", "Section 1 : Calcul, liquidation et versement des aides", @@ -29123,14 +27394,14 @@ def calcul_allocation_logement(calcul_allocation_logement_in:CalculAllocationLog "Partie réglementaire", "Code de la construction et de l'habitation"])) try: - temp_sous_calcul_traitement_163 = proprietaire_10.mensualite_principale + temp_traitement_formule_73 = zone_7 except EmptyError: - temp_sous_calcul_traitement_163 = dead_value + temp_traitement_formule_73 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1600, - start_column=38, - end_line=1600, - end_column=72, + start_line=1537, + start_column=20, + end_line=1537, + end_column=24, law_headings=["Article D823-9", "Section 1 : Calcul, liquidation et versement des aides", "Chapitre III : Modalités de liquidation et de versement", @@ -29139,14 +27410,14 @@ def calcul_allocation_logement(calcul_allocation_logement_in:CalculAllocationLog "Partie réglementaire", "Code de la construction et de l'habitation"])) try: - temp_sous_calcul_traitement_164 = date_courante_20 + temp_traitement_formule_74 = location_8.logement_est_chambre except EmptyError: - temp_sous_calcul_traitement_164 = dead_value + temp_traitement_formule_74 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1598, - start_column=30, - end_line=1598, - end_column=43, + start_line=1543, + start_column=36, + end_line=1543, + end_column=65, law_headings=["Article D823-9", "Section 1 : Calcul, liquidation et versement des aides", "Chapitre III : Modalités de liquidation et de versement", @@ -29155,14 +27426,46 @@ def calcul_allocation_logement(calcul_allocation_logement_in:CalculAllocationLog "Partie réglementaire", "Code de la construction et de l'habitation"])) try: - temp_sous_calcul_traitement_165 = residence_10 + temp_traitement_formule_75 = location_8.agees_ou_handicap_adultes_hebergees_onereux_particuliers except EmptyError: - temp_sous_calcul_traitement_165 = dead_value + temp_traitement_formule_75 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1594, + start_line=1546, + start_column=15, + end_line=1546, + end_column=80, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_76 = type_aide_3 + except EmptyError: + temp_traitement_formule_76 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1547, + start_column=25, + end_line=1547, + end_column=34, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_77 = location_8.colocation + except EmptyError: + temp_traitement_formule_77 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1544, start_column=26, - end_line=1594, - end_column=35, + end_line=1544, + end_column=45, law_headings=["Article D823-9", "Section 1 : Calcul, liquidation et versement des aides", "Chapitre III : Modalités de liquidation et de versement", @@ -29171,14 +27474,23 @@ def calcul_allocation_logement(calcul_allocation_logement_in:CalculAllocationLog "Partie réglementaire", "Code de la construction et de l'habitation"])) try: - temp_sous_calcul_traitement_166 = zone_7 + match_arg_719 = location_8.bailleur + if match_arg_719.code == TypeBailleur_Code.BailleurSocial: + bailleur_1 = match_arg_719.value + temp_traitement_formule_78 = bailleur_1.reduction_loyer_solidarite_percue + elif match_arg_719.code == TypeBailleur_Code.BailleurPriveAvecConventionnementSocial: + _ = match_arg_719.value + temp_traitement_formule_78 = money_of_cents_string("0") + elif match_arg_719.code == TypeBailleur_Code.BailleurPrive: + _ = match_arg_719.value + temp_traitement_formule_78 = money_of_cents_string("0") except EmptyError: - temp_sous_calcul_traitement_166 = dead_value + temp_traitement_formule_78 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1593, - start_column=21, - end_line=1593, - end_column=25, + start_line=1549, + start_column=16, + end_line=1552, + end_column=39, law_headings=["Article D823-9", "Section 1 : Calcul, liquidation et versement des aides", "Chapitre III : Modalités de liquidation et de versement", @@ -29187,13 +27499,45 @@ def calcul_allocation_logement(calcul_allocation_logement_in:CalculAllocationLog "Partie réglementaire", "Code de la construction et de l'habitation"])) try: - temp_sous_calcul_traitement_167 = situation_familiale_calcul_apl_9 + temp_traitement_formule_79 = location_8.logement_meuble_d842_2 except EmptyError: - temp_sous_calcul_traitement_167 = dead_value + temp_traitement_formule_79 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1599, - start_column=47, - end_line=1599, + start_line=1553, + start_column=38, + end_line=1553, + end_column=69, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_80 = residence_10 + except EmptyError: + temp_traitement_formule_80 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1534, + start_column=25, + end_line=1534, + end_column=34, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_81 = location_8.changement_logement_d842_4 + except EmptyError: + temp_traitement_formule_81 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1554, + start_column=42, + end_line=1554, end_column=77, law_headings=["Article D823-9", "Section 1 : Calcul, liquidation et versement des aides", @@ -29202,10 +27546,54 @@ def calcul_allocation_logement(calcul_allocation_logement_in:CalculAllocationLog "Livre VIII : Aides personnelles au logement", "Partie réglementaire", "Code de la construction et de l'habitation"])) + traitement_formule_4 = temp_traitement_formule_65(calcul_allocation_logement_locatif( + CalculAllocationLogementLocatifIn(loyer_principal_in = temp_traitement_formule_67, + ressources_menage_arrondies_in = temp_traitement_formule_68, + beneficiaire_aide_adulte_ou_enfant_handicapes_in = temp_traitement_formule_69, + date_courante_in = temp_traitement_formule_70, + nombre_personnes_a_charge_in = temp_traitement_formule_71, + situation_familiale_calcul_apl_in = temp_traitement_formule_72, + zone_in = temp_traitement_formule_73, + logement_est_chambre_in = temp_traitement_formule_74, + agees_ou_handicap_adultes_hebergees_onereux_particuliers_in = temp_traitement_formule_75, + type_aide_in = temp_traitement_formule_76, + colocation_in = temp_traitement_formule_77, + reduction_loyer_solidarite_in = temp_traitement_formule_78, + logement_meuble_d842_2_in = temp_traitement_formule_79, + residence_in = temp_traitement_formule_80, + changement_logement_d842_4_in = temp_traitement_formule_81))) + temp_sous_calcul_traitement_5 = TraitementFormuleAideFinale(aide_finale_formule = traitement_formule_4.aide_finale_formule, + traitement_aide_finale = traitement_formule_4.traitement_aide_finale) + elif match_arg_718.code == CategorieCalculAPL_Code.AccessionPropriete: + proprietaire_10 = match_arg_718.value + def temp_traitement_formule_82(result_29:CalculAllocationLogementAccessionPropriete): + def temp_traitement_formule_83(param0_5:Money): + return result_29.traitement_aide_finale(param0_5) + return CalculAllocationLogementAccessionPropriete(mensualite_eligible = result_29.mensualite_eligible, + mensualite_minimale = result_29.mensualite_minimale, + coefficient_prise_en_charge = result_29.coefficient_prise_en_charge, + aide_finale_formule = result_29.aide_finale_formule, + traitement_aide_finale = temp_traitement_formule_83) try: - temp_sous_calcul_traitement_168 = nombre_personnes_a_charge_12 + temp_traitement_formule_84 = ressources_menage_avec_arrondi_1 except EmptyError: - temp_sous_calcul_traitement_168 = dead_value + temp_traitement_formule_84 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1591, + start_column=44, + end_line=1591, + end_column=61, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_85 = nombre_personnes_a_charge_12 + except EmptyError: + temp_traitement_formule_85 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", start_line=1592, start_column=42, @@ -29219,307 +27607,14 @@ def calcul_allocation_logement(calcul_allocation_logement_in:CalculAllocationLog "Partie réglementaire", "Code de la construction et de l'habitation"])) try: - temp_sous_calcul_traitement_169 = ressources_menage_avec_arrondi_1 + temp_traitement_formule_86 = situation_familiale_calcul_apl_9 except EmptyError: - temp_sous_calcul_traitement_169 = dead_value + temp_traitement_formule_86 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1591, - start_column=44, - end_line=1591, - end_column=61, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - def temp_sous_calcul_traitement_170(param0_5:Money): - try: - temp_sous_calcul_traitement_171 = ressources_menage_avec_arrondi_1 - except EmptyError: - temp_sous_calcul_traitement_171 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1591, - start_column=44, - end_line=1591, - end_column=61, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_172 = nombre_personnes_a_charge_12 - except EmptyError: - temp_sous_calcul_traitement_172 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1592, - start_column=42, - end_line=1592, - end_column=67, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_173 = situation_familiale_calcul_apl_9 - except EmptyError: - temp_sous_calcul_traitement_173 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1599, - start_column=47, - end_line=1599, - end_column=77, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_174 = zone_7 - except EmptyError: - temp_sous_calcul_traitement_174 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1593, - start_column=21, - end_line=1593, - end_column=25, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_175 = residence_10 - except EmptyError: - temp_sous_calcul_traitement_175 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1594, - start_column=26, - end_line=1594, - end_column=35, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_176 = date_courante_20 - except EmptyError: - temp_sous_calcul_traitement_176 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1598, - start_column=30, - end_line=1598, - end_column=43, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_177 = proprietaire_10.mensualite_principale - except EmptyError: - temp_sous_calcul_traitement_177 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1600, - start_column=38, - end_line=1600, - end_column=72, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_178 = proprietaire_10.situation_r822_11_13_17 - except EmptyError: - temp_sous_calcul_traitement_178 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1608, - start_column=40, - end_line=1608, - end_column=76, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_179 = proprietaire_10.pret.date_signature - except EmptyError: - temp_sous_calcul_traitement_179 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1603, - start_column=36, - end_line=1603, - end_column=68, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_180 = proprietaire_10.type_travaux_logement_r842_5 - except EmptyError: - temp_sous_calcul_traitement_180 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1602, - start_column=38, - end_line=1602, - end_column=79, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_181 = proprietaire_10.local_habite_premiere_fois_beneficiaire - except EmptyError: - temp_sous_calcul_traitement_181 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1605, - start_column=14, - end_line=1605, - end_column=66, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_182 = proprietaire_10.date_entree_logement - except EmptyError: - temp_sous_calcul_traitement_182 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1606, - start_column=37, - end_line=1606, - end_column=70, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_183 = proprietaire_10.charges_mensuelles_pret - except EmptyError: - temp_sous_calcul_traitement_183 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1601, - start_column=40, - end_line=1601, - end_column=76, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_184 = proprietaire_10.copropriete - except EmptyError: - temp_sous_calcul_traitement_184 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1607, - start_column=28, - end_line=1607, - end_column=52, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_185 = proprietaire_10.operations_logement_evolutifs_sociaux_accession_propriete_aidee_Etat - except EmptyError: - temp_sous_calcul_traitement_185 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1596, - start_column=11, - end_line=1597, - end_column=81, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - return calcul_allocation_logement_accession_propriete( - CalculAllocationLogementAccessionProprieteIn(ressources_menage_arrondies_base_in = temp_sous_calcul_traitement_171, - nombre_personnes_a_charge_in = temp_sous_calcul_traitement_172, - situation_familiale_calcul_apl_in = temp_sous_calcul_traitement_173, - zone_in = temp_sous_calcul_traitement_174, - residence_in = temp_sous_calcul_traitement_175, - date_courante_in = temp_sous_calcul_traitement_176, - mensualite_principale_in = temp_sous_calcul_traitement_177, - situation_r822_11_13_17_in = temp_sous_calcul_traitement_178, - date_signature_pret_in = temp_sous_calcul_traitement_179, - type_travaux_logement_in = temp_sous_calcul_traitement_180, - local_habite_premiere_fois_beneficiaire_in = temp_sous_calcul_traitement_181, - date_entree_logement_in = temp_sous_calcul_traitement_182, - charges_mensuelles_pret_in = temp_sous_calcul_traitement_183, - copropriete_in = temp_sous_calcul_traitement_184, - operations_logement_evolutifs_sociaux_accession_propriete_aidee_Etat_in = temp_sous_calcul_traitement_185)).traitement_aide_finale( - param0_5) - temp_sous_calcul_traitement_123 = TraitementFormuleAideFinale(aide_finale_formule = calcul_allocation_logement_accession_propriete( - CalculAllocationLogementAccessionProprieteIn(ressources_menage_arrondies_base_in = temp_sous_calcul_traitement_169, - nombre_personnes_a_charge_in = temp_sous_calcul_traitement_168, - situation_familiale_calcul_apl_in = temp_sous_calcul_traitement_167, - zone_in = temp_sous_calcul_traitement_166, - residence_in = temp_sous_calcul_traitement_165, - date_courante_in = temp_sous_calcul_traitement_164, - mensualite_principale_in = temp_sous_calcul_traitement_163, - situation_r822_11_13_17_in = temp_sous_calcul_traitement_162, - date_signature_pret_in = temp_sous_calcul_traitement_161, - type_travaux_logement_in = temp_sous_calcul_traitement_160, - local_habite_premiere_fois_beneficiaire_in = temp_sous_calcul_traitement_159, - date_entree_logement_in = temp_sous_calcul_traitement_158, - charges_mensuelles_pret_in = temp_sous_calcul_traitement_157, - copropriete_in = temp_sous_calcul_traitement_156, - operations_logement_evolutifs_sociaux_accession_propriete_aidee_Etat_in = temp_sous_calcul_traitement_155)).aide_finale_formule, - traitement_aide_finale = temp_sous_calcul_traitement_170) - elif match_arg_740.code == CategorieCalculAPL_Code.LogementFoyer: - logement_foyer__2 = match_arg_740.value - try: - temp_sous_calcul_traitement_186 = logement_foyer__2.categorie_equivalence_loyer_d842_16 - except EmptyError: - temp_sous_calcul_traitement_186 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1577, - start_column=13, - end_line=1577, - end_column=64, + start_line=1599, + start_column=47, + end_line=1599, + end_column=77, law_headings=["Article D823-9", "Section 1 : Calcul, liquidation et versement des aides", "Chapitre III : Modalités de liquidation et de versement", @@ -29528,14 +27623,14 @@ def calcul_allocation_logement(calcul_allocation_logement_in:CalculAllocationLog "Partie réglementaire", "Code de la construction et de l'habitation"])) try: - temp_sous_calcul_traitement_187 = date_courante_20 + temp_traitement_formule_87 = zone_7 except EmptyError: - temp_sous_calcul_traitement_187 = dead_value + temp_traitement_formule_87 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1571, - start_column=29, - end_line=1571, - end_column=42, + start_line=1593, + start_column=21, + end_line=1593, + end_column=25, law_headings=["Article D823-9", "Section 1 : Calcul, liquidation et versement des aides", "Chapitre III : Modalités de liquidation et de versement", @@ -29544,14 +27639,14 @@ def calcul_allocation_logement(calcul_allocation_logement_in:CalculAllocationLog "Partie réglementaire", "Code de la construction et de l'habitation"])) try: - temp_sous_calcul_traitement_188 = zone_7 + temp_traitement_formule_88 = residence_10 except EmptyError: - temp_sous_calcul_traitement_188 = dead_value + temp_traitement_formule_88 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1570, - start_column=20, - end_line=1570, - end_column=24, + start_line=1594, + start_column=26, + end_line=1594, + end_column=35, law_headings=["Article D823-9", "Section 1 : Calcul, liquidation et versement des aides", "Chapitre III : Modalités de liquidation et de versement", @@ -29560,13 +27655,45 @@ def calcul_allocation_logement(calcul_allocation_logement_in:CalculAllocationLog "Partie réglementaire", "Code de la construction et de l'habitation"])) try: - temp_sous_calcul_traitement_189 = situation_familiale_calcul_apl_9 + temp_traitement_formule_89 = date_courante_20 except EmptyError: - temp_sous_calcul_traitement_189 = dead_value + temp_traitement_formule_89 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1572, - start_column=46, - end_line=1572, + start_line=1598, + start_column=30, + end_line=1598, + end_column=43, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_90 = proprietaire_10.mensualite_principale + except EmptyError: + temp_traitement_formule_90 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1600, + start_column=38, + end_line=1600, + end_column=72, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_91 = proprietaire_10.situation_r822_11_13_17 + except EmptyError: + temp_traitement_formule_91 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1608, + start_column=40, + end_line=1608, end_column=76, law_headings=["Article D823-9", "Section 1 : Calcul, liquidation et versement des aides", @@ -29576,13 +27703,45 @@ def calcul_allocation_logement(calcul_allocation_logement_in:CalculAllocationLog "Partie réglementaire", "Code de la construction et de l'habitation"])) try: - temp_sous_calcul_traitement_190 = nombre_personnes_a_charge_12 + temp_traitement_formule_92 = proprietaire_10.pret.date_signature except EmptyError: - temp_sous_calcul_traitement_190 = dead_value + temp_traitement_formule_92 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1568, - start_column=41, - end_line=1568, + start_line=1603, + start_column=36, + end_line=1603, + end_column=68, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_93 = proprietaire_10.type_travaux_logement_r842_5 + except EmptyError: + temp_traitement_formule_93 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1602, + start_column=38, + end_line=1602, + end_column=79, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_94 = proprietaire_10.local_habite_premiere_fois_beneficiaire + except EmptyError: + temp_traitement_formule_94 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1605, + start_column=14, + end_line=1605, end_column=66, law_headings=["Article D823-9", "Section 1 : Calcul, liquidation et versement des aides", @@ -29592,62 +27751,14 @@ def calcul_allocation_logement(calcul_allocation_logement_in:CalculAllocationLog "Partie réglementaire", "Code de la construction et de l'habitation"])) try: - temp_sous_calcul_traitement_191 = ressources_menage_avec_arrondi_1 + temp_traitement_formule_95 = proprietaire_10.date_entree_logement except EmptyError: - temp_sous_calcul_traitement_191 = dead_value + temp_traitement_formule_95 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1567, - start_column=43, - end_line=1567, - end_column=60, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_192 = logement_foyer__2.redevance - except EmptyError: - temp_sous_calcul_traitement_192 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1575, - start_column=25, - end_line=1575, - end_column=50, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_193 = residence_10 - except EmptyError: - temp_sous_calcul_traitement_193 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1569, - start_column=25, - end_line=1569, - end_column=34, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_194 = logement_foyer__2.date_conventionnement - except EmptyError: - temp_sous_calcul_traitement_194 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1579, + start_line=1606, start_column=37, - end_line=1579, - end_column=74, + end_line=1606, + end_column=70, law_headings=["Article D823-9", "Section 1 : Calcul, liquidation et versement des aides", "Chapitre III : Modalités de liquidation et de versement", @@ -29656,9 +27767,102 @@ def calcul_allocation_logement(calcul_allocation_logement_in:CalculAllocationLog "Partie réglementaire", "Code de la construction et de l'habitation"])) try: - temp_sous_calcul_traitement_195 = logement_foyer__2.logement_foyer_jeunes_travailleurs + temp_traitement_formule_96 = proprietaire_10.charges_mensuelles_pret except EmptyError: - temp_sous_calcul_traitement_195 = dead_value + temp_traitement_formule_96 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1601, + start_column=40, + end_line=1601, + end_column=76, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_97 = proprietaire_10.copropriete + except EmptyError: + temp_traitement_formule_97 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1607, + start_column=28, + end_line=1607, + end_column=52, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_98 = proprietaire_10.operations_logement_evolutifs_sociaux_accession_propriete_aidee_Etat + except EmptyError: + temp_traitement_formule_98 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1596, + start_column=11, + end_line=1597, + end_column=81, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + traitement_formule_5 = temp_traitement_formule_82(calcul_allocation_logement_accession_propriete( + CalculAllocationLogementAccessionProprieteIn(ressources_menage_arrondies_base_in = temp_traitement_formule_84, + nombre_personnes_a_charge_in = temp_traitement_formule_85, + situation_familiale_calcul_apl_in = temp_traitement_formule_86, + zone_in = temp_traitement_formule_87, + residence_in = temp_traitement_formule_88, + date_courante_in = temp_traitement_formule_89, + mensualite_principale_in = temp_traitement_formule_90, + situation_r822_11_13_17_in = temp_traitement_formule_91, + date_signature_pret_in = temp_traitement_formule_92, + type_travaux_logement_in = temp_traitement_formule_93, + local_habite_premiere_fois_beneficiaire_in = temp_traitement_formule_94, + date_entree_logement_in = temp_traitement_formule_95, + charges_mensuelles_pret_in = temp_traitement_formule_96, + copropriete_in = temp_traitement_formule_97, + operations_logement_evolutifs_sociaux_accession_propriete_aidee_Etat_in = temp_traitement_formule_98))) + temp_sous_calcul_traitement_5 = TraitementFormuleAideFinale(aide_finale_formule = traitement_formule_5.aide_finale_formule, + traitement_aide_finale = traitement_formule_5.traitement_aide_finale) + elif match_arg_718.code == CategorieCalculAPL_Code.LogementFoyer: + logement_foyer__2 = match_arg_718.value + def temp_traitement_formule_99(result_30:CalculAllocationLogementFoyer): + def temp_traitement_formule_100(param0_6:Money): + return result_30.traitement_aide_finale(param0_6) + return CalculAllocationLogementFoyer(coefficient_prise_en_charge = result_30.coefficient_prise_en_charge, + equivalence_loyer = result_30.equivalence_loyer, + montant_forfaitaire_charges = result_30.montant_forfaitaire_charges, + loyer_minimal = result_30.loyer_minimal, + aide_finale_formule = result_30.aide_finale_formule, + traitement_aide_finale = temp_traitement_formule_100) + try: + temp_traitement_formule_101 = logement_foyer__2.type + except EmptyError: + temp_traitement_formule_101 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1578, + start_column=35, + end_line=1578, + end_column=55, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_102 = logement_foyer__2.logement_foyer_jeunes_travailleurs + except EmptyError: + temp_traitement_formule_102 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", start_line=1574, start_column=13, @@ -29672,14 +27876,14 @@ def calcul_allocation_logement(calcul_allocation_logement_in:CalculAllocationLog "Partie réglementaire", "Code de la construction et de l'habitation"])) try: - temp_sous_calcul_traitement_196 = logement_foyer__2.type + temp_traitement_formule_103 = logement_foyer__2.date_conventionnement except EmptyError: - temp_sous_calcul_traitement_196 = dead_value + temp_traitement_formule_103 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1578, - start_column=35, - end_line=1578, - end_column=55, + start_line=1579, + start_column=37, + end_line=1579, + end_column=74, law_headings=["Article D823-9", "Section 1 : Calcul, liquidation et versement des aides", "Chapitre III : Modalités de liquidation et de versement", @@ -29687,210 +27891,150 @@ def calcul_allocation_logement(calcul_allocation_logement_in:CalculAllocationLog "Livre VIII : Aides personnelles au logement", "Partie réglementaire", "Code de la construction et de l'habitation"])) - def temp_sous_calcul_traitement_197(param0_6:Money): - try: - temp_sous_calcul_traitement_198 = logement_foyer__2.type - except EmptyError: - temp_sous_calcul_traitement_198 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1578, - start_column=35, - end_line=1578, - end_column=55, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_199 = logement_foyer__2.logement_foyer_jeunes_travailleurs - except EmptyError: - temp_sous_calcul_traitement_199 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1574, - start_column=13, - end_line=1574, - end_column=63, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_200 = logement_foyer__2.date_conventionnement - except EmptyError: - temp_sous_calcul_traitement_200 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1579, - start_column=37, - end_line=1579, - end_column=74, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_201 = residence_10 - except EmptyError: - temp_sous_calcul_traitement_201 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1569, - start_column=25, - end_line=1569, - end_column=34, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_202 = logement_foyer__2.redevance - except EmptyError: - temp_sous_calcul_traitement_202 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1575, - start_column=25, - end_line=1575, - end_column=50, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_203 = ressources_menage_avec_arrondi_1 - except EmptyError: - temp_sous_calcul_traitement_203 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1567, - start_column=43, - end_line=1567, - end_column=60, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_204 = nombre_personnes_a_charge_12 - except EmptyError: - temp_sous_calcul_traitement_204 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1568, - start_column=41, - end_line=1568, - end_column=66, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_205 = situation_familiale_calcul_apl_9 - except EmptyError: - temp_sous_calcul_traitement_205 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1572, - start_column=46, - end_line=1572, - end_column=76, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_206 = zone_7 - except EmptyError: - temp_sous_calcul_traitement_206 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1570, - start_column=20, - end_line=1570, - end_column=24, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_207 = date_courante_20 - except EmptyError: - temp_sous_calcul_traitement_207 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1571, - start_column=29, - end_line=1571, - end_column=42, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - try: - temp_sous_calcul_traitement_208 = logement_foyer__2.categorie_equivalence_loyer_d842_16 - except EmptyError: - temp_sous_calcul_traitement_208 = dead_value - raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", - start_line=1577, - start_column=13, - end_line=1577, - end_column=64, - law_headings=["Article D823-9", - "Section 1 : Calcul, liquidation et versement des aides", - "Chapitre III : Modalités de liquidation et de versement", - "Titre II : Dispositions communes aux aides personnelles au logement", - "Livre VIII : Aides personnelles au logement", - "Partie réglementaire", - "Code de la construction et de l'habitation"])) - return calcul_allocation_logement_foyer(CalculAllocationLogementFoyerIn(type_logement_foyer_in = temp_sous_calcul_traitement_198, - logement_foyer_jeunes_travailleurs_in = temp_sous_calcul_traitement_199, - date_conventionnement_in = temp_sous_calcul_traitement_200, - residence_in = temp_sous_calcul_traitement_201, - redevance_in = temp_sous_calcul_traitement_202, - ressources_menage_arrondies_in = temp_sous_calcul_traitement_203, - nombre_personnes_a_charge_in = temp_sous_calcul_traitement_204, - situation_familiale_calcul_apl_in = temp_sous_calcul_traitement_205, - zone_in = temp_sous_calcul_traitement_206, - date_courante_in = temp_sous_calcul_traitement_207, - categorie_equivalence_loyer_d842_16_in = temp_sous_calcul_traitement_208)).traitement_aide_finale( - param0_6) - temp_sous_calcul_traitement_123 = TraitementFormuleAideFinale(aide_finale_formule = calcul_allocation_logement_foyer( - CalculAllocationLogementFoyerIn(type_logement_foyer_in = temp_sous_calcul_traitement_196, - logement_foyer_jeunes_travailleurs_in = temp_sous_calcul_traitement_195, - date_conventionnement_in = temp_sous_calcul_traitement_194, - residence_in = temp_sous_calcul_traitement_193, - redevance_in = temp_sous_calcul_traitement_192, - ressources_menage_arrondies_in = temp_sous_calcul_traitement_191, - nombre_personnes_a_charge_in = temp_sous_calcul_traitement_190, - situation_familiale_calcul_apl_in = temp_sous_calcul_traitement_189, - zone_in = temp_sous_calcul_traitement_188, - date_courante_in = temp_sous_calcul_traitement_187, - categorie_equivalence_loyer_d842_16_in = temp_sous_calcul_traitement_186)).aide_finale_formule, - traitement_aide_finale = temp_sous_calcul_traitement_197) + try: + temp_traitement_formule_104 = residence_10 + except EmptyError: + temp_traitement_formule_104 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1569, + start_column=25, + end_line=1569, + end_column=34, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_105 = logement_foyer__2.redevance + except EmptyError: + temp_traitement_formule_105 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1575, + start_column=25, + end_line=1575, + end_column=50, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_106 = ressources_menage_avec_arrondi_1 + except EmptyError: + temp_traitement_formule_106 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1567, + start_column=43, + end_line=1567, + end_column=60, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_107 = nombre_personnes_a_charge_12 + except EmptyError: + temp_traitement_formule_107 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1568, + start_column=41, + end_line=1568, + end_column=66, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_108 = situation_familiale_calcul_apl_9 + except EmptyError: + temp_traitement_formule_108 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1572, + start_column=46, + end_line=1572, + end_column=76, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_109 = zone_7 + except EmptyError: + temp_traitement_formule_109 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1570, + start_column=20, + end_line=1570, + end_column=24, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_110 = date_courante_20 + except EmptyError: + temp_traitement_formule_110 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1571, + start_column=29, + end_line=1571, + end_column=42, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + try: + temp_traitement_formule_111 = logement_foyer__2.categorie_equivalence_loyer_d842_16 + except EmptyError: + temp_traitement_formule_111 = dead_value + raise NoValueProvided(SourcePosition(filename="examples/aides_logement/code_construction_reglementaire.catala_fr", + start_line=1577, + start_column=13, + end_line=1577, + end_column=64, + law_headings=["Article D823-9", + "Section 1 : Calcul, liquidation et versement des aides", + "Chapitre III : Modalités de liquidation et de versement", + "Titre II : Dispositions communes aux aides personnelles au logement", + "Livre VIII : Aides personnelles au logement", + "Partie réglementaire", + "Code de la construction et de l'habitation"])) + traitement_formule_6 = temp_traitement_formule_99(calcul_allocation_logement_foyer( + CalculAllocationLogementFoyerIn(type_logement_foyer_in = temp_traitement_formule_101, + logement_foyer_jeunes_travailleurs_in = temp_traitement_formule_102, + date_conventionnement_in = temp_traitement_formule_103, + residence_in = temp_traitement_formule_104, + redevance_in = temp_traitement_formule_105, + ressources_menage_arrondies_in = temp_traitement_formule_106, + nombre_personnes_a_charge_in = temp_traitement_formule_107, + situation_familiale_calcul_apl_in = temp_traitement_formule_108, + zone_in = temp_traitement_formule_109, + date_courante_in = temp_traitement_formule_110, + categorie_equivalence_loyer_d842_16_in = temp_traitement_formule_111))) + temp_sous_calcul_traitement_5 = TraitementFormuleAideFinale(aide_finale_formule = traitement_formule_6.aide_finale_formule, + traitement_aide_finale = traitement_formule_6.traitement_aide_finale) except EmptyError: - temp_sous_calcul_traitement_123 = dead_value + temp_sous_calcul_traitement_5 = dead_value raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", start_line=1070, start_column=11, end_line=1070, @@ -29899,7 +28043,7 @@ def calcul_allocation_logement(calcul_allocation_logement_in:CalculAllocationLog "Secteur logement-foyer", "Calcul du montant de l'allocation logement", "Prologue : aides au logement"])) - sous_calcul_traitement_1 = temp_sous_calcul_traitement_123 + sous_calcul_traitement_1 = temp_sous_calcul_traitement_5 def temp_traitement_aide_finale_4(arg_1:Money): try: return sous_calcul_traitement_1.traitement_aide_finale(arg_1) @@ -29985,13 +28129,13 @@ def calculette_aides_au_logement(calculette_aides_au_logement_in:CalculetteAides "Partie législative", "Code de la construction et de l'habitation"])) eligibilite_allocation_logement_dot_beneficie_aide_personnalisee_logement = temp_eligibilite_allocation_logement_dot_beneficie_aide_personnalisee_logement - result_24 = eligibilite_allocation_logement(EligibiliteAllocationLogementIn(date_courante_in = eligibilite_allocation_logement_dot_date_courante, + result_31 = eligibilite_allocation_logement(EligibiliteAllocationLogementIn(date_courante_in = eligibilite_allocation_logement_dot_date_courante, menage_in = eligibilite_allocation_logement_dot_menage, demandeur_in = eligibilite_allocation_logement_dot_demandeur, beneficie_aide_personnalisee_logement_in = eligibilite_allocation_logement_dot_beneficie_aide_personnalisee_logement)) - eligibilite_allocation_logement_dot_eligibilite_l841_2 = result_24.eligibilite - eligibilite_allocation_logement_dot_nombre_personnes_a_charge_prises_en_compte = result_24.nombre_personnes_a_charge_prises_en_compte - eligibilite_allocation_logement_dot_coefficents_enfants_garde_alternee_pris_en_compte = result_24.coefficents_enfants_garde_alternee_pris_en_compte + eligibilite_allocation_logement_dot_eligibilite_l841_2 = result_31.eligibilite + eligibilite_allocation_logement_dot_nombre_personnes_a_charge_prises_en_compte = result_31.nombre_personnes_a_charge_prises_en_compte + eligibilite_allocation_logement_dot_coefficents_enfants_garde_alternee_pris_en_compte = result_31.coefficents_enfants_garde_alternee_pris_en_compte try: temp_eligibilite_aide_personnalisee_logement_dot_menage = menage_4 except EmptyError: @@ -30028,13 +28172,13 @@ def calculette_aides_au_logement(calculette_aides_au_logement_in:CalculetteAides "Calcul de l'aide au logement effective", "Prologue : aides au logement"])) eligibilite_aide_personnalisee_logement_dot_date_courante = temp_eligibilite_aide_personnalisee_logement_dot_date_courante - result_25 = eligibilite_aide_personnalisee_logement(EligibiliteAidePersonnaliseeLogementIn(menage_in = eligibilite_aide_personnalisee_logement_dot_menage, + result_32 = eligibilite_aide_personnalisee_logement(EligibiliteAidePersonnaliseeLogementIn(menage_in = eligibilite_aide_personnalisee_logement_dot_menage, demandeur_in = eligibilite_aide_personnalisee_logement_dot_demandeur, date_courante_in = eligibilite_aide_personnalisee_logement_dot_date_courante)) - eligibilite_aide_personnalisee_logement_dot_date_courante_1 = result_25.date_courante - eligibilite_aide_personnalisee_logement_dot_eligibilite = result_25.eligibilite - eligibilite_aide_personnalisee_logement_dot_nombre_personnes_a_charge_prises_en_compte = result_25.nombre_personnes_a_charge_prises_en_compte - eligibilite_aide_personnalisee_logement_dot_coefficents_enfants_garde_alternee_pris_en_compte = result_25.coefficents_enfants_garde_alternee_pris_en_compte + eligibilite_aide_personnalisee_logement_dot_date_courante_1 = result_32.date_courante + eligibilite_aide_personnalisee_logement_dot_eligibilite = result_32.eligibilite + eligibilite_aide_personnalisee_logement_dot_nombre_personnes_a_charge_prises_en_compte = result_32.nombre_personnes_a_charge_prises_en_compte + eligibilite_aide_personnalisee_logement_dot_coefficents_enfants_garde_alternee_pris_en_compte = result_32.coefficents_enfants_garde_alternee_pris_en_compte try: temp_calcul_allocation_logement_dot_mode_occupation = menage_4.logement.mode_occupation except EmptyError: @@ -30108,17 +28252,17 @@ def calculette_aides_au_logement(calculette_aides_au_logement_in:CalculetteAides "Prologue : aides au logement"])) calcul_allocation_logement_dot_date_courante = temp_calcul_allocation_logement_dot_date_courante try: - match_arg_743 = eligibilite_allocation_logement_dot_eligibilite_l841_2 - if match_arg_743.code == TypeEligibiliteAllocationLogement_Code.PasEligible: - _ = match_arg_743.value + match_arg_720 = eligibilite_allocation_logement_dot_eligibilite_l841_2 + if match_arg_720.code == TypeEligibiliteAllocationLogement_Code.PasEligible: + _ = match_arg_720.value temp_calcul_allocation_logement_dot_type_aide = TypeAidesPersonnelleLogement(TypeAidesPersonnelleLogement_Code.AllocationLogementSociale, Unit()) - elif match_arg_743.code == TypeEligibiliteAllocationLogement_Code.AllocationLogementFamiliale: - _ = match_arg_743.value + elif match_arg_720.code == TypeEligibiliteAllocationLogement_Code.AllocationLogementFamiliale: + _ = match_arg_720.value temp_calcul_allocation_logement_dot_type_aide = TypeAidesPersonnelleLogement(TypeAidesPersonnelleLogement_Code.AllocationLogementFamiliale, Unit()) - elif match_arg_743.code == TypeEligibiliteAllocationLogement_Code.AllocationLogementSociale: - _ = match_arg_743.value + elif match_arg_720.code == TypeEligibiliteAllocationLogement_Code.AllocationLogementSociale: + _ = match_arg_720.value temp_calcul_allocation_logement_dot_type_aide = TypeAidesPersonnelleLogement(TypeAidesPersonnelleLogement_Code.AllocationLogementSociale, Unit()) except EmptyError: @@ -30146,7 +28290,7 @@ def calculette_aides_au_logement(calculette_aides_au_logement_in:CalculetteAides "Calcul de l'aide au logement effective", "Prologue : aides au logement"])) calcul_allocation_logement_dot_residence = temp_calcul_allocation_logement_dot_residence - result_26 = calcul_allocation_logement(CalculAllocationLogementIn(mode_occupation_in = calcul_allocation_logement_dot_mode_occupation, + result_33 = calcul_allocation_logement(CalculAllocationLogementIn(mode_occupation_in = calcul_allocation_logement_dot_mode_occupation, ressources_menage_sans_arrondi_in = calcul_allocation_logement_dot_ressources_menage_sans_arrondi, situation_familiale_in = calcul_allocation_logement_dot_situation_familiale, nombre_personnes_a_charge_in = calcul_allocation_logement_dot_nombre_personnes_a_charge, @@ -30154,8 +28298,8 @@ def calculette_aides_au_logement(calculette_aides_au_logement_in:CalculetteAides date_courante_in = calcul_allocation_logement_dot_date_courante, type_aide_in = calcul_allocation_logement_dot_type_aide, residence_in = calcul_allocation_logement_dot_residence)) - calcul_allocation_logement_dot_aide_finale_formule = result_26.aide_finale_formule - calcul_allocation_logement_dot_traitement_aide_finale = result_26.traitement_aide_finale + calcul_allocation_logement_dot_aide_finale_formule = result_33.aide_finale_formule + calcul_allocation_logement_dot_traitement_aide_finale = result_33.traitement_aide_finale try: temp_calcul_aide_personnalisee_logement_dot_mode_occupation = menage_4.logement.mode_occupation except EmptyError: @@ -30255,7 +28399,7 @@ def calculette_aides_au_logement(calculette_aides_au_logement_in:CalculetteAides "Calcul de l'aide au logement effective", "Prologue : aides au logement"])) calcul_aide_personnalisee_logement_dot_residence = temp_calcul_aide_personnalisee_logement_dot_residence - result_27 = calcul_aide_personnalisee_logement(CalculAidePersonnaliseeLogementIn(mode_occupation_in = calcul_aide_personnalisee_logement_dot_mode_occupation, + result_34 = calcul_aide_personnalisee_logement(CalculAidePersonnaliseeLogementIn(mode_occupation_in = calcul_aide_personnalisee_logement_dot_mode_occupation, type_aide_in = calcul_aide_personnalisee_logement_dot_type_aide, ressources_menage_sans_arrondi_in = calcul_aide_personnalisee_logement_dot_ressources_menage_sans_arrondi, situation_familiale_in = calcul_aide_personnalisee_logement_dot_situation_familiale, @@ -30263,8 +28407,8 @@ def calculette_aides_au_logement(calculette_aides_au_logement_in:CalculetteAides zone_in = calcul_aide_personnalisee_logement_dot_zone, date_courante_in = calcul_aide_personnalisee_logement_dot_date_courante, residence_in = calcul_aide_personnalisee_logement_dot_residence)) - calcul_aide_personnalisee_logement_dot_aide_finale_formule = result_27.aide_finale_formule - calcul_aide_personnalisee_logement_dot_traitement_aide_finale = result_27.traitement_aide_finale + calcul_aide_personnalisee_logement_dot_aide_finale_formule = result_34.aide_finale_formule + calcul_aide_personnalisee_logement_dot_traitement_aide_finale = result_34.traitement_aide_finale try: temp_coefficents_enfants_garde_alternee_pris_en_compte_5 = eligibilite_aide_personnalisee_logement_dot_coefficents_enfants_garde_alternee_pris_en_compte except EmptyError: @@ -30278,15 +28422,15 @@ def calculette_aides_au_logement(calculette_aides_au_logement_in:CalculetteAides "Prologue : aides au logement"])) coefficents_enfants_garde_alternee_pris_en_compte_3 = temp_coefficents_enfants_garde_alternee_pris_en_compte_5 try: - match_arg_744 = eligibilite_allocation_logement_dot_eligibilite_l841_2 - if match_arg_744.code == TypeEligibiliteAllocationLogement_Code.PasEligible: - _ = match_arg_744.value + match_arg_721 = eligibilite_allocation_logement_dot_eligibilite_l841_2 + if match_arg_721.code == TypeEligibiliteAllocationLogement_Code.PasEligible: + _ = match_arg_721.value temp_eligibilite_13 = False - elif match_arg_744.code == TypeEligibiliteAllocationLogement_Code.AllocationLogementFamiliale: - _ = match_arg_744.value + elif match_arg_721.code == TypeEligibiliteAllocationLogement_Code.AllocationLogementFamiliale: + _ = match_arg_721.value temp_eligibilite_13 = True - elif match_arg_744.code == TypeEligibiliteAllocationLogement_Code.AllocationLogementSociale: - _ = match_arg_744.value + elif match_arg_721.code == TypeEligibiliteAllocationLogement_Code.AllocationLogementSociale: + _ = match_arg_721.value temp_eligibilite_13 = True temp_eligibilite_14 = (eligibilite_aide_personnalisee_logement_dot_eligibilite or temp_eligibilite_13) @@ -30300,39 +28444,37 @@ def calculette_aides_au_logement(calculette_aides_au_logement_in:CalculetteAides "Calcul de l'aide au logement effective", "Prologue : aides au logement"])) eligibilite_3 = temp_eligibilite_14 - def temp_traitement_aide_finale_5(aide_finale_29:Money): + def temp_traitement_aide_finale_5(aide_finale_51:Money): try: + aide_finale_apl = calcul_aide_personnalisee_logement_dot_traitement_aide_finale( + aide_finale_51) + aide_finale_al = calcul_allocation_logement_dot_traitement_aide_finale( + aide_finale_51) if not eligibilite_3: - return aide_finale_29 + return aide_finale_51 else: - match_arg_745 = eligibilite_allocation_logement_dot_eligibilite_l841_2 - if match_arg_745.code == TypeEligibiliteAllocationLogement_Code.PasEligible: - _ = match_arg_745.value + match_arg_722 = eligibilite_allocation_logement_dot_eligibilite_l841_2 + if match_arg_722.code == TypeEligibiliteAllocationLogement_Code.PasEligible: + _ = match_arg_722.value temp_traitement_aide_finale_6 = True - elif match_arg_745.code == TypeEligibiliteAllocationLogement_Code.AllocationLogementFamiliale: - _ = match_arg_745.value + elif match_arg_722.code == TypeEligibiliteAllocationLogement_Code.AllocationLogementFamiliale: + _ = match_arg_722.value temp_traitement_aide_finale_6 = False - elif match_arg_745.code == TypeEligibiliteAllocationLogement_Code.AllocationLogementSociale: - _ = match_arg_745.value + elif match_arg_722.code == TypeEligibiliteAllocationLogement_Code.AllocationLogementSociale: + _ = match_arg_722.value temp_traitement_aide_finale_6 = False if (eligibilite_aide_personnalisee_logement_dot_eligibilite and not temp_traitement_aide_finale_6): - if (calcul_aide_personnalisee_logement_dot_traitement_aide_finale( - aide_finale_29) > - calcul_allocation_logement_dot_traitement_aide_finale( - aide_finale_29)): - return calcul_aide_personnalisee_logement_dot_traitement_aide_finale( - aide_finale_29) + if (aide_finale_apl > + aide_finale_al): + return aide_finale_apl else: - return calcul_allocation_logement_dot_traitement_aide_finale( - aide_finale_29) + return aide_finale_al else: if eligibilite_aide_personnalisee_logement_dot_eligibilite: - return calcul_aide_personnalisee_logement_dot_traitement_aide_finale( - aide_finale_29) + return aide_finale_apl else: - return calcul_allocation_logement_dot_traitement_aide_finale( - aide_finale_29) + return aide_finale_al except EmptyError: raise NoValueProvided(SourcePosition(filename="examples/aides_logement/prologue.catala_fr", start_line=1137, @@ -30347,15 +28489,15 @@ def calculette_aides_au_logement(calculette_aides_au_logement_in:CalculetteAides if not eligibilite_3: temp_aide_finale_formule_10 = money_of_cents_string("0") else: - match_arg_746 = eligibilite_allocation_logement_dot_eligibilite_l841_2 - if match_arg_746.code == TypeEligibiliteAllocationLogement_Code.PasEligible: - _ = match_arg_746.value + match_arg_723 = eligibilite_allocation_logement_dot_eligibilite_l841_2 + if match_arg_723.code == TypeEligibiliteAllocationLogement_Code.PasEligible: + _ = match_arg_723.value temp_aide_finale_formule_11 = True - elif match_arg_746.code == TypeEligibiliteAllocationLogement_Code.AllocationLogementFamiliale: - _ = match_arg_746.value + elif match_arg_723.code == TypeEligibiliteAllocationLogement_Code.AllocationLogementFamiliale: + _ = match_arg_723.value temp_aide_finale_formule_11 = False - elif match_arg_746.code == TypeEligibiliteAllocationLogement_Code.AllocationLogementSociale: - _ = match_arg_746.value + elif match_arg_723.code == TypeEligibiliteAllocationLogement_Code.AllocationLogementSociale: + _ = match_arg_723.value temp_aide_finale_formule_11 = False if (eligibilite_aide_personnalisee_logement_dot_eligibilite and not temp_aide_finale_formule_11): @@ -30393,18 +28535,18 @@ def calculette_aides_au_logement_garde_alternee(calculette_aides_au_logement_gar ressources_menage_prises_en_compte_1 = calculette_aides_au_logement_garde_alternee_in.ressources_menage_prises_en_compte_in try: def temp_menage_sans_enfants_garde_alternee(personne_a_charge_14:PersonneACharge): - match_arg_747 = personne_a_charge_14 - if match_arg_747.code == PersonneACharge_Code.EnfantACharge: - enfant_15 = match_arg_747.value - match_arg_748 = enfant_15.situation_garde_alternee - if match_arg_748.code == SituationGardeAlternee_Code.PasDeGardeAlternee: - _ = match_arg_748.value + match_arg_724 = personne_a_charge_14 + if match_arg_724.code == PersonneACharge_Code.EnfantACharge: + enfant_15 = match_arg_724.value + match_arg_725 = enfant_15.situation_garde_alternee + if match_arg_725.code == SituationGardeAlternee_Code.PasDeGardeAlternee: + _ = match_arg_725.value return True - elif match_arg_748.code == SituationGardeAlternee_Code.GardeAlterneeCoefficientPriseEnCharge: - _ = match_arg_748.value + elif match_arg_725.code == SituationGardeAlternee_Code.GardeAlterneeCoefficientPriseEnCharge: + _ = match_arg_725.value return False - elif match_arg_747.code == PersonneACharge_Code.AutrePersonneACharge: - _ = match_arg_747.value + elif match_arg_724.code == PersonneACharge_Code.AutrePersonneACharge: + _ = match_arg_724.value return True temp_menage_sans_enfants_garde_alternee_1 = Menage(prestations_recues = menage_5.prestations_recues, logement = menage_5.logement, @@ -30474,14 +28616,14 @@ def calculette_aides_au_logement_garde_alternee(calculette_aides_au_logement_gar "Calcul de l'aide au logement effective", "Prologue : aides au logement"])) calculette_dot_ressources_menage_prises_en_compte = temp_calculette_dot_ressources_menage_prises_en_compte - result_28 = calculette_aides_au_logement(CalculetteAidesAuLogementIn(menage_in = calculette_dot_menage, + result_35 = calculette_aides_au_logement(CalculetteAidesAuLogementIn(menage_in = calculette_dot_menage, demandeur_in = calculette_dot_demandeur, date_courante_in = calculette_dot_date_courante, ressources_menage_prises_en_compte_in = calculette_dot_ressources_menage_prises_en_compte)) - calculette_dot_eligibilite = result_28.eligibilite - calculette_dot_aide_finale_formule = result_28.aide_finale_formule - calculette_dot_traitement_aide_finale = result_28.traitement_aide_finale - calculette_dot_coefficents_enfants_garde_alternee_pris_en_compte = result_28.coefficents_enfants_garde_alternee_pris_en_compte + calculette_dot_eligibilite = result_35.eligibilite + calculette_dot_aide_finale_formule = result_35.aide_finale_formule + calculette_dot_traitement_aide_finale = result_35.traitement_aide_finale + calculette_dot_coefficents_enfants_garde_alternee_pris_en_compte = result_35.coefficents_enfants_garde_alternee_pris_en_compte try: temp_calculette_sans_garde_alternee_dot_menage = menage_sans_enfants_garde_alternee except EmptyError: @@ -30529,14 +28671,14 @@ def calculette_aides_au_logement_garde_alternee(calculette_aides_au_logement_gar "Calcul de l'aide au logement effective", "Prologue : aides au logement"])) calculette_sans_garde_alternee_dot_ressources_menage_prises_en_compte = temp_calculette_sans_garde_alternee_dot_ressources_menage_prises_en_compte - result_29 = calculette_aides_au_logement(CalculetteAidesAuLogementIn(menage_in = calculette_sans_garde_alternee_dot_menage, + result_36 = calculette_aides_au_logement(CalculetteAidesAuLogementIn(menage_in = calculette_sans_garde_alternee_dot_menage, demandeur_in = calculette_sans_garde_alternee_dot_demandeur, date_courante_in = calculette_sans_garde_alternee_dot_date_courante, ressources_menage_prises_en_compte_in = calculette_sans_garde_alternee_dot_ressources_menage_prises_en_compte)) - calculette_sans_garde_alternee_dot_eligibilite = result_29.eligibilite - calculette_sans_garde_alternee_dot_aide_finale_formule = result_29.aide_finale_formule - calculette_sans_garde_alternee_dot_traitement_aide_finale = result_29.traitement_aide_finale - calculette_sans_garde_alternee_dot_coefficents_enfants_garde_alternee_pris_en_compte = result_29.coefficents_enfants_garde_alternee_pris_en_compte + calculette_sans_garde_alternee_dot_eligibilite = result_36.eligibilite + calculette_sans_garde_alternee_dot_aide_finale_formule = result_36.aide_finale_formule + calculette_sans_garde_alternee_dot_traitement_aide_finale = result_36.traitement_aide_finale + calculette_sans_garde_alternee_dot_coefficents_enfants_garde_alternee_pris_en_compte = result_36.coefficents_enfants_garde_alternee_pris_en_compte try: temp_eligibilite_15 = calculette_dot_eligibilite except EmptyError: @@ -30584,6 +28726,6 @@ def calculette_aides_au_logement_garde_alternee(calculette_aides_au_logement_gar law_headings=["Calculette avec garde alternée", "Calcul de l'aide au logement effective", "Prologue : aides au logement"])) - aide_finale_30 = temp_aide_finale_2 + aide_finale_52 = temp_aide_finale_2 return CalculetteAidesAuLogementGardeAlternee(eligibilite = eligibilite_4, - aide_finale = aide_finale_30) + aide_finale = aide_finale_52) From 9007eb4204a7d2ad6f8efea96561c617db73ae2f Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Mon, 19 Jun 2023 17:29:51 +0200 Subject: [PATCH 26/26] Apply suggestions by @altgr --- Dockerfile | 2 -- compiler/catala_utils/message.ml | 4 ++-- compiler/lcalc/closure_conversion.ml | 30 +++++++++++++++------------- compiler/shared_ast/typing.ml | 7 ++++--- 4 files changed, 22 insertions(+), 21 deletions(-) diff --git a/Dockerfile b/Dockerfile index dec54020..7093f7ea 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,8 +10,6 @@ RUN sudo apk add python3 RUN sudo ln -s /usr/bin/python3 /usr/bin/python RUN sudo apk add g++ RUN sudo apk add make -# We also need bash to build JaneStreet's base -RUN sudo apk add bash RUN mkdir catala WORKDIR catala diff --git a/compiler/catala_utils/message.ml b/compiler/catala_utils/message.ml index e92b9549..db4cdfa0 100644 --- a/compiler/catala_utils/message.ml +++ b/compiler/catala_utils/message.ml @@ -75,7 +75,7 @@ let print_time_marker = time := new_time; let delta = (new_time -. old_time) *. 1000. in if delta > 50. then - Format.fprintf ppf "@{[TIME] %.0fms@}@\n" delta + Format.fprintf ppf "@{[TIME] %.0fms@}@ " delta let pp_marker target ppf = let open Ocolor_types in @@ -108,7 +108,7 @@ module Content = struct let internal_error_prefix = "Internal Error, please report to \ - https://github.com/CatalaLang/catala/issues: " + https://github.com/CatalaLang/catala/issues : " let prepend_message (content : t) prefix : t = { diff --git a/compiler/lcalc/closure_conversion.ml b/compiler/lcalc/closure_conversion.ml index 599e3a21..2948f009 100644 --- a/compiler/lcalc/closure_conversion.ml +++ b/compiler/lcalc/closure_conversion.ml @@ -166,10 +166,11 @@ let rec transform_closures_expr : as f; args; } -> - (* Special case for some operators: its arguments closures thunks because if - you want to extract it as a function you need these closures to preserve - evaluation order, but backends that don't support closures will simply - extract these operators in a inlined way and skip the thunks. *) + (* Special case for some operators: its arguments shall remain thunks (which + are closures) because if you want to extract it as a function you need + these closures to preserve evaluation order, but backends that don't + support closures will simply extract these operators in a inlined way and + skip the thunks. *) let free_vars, new_args = List.fold_right (fun (arg : (lcalc, m) gexpr) (free_vars, new_args) -> @@ -308,15 +309,17 @@ let transform_closures_program (p : 'm program) : 'm program Bindlib.box = in (* Now we need to further tweak [decl_ctx] because some of the user-defined types can have closures in them and these closured might have changed type. - So we reset them to [TAny] in the hopes that the transformation applied - will not yield to type unification conflicts. Indeed, consider the - following closure: [let f = if ... then fun v -> x + v else fun v -> v]. To - be typed correctly once converted, this closure needs an existential type - but the Catala typechecker doesn't have them. However, this kind of type - conflict is difficult to produce using the Catala surface language: it can - only happen if you store a closure which is the output of a scope inside a - user-defined data structure, and if you do it in two different places in - the code with two closures that don't have the same capture footprint. *) + So we reset them to [TAny] and leave the typechecker to figure it out. This + will not yield any type unification conflicts because of the special type + [TClosureEnv]. Indeed, consider the following closure: [let f = if ... then + fun v -> x + v else fun v -> v]. To be typed correctly once converted, this + closure needs an existential type, this is what [TClosureEnv] is for. This + kind of situation is difficult to produce using the Catala surface + language: it can only happen if you store a closure which is the output of + a scope inside a user-defined data structure, and if you do it in two + different places in the code with two closures that don't have the same + capture footprint. See + [tests/tests_func/good/scope_call_func_struct_closure.catala_en]. *) let new_decl_ctx = let rec type_contains_arrow t = match Mark.remove t with @@ -463,7 +466,6 @@ let rec hoist_closures_expr : | EVar _ -> Expr.map_gather ~acc:[] ~join:( @ ) ~f:(hoist_closures_expr name_context) e | _ -> . - [@@warning "-32"] (* Here I have to reimplement Scope.map_exprs_in_lets because I'm changing the type *) diff --git a/compiler/shared_ast/typing.ml b/compiler/shared_ast/typing.ml index 8e89ad8f..43892d46 100644 --- a/compiler/shared_ast/typing.ml +++ b/compiler/shared_ast/typing.ml @@ -233,9 +233,10 @@ let handle_type_error ctx (A.AnyExpr e) t1 t2 = (format_typ ctx) t2), t2_pos ); ] - "@[Error during typechecking, incompatible types:@]@\n\ - @[@{┌─⯈@} @[%a@]@,\ - @{└─⯈@} @[%a@]@]" (format_typ ctx) t1 (format_typ ctx) t2 + "Error during typechecking, incompatible types:@,\ + @[@{@<3>%s@} @[%a@]@,\ + @{@<3>%s@} @[%a@]@]" "┌─⯈" (format_typ ctx) t1 "└─⯈" + (format_typ ctx) t2 let lit_type (lit : A.lit) : naked_typ = match lit with