From 6fdd739f54bce76068c36cf8bc6e283b6b60448b Mon Sep 17 00:00:00 2001 From: Alain Date: Tue, 2 Nov 2021 18:09:59 +0100 Subject: [PATCH 001/102] saving my work somewhere --- compiler/lcalc/ast.ml | 5 + compiler/lcalc/ast.mli | 5 + compiler/lcalc/optimizations.ml | 2 +- compiler/lcalc/print.ml | 8 ++ compiler/lcalc/remove_empty_exceptions.ml | 137 +++++++++++++++++++++ compiler/lcalc/remove_empty_exceptions.mli | 17 +++ compiler/lcalc/to_ocaml.ml | 1 + 7 files changed, 174 insertions(+), 1 deletion(-) create mode 100644 compiler/lcalc/remove_empty_exceptions.ml create mode 100644 compiler/lcalc/remove_empty_exceptions.mli diff --git a/compiler/lcalc/ast.ml b/compiler/lcalc/ast.ml index 89e036325..5a8cf8dcb 100644 --- a/compiler/lcalc/ast.ml +++ b/compiler/lcalc/ast.ml @@ -46,6 +46,11 @@ type expr = | ERaise of except | ECatch of expr Pos.marked * except * expr Pos.marked + (* TODO: temporary *) + | EMatchopt of expr Pos.marked * expr Pos.marked * expr Pos.marked + | ESome of expr Pos.marked + | ENone + module Var = struct type t = expr Bindlib.var diff --git a/compiler/lcalc/ast.mli b/compiler/lcalc/ast.mli index 6b77042f3..36a8e26d6 100644 --- a/compiler/lcalc/ast.mli +++ b/compiler/lcalc/ast.mli @@ -53,6 +53,11 @@ type expr = | ERaise of except | ECatch of expr Pos.marked * except * expr Pos.marked + (* TODO: temporary *) + | EMatchopt of expr Pos.marked * expr Pos.marked * expr Pos.marked + | ESome of expr Pos.marked + | ENone + (** {1 Variable helpers} *) module Var : sig diff --git a/compiler/lcalc/optimizations.ml b/compiler/lcalc/optimizations.ml index 40a558e7f..2d15695cc 100644 --- a/compiler/lcalc/optimizations.ml +++ b/compiler/lcalc/optimizations.ml @@ -64,7 +64,7 @@ let rec peephole_expr (e : expr Pos.marked) : expr Pos.marked Bindlib.box = | _ -> ECatch (e1, exn, e2)), Pos.get_position e )) (peephole_expr e1) (peephole_expr e2) - | ERaise _ | ELit _ | EOp _ -> Bindlib.box e + | ERaise _ | ELit _ | EOp _ | ENone | ESome _ | EMatchopt _ -> Bindlib.box e let peephole_optimizations (p : program) : program = { p with scopes = List.map (fun (var, e) -> (var, Bindlib.unbox (peephole_expr e))) p.scopes } diff --git a/compiler/lcalc/print.ml b/compiler/lcalc/print.ml index 6df7a532d..2829fa23d 100644 --- a/compiler/lcalc/print.ml +++ b/compiler/lcalc/print.ml @@ -180,3 +180,11 @@ let rec format_expr (ctx : Dcalc.Ast.decl_ctx) (fmt : Format.formatter) (e : exp | EAssert e' -> Format.fprintf fmt "@[%a@ %a%a%a@]" format_keyword "assert" format_punctuation "(" format_expr e' format_punctuation ")" + | ENone -> Format.fprintf fmt "%a@" format_keyword "None" + | ESome e' -> Format.fprintf fmt "@[%a%a%a@]" format_punctuation "(" format_expr e' format_punctuation "(" + | EMatchopt (e1, e2, e3) -> + Format.fprintf fmt "@[%a@ %a@ %a@ @[%a%a%a%a@ %a%a%a%a@]@]" + format_keyword "match" format_expr e1 format_keyword "with" + format_punctuation "\n|" format_keyword "None" format_punctuation "->" format_expr e2 + format_punctuation "\n|" format_keyword "Some" format_punctuation "->" format_expr e3 + diff --git a/compiler/lcalc/remove_empty_exceptions.ml b/compiler/lcalc/remove_empty_exceptions.ml new file mode 100644 index 000000000..21333a436 --- /dev/null +++ b/compiler/lcalc/remove_empty_exceptions.ml @@ -0,0 +1,137 @@ +(* This file is part of the Catala compiler, a specification language for tax and social benefits + computation rules. Copyright (C) 2020 Inria, contributor: Denis Merigoux + + + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + in compliance with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under the License + is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + or implied. See the License for the specific language governing permissions and limitations under + the License. *) + +open Utils +module T = Dcalc.Ast +module D = Ast +module A = Ast + +type ctx = A.expr Pos.marked Bindlib.box D.VarMap.t + +let translate_lit (l : D.lit) : A.expr = + match l with + | D.LBool l -> A.ELit (A.LBool l) + | D.LInt i -> A.ELit (A.LInt i) + | D.LRat r -> A.ELit (A.LRat r) + | D.LMoney m -> A.ELit (A.LMoney m) + | D.LUnit -> A.ELit A.LUnit + | D.LDate d -> A.ELit (A.LDate d) + | D.LDuration d -> A.ELit (A.LDuration d) + + +(* let thunk_expr (e : A.expr Pos.marked Bindlib.box) (pos : Pos.t) : A.expr Pos.marked Bindlib.box = + let dummy_var = A.Var.make ("_", pos) in + A.make_abs [| dummy_var |] e pos [ (T.TAny, pos) ] pos *) + +let (let+) x f = Bindlib.box_apply f x + +let (and+) x y = Bindlib.box_pair x y + + +let rec translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindlib.box = + let same_pos x = Pos.same_pos_as x e in + match Pos.unmark e with + | D.EVar v -> + D.VarMap.find (Pos.unmark v) ctx + | D.ETuple (args, s) -> + let+ args = Bindlib.box_list (List.map (translate_expr ctx) args) in + same_pos @@ A.ETuple (args, s) + | D.ETupleAccess (e1, i, s, ts) -> + let+ e1 = translate_expr ctx e1 in + same_pos @@ A.ETupleAccess (e1, i, s, ts) + | D.EInj (e1, i, en, ts) -> + let+ e1 = translate_expr ctx e1 in + same_pos @@ A.EInj (e1, i, en, ts) + | D.EMatch (e1, cases, en) -> + let+ e1 = translate_expr ctx e1 + and+ cases = Bindlib.box_list (List.map (translate_expr ctx) cases) in + same_pos @@ A.EMatch (e1, cases, en) + | D.EArray es -> + let+ es = Bindlib.box_list (List.map (translate_expr ctx) es) in + same_pos @@ A.EArray es + | D.EOp op -> + Bindlib.box @@ same_pos @@ A.EOp op + | D.EIfThenElse (e1, e2, e3) -> + let+ e1 = translate_expr ctx e1 + and+ e2 = translate_expr ctx e2 + and+ e3 = translate_expr ctx e3 in + same_pos @@ A.EIfThenElse (e1, e2, e3) + | D.EAssert e1 -> + let+ e1 = translate_expr ctx e1 in + same_pos (A.EAssert e1) + | D.EApp (e1, args) -> + let+ e1 = translate_expr ctx e1 + and+ args = Bindlib.box_list (List.map (translate_expr ctx) args) in + same_pos @@ A.EApp (e1, args) + | D.EAbs ((binder, pos_binder), ts) -> + (* let bla = e1 in matchopt bla with None -> None | Some x -> e2 *) + let vars, body = Bindlib.unmbind binder in + let ctx, lc_vars = + Array.fold_right + (fun var (ctx, lc_vars) -> + let lc_var = A.Var.make (Bindlib.name_of var, pos_binder) in + let lc_var_expr = A.make_var (lc_var, pos_binder) in + (D.VarMap.add var lc_var_expr ctx, lc_var :: lc_vars)) + vars (ctx, []) + in + let lc_vars = Array.of_list lc_vars in + let new_body = translate_expr ctx body in + let new_binder = Bindlib.bind_mvar lc_vars new_body in + Bindlib.box_apply + (fun new_binder -> Pos.same_pos_as (A.EAbs ((new_binder, pos_binder), ts)) e) + new_binder + | D.ECatch (e1, exc, e2) -> + begin match exc with + | EmptyError -> + (* let bla = e1 in matchopt bla with None -> e2 | Some _ -> bla *) + (* (fun bla -> matchopt bla with None -> e2 | Some _ -> bla) e1 *) + + failwith "todo" + | _ -> + Bindlib.box_apply2 + (fun e1 e2 -> Pos.same_pos_as (A.ECatch (e1, exc, e2)) e) + (translate_expr ctx e1) (translate_expr ctx e2) + end + | D.ERaise exc -> + begin match exc with + | EmptyError -> + Bindlib.box @@ same_pos A.ENone + | _ -> Bindlib.box (Pos.same_pos_as (A.ERaise exc) e) + end + + + | D.ELit l -> Bindlib.box (same_pos (A.ESome (same_pos (translate_lit l)))) + | D.EMatchopt _ + | D.ENone + | D.ESome _ -> failwith "todo" + + +let translate_program (prgm : D.program) : A.program = + { + scopes = prgm.scopes + |> ListLabels.fold_left ~init:([], D.VarMap.empty) + ~f:begin fun (acc, ctx) (n, e) -> + let new_n = n in + let new_acc = + ( new_n, + Bindlib.unbox (translate_expr (A.VarMap.map (fun v -> D.make_var (v, Pos.no_pos)) ctx) e) + ) :: acc in + let new_ctx = A.VarMap.add n new_n ctx in + (new_acc, new_ctx) + end + |> fst + |> List.rev + ; + decl_ctx = prgm.decl_ctx; + } diff --git a/compiler/lcalc/remove_empty_exceptions.mli b/compiler/lcalc/remove_empty_exceptions.mli new file mode 100644 index 000000000..2b19c6dce --- /dev/null +++ b/compiler/lcalc/remove_empty_exceptions.mli @@ -0,0 +1,17 @@ +(* This file is part of the Catala compiler, a specification language for tax and social benefits + computation rules. Copyright (C) 2020 Inria, contributor: Denis Merigoux + + + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + in compliance with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under the License + is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + or implied. See the License for the specific language governing permissions and limitations under + the License. *) + +(** Translation from the default calculus to the lambda calculus *) + +val translate_program : Ast.program -> Ast.program diff --git a/compiler/lcalc/to_ocaml.ml b/compiler/lcalc/to_ocaml.ml index 8352f3826..82c3ee3e6 100644 --- a/compiler/lcalc/to_ocaml.ml +++ b/compiler/lcalc/to_ocaml.ml @@ -327,6 +327,7 @@ let rec format_expr (ctx : Dcalc.Ast.decl_ctx) (fmt : Format.formatter) (e : exp format_exception (exc, Pos.get_position e) format_with_parens e2 + | ESome _ | ENone | EMatchopt _ -> failwith "todo" let format_struct_embedding (fmt : Format.formatter) ((struct_name, struct_fields) : D.StructName.t * (D.StructFieldName.t * D.typ Pos.marked) list) From a24a4ab6dffa308b01e5f9ce3db10830854cb72c Mon Sep 17 00:00:00 2001 From: Alain Date: Wed, 3 Nov 2021 16:54:21 +0100 Subject: [PATCH 002/102] starting to work on type inference --- compiler/dcalc/ast.mli | 1 + compiler/lcalc/remove_empty_exceptions.ml | 79 ++++++++++++++--------- compiler/lcalc/typecheck.ml | 6 ++ 3 files changed, 54 insertions(+), 32 deletions(-) create mode 100644 compiler/lcalc/typecheck.ml diff --git a/compiler/dcalc/ast.mli b/compiler/dcalc/ast.mli index 617ee26ad..ebe7f520f 100644 --- a/compiler/dcalc/ast.mli +++ b/compiler/dcalc/ast.mli @@ -40,6 +40,7 @@ type typ = | TEnum of typ Pos.marked list * EnumName.t | TArrow of typ Pos.marked * typ Pos.marked | TArray of typ Pos.marked + | TOption of typ Pos.marked | TAny type date = Runtime.date diff --git a/compiler/lcalc/remove_empty_exceptions.ml b/compiler/lcalc/remove_empty_exceptions.ml index 21333a436..a7fc1a6f9 100644 --- a/compiler/lcalc/remove_empty_exceptions.ml +++ b/compiler/lcalc/remove_empty_exceptions.ml @@ -42,8 +42,6 @@ let (and+) x y = Bindlib.box_pair x y let rec translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindlib.box = let same_pos x = Pos.same_pos_as x e in match Pos.unmark e with - | D.EVar v -> - D.VarMap.find (Pos.unmark v) ctx | D.ETuple (args, s) -> let+ args = Bindlib.box_list (List.map (translate_expr ctx) args) in same_pos @@ A.ETuple (args, s) @@ -59,23 +57,21 @@ let rec translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked B same_pos @@ A.EMatch (e1, cases, en) | D.EArray es -> let+ es = Bindlib.box_list (List.map (translate_expr ctx) es) in - same_pos @@ A.EArray es + same_pos @@ A.ESome (same_pos @@ A.EArray es) | D.EOp op -> - Bindlib.box @@ same_pos @@ A.EOp op - | D.EIfThenElse (e1, e2, e3) -> - let+ e1 = translate_expr ctx e1 - and+ e2 = translate_expr ctx e2 - and+ e3 = translate_expr ctx e3 in - same_pos @@ A.EIfThenElse (e1, e2, e3) + Bindlib.box @@ same_pos @@ A.ESome (same_pos @@ A.EOp op) | D.EAssert e1 -> let+ e1 = translate_expr ctx e1 in same_pos (A.EAssert e1) | D.EApp (e1, args) -> + (* e1 args* *) + (* match e1 with | None -> None | Some e1 -> e1 args* *) let+ e1 = translate_expr ctx e1 and+ args = Bindlib.box_list (List.map (translate_expr ctx) args) in same_pos @@ A.EApp (e1, args) | D.EAbs ((binder, pos_binder), ts) -> - (* let bla = e1 in matchopt bla with None -> None | Some x -> e2 *) + (* fun vars: tys -> body *) + (* Some (fun vars: [|tys|] -> body) *) let vars, body = Bindlib.unmbind binder in let ctx, lc_vars = Array.fold_right @@ -87,34 +83,53 @@ let rec translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked B in let lc_vars = Array.of_list lc_vars in let new_body = translate_expr ctx body in - let new_binder = Bindlib.bind_mvar lc_vars new_body in - Bindlib.box_apply - (fun new_binder -> Pos.same_pos_as (A.EAbs ((new_binder, pos_binder), ts)) e) - new_binder + let+ new_binder = Bindlib.bind_mvar lc_vars new_body in + same_pos @@ A.EAbs ((new_binder, pos_binder), ts) + + | D.EIfThenElse (e1, e2, e3) -> + let+ e1 = translate_expr ctx e1 + and+ e2 = translate_expr ctx e2 + and+ e3 = translate_expr ctx e3 in + let x = A.Var.make ("e1", snd e1 ) in + (* same_pos @@ + A.make_let_in x (T.TOption T.TBool) + (Pos.same_pos_as e1 e1) + (same_pos @@ A.EMatchopt(A.make_var x, A.ENone, A.EAbs A.EIfThenElse (A.make_var x, e2, e3))) *) + assert false | D.ECatch (e1, exc, e2) -> begin match exc with | EmptyError -> - (* let bla = e1 in matchopt bla with None -> e2 | Some _ -> bla *) - (* (fun bla -> matchopt bla with None -> e2 | Some _ -> bla) e1 *) - - failwith "todo" + begin + (* let bla = e1 in matchopt bla with None -> e2 | Some _ -> bla *) + (* (fun bla -> matchopt bla with None -> e2 | Some _ -> bla) e1 *) + let+ e1 = translate_expr ctx e1 + and+ e2 = translate_expr ctx e2 in + (* todo: /!\ exponential cost. Use let in instead *) + same_pos @@ A.EMatchopt(e1, e2, e1) + end | _ -> - Bindlib.box_apply2 - (fun e1 e2 -> Pos.same_pos_as (A.ECatch (e1, exc, e2)) e) - (translate_expr ctx e1) (translate_expr ctx e2) + let+ e1 = translate_expr ctx e1 + and+ e2 = translate_expr ctx e2 in + same_pos @@ A.ECatch (e1, exc, e2) end | D.ERaise exc -> - begin match exc with - | EmptyError -> - Bindlib.box @@ same_pos A.ENone - | _ -> Bindlib.box (Pos.same_pos_as (A.ERaise exc) e) - end - - - | D.ELit l -> Bindlib.box (same_pos (A.ESome (same_pos (translate_lit l)))) - | D.EMatchopt _ - | D.ENone - | D.ESome _ -> failwith "todo" + Bindlib.box begin match exc with + | EmptyError -> same_pos @@ A.ENone + | _ -> same_pos @@ A.ERaise exc + end + | D.EVar v -> D.VarMap.find (Pos.unmark v) ctx + | D.EMatchopt (e1, e2, e3) -> + let+ e1 = translate_expr ctx e1 + and+ e2 = translate_expr ctx e2 + and+ e3 = translate_expr ctx e3 in + same_pos @@ A.EMatchopt (e1, e2, e3) + | D.ELit l -> + Bindlib.box @@ same_pos @@ A.ESome (same_pos (translate_lit l)) + | D.ENone -> + Bindlib.box @@ same_pos @@ A.ESome (same_pos @@ A.ENone) + | D.ESome e1 -> + let+ e1 = translate_expr ctx e1 in + same_pos @@ A.ESome (same_pos @@ A.ESome e1) let translate_program (prgm : D.program) : A.program = diff --git a/compiler/lcalc/typecheck.ml b/compiler/lcalc/typecheck.ml new file mode 100644 index 000000000..06e466706 --- /dev/null +++ b/compiler/lcalc/typecheck.ml @@ -0,0 +1,6 @@ +module A = Ast + + +let rec infer ctx (e: A.expr) = + match e with + | \ No newline at end of file From 41a89612854b6fe94e97a07773d6ae80f61719b0 Mon Sep 17 00:00:00 2001 From: Alain Date: Thu, 4 Nov 2021 16:00:27 +0100 Subject: [PATCH 003/102] tentative, trying something else --- compiler/dcalc/ast.ml | 1 + compiler/dcalc/implementing defaults | 7 + compiler/lcalc/ast.mli | 7 + compiler/lcalc/compile_without_exceptions.ml | 151 ++++++++++++++++++ compiler/lcalc/compile_without_exceptions.mli | 17 ++ compiler/lcalc/remove_empty_exceptions.ml | 17 +- compiler/lcalc/typecheck.ml | 6 +- 7 files changed, 200 insertions(+), 6 deletions(-) create mode 100644 compiler/dcalc/implementing defaults create mode 100644 compiler/lcalc/compile_without_exceptions.ml create mode 100644 compiler/lcalc/compile_without_exceptions.mli diff --git a/compiler/dcalc/ast.ml b/compiler/dcalc/ast.ml index 994afd6ac..d0d41080a 100644 --- a/compiler/dcalc/ast.ml +++ b/compiler/dcalc/ast.ml @@ -44,6 +44,7 @@ type typ = | TEnum of typ Pos.marked list * enum_name | TArrow of typ Pos.marked * typ Pos.marked | TArray of typ Pos.marked + | TOption of typ Pos.marked | TAny type date = Runtime.date diff --git a/compiler/dcalc/implementing defaults b/compiler/dcalc/implementing defaults new file mode 100644 index 000000000..de6c49abd --- /dev/null +++ b/compiler/dcalc/implementing defaults @@ -0,0 +1,7 @@ +implementing options translation + +practical issues: + * bindlib code is hard to read without let+. + * type inference is not implemented for lcalc terms. So i will need to go inside dcalc terms. + * manipulating lets requires types + * lets are use everywhere inside the translation diff --git a/compiler/lcalc/ast.mli b/compiler/lcalc/ast.mli index 36a8e26d6..4e22145ca 100644 --- a/compiler/lcalc/ast.mli +++ b/compiler/lcalc/ast.mli @@ -95,6 +95,13 @@ val make_let_in : expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box + val make_let_in' : + Var.t -> + Dcalc.Ast.typ Pos.marked -> + expr Pos.marked -> + expr Pos.marked -> + expr Pos.marked + val handle_default : Var.t type binder = (expr, expr Pos.marked) Bindlib.binder diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml new file mode 100644 index 000000000..d34249538 --- /dev/null +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -0,0 +1,151 @@ +(* This file is part of the Catala compiler, a specification language for tax and social benefits + computation rules. Copyright (C) 2020 Inria, contributor: Denis Merigoux + + + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + in compliance with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under the License + is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + or implied. See the License for the specific language governing permissions and limitations under + the License. *) + + open Utils + module D = Dcalc.Ast + module A = Ast + + type ctx = A.expr Pos.marked Bindlib.box D.VarMap.t + + let translate_lit (l : D.lit) : A.expr = + match l with + | D.LBool l -> A.ELit (A.LBool l) + | D.LInt i -> A.ELit (A.LInt i) + | D.LRat r -> A.ELit (A.LRat r) + | D.LMoney m -> A.ELit (A.LMoney m) + | D.LUnit -> A.ELit A.LUnit + | D.LDate d -> A.ELit (A.LDate d) + | D.LDuration d -> A.ELit (A.LDuration d) + | D.LEmptyError -> A.ERaise A.EmptyError + + let thunk_expr (e : A.expr Pos.marked Bindlib.box) (pos : Pos.t) : A.expr Pos.marked Bindlib.box = + let dummy_var = A.Var.make ("_", pos) in + A.make_abs [| dummy_var |] e pos [ (D.TAny, pos) ] pos + + let rec translate_default (ctx : ctx) (exceptions : D.expr Pos.marked list) + (just : D.expr Pos.marked) (cons : D.expr Pos.marked) (pos_default : Pos.t) : + A.expr Pos.marked Bindlib.box = + let exceptions = + List.map (fun except -> thunk_expr (translate_expr ctx except) pos_default) exceptions + in + let exceptions = + A.make_app + (A.make_var (A.handle_default, pos_default)) + [ + Bindlib.box_apply + (fun exceptions -> (A.EArray exceptions, pos_default)) + (Bindlib.box_list exceptions); + thunk_expr (translate_expr ctx just) pos_default; + thunk_expr (translate_expr ctx cons) pos_default; + ] + pos_default + in + exceptions + + and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindlib.box = + match Pos.unmark e with + | D.EVar v -> D.VarMap.find (Pos.unmark v) ctx + | D.ETuple (args, s) -> + Bindlib.box_apply + (fun args -> Pos.same_pos_as (A.ETuple (args, s)) e) + (Bindlib.box_list (List.map (translate_expr ctx) args)) + | D.ETupleAccess (e1, i, s, ts) -> + Bindlib.box_apply + (fun e1 -> Pos.same_pos_as (A.ETupleAccess (e1, i, s, ts)) e) + (translate_expr ctx e1) + | D.EInj (e1, i, en, ts) -> + Bindlib.box_apply + (fun e1 -> Pos.same_pos_as (A.EInj (e1, i, en, ts)) e) + (translate_expr ctx e1) + | D.EMatch (e1, cases, en) -> + Bindlib.box_apply2 + (fun e1 cases -> Pos.same_pos_as (A.EMatch (e1, cases, en)) e) + (translate_expr ctx e1) + (Bindlib.box_list (List.map (translate_expr ctx) cases)) + | D.EArray es -> + Bindlib.box_apply + (fun es -> Pos.same_pos_as (A.EArray es) e) + (Bindlib.box_list (List.map (translate_expr ctx) es)) + | D.ELit l -> Bindlib.box (Pos.same_pos_as (translate_lit l) e) + | D.EOp op -> Bindlib.box (Pos.same_pos_as (A.EOp op) e) + | D.EIfThenElse (e1, e2, e3) -> + Bindlib.box_apply3 + (fun e1 e2 e3 -> Pos.same_pos_as (A.EIfThenElse (e1, e2, e3)) e) + (translate_expr ctx e1) (translate_expr ctx e2) (translate_expr ctx e3) + | D.EAssert e1 -> + Bindlib.box_apply (fun e1 -> Pos.same_pos_as (A.EAssert e1) e) (translate_expr ctx e1) + | D.ErrorOnEmpty arg -> + Bindlib.box_apply + (fun arg -> + Pos.same_pos_as + (A.ECatch (arg, A.EmptyError, Pos.same_pos_as (A.ERaise A.NoValueProvided) e)) + e) + (translate_expr ctx arg) + | D.EApp (e1, args) -> + Bindlib.box_apply2 + (fun e1 args -> Pos.same_pos_as (A.EApp (e1, args)) e) + (translate_expr ctx e1) + (Bindlib.box_list (List.map (translate_expr ctx) args)) + | D.EAbs ((binder, pos_binder), ts) -> + let vars, body = Bindlib.unmbind binder in + let ctx, lc_vars = + Array.fold_right + (fun var (ctx, lc_vars) -> + let lc_var = A.Var.make (Bindlib.name_of var, pos_binder) in + let lc_var_expr = A.make_var (lc_var, pos_binder) in + (D.VarMap.add var lc_var_expr ctx, lc_var :: lc_vars)) + vars (ctx, []) + in + let lc_vars = Array.of_list lc_vars in + let new_body = translate_expr ctx body in + let new_binder = Bindlib.bind_mvar lc_vars new_body in + Bindlib.box_apply + (fun new_binder -> Pos.same_pos_as (A.EAbs ((new_binder, pos_binder), ts)) e) + new_binder + | D.EDefault ([ exn ], just, cons) when !Cli.optimize_flag -> + Bindlib.box_apply3 + (fun exn just cons -> + Pos.same_pos_as + (A.ECatch + ( exn, + A.EmptyError, + Pos.same_pos_as + (A.EIfThenElse (just, cons, Pos.same_pos_as (A.ERaise A.EmptyError) e)) + e )) + e) + (translate_expr ctx exn) (translate_expr ctx just) (translate_expr ctx cons) + | D.EDefault (exceptions, just, cons) -> + translate_default ctx exceptions just cons (Pos.get_position e) + + let translate_program (prgm : D.program) : A.program = + { + scopes = + (let acc, _ = + List.fold_left + (fun ((acc, ctx) : 'a * A.Var.t D.VarMap.t) (_, n, e) -> + let new_n = A.Var.make (Bindlib.name_of n, Pos.no_pos) in + let new_acc = + ( new_n, + Bindlib.unbox + (translate_expr (D.VarMap.map (fun v -> A.make_var (v, Pos.no_pos)) ctx) e) ) + :: acc + in + let new_ctx = D.VarMap.add n new_n ctx in + (new_acc, new_ctx)) + ([], D.VarMap.empty) prgm.scopes + in + List.rev acc); + decl_ctx = prgm.decl_ctx; + } + \ No newline at end of file diff --git a/compiler/lcalc/compile_without_exceptions.mli b/compiler/lcalc/compile_without_exceptions.mli new file mode 100644 index 000000000..6e4acf406 --- /dev/null +++ b/compiler/lcalc/compile_without_exceptions.mli @@ -0,0 +1,17 @@ +(* This file is part of the Catala compiler, a specification language for tax and social benefits + computation rules. Copyright (C) 2020 Inria, contributor: Denis Merigoux + + + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + in compliance with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under the License + is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + or implied. See the License for the specific language governing permissions and limitations under + the License. *) + +(** Translation from the default calculus to the lambda calculus *) + +val translate_program : Dcalc.Ast.program -> Ast.program diff --git a/compiler/lcalc/remove_empty_exceptions.ml b/compiler/lcalc/remove_empty_exceptions.ml index a7fc1a6f9..4a27b1804 100644 --- a/compiler/lcalc/remove_empty_exceptions.ml +++ b/compiler/lcalc/remove_empty_exceptions.ml @@ -102,10 +102,21 @@ let rec translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked B begin (* let bla = e1 in matchopt bla with None -> e2 | Some _ -> bla *) (* (fun bla -> matchopt bla with None -> e2 | Some _ -> bla) e1 *) - let+ e1 = translate_expr ctx e1 - and+ e2 = translate_expr ctx e2 in + + let pos = snd e1 in + let x_var = (A.Var.make ("e1", pos), pos) in + + let e1 = translate_expr ctx e1 in + let e2 = translate_expr ctx e2 in + let x = A.make_var x_var in (* todo: /!\ exponential cost. Use let in instead *) - same_pos @@ A.EMatchopt(e1, e2, e1) + + let body = let+ e2 = e2 and+ x = x in + same_pos @@ A.EMatchopt(x, e2, x) in + + let tau = assert false in + + A.make_let_in (fst x_var) tau e1 body end | _ -> let+ e1 = translate_expr ctx e1 diff --git a/compiler/lcalc/typecheck.ml b/compiler/lcalc/typecheck.ml index 06e466706..3688921a3 100644 --- a/compiler/lcalc/typecheck.ml +++ b/compiler/lcalc/typecheck.ml @@ -1,6 +1,6 @@ module A = Ast +module T = Dcalc.Ast -let rec infer ctx (e: A.expr) = - match e with - | \ No newline at end of file +let rec infer ctx (e: A.expr) : Dcalc.Ast.typ = + assert false \ No newline at end of file From 0f5fde2c5a848dbf153f783921ff877565b6a66c Mon Sep 17 00:00:00 2001 From: Alain Date: Thu, 4 Nov 2021 17:57:41 +0100 Subject: [PATCH 004/102] advancing --- compiler/dcalc/ast.ml | 1 - compiler/dcalc/ast.mli | 1 - compiler/lcalc/ast.ml | 42 +++ compiler/lcalc/ast.mli | 8 +- compiler/lcalc/compile_without_exceptions.ml | 317 ++++++++++--------- compiler/lcalc/remove_empty_exceptions.ml | 163 ---------- compiler/lcalc/remove_empty_exceptions.mli | 17 - compiler/lcalc/typecheck.ml | 6 - 8 files changed, 213 insertions(+), 342 deletions(-) delete mode 100644 compiler/lcalc/remove_empty_exceptions.ml delete mode 100644 compiler/lcalc/remove_empty_exceptions.mli delete mode 100644 compiler/lcalc/typecheck.ml diff --git a/compiler/dcalc/ast.ml b/compiler/dcalc/ast.ml index d0d41080a..994afd6ac 100644 --- a/compiler/dcalc/ast.ml +++ b/compiler/dcalc/ast.ml @@ -44,7 +44,6 @@ type typ = | TEnum of typ Pos.marked list * enum_name | TArrow of typ Pos.marked * typ Pos.marked | TArray of typ Pos.marked - | TOption of typ Pos.marked | TAny type date = Runtime.date diff --git a/compiler/dcalc/ast.mli b/compiler/dcalc/ast.mli index ebe7f520f..617ee26ad 100644 --- a/compiler/dcalc/ast.mli +++ b/compiler/dcalc/ast.mli @@ -40,7 +40,6 @@ type typ = | TEnum of typ Pos.marked list * EnumName.t | TArrow of typ Pos.marked * typ Pos.marked | TArray of typ Pos.marked - | TOption of typ Pos.marked | TAny type date = Runtime.date diff --git a/compiler/lcalc/ast.ml b/compiler/lcalc/ast.ml index 5a8cf8dcb..c4ae61230 100644 --- a/compiler/lcalc/ast.ml +++ b/compiler/lcalc/ast.ml @@ -47,6 +47,24 @@ type expr = | ECatch of expr Pos.marked * except * expr Pos.marked (* TODO: temporary *) + + (* semantics of ESome and ENone should be easy to comprehend. *) + (* The semantics of EMatchopt i've choosen are as following : + + Context : + + C := ... + | matchopt [.] e2 e3 + + And the rules : + + ---------------------------------- + matchopt (Some e1) e2 e3 ~~> e3 e1 + + -------------------------- + matchopt None e2 e3 ~~> e2 + + *) | EMatchopt of expr Pos.marked * expr Pos.marked * expr Pos.marked | ESome of expr Pos.marked | ENone @@ -89,6 +107,30 @@ let make_let_in (x : Var.t) (tau : D.typ Pos.marked) (e1 : expr Pos.marked Bindl (Pos.get_position (Bindlib.unbox e2))) (Bindlib.box_list [ e1 ]) + +let (let+) x f = Bindlib.box_apply f x +let (and+) x y =Bindlib.box_pair x y + +let make_letopt_in + (x: Var.t) + (tau: D.typ Pos.marked) + (e1: expr Pos.marked Bindlib.box) + (e2: expr Pos.marked Bindlib.box) +: expr Pos.marked Bindlib.box = + + let pos = Pos.get_position (Bindlib.unbox e2) in + + let+ e2 = make_abs + (Array.of_list [ x ]) + e2 + (Pos.get_position (Bindlib.unbox e2)) + [ tau ] + (Pos.get_position (Bindlib.unbox e2)) + and+ e1 = e1 in + + (EMatchopt (e1, (ENone, pos) , e2), pos) + + let handle_default = Var.make ("handle_default", Pos.no_pos) type binder = (expr, expr Pos.marked) Bindlib.binder diff --git a/compiler/lcalc/ast.mli b/compiler/lcalc/ast.mli index 4e22145ca..d6aca357f 100644 --- a/compiler/lcalc/ast.mli +++ b/compiler/lcalc/ast.mli @@ -95,12 +95,12 @@ val make_let_in : expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box - val make_let_in' : +val make_letopt_in: Var.t -> Dcalc.Ast.typ Pos.marked -> - expr Pos.marked -> - expr Pos.marked -> - expr Pos.marked + expr Pos.marked Bindlib.box -> + expr Pos.marked Bindlib.box -> + expr Pos.marked Bindlib.box val handle_default : Var.t diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index d34249538..3e565b673 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -1,151 +1,168 @@ (* This file is part of the Catala compiler, a specification language for tax and social benefits - computation rules. Copyright (C) 2020 Inria, contributor: Denis Merigoux - - - Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - in compliance with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software distributed under the License - is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - or implied. See the License for the specific language governing permissions and limitations under - the License. *) - - open Utils - module D = Dcalc.Ast - module A = Ast - - type ctx = A.expr Pos.marked Bindlib.box D.VarMap.t - - let translate_lit (l : D.lit) : A.expr = - match l with - | D.LBool l -> A.ELit (A.LBool l) - | D.LInt i -> A.ELit (A.LInt i) - | D.LRat r -> A.ELit (A.LRat r) - | D.LMoney m -> A.ELit (A.LMoney m) - | D.LUnit -> A.ELit A.LUnit - | D.LDate d -> A.ELit (A.LDate d) - | D.LDuration d -> A.ELit (A.LDuration d) - | D.LEmptyError -> A.ERaise A.EmptyError - - let thunk_expr (e : A.expr Pos.marked Bindlib.box) (pos : Pos.t) : A.expr Pos.marked Bindlib.box = - let dummy_var = A.Var.make ("_", pos) in - A.make_abs [| dummy_var |] e pos [ (D.TAny, pos) ] pos - - let rec translate_default (ctx : ctx) (exceptions : D.expr Pos.marked list) - (just : D.expr Pos.marked) (cons : D.expr Pos.marked) (pos_default : Pos.t) : - A.expr Pos.marked Bindlib.box = - let exceptions = - List.map (fun except -> thunk_expr (translate_expr ctx except) pos_default) exceptions - in - let exceptions = - A.make_app - (A.make_var (A.handle_default, pos_default)) - [ - Bindlib.box_apply - (fun exceptions -> (A.EArray exceptions, pos_default)) - (Bindlib.box_list exceptions); - thunk_expr (translate_expr ctx just) pos_default; - thunk_expr (translate_expr ctx cons) pos_default; - ] - pos_default - in - exceptions - - and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindlib.box = - match Pos.unmark e with - | D.EVar v -> D.VarMap.find (Pos.unmark v) ctx - | D.ETuple (args, s) -> - Bindlib.box_apply - (fun args -> Pos.same_pos_as (A.ETuple (args, s)) e) - (Bindlib.box_list (List.map (translate_expr ctx) args)) - | D.ETupleAccess (e1, i, s, ts) -> - Bindlib.box_apply - (fun e1 -> Pos.same_pos_as (A.ETupleAccess (e1, i, s, ts)) e) - (translate_expr ctx e1) - | D.EInj (e1, i, en, ts) -> - Bindlib.box_apply - (fun e1 -> Pos.same_pos_as (A.EInj (e1, i, en, ts)) e) - (translate_expr ctx e1) - | D.EMatch (e1, cases, en) -> - Bindlib.box_apply2 - (fun e1 cases -> Pos.same_pos_as (A.EMatch (e1, cases, en)) e) - (translate_expr ctx e1) - (Bindlib.box_list (List.map (translate_expr ctx) cases)) - | D.EArray es -> - Bindlib.box_apply - (fun es -> Pos.same_pos_as (A.EArray es) e) - (Bindlib.box_list (List.map (translate_expr ctx) es)) - | D.ELit l -> Bindlib.box (Pos.same_pos_as (translate_lit l) e) - | D.EOp op -> Bindlib.box (Pos.same_pos_as (A.EOp op) e) - | D.EIfThenElse (e1, e2, e3) -> - Bindlib.box_apply3 - (fun e1 e2 e3 -> Pos.same_pos_as (A.EIfThenElse (e1, e2, e3)) e) - (translate_expr ctx e1) (translate_expr ctx e2) (translate_expr ctx e3) - | D.EAssert e1 -> - Bindlib.box_apply (fun e1 -> Pos.same_pos_as (A.EAssert e1) e) (translate_expr ctx e1) - | D.ErrorOnEmpty arg -> - Bindlib.box_apply - (fun arg -> - Pos.same_pos_as - (A.ECatch (arg, A.EmptyError, Pos.same_pos_as (A.ERaise A.NoValueProvided) e)) - e) - (translate_expr ctx arg) - | D.EApp (e1, args) -> - Bindlib.box_apply2 - (fun e1 args -> Pos.same_pos_as (A.EApp (e1, args)) e) - (translate_expr ctx e1) - (Bindlib.box_list (List.map (translate_expr ctx) args)) - | D.EAbs ((binder, pos_binder), ts) -> - let vars, body = Bindlib.unmbind binder in - let ctx, lc_vars = - Array.fold_right - (fun var (ctx, lc_vars) -> - let lc_var = A.Var.make (Bindlib.name_of var, pos_binder) in - let lc_var_expr = A.make_var (lc_var, pos_binder) in - (D.VarMap.add var lc_var_expr ctx, lc_var :: lc_vars)) - vars (ctx, []) - in - let lc_vars = Array.of_list lc_vars in - let new_body = translate_expr ctx body in - let new_binder = Bindlib.bind_mvar lc_vars new_body in - Bindlib.box_apply - (fun new_binder -> Pos.same_pos_as (A.EAbs ((new_binder, pos_binder), ts)) e) - new_binder - | D.EDefault ([ exn ], just, cons) when !Cli.optimize_flag -> - Bindlib.box_apply3 - (fun exn just cons -> - Pos.same_pos_as - (A.ECatch - ( exn, - A.EmptyError, - Pos.same_pos_as - (A.EIfThenElse (just, cons, Pos.same_pos_as (A.ERaise A.EmptyError) e)) - e )) - e) - (translate_expr ctx exn) (translate_expr ctx just) (translate_expr ctx cons) - | D.EDefault (exceptions, just, cons) -> - translate_default ctx exceptions just cons (Pos.get_position e) - - let translate_program (prgm : D.program) : A.program = - { - scopes = - (let acc, _ = - List.fold_left - (fun ((acc, ctx) : 'a * A.Var.t D.VarMap.t) (_, n, e) -> - let new_n = A.Var.make (Bindlib.name_of n, Pos.no_pos) in - let new_acc = - ( new_n, - Bindlib.unbox - (translate_expr (D.VarMap.map (fun v -> A.make_var (v, Pos.no_pos)) ctx) e) ) - :: acc - in - let new_ctx = D.VarMap.add n new_n ctx in - (new_acc, new_ctx)) - ([], D.VarMap.empty) prgm.scopes - in - List.rev acc); - decl_ctx = prgm.decl_ctx; - } - \ No newline at end of file +computation rules. Copyright (C) 2020 Inria, contributor: Denis Merigoux + + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except +in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License +is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +or implied. See the License for the specific language governing permissions and limitations under +the License. *) + +open Utils +module D = Dcalc.Ast +module A = Ast + +type ctx = A.expr Pos.marked Bindlib.box D.VarMap.t + +let translate_lit (l : D.lit) : A.expr = + match l with + | D.LBool l -> A.ELit (A.LBool l) + | D.LInt i -> A.ELit (A.LInt i) + | D.LRat r -> A.ELit (A.LRat r) + | D.LMoney m -> A.ELit (A.LMoney m) + | D.LUnit -> A.ELit A.LUnit + | D.LDate d -> A.ELit (A.LDate d) + | D.LDuration d -> A.ELit (A.LDuration d) + | D.LEmptyError -> A.ERaise A.EmptyError + +let (let+) x f = Bindlib.box_apply f x +let (and+) x y = Bindlib.box_pair x y + +let thunk_expr (e : A.expr Pos.marked Bindlib.box) (pos : Pos.t) : A.expr Pos.marked Bindlib.box = + let dummy_var = A.Var.make ("_", pos) in + A.make_abs [| dummy_var |] e pos [ (D.TAny, pos) ] pos + +let rec translate_default (ctx : ctx) (exceptions : D.expr Pos.marked list) + (just : D.expr Pos.marked) (cons : D.expr Pos.marked) (pos_default : Pos.t) : + A.expr Pos.marked Bindlib.box = + let exceptions = + List.map (fun except -> thunk_expr (translate_expr ctx except) pos_default) exceptions + in + let exceptions = + A.make_app + (A.make_var (A.handle_default, pos_default)) + [ + Bindlib.box_apply + (fun exceptions -> (A.EArray exceptions, pos_default)) + (Bindlib.box_list exceptions); + thunk_expr (translate_expr ctx just) pos_default; + thunk_expr (translate_expr ctx cons) pos_default; + ] + pos_default + in + exceptions + +(* non-existing for the moment. *) +and translate_typ (t: D.typ Pos.marked) : D.typ Pos.marked = + let _ = t in assert false + +and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindlib.box = + match Pos.unmark e with + | D.EVar v -> D.VarMap.find (Pos.unmark v) ctx + | D.ETuple (args, s) -> + let+ args = Bindlib.box_list (List.map (translate_expr ctx) args) in + Pos.same_pos_as (A.ETuple (args, s)) e + | D.ETupleAccess (e1, i, s, ts) -> + let e1 = translate_expr ctx e1 in + (* e1 : [|'a|] array option *) + + let pos = Pos.get_position(Bindlib.unbox e1) in + let x = A.Var.make ("e1", pos) in + let tau = assert false in + + let e2 = + let+ e1 = Bindlib.box (A.EVar (x, pos)) in + (A.ETupleAccess ((e1, pos), i, s, ts), pos) in + + A.make_letopt_in x tau e1 e2 + + | D.EInj (e1, i, en, ts) -> + Bindlib.box_apply + (fun e1 -> Pos.same_pos_as (A.EInj (e1, i, en, ts)) e) + (translate_expr ctx e1) + | D.EMatch (e1, cases, en) -> + Bindlib.box_apply2 + (fun e1 cases -> Pos.same_pos_as (A.EMatch (e1, cases, en)) e) + (translate_expr ctx e1) + (Bindlib.box_list (List.map (translate_expr ctx) cases)) + | D.EArray es -> + Bindlib.box_apply + (fun es -> Pos.same_pos_as (A.EArray es) e) + (Bindlib.box_list (List.map (translate_expr ctx) es)) + | D.ELit l -> Bindlib.box (Pos.same_pos_as (translate_lit l) e) + | D.EOp op -> Bindlib.box (Pos.same_pos_as (A.EOp op) e) + | D.EIfThenElse (e1, e2, e3) -> + Bindlib.box_apply3 + (fun e1 e2 e3 -> Pos.same_pos_as (A.EIfThenElse (e1, e2, e3)) e) + (translate_expr ctx e1) (translate_expr ctx e2) (translate_expr ctx e3) + | D.EAssert e1 -> + Bindlib.box_apply (fun e1 -> Pos.same_pos_as (A.EAssert e1) e) (translate_expr ctx e1) + | D.ErrorOnEmpty arg -> + Bindlib.box_apply + (fun arg -> + Pos.same_pos_as + (A.ECatch (arg, A.EmptyError, Pos.same_pos_as (A.ERaise A.NoValueProvided) e)) + e) + (translate_expr ctx arg) + | D.EApp (e1, args) -> + Bindlib.box_apply2 + (fun e1 args -> Pos.same_pos_as (A.EApp (e1, args)) e) + (translate_expr ctx e1) + (Bindlib.box_list (List.map (translate_expr ctx) args)) + | D.EAbs ((binder, pos_binder), ts) -> + let vars, body = Bindlib.unmbind binder in + let ctx, lc_vars = + Array.fold_right + (fun var (ctx, lc_vars) -> + let lc_var = A.Var.make (Bindlib.name_of var, pos_binder) in + let lc_var_expr = A.make_var (lc_var, pos_binder) in + (D.VarMap.add var lc_var_expr ctx, lc_var :: lc_vars)) + vars (ctx, []) + in + let lc_vars = Array.of_list lc_vars in + let new_body = translate_expr ctx body in + let new_binder = Bindlib.bind_mvar lc_vars new_body in + Bindlib.box_apply + (fun new_binder -> Pos.same_pos_as (A.EAbs ((new_binder, pos_binder), ts)) e) + new_binder + | D.EDefault ([ exn ], just, cons) when !Cli.optimize_flag -> + Bindlib.box_apply3 + (fun exn just cons -> + Pos.same_pos_as + (A.ECatch + ( exn, + A.EmptyError, + Pos.same_pos_as + (A.EIfThenElse (just, cons, Pos.same_pos_as (A.ERaise A.EmptyError) e)) + e )) + e) + (translate_expr ctx exn) (translate_expr ctx just) (translate_expr ctx cons) + | D.EDefault (exceptions, just, cons) -> + translate_default ctx exceptions just cons (Pos.get_position e) + + +(* no change here *) +let translate_program (prgm : D.program) : A.program = + { + scopes = + (let acc, _ = + List.fold_left + (fun ((acc, ctx) : 'a * A.Var.t D.VarMap.t) (_, n, e) -> + let new_n = A.Var.make (Bindlib.name_of n, Pos.no_pos) in + let new_acc = + ( new_n, + Bindlib.unbox + (translate_expr (D.VarMap.map (fun v -> A.make_var (v, Pos.no_pos)) ctx) e) ) + :: acc + in + let new_ctx = D.VarMap.add n new_n ctx in + (new_acc, new_ctx)) + ([], D.VarMap.empty) prgm.scopes + in + List.rev acc); + decl_ctx = prgm.decl_ctx; + } diff --git a/compiler/lcalc/remove_empty_exceptions.ml b/compiler/lcalc/remove_empty_exceptions.ml deleted file mode 100644 index 4a27b1804..000000000 --- a/compiler/lcalc/remove_empty_exceptions.ml +++ /dev/null @@ -1,163 +0,0 @@ -(* This file is part of the Catala compiler, a specification language for tax and social benefits - computation rules. Copyright (C) 2020 Inria, contributor: Denis Merigoux - - - Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - in compliance with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software distributed under the License - is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - or implied. See the License for the specific language governing permissions and limitations under - the License. *) - -open Utils -module T = Dcalc.Ast -module D = Ast -module A = Ast - -type ctx = A.expr Pos.marked Bindlib.box D.VarMap.t - -let translate_lit (l : D.lit) : A.expr = - match l with - | D.LBool l -> A.ELit (A.LBool l) - | D.LInt i -> A.ELit (A.LInt i) - | D.LRat r -> A.ELit (A.LRat r) - | D.LMoney m -> A.ELit (A.LMoney m) - | D.LUnit -> A.ELit A.LUnit - | D.LDate d -> A.ELit (A.LDate d) - | D.LDuration d -> A.ELit (A.LDuration d) - - -(* let thunk_expr (e : A.expr Pos.marked Bindlib.box) (pos : Pos.t) : A.expr Pos.marked Bindlib.box = - let dummy_var = A.Var.make ("_", pos) in - A.make_abs [| dummy_var |] e pos [ (T.TAny, pos) ] pos *) - -let (let+) x f = Bindlib.box_apply f x - -let (and+) x y = Bindlib.box_pair x y - - -let rec translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindlib.box = - let same_pos x = Pos.same_pos_as x e in - match Pos.unmark e with - | D.ETuple (args, s) -> - let+ args = Bindlib.box_list (List.map (translate_expr ctx) args) in - same_pos @@ A.ETuple (args, s) - | D.ETupleAccess (e1, i, s, ts) -> - let+ e1 = translate_expr ctx e1 in - same_pos @@ A.ETupleAccess (e1, i, s, ts) - | D.EInj (e1, i, en, ts) -> - let+ e1 = translate_expr ctx e1 in - same_pos @@ A.EInj (e1, i, en, ts) - | D.EMatch (e1, cases, en) -> - let+ e1 = translate_expr ctx e1 - and+ cases = Bindlib.box_list (List.map (translate_expr ctx) cases) in - same_pos @@ A.EMatch (e1, cases, en) - | D.EArray es -> - let+ es = Bindlib.box_list (List.map (translate_expr ctx) es) in - same_pos @@ A.ESome (same_pos @@ A.EArray es) - | D.EOp op -> - Bindlib.box @@ same_pos @@ A.ESome (same_pos @@ A.EOp op) - | D.EAssert e1 -> - let+ e1 = translate_expr ctx e1 in - same_pos (A.EAssert e1) - | D.EApp (e1, args) -> - (* e1 args* *) - (* match e1 with | None -> None | Some e1 -> e1 args* *) - let+ e1 = translate_expr ctx e1 - and+ args = Bindlib.box_list (List.map (translate_expr ctx) args) in - same_pos @@ A.EApp (e1, args) - | D.EAbs ((binder, pos_binder), ts) -> - (* fun vars: tys -> body *) - (* Some (fun vars: [|tys|] -> body) *) - let vars, body = Bindlib.unmbind binder in - let ctx, lc_vars = - Array.fold_right - (fun var (ctx, lc_vars) -> - let lc_var = A.Var.make (Bindlib.name_of var, pos_binder) in - let lc_var_expr = A.make_var (lc_var, pos_binder) in - (D.VarMap.add var lc_var_expr ctx, lc_var :: lc_vars)) - vars (ctx, []) - in - let lc_vars = Array.of_list lc_vars in - let new_body = translate_expr ctx body in - let+ new_binder = Bindlib.bind_mvar lc_vars new_body in - same_pos @@ A.EAbs ((new_binder, pos_binder), ts) - - | D.EIfThenElse (e1, e2, e3) -> - let+ e1 = translate_expr ctx e1 - and+ e2 = translate_expr ctx e2 - and+ e3 = translate_expr ctx e3 in - let x = A.Var.make ("e1", snd e1 ) in - (* same_pos @@ - A.make_let_in x (T.TOption T.TBool) - (Pos.same_pos_as e1 e1) - (same_pos @@ A.EMatchopt(A.make_var x, A.ENone, A.EAbs A.EIfThenElse (A.make_var x, e2, e3))) *) - assert false - | D.ECatch (e1, exc, e2) -> - begin match exc with - | EmptyError -> - begin - (* let bla = e1 in matchopt bla with None -> e2 | Some _ -> bla *) - (* (fun bla -> matchopt bla with None -> e2 | Some _ -> bla) e1 *) - - let pos = snd e1 in - let x_var = (A.Var.make ("e1", pos), pos) in - - let e1 = translate_expr ctx e1 in - let e2 = translate_expr ctx e2 in - let x = A.make_var x_var in - (* todo: /!\ exponential cost. Use let in instead *) - - let body = let+ e2 = e2 and+ x = x in - same_pos @@ A.EMatchopt(x, e2, x) in - - let tau = assert false in - - A.make_let_in (fst x_var) tau e1 body - end - | _ -> - let+ e1 = translate_expr ctx e1 - and+ e2 = translate_expr ctx e2 in - same_pos @@ A.ECatch (e1, exc, e2) - end - | D.ERaise exc -> - Bindlib.box begin match exc with - | EmptyError -> same_pos @@ A.ENone - | _ -> same_pos @@ A.ERaise exc - end - | D.EVar v -> D.VarMap.find (Pos.unmark v) ctx - | D.EMatchopt (e1, e2, e3) -> - let+ e1 = translate_expr ctx e1 - and+ e2 = translate_expr ctx e2 - and+ e3 = translate_expr ctx e3 in - same_pos @@ A.EMatchopt (e1, e2, e3) - | D.ELit l -> - Bindlib.box @@ same_pos @@ A.ESome (same_pos (translate_lit l)) - | D.ENone -> - Bindlib.box @@ same_pos @@ A.ESome (same_pos @@ A.ENone) - | D.ESome e1 -> - let+ e1 = translate_expr ctx e1 in - same_pos @@ A.ESome (same_pos @@ A.ESome e1) - - -let translate_program (prgm : D.program) : A.program = - { - scopes = prgm.scopes - |> ListLabels.fold_left ~init:([], D.VarMap.empty) - ~f:begin fun (acc, ctx) (n, e) -> - let new_n = n in - let new_acc = - ( new_n, - Bindlib.unbox (translate_expr (A.VarMap.map (fun v -> D.make_var (v, Pos.no_pos)) ctx) e) - ) :: acc in - let new_ctx = A.VarMap.add n new_n ctx in - (new_acc, new_ctx) - end - |> fst - |> List.rev - ; - decl_ctx = prgm.decl_ctx; - } diff --git a/compiler/lcalc/remove_empty_exceptions.mli b/compiler/lcalc/remove_empty_exceptions.mli deleted file mode 100644 index 2b19c6dce..000000000 --- a/compiler/lcalc/remove_empty_exceptions.mli +++ /dev/null @@ -1,17 +0,0 @@ -(* This file is part of the Catala compiler, a specification language for tax and social benefits - computation rules. Copyright (C) 2020 Inria, contributor: Denis Merigoux - - - Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - in compliance with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software distributed under the License - is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - or implied. See the License for the specific language governing permissions and limitations under - the License. *) - -(** Translation from the default calculus to the lambda calculus *) - -val translate_program : Ast.program -> Ast.program diff --git a/compiler/lcalc/typecheck.ml b/compiler/lcalc/typecheck.ml deleted file mode 100644 index 3688921a3..000000000 --- a/compiler/lcalc/typecheck.ml +++ /dev/null @@ -1,6 +0,0 @@ -module A = Ast -module T = Dcalc.Ast - - -let rec infer ctx (e: A.expr) : Dcalc.Ast.typ = - assert false \ No newline at end of file From 53b40121adbdf4df811cad6303c45b2cb2d5b0bb Mon Sep 17 00:00:00 2001 From: Alain Date: Mon, 22 Nov 2021 15:49:39 +0100 Subject: [PATCH 005/102] should be ok, without handling the types --- compiler/lcalc/compile_without_exceptions.ml | 137 +++++++++++++------ 1 file changed, 93 insertions(+), 44 deletions(-) diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index 3e565b673..5703ae5cb 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -40,7 +40,7 @@ let rec translate_default (ctx : ctx) (exceptions : D.expr Pos.marked list) (just : D.expr Pos.marked) (cons : D.expr Pos.marked) (pos_default : Pos.t) : A.expr Pos.marked Bindlib.box = let exceptions = - List.map (fun except -> thunk_expr (translate_expr ctx except) pos_default) exceptions + List.map (fun except -> translate_expr ctx except) exceptions in let exceptions = A.make_app @@ -61,6 +61,8 @@ and translate_typ (t: D.typ Pos.marked) : D.typ Pos.marked = let _ = t in assert false and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindlib.box = + + let same_pos e' = Pos.same_pos_as e' e in match Pos.unmark e with | D.EVar v -> D.VarMap.find (Pos.unmark v) ctx | D.ETuple (args, s) -> @@ -72,47 +74,108 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl let pos = Pos.get_position(Bindlib.unbox e1) in let x = A.Var.make ("e1", pos) in - let tau = assert false in + let tau = failwith "todo" in let e2 = let+ e1 = Bindlib.box (A.EVar (x, pos)) in - (A.ETupleAccess ((e1, pos), i, s, ts), pos) in + same_pos @@ A.ETupleAccess ((e1, pos), i, s, ts) + in A.make_letopt_in x tau e1 e2 | D.EInj (e1, i, en, ts) -> - Bindlib.box_apply - (fun e1 -> Pos.same_pos_as (A.EInj (e1, i, en, ts)) e) - (translate_expr ctx e1) + + let e1 = translate_expr ctx e1 in + let pos = Pos.get_position(Bindlib.unbox e1) in + let x = A.Var.make ("e1", pos) in + + let tau = failwith "todo" in + + let e2 = + let+ e1 = Bindlib.box (A.EVar (x, pos)) in + same_pos @@ A.EInj ((e1, pos), i, en, ts) + in + + A.make_letopt_in x tau e1 e2 | D.EMatch (e1, cases, en) -> - Bindlib.box_apply2 - (fun e1 cases -> Pos.same_pos_as (A.EMatch (e1, cases, en)) e) - (translate_expr ctx e1) - (Bindlib.box_list (List.map (translate_expr ctx) cases)) + let e1 = translate_expr ctx e1 in + let pos = Pos.get_position(Bindlib.unbox e1) in + let x = A.Var.make ("e1", pos) in + + let tau = failwith "todo" in + + let e2 = + let+ e1 = Bindlib.box (A.EVar (x, pos)) + and+ cases = Bindlib.box_list (List.map (translate_expr ctx) cases) in + same_pos @@ A.EMatch ((e1, pos), cases, en) + in + + A.make_letopt_in x tau e1 e2 + | D.EArray es -> + Bindlib.box_apply - (fun es -> Pos.same_pos_as (A.EArray es) e) + (fun es -> same_pos @@ A.ESome (same_pos @@ (A.EArray es) )) (Bindlib.box_list (List.map (translate_expr ctx) es)) - | D.ELit l -> Bindlib.box (Pos.same_pos_as (translate_lit l) e) - | D.EOp op -> Bindlib.box (Pos.same_pos_as (A.EOp op) e) + | D.ELit l -> Bindlib.box @@ same_pos @@ A.ESome (same_pos @@ translate_lit l) + | D.EOp op -> Bindlib.box @@ same_pos @@ A.ESome (same_pos @@ A.EOp op) | D.EIfThenElse (e1, e2, e3) -> - Bindlib.box_apply3 - (fun e1 e2 e3 -> Pos.same_pos_as (A.EIfThenElse (e1, e2, e3)) e) - (translate_expr ctx e1) (translate_expr ctx e2) (translate_expr ctx e3) - | D.EAssert e1 -> - Bindlib.box_apply (fun e1 -> Pos.same_pos_as (A.EAssert e1) e) (translate_expr ctx e1) + let e1 = translate_expr ctx e1 in + let pos = Pos.get_position (Bindlib.unbox e1) in + let x = A.Var.make ("e1", pos) in + + (* we can say staticly what is the type of tau here. *) + let tau = failwith "todo" in + + let e2 = + let+ e1 = Bindlib.box (A.EVar (x, pos)) + and+ e2 = translate_expr ctx e2 + and+ e3 = translate_expr ctx e3 in + same_pos @@ A.EIfThenElse ((e1, pos), e2, e3) + in + + A.make_letopt_in x tau e1 e2 + + | D.EAssert _e1 -> + (* don't know the semantic of EAssert. *) + (* Bindlib.box_apply (fun e1 -> Pos.same_pos_as (A.EAssert e1) e) (translate_expr ctx e1) *) + + failwith "todo" + | D.ErrorOnEmpty arg -> - Bindlib.box_apply - (fun arg -> - Pos.same_pos_as - (A.ECatch (arg, A.EmptyError, Pos.same_pos_as (A.ERaise A.NoValueProvided) e)) - e) - (translate_expr ctx arg) + + let pos = Pos.get_position arg in + let x = A.Var.make ("e1", pos) in + let arg = translate_expr ctx arg in + + let tau = failwith "todo" in + + let+ e2 = A.make_abs + (Array.of_list [ x ]) + (Bindlib.box @@ same_pos @@ A.EVar (x, pos)) + pos + [ tau ] + pos + and+ e1 = arg in + + same_pos @@ A.EMatchopt (e1, same_pos @@ A.ERaise A.NoValueProvided , e2) + | D.EApp (e1, args) -> - Bindlib.box_apply2 - (fun e1 args -> Pos.same_pos_as (A.EApp (e1, args)) e) - (translate_expr ctx e1) - (Bindlib.box_list (List.map (translate_expr ctx) args)) + let e1 = translate_expr ctx e1 in + let pos = Pos.get_position(Bindlib.unbox e1) in + let x = A.Var.make ("e1", pos) in + + let tau = failwith "todo" in + + let e2 = + let+ e1 = Bindlib.box (A.EVar (x, pos)) + and+ args = Bindlib.box_list (List.map (translate_expr ctx) args) in + same_pos @@ A.EApp ((e1, pos), args) + in + + A.make_letopt_in x tau e1 e2 + + | D.EAbs ((binder, pos_binder), ts) -> let vars, body = Bindlib.unmbind binder in let ctx, lc_vars = @@ -125,22 +188,8 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl in let lc_vars = Array.of_list lc_vars in let new_body = translate_expr ctx body in - let new_binder = Bindlib.bind_mvar lc_vars new_body in - Bindlib.box_apply - (fun new_binder -> Pos.same_pos_as (A.EAbs ((new_binder, pos_binder), ts)) e) - new_binder - | D.EDefault ([ exn ], just, cons) when !Cli.optimize_flag -> - Bindlib.box_apply3 - (fun exn just cons -> - Pos.same_pos_as - (A.ECatch - ( exn, - A.EmptyError, - Pos.same_pos_as - (A.EIfThenElse (just, cons, Pos.same_pos_as (A.ERaise A.EmptyError) e)) - e )) - e) - (translate_expr ctx exn) (translate_expr ctx just) (translate_expr ctx cons) + let+ new_binder = Bindlib.bind_mvar lc_vars new_body in + same_pos @@ A.ESome (same_pos @@ A.EAbs ((new_binder, pos_binder), List.map translate_typ ts)) | D.EDefault (exceptions, just, cons) -> translate_default ctx exceptions just cons (Pos.get_position e) From f75341c44f8123adbf365934f11db4d550c7185f Mon Sep 17 00:00:00 2001 From: Alain Date: Tue, 9 Nov 2021 11:47:05 +0100 Subject: [PATCH 006/102] making options default compilation target --- compiler/driver.ml | 2 +- compiler/lcalc/compile_without_exceptions.ml | 35 +++++++++++++------- compiler/lcalc/to_ocaml.ml | 7 +++- default.nix | 2 +- 4 files changed, 31 insertions(+), 15 deletions(-) diff --git a/compiler/driver.ml b/compiler/driver.ml index 0f8cd7710..26f266f7a 100644 --- a/compiler/driver.ml +++ b/compiler/driver.ml @@ -243,7 +243,7 @@ let driver (source_file : Pos.input_file) (debug : bool) (unstyled : bool) 0 | Cli.OCaml | Cli.Python -> Cli.debug_print "Compiling program into lambda calculus..."; - let prgm = Lcalc.Compile_with_exceptions.translate_program prgm in + let prgm = Lcalc.Compile_without_exceptions.translate_program prgm in let prgm = if optimize then begin Cli.debug_print "Optimizing lambda calculus..."; diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index 5703ae5cb..a7388fe62 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -56,9 +56,9 @@ let rec translate_default (ctx : ctx) (exceptions : D.expr Pos.marked list) in exceptions -(* non-existing for the moment. *) and translate_typ (t: D.typ Pos.marked) : D.typ Pos.marked = - let _ = t in assert false + (* Hack: If the type is D.TAny, it means for the compiler to not put any type annotation.*) + Pos.same_pos_as D.TAny t and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindlib.box = @@ -74,7 +74,7 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl let pos = Pos.get_position(Bindlib.unbox e1) in let x = A.Var.make ("e1", pos) in - let tau = failwith "todo" in + let tau = (D.TAny, pos) in let e2 = let+ e1 = Bindlib.box (A.EVar (x, pos)) in @@ -89,7 +89,7 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl let pos = Pos.get_position(Bindlib.unbox e1) in let x = A.Var.make ("e1", pos) in - let tau = failwith "todo" in + let tau = (D.TAny, pos) in let e2 = let+ e1 = Bindlib.box (A.EVar (x, pos)) in @@ -102,7 +102,7 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl let pos = Pos.get_position(Bindlib.unbox e1) in let x = A.Var.make ("e1", pos) in - let tau = failwith "todo" in + let tau = (D.TAny, pos) in let e2 = let+ e1 = Bindlib.box (A.EVar (x, pos)) @@ -125,7 +125,7 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl let x = A.Var.make ("e1", pos) in (* we can say staticly what is the type of tau here. *) - let tau = failwith "todo" in + let tau = (D.TAny, pos) in let e2 = let+ e1 = Bindlib.box (A.EVar (x, pos)) @@ -136,11 +136,24 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl A.make_letopt_in x tau e1 e2 - | D.EAssert _e1 -> + | D.EAssert e1 -> (* don't know the semantic of EAssert. *) (* Bindlib.box_apply (fun e1 -> Pos.same_pos_as (A.EAssert e1) e) (translate_expr ctx e1) *) - failwith "todo" + + + let e1 = translate_expr ctx e1 in + let pos = Pos.get_position (Bindlib.unbox e1) in + let x = A.Var.make ("e1", pos) in + let tau = (D.TAny, pos) in + + let e2 = + let+ e1 = Bindlib.box (A.EVar (x, pos)) in + + same_pos @@ A.EAssert (e1, pos) + in + + A.make_letopt_in x tau e1 e2 | D.ErrorOnEmpty arg -> @@ -148,7 +161,7 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl let x = A.Var.make ("e1", pos) in let arg = translate_expr ctx arg in - let tau = failwith "todo" in + let tau = (D.TAny, pos) in let+ e2 = A.make_abs (Array.of_list [ x ]) @@ -165,7 +178,7 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl let pos = Pos.get_position(Bindlib.unbox e1) in let x = A.Var.make ("e1", pos) in - let tau = failwith "todo" in + let tau = (D.TAny, pos) in let e2 = let+ e1 = Bindlib.box (A.EVar (x, pos)) @@ -193,8 +206,6 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl | D.EDefault (exceptions, just, cons) -> translate_default ctx exceptions just cons (Pos.get_position e) - -(* no change here *) let translate_program (prgm : D.program) : A.program = { scopes = diff --git a/compiler/lcalc/to_ocaml.ml b/compiler/lcalc/to_ocaml.ml index 82c3ee3e6..1696246b8 100644 --- a/compiler/lcalc/to_ocaml.ml +++ b/compiler/lcalc/to_ocaml.ml @@ -327,7 +327,12 @@ let rec format_expr (ctx : Dcalc.Ast.decl_ctx) (fmt : Format.formatter) (e : exp format_exception (exc, Pos.get_position e) format_with_parens e2 - | ESome _ | ENone | EMatchopt _ -> failwith "todo" + | ESome e1 -> + Format.fprintf fmt "@[ Some@ %a@ @]" format_with_parens e1 + | ENone -> Format.fprintf fmt "None@" + | EMatchopt (e1, e2, e3) -> + let x = assert false in + Format.fprintf fmt "@[match@ %a@]@ with@\n| None ->@[@ %a@]@\n| Some %a ->@[@ %a@ %a@]" format_expr e1 format_with_parens e2 format_var x format_with_parens e3 format_var x let format_struct_embedding (fmt : Format.formatter) ((struct_name, struct_fields) : D.StructName.t * (D.StructFieldName.t * D.typ Pos.marked) list) diff --git a/default.nix b/default.nix index 2531e9875..933963688 100644 --- a/default.nix +++ b/default.nix @@ -34,7 +34,7 @@ buildDunePackage rec { ]; doCheck = true; - patches = [ ./.nix/no-web.patch ]; + # patches = [ ./.nix/no-web.patch ]; meta = with lib; { homepage = "https://catala-lang.org"; From 08b38472e22c428316f648bc7a3014b119a546f1 Mon Sep 17 00:00:00 2001 From: Alain Date: Mon, 22 Nov 2021 15:49:02 +0100 Subject: [PATCH 007/102] found a bug inside the match translation. --- compiler/lcalc/ast.ml | 3 +++ compiler/lcalc/compile_without_exceptions.ml | 11 ++++++++++- compiler/lcalc/to_ocaml.ml | 3 ++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/compiler/lcalc/ast.ml b/compiler/lcalc/ast.ml index c4ae61230..c5eb24673 100644 --- a/compiler/lcalc/ast.ml +++ b/compiler/lcalc/ast.ml @@ -26,6 +26,7 @@ type lit = type except = ConflictError | EmptyError | NoValueProvided | Crash + type expr = | EVar of expr Bindlib.var Pos.marked | ETuple of expr Pos.marked list * D.StructName.t option @@ -118,6 +119,8 @@ let make_letopt_in (e2: expr Pos.marked Bindlib.box) : expr Pos.marked Bindlib.box = +(* let%opt x: tau = e1 in e2 == matchopt e1 with | None -> None | Some x -> e2 *) + let pos = Pos.get_position (Bindlib.unbox e2) in let+ e2 = make_abs diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index a7388fe62..555df713b 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -106,7 +106,16 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl let e2 = let+ e1 = Bindlib.box (A.EVar (x, pos)) - and+ cases = Bindlib.box_list (List.map (translate_expr ctx) cases) in + (* there is an issue here. *) + and+ cases = cases + |> List.map (fun e' -> translate_expr ctx e') + |> List.map (function + | A.ESome e'' -> e'' + | _ -> assert false + ) + |> assert false + |> Bindlib.box_list + in same_pos @@ A.EMatch ((e1, pos), cases, en) in diff --git a/compiler/lcalc/to_ocaml.ml b/compiler/lcalc/to_ocaml.ml index 1696246b8..65081f016 100644 --- a/compiler/lcalc/to_ocaml.ml +++ b/compiler/lcalc/to_ocaml.ml @@ -108,6 +108,7 @@ let avoid_keywords (s : string) : string = | "object" | "of" | "open" | "or" | "private" | "rec" | "sig" | "struct" | "then" | "to" | "true" | "try" | "type" | "val" | "virtual" | "when" | "while" | "with" -> true + | "x" -> true (* i need a variable to make the translation *) | _ -> false then s ^ "_" else s @@ -331,7 +332,7 @@ let rec format_expr (ctx : Dcalc.Ast.decl_ctx) (fmt : Format.formatter) (e : exp Format.fprintf fmt "@[ Some@ %a@ @]" format_with_parens e1 | ENone -> Format.fprintf fmt "None@" | EMatchopt (e1, e2, e3) -> - let x = assert false in + let x = Ast.Var.make ("x", Pos.no_pos) in Format.fprintf fmt "@[match@ %a@]@ with@\n| None ->@[@ %a@]@\n| Some %a ->@[@ %a@ %a@]" format_expr e1 format_with_parens e2 format_var x format_with_parens e3 format_var x let format_struct_embedding (fmt : Format.formatter) From 949df1cd33157da2f937e8458a2798747ac49c0f Mon Sep 17 00:00:00 2001 From: Alain Date: Wed, 24 Nov 2021 11:01:45 +0100 Subject: [PATCH 008/102] the translation executes correctly, but the result is totally unreadable --- compiler/lcalc/compile_without_exceptions.ml | 26 +++++++++++++++----- compiler/lcalc/print.ml | 2 +- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index 555df713b..3637101cc 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -108,12 +108,26 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl let+ e1 = Bindlib.box (A.EVar (x, pos)) (* there is an issue here. *) and+ cases = cases - |> List.map (fun e' -> translate_expr ctx e') - |> List.map (function - | A.ESome e'' -> e'' - | _ -> assert false - ) - |> assert false + |> List.map (fun (e', _pos) -> + match e' with + | D.EAbs ((binder, pos_binder), ts) -> + begin + let vars, body = Bindlib.unmbind binder in + let ctx, lc_vars = + Array.fold_right + (fun var (ctx, lc_vars) -> + let lc_var = A.Var.make (Bindlib.name_of var, pos_binder) in + let lc_var_expr = A.make_var (lc_var, pos_binder) in + (D.VarMap.add var lc_var_expr ctx, lc_var :: lc_vars)) + vars (ctx, []) + in + let lc_vars = Array.of_list lc_vars in + let new_body = translate_expr ctx body in + let+ new_binder = Bindlib.bind_mvar lc_vars new_body in + same_pos @@ A.EAbs ((new_binder, pos_binder), List.map translate_typ ts) + end + | _ -> assert false + ) |> Bindlib.box_list in same_pos @@ A.EMatch ((e1, pos), cases, en) diff --git a/compiler/lcalc/print.ml b/compiler/lcalc/print.ml index 2829fa23d..6d7ebd5ec 100644 --- a/compiler/lcalc/print.ml +++ b/compiler/lcalc/print.ml @@ -180,7 +180,7 @@ let rec format_expr (ctx : Dcalc.Ast.decl_ctx) (fmt : Format.formatter) (e : exp | EAssert e' -> Format.fprintf fmt "@[%a@ %a%a%a@]" format_keyword "assert" format_punctuation "(" format_expr e' format_punctuation ")" - | ENone -> Format.fprintf fmt "%a@" format_keyword "None" + | ENone -> Format.fprintf fmt "%a@ " format_keyword "None" | ESome e' -> Format.fprintf fmt "@[%a%a%a@]" format_punctuation "(" format_expr e' format_punctuation "(" | EMatchopt (e1, e2, e3) -> Format.fprintf fmt "@[%a@ %a@ %a@ @[%a%a%a%a@ %a%a%a%a@]@]" From fb281a0d99d66b06ca19e46c2a88ea9e8aa908cf Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Wed, 24 Nov 2021 15:22:29 +0100 Subject: [PATCH 009/102] Formatting --- compiler/lcalc/ast.ml | 63 ++---- compiler/lcalc/ast.mli | 3 +- compiler/lcalc/compile_without_exceptions.ml | 220 +++++++++---------- compiler/lcalc/print.ml | 13 +- compiler/lcalc/to_ocaml.ml | 9 +- 5 files changed, 137 insertions(+), 171 deletions(-) diff --git a/compiler/lcalc/ast.ml b/compiler/lcalc/ast.ml index c5eb24673..a356a97a0 100644 --- a/compiler/lcalc/ast.ml +++ b/compiler/lcalc/ast.ml @@ -26,7 +26,6 @@ type lit = type except = ConflictError | EmptyError | NoValueProvided | Crash - type expr = | EVar of expr Bindlib.var Pos.marked | ETuple of expr Pos.marked list * D.StructName.t option @@ -45,27 +44,19 @@ type expr = | EOp of D.operator | EIfThenElse of expr Pos.marked * expr Pos.marked * expr Pos.marked | ERaise of except - | ECatch of expr Pos.marked * except * expr Pos.marked + | ECatch of expr Pos.marked * except * expr Pos.marked (* TODO: temporary *) + (* semantics of ESome and ENone should be easy to comprehend. *) + (* The semantics of EMatchopt i've choosen are as following : - (* TODO: temporary *) + Context : - (* semantics of ESome and ENone should be easy to comprehend. *) - (* The semantics of EMatchopt i've choosen are as following : - - Context : - - C := ... - | matchopt [.] e2 e3 - - And the rules : - - ---------------------------------- - matchopt (Some e1) e2 e3 ~~> e3 e1 - - -------------------------- - matchopt None e2 e3 ~~> e2 - - *) + C := ... | matchopt [.] e2 e3 + + And the rules : + + ---------------------------------- matchopt (Some e1) e2 e3 ~~> e3 e1 + + -------------------------- matchopt None e2 e3 ~~> e2 *) | EMatchopt of expr Pos.marked * expr Pos.marked * expr Pos.marked | ESome of expr Pos.marked | ENone @@ -108,31 +99,25 @@ let make_let_in (x : Var.t) (tau : D.typ Pos.marked) (e1 : expr Pos.marked Bindl (Pos.get_position (Bindlib.unbox e2))) (Bindlib.box_list [ e1 ]) +let ( let+ ) x f = Bindlib.box_apply f x -let (let+) x f = Bindlib.box_apply f x -let (and+) x y =Bindlib.box_pair x y - -let make_letopt_in - (x: Var.t) - (tau: D.typ Pos.marked) - (e1: expr Pos.marked Bindlib.box) - (e2: expr Pos.marked Bindlib.box) -: expr Pos.marked Bindlib.box = - -(* let%opt x: tau = e1 in e2 == matchopt e1 with | None -> None | Some x -> e2 *) +let ( and+ ) x y = Bindlib.box_pair x y +let make_letopt_in (x : Var.t) (tau : D.typ Pos.marked) (e1 : expr Pos.marked Bindlib.box) + (e2 : expr Pos.marked Bindlib.box) : expr Pos.marked Bindlib.box = + (* let%opt x: tau = e1 in e2 == matchopt e1 with | None -> None | Some x -> e2 *) let pos = Pos.get_position (Bindlib.unbox e2) in - let+ e2 = make_abs - (Array.of_list [ x ]) - e2 - (Pos.get_position (Bindlib.unbox e2)) - [ tau ] - (Pos.get_position (Bindlib.unbox e2)) + let+ e2 = + make_abs + (Array.of_list [ x ]) + e2 + (Pos.get_position (Bindlib.unbox e2)) + [ tau ] + (Pos.get_position (Bindlib.unbox e2)) and+ e1 = e1 in - (EMatchopt (e1, (ENone, pos) , e2), pos) - + (EMatchopt (e1, (ENone, pos), e2), pos) let handle_default = Var.make ("handle_default", Pos.no_pos) diff --git a/compiler/lcalc/ast.mli b/compiler/lcalc/ast.mli index d6aca357f..53792c998 100644 --- a/compiler/lcalc/ast.mli +++ b/compiler/lcalc/ast.mli @@ -52,7 +52,6 @@ type expr = | EIfThenElse of expr Pos.marked * expr Pos.marked * expr Pos.marked | ERaise of except | ECatch of expr Pos.marked * except * expr Pos.marked - (* TODO: temporary *) | EMatchopt of expr Pos.marked * expr Pos.marked * expr Pos.marked | ESome of expr Pos.marked @@ -95,7 +94,7 @@ val make_let_in : expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box -val make_letopt_in: +val make_letopt_in : Var.t -> Dcalc.Ast.typ Pos.marked -> expr Pos.marked Bindlib.box -> diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index 3637101cc..184e1fefc 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -1,16 +1,16 @@ (* This file is part of the Catala compiler, a specification language for tax and social benefits -computation rules. Copyright (C) 2020 Inria, contributor: Denis Merigoux - + computation rules. Copyright (C) 2020 Inria, contributor: Denis Merigoux + -Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except -in compliance with the License. You may obtain a copy of the License at + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + in compliance with the License. You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software distributed under the License -is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -or implied. See the License for the specific language governing permissions and limitations under -the License. *) + Unless required by applicable law or agreed to in writing, software distributed under the License + is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + or implied. See the License for the specific language governing permissions and limitations under + the License. *) open Utils module D = Dcalc.Ast @@ -29,8 +29,9 @@ let translate_lit (l : D.lit) : A.expr = | D.LDuration d -> A.ELit (A.LDuration d) | D.LEmptyError -> A.ERaise A.EmptyError -let (let+) x f = Bindlib.box_apply f x -let (and+) x y = Bindlib.box_pair x y +let ( let+ ) x f = Bindlib.box_apply f x + +let ( and+ ) x y = Bindlib.box_pair x y let thunk_expr (e : A.expr Pos.marked Bindlib.box) (pos : Pos.t) : A.expr Pos.marked Bindlib.box = let dummy_var = A.Var.make ("_", pos) in @@ -39,9 +40,7 @@ let thunk_expr (e : A.expr Pos.marked Bindlib.box) (pos : Pos.t) : A.expr Pos.ma let rec translate_default (ctx : ctx) (exceptions : D.expr Pos.marked list) (just : D.expr Pos.marked) (cons : D.expr Pos.marked) (pos_default : Pos.t) : A.expr Pos.marked Bindlib.box = - let exceptions = - List.map (fun except -> translate_expr ctx except) exceptions - in + let exceptions = List.map (fun except -> translate_expr ctx except) exceptions in let exceptions = A.make_app (A.make_var (A.handle_default, pos_default)) @@ -56,37 +55,34 @@ let rec translate_default (ctx : ctx) (exceptions : D.expr Pos.marked list) in exceptions -and translate_typ (t: D.typ Pos.marked) : D.typ Pos.marked = +and translate_typ (t : D.typ Pos.marked) : D.typ Pos.marked = (* Hack: If the type is D.TAny, it means for the compiler to not put any type annotation.*) Pos.same_pos_as D.TAny t and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindlib.box = - - let same_pos e' = Pos.same_pos_as e' e in + let same_pos e' = Pos.same_pos_as e' e in match Pos.unmark e with | D.EVar v -> D.VarMap.find (Pos.unmark v) ctx | D.ETuple (args, s) -> - let+ args = Bindlib.box_list (List.map (translate_expr ctx) args) in - Pos.same_pos_as (A.ETuple (args, s)) e + let+ args = Bindlib.box_list (List.map (translate_expr ctx) args) in + Pos.same_pos_as (A.ETuple (args, s)) e | D.ETupleAccess (e1, i, s, ts) -> let e1 = translate_expr ctx e1 in - (* e1 : [|'a|] array option *) - let pos = Pos.get_position(Bindlib.unbox e1) in + (* e1 : [|'a|] array option *) + let pos = Pos.get_position (Bindlib.unbox e1) in let x = A.Var.make ("e1", pos) in let tau = (D.TAny, pos) in - let e2 = + let e2 = let+ e1 = Bindlib.box (A.EVar (x, pos)) in same_pos @@ A.ETupleAccess ((e1, pos), i, s, ts) in A.make_letopt_in x tau e1 e2 - | D.EInj (e1, i, en, ts) -> - let e1 = translate_expr ctx e1 in - let pos = Pos.get_position(Bindlib.unbox e1) in + let pos = Pos.get_position (Bindlib.unbox e1) in let x = A.Var.make ("e1", pos) in let tau = (D.TAny, pos) in @@ -95,50 +91,46 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl let+ e1 = Bindlib.box (A.EVar (x, pos)) in same_pos @@ A.EInj ((e1, pos), i, en, ts) in - + A.make_letopt_in x tau e1 e2 | D.EMatch (e1, cases, en) -> - let e1 = translate_expr ctx e1 in - let pos = Pos.get_position(Bindlib.unbox e1) in - let x = A.Var.make ("e1", pos) in - - let tau = (D.TAny, pos) in - - let e2 = - let+ e1 = Bindlib.box (A.EVar (x, pos)) - (* there is an issue here. *) - and+ cases = cases - |> List.map (fun (e', _pos) -> - match e' with - | D.EAbs ((binder, pos_binder), ts) -> - begin - let vars, body = Bindlib.unmbind binder in - let ctx, lc_vars = - Array.fold_right - (fun var (ctx, lc_vars) -> - let lc_var = A.Var.make (Bindlib.name_of var, pos_binder) in - let lc_var_expr = A.make_var (lc_var, pos_binder) in - (D.VarMap.add var lc_var_expr ctx, lc_var :: lc_vars)) - vars (ctx, []) - in - let lc_vars = Array.of_list lc_vars in - let new_body = translate_expr ctx body in - let+ new_binder = Bindlib.bind_mvar lc_vars new_body in - same_pos @@ A.EAbs ((new_binder, pos_binder), List.map translate_typ ts) - end - | _ -> assert false - ) - |> Bindlib.box_list - in - same_pos @@ A.EMatch ((e1, pos), cases, en) - in + let e1 = translate_expr ctx e1 in + let pos = Pos.get_position (Bindlib.unbox e1) in + let x = A.Var.make ("e1", pos) in - A.make_letopt_in x tau e1 e2 + let tau = (D.TAny, pos) in - | D.EArray es -> + let e2 = + let+ e1 = Bindlib.box (A.EVar (x, pos)) + (* there is an issue here. *) + and+ cases = + cases + |> List.map (fun (e', _pos) -> + match e' with + | D.EAbs ((binder, pos_binder), ts) -> + let vars, body = Bindlib.unmbind binder in + let ctx, lc_vars = + Array.fold_right + (fun var (ctx, lc_vars) -> + let lc_var = A.Var.make (Bindlib.name_of var, pos_binder) in + let lc_var_expr = A.make_var (lc_var, pos_binder) in + (D.VarMap.add var lc_var_expr ctx, lc_var :: lc_vars)) + vars (ctx, []) + in + let lc_vars = Array.of_list lc_vars in + let new_body = translate_expr ctx body in + let+ new_binder = Bindlib.bind_mvar lc_vars new_body in + same_pos @@ A.EAbs ((new_binder, pos_binder), List.map translate_typ ts) + | _ -> assert false) + |> Bindlib.box_list + in + same_pos @@ A.EMatch ((e1, pos), cases, en) + in + A.make_letopt_in x tau e1 e2 + | D.EArray es -> Bindlib.box_apply - (fun es -> same_pos @@ A.ESome (same_pos @@ (A.EArray es) )) + (fun es -> same_pos @@ A.ESome (same_pos @@ A.EArray es)) (Bindlib.box_list (List.map (translate_expr ctx) es)) | D.ELit l -> Bindlib.box @@ same_pos @@ A.ESome (same_pos @@ translate_lit l) | D.EOp op -> Bindlib.box @@ same_pos @@ A.ESome (same_pos @@ A.EOp op) @@ -150,7 +142,7 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl (* we can say staticly what is the type of tau here. *) let tau = (D.TAny, pos) in - let e2 = + let e2 = let+ e1 = Bindlib.box (A.EVar (x, pos)) and+ e2 = translate_expr ctx e2 and+ e3 = translate_expr ctx e3 in @@ -158,60 +150,48 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl in A.make_letopt_in x tau e1 e2 - | D.EAssert e1 -> - (* don't know the semantic of EAssert. *) - (* Bindlib.box_apply (fun e1 -> Pos.same_pos_as (A.EAssert e1) e) (translate_expr ctx e1) *) - - - - let e1 = translate_expr ctx e1 in - let pos = Pos.get_position (Bindlib.unbox e1) in - let x = A.Var.make ("e1", pos) in - let tau = (D.TAny, pos) in - - let e2 = - let+ e1 = Bindlib.box (A.EVar (x, pos)) in + (* don't know the semantic of EAssert. *) + (* Bindlib.box_apply (fun e1 -> Pos.same_pos_as (A.EAssert e1) e) (translate_expr ctx e1) *) + let e1 = translate_expr ctx e1 in + let pos = Pos.get_position (Bindlib.unbox e1) in + let x = A.Var.make ("e1", pos) in + let tau = (D.TAny, pos) in - same_pos @@ A.EAssert (e1, pos) - in + let e2 = let+ e1 = Bindlib.box (A.EVar (x, pos)) in - A.make_letopt_in x tau e1 e2 + same_pos @@ A.EAssert (e1, pos) in + A.make_letopt_in x tau e1 e2 | D.ErrorOnEmpty arg -> + let pos = Pos.get_position arg in + let x = A.Var.make ("e1", pos) in + let arg = translate_expr ctx arg in - let pos = Pos.get_position arg in - let x = A.Var.make ("e1", pos) in - let arg = translate_expr ctx arg in - - let tau = (D.TAny, pos) in - - let+ e2 = A.make_abs - (Array.of_list [ x ]) - (Bindlib.box @@ same_pos @@ A.EVar (x, pos)) - pos - [ tau ] - pos - and+ e1 = arg in + let tau = (D.TAny, pos) in - same_pos @@ A.EMatchopt (e1, same_pos @@ A.ERaise A.NoValueProvided , e2) + let+ e2 = + A.make_abs + (Array.of_list [ x ]) + (Bindlib.box @@ same_pos @@ A.EVar (x, pos)) + pos [ tau ] pos + and+ e1 = arg in + same_pos @@ A.EMatchopt (e1, same_pos @@ A.ERaise A.NoValueProvided, e2) | D.EApp (e1, args) -> - let e1 = translate_expr ctx e1 in - let pos = Pos.get_position(Bindlib.unbox e1) in - let x = A.Var.make ("e1", pos) in - - let tau = (D.TAny, pos) in + let e1 = translate_expr ctx e1 in + let pos = Pos.get_position (Bindlib.unbox e1) in + let x = A.Var.make ("e1", pos) in - let e2 = - let+ e1 = Bindlib.box (A.EVar (x, pos)) - and+ args = Bindlib.box_list (List.map (translate_expr ctx) args) in - same_pos @@ A.EApp ((e1, pos), args) - in + let tau = (D.TAny, pos) in - A.make_letopt_in x tau e1 e2 + let e2 = + let+ e1 = Bindlib.box (A.EVar (x, pos)) + and+ args = Bindlib.box_list (List.map (translate_expr ctx) args) in + same_pos @@ A.EApp ((e1, pos), args) + in - + A.make_letopt_in x tau e1 e2 | D.EAbs ((binder, pos_binder), ts) -> let vars, body = Bindlib.unmbind binder in let ctx, lc_vars = @@ -233,19 +213,19 @@ let translate_program (prgm : D.program) : A.program = { scopes = (let acc, _ = - List.fold_left - (fun ((acc, ctx) : 'a * A.Var.t D.VarMap.t) (_, n, e) -> - let new_n = A.Var.make (Bindlib.name_of n, Pos.no_pos) in - let new_acc = - ( new_n, - Bindlib.unbox - (translate_expr (D.VarMap.map (fun v -> A.make_var (v, Pos.no_pos)) ctx) e) ) - :: acc - in - let new_ctx = D.VarMap.add n new_n ctx in - (new_acc, new_ctx)) - ([], D.VarMap.empty) prgm.scopes - in - List.rev acc); + List.fold_left + (fun ((acc, ctx) : 'a * A.Var.t D.VarMap.t) (_, n, e) -> + let new_n = A.Var.make (Bindlib.name_of n, Pos.no_pos) in + let new_acc = + ( new_n, + Bindlib.unbox + (translate_expr (D.VarMap.map (fun v -> A.make_var (v, Pos.no_pos)) ctx) e) ) + :: acc + in + let new_ctx = D.VarMap.add n new_n ctx in + (new_acc, new_ctx)) + ([], D.VarMap.empty) prgm.scopes + in + List.rev acc); decl_ctx = prgm.decl_ctx; } diff --git a/compiler/lcalc/print.ml b/compiler/lcalc/print.ml index 6d7ebd5ec..68d73c1c3 100644 --- a/compiler/lcalc/print.ml +++ b/compiler/lcalc/print.ml @@ -181,10 +181,11 @@ let rec format_expr (ctx : Dcalc.Ast.decl_ctx) (fmt : Format.formatter) (e : exp Format.fprintf fmt "@[%a@ %a%a%a@]" format_keyword "assert" format_punctuation "(" format_expr e' format_punctuation ")" | ENone -> Format.fprintf fmt "%a@ " format_keyword "None" - | ESome e' -> Format.fprintf fmt "@[%a%a%a@]" format_punctuation "(" format_expr e' format_punctuation "(" + | ESome e' -> + Format.fprintf fmt "@[%a%a%a@]" format_punctuation "(" format_expr e' + format_punctuation "(" | EMatchopt (e1, e2, e3) -> - Format.fprintf fmt "@[%a@ %a@ %a@ @[%a%a%a%a@ %a%a%a%a@]@]" - format_keyword "match" format_expr e1 format_keyword "with" - format_punctuation "\n|" format_keyword "None" format_punctuation "->" format_expr e2 - format_punctuation "\n|" format_keyword "Some" format_punctuation "->" format_expr e3 - + Format.fprintf fmt "@[%a@ %a@ %a@ @[%a%a%a%a@ %a%a%a%a@]@]" format_keyword + "match" format_expr e1 format_keyword "with" format_punctuation "\n|" format_keyword "None" + format_punctuation "->" format_expr e2 format_punctuation "\n|" format_keyword "Some" + format_punctuation "->" format_expr e3 diff --git a/compiler/lcalc/to_ocaml.ml b/compiler/lcalc/to_ocaml.ml index 65081f016..41fea2aef 100644 --- a/compiler/lcalc/to_ocaml.ml +++ b/compiler/lcalc/to_ocaml.ml @@ -328,12 +328,13 @@ let rec format_expr (ctx : Dcalc.Ast.decl_ctx) (fmt : Format.formatter) (e : exp format_exception (exc, Pos.get_position e) format_with_parens e2 - | ESome e1 -> - Format.fprintf fmt "@[ Some@ %a@ @]" format_with_parens e1 + | ESome e1 -> Format.fprintf fmt "@[ Some@ %a@ @]" format_with_parens e1 | ENone -> Format.fprintf fmt "None@" | EMatchopt (e1, e2, e3) -> - let x = Ast.Var.make ("x", Pos.no_pos) in - Format.fprintf fmt "@[match@ %a@]@ with@\n| None ->@[@ %a@]@\n| Some %a ->@[@ %a@ %a@]" format_expr e1 format_with_parens e2 format_var x format_with_parens e3 format_var x + let x = Ast.Var.make ("x", Pos.no_pos) in + Format.fprintf fmt + "@[match@ %a@]@ with@\n| None ->@[@ %a@]@\n| Some %a ->@[@ %a@ %a@]" + format_expr e1 format_with_parens e2 format_var x format_with_parens e3 format_var x let format_struct_embedding (fmt : Format.formatter) ((struct_name, struct_fields) : D.StructName.t * (D.StructFieldName.t * D.typ Pos.marked) list) From 7d3e381d45ef610cd1ed0fbefdd2ab5c26099f56 Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Wed, 24 Nov 2021 15:51:49 +0100 Subject: [PATCH 010/102] Improvements with Alain during weekly meeting --- compiler/driver.ml | 11 +++++++---- compiler/lcalc/compile_without_exceptions.ml | 2 +- compiler/lcalc/to_ocaml.ml | 16 +++++++++------- compiler/utils/cli.ml | 7 ++++++- compiler/utils/cli.mli | 3 ++- 5 files changed, 25 insertions(+), 14 deletions(-) diff --git a/compiler/driver.ml b/compiler/driver.ml index 26f266f7a..7a4bbc0cc 100644 --- a/compiler/driver.ml +++ b/compiler/driver.ml @@ -26,9 +26,9 @@ let extensions = [ (".catala_fr", "fr"); (".catala_en", "en"); (".catala_pl", "p (** Entry function for the executable. Returns a negative number in case of error. Usage: [driver source_file debug dcalc unstyled wrap_weaved_output backend language max_prec_digits trace optimize scope_to_execute output_file]*) let driver (source_file : Pos.input_file) (debug : bool) (unstyled : bool) - (wrap_weaved_output : bool) (backend : string) (language : string option) - (max_prec_digits : int option) (trace : bool) (optimize : bool) (ex_scope : string option) - (output_file : string option) : int = + (wrap_weaved_output : bool) (avoid_exceptions : bool) (backend : string) + (language : string option) (max_prec_digits : int option) (trace : bool) (optimize : bool) + (ex_scope : string option) (output_file : string option) : int = try Cli.debug_flag := debug; Cli.style_flag := not unstyled; @@ -243,7 +243,10 @@ let driver (source_file : Pos.input_file) (debug : bool) (unstyled : bool) 0 | Cli.OCaml | Cli.Python -> Cli.debug_print "Compiling program into lambda calculus..."; - let prgm = Lcalc.Compile_without_exceptions.translate_program prgm in + let prgm = + if avoid_exceptions then Lcalc.Compile_without_exceptions.translate_program prgm + else Lcalc.Compile_with_exceptions.translate_program prgm + in let prgm = if optimize then begin Cli.debug_print "Optimizing lambda calculus..."; diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index 184e1fefc..50885f6ba 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -27,7 +27,7 @@ let translate_lit (l : D.lit) : A.expr = | D.LUnit -> A.ELit A.LUnit | D.LDate d -> A.ELit (A.LDate d) | D.LDuration d -> A.ELit (A.LDuration d) - | D.LEmptyError -> A.ERaise A.EmptyError + | D.LEmptyError -> A.ENone let ( let+ ) x f = Bindlib.box_apply f x diff --git a/compiler/lcalc/to_ocaml.ml b/compiler/lcalc/to_ocaml.ml index 41fea2aef..ab1ff4ee6 100644 --- a/compiler/lcalc/to_ocaml.ml +++ b/compiler/lcalc/to_ocaml.ml @@ -41,7 +41,7 @@ let format_op_kind (fmt : Format.formatter) (k : Dcalc.Ast.op_kind) = Format.fprintf fmt "%s" (match k with KInt -> "!" | KRat -> "&" | KMoney -> "$" | KDate -> "@" | KDuration -> "^") -let format_log_entry (fmt : Format.formatter) (entry : Dcalc.Ast.log_entry) : unit = +let _format_log_entry (fmt : Format.formatter) (entry : Dcalc.Ast.log_entry) : unit = Format.fprintf fmt "%s" (match entry with | VarDef _ -> ":=" @@ -88,9 +88,10 @@ let format_unop (fmt : Format.formatter) (op : Dcalc.Ast.unop Pos.marked) : unit match Pos.unmark op with | Minus k -> Format.fprintf fmt "~-%a" format_op_kind k | Not -> Format.fprintf fmt "%s" "not" - | Log (entry, infos) -> - Format.fprintf fmt "@[log_entry@ \"%a|%a\"@]" format_log_entry entry format_uid_list - infos + | Log (_entry, _infos) -> + (* Errors.raise_spanned_error "Internal error: a log operator has not been caught by the + expression match" (Pos.get_position op) *) + Format.fprintf fmt "Fun.id" | Length -> Format.fprintf fmt "%s" "array_length" | IntToRat -> Format.fprintf fmt "%s" "decimal_of_integer" | GetDay -> Format.fprintf fmt "%s" "day_of_month_of_date" @@ -108,7 +109,6 @@ let avoid_keywords (s : string) : string = | "object" | "of" | "open" | "or" | "private" | "rec" | "sig" | "struct" | "then" | "to" | "true" | "try" | "type" | "val" | "virtual" | "when" | "while" | "with" -> true - | "x" -> true (* i need a variable to make the translation *) | _ -> false then s ^ "_" else s @@ -169,7 +169,9 @@ let rec format_typ (fmt : Format.formatter) (typ : Dcalc.Ast.typ Pos.marked) : u | TAny -> Format.fprintf fmt "_" let format_var (fmt : Format.formatter) (v : Var.t) : unit = - let lowercase_name = to_lowercase (to_ascii (Bindlib.name_of v)) in + let lowercase_name = + to_lowercase (to_ascii (Bindlib.name_of v) ^ "_" ^ string_of_int (Bindlib.uid_of v)) + in let lowercase_name = Re.Pcre.substitute ~rex:(Re.Pcre.regexp "\\.") ~subst:(fun _ -> "_dot_") lowercase_name in @@ -329,7 +331,7 @@ let rec format_expr (ctx : Dcalc.Ast.decl_ctx) (fmt : Format.formatter) (e : exp (exc, Pos.get_position e) format_with_parens e2 | ESome e1 -> Format.fprintf fmt "@[ Some@ %a@ @]" format_with_parens e1 - | ENone -> Format.fprintf fmt "None@" + | ENone -> Format.fprintf fmt "None" | EMatchopt (e1, e2, e3) -> let x = Ast.Var.make ("x", Pos.no_pos) in Format.fprintf fmt diff --git a/compiler/utils/cli.ml b/compiler/utils/cli.ml index 21a4b2b22..76068b2e6 100644 --- a/compiler/utils/cli.ml +++ b/compiler/utils/cli.ml @@ -52,6 +52,11 @@ let trace_opt = Arg.( value & flag & info [ "trace"; "t" ] ~doc:"Displays a trace of the interpreter's computation") +let avoid_exceptions = + Arg.( + value & flag + & info [ "avoid_exceptions" ] ~doc:"Compiles the default calculus without exceptions") + let wrap_weaved_output = Arg.( value & flag @@ -92,7 +97,7 @@ let output = let catala_t f = Term.( - const f $ file $ debug $ unstyled $ wrap_weaved_output $ backend $ language + const f $ file $ debug $ unstyled $ wrap_weaved_output $ avoid_exceptions $ backend $ language $ max_prec_digits_opt $ trace_opt $ optimize $ ex_scope $ output) let version = "0.5.0" diff --git a/compiler/utils/cli.mli b/compiler/utils/cli.mli index f17568a21..b7aaf49dc 100644 --- a/compiler/utils/cli.mli +++ b/compiler/utils/cli.mli @@ -64,6 +64,7 @@ val catala_t : bool -> bool -> bool -> + bool -> string -> string option -> int option -> @@ -74,7 +75,7 @@ val catala_t : 'a) -> 'a Cmdliner.Term.t (** Main entry point: - [catala_t file debug unstyled wrap_weaved_output backend language max_prec_digits_opt trace_opt optimize + [catala_t file debug unstyled wrap_weaved_output avoid_exceptions backend language max_prec_digits_opt trace_opt optimize ex_scope output] *) val version : string From 3d2f9635e94908e9f8fe593f46ddf56459ef0595 Mon Sep 17 00:00:00 2001 From: Alain Date: Thu, 25 Nov 2021 17:26:13 +0100 Subject: [PATCH 011/102] add marking in the position utils. This replace the internal-based model to create new positions --- compiler/utils/pos.ml | 2 ++ compiler/utils/pos.mli | 2 ++ 2 files changed, 4 insertions(+) diff --git a/compiler/utils/pos.ml b/compiler/utils/pos.ml index 7ffa2d4ea..f45a98d3f 100644 --- a/compiler/utils/pos.ml +++ b/compiler/utils/pos.ml @@ -175,6 +175,8 @@ let no_pos : t = in { code_pos = (zero_pos, zero_pos); law_pos = [] } +let mark pos e : 'a marked = (e, pos) + let unmark ((x, _) : 'a marked) : 'a = x let get_position ((_, x) : 'a marked) : t = x diff --git a/compiler/utils/pos.mli b/compiler/utils/pos.mli index c38c72aa4..12d649aa9 100644 --- a/compiler/utils/pos.mli +++ b/compiler/utils/pos.mli @@ -64,6 +64,8 @@ type 'a marked = 'a * t val no_pos : t (** Placeholder position *) +val mark: t -> 'a -> 'a marked + val unmark : 'a marked -> 'a val get_position : 'a marked -> t From 7ec067c6ec463ff1f5121682e50e27c4ff5e2d30 Mon Sep 17 00:00:00 2001 From: Alain Date: Thu, 25 Nov 2021 17:27:03 +0100 Subject: [PATCH 012/102] added mockup of eoption in the ocaml runtime --- compiler/runtime.ml | 4 ++++ compiler/runtime.mli | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/compiler/runtime.ml b/compiler/runtime.ml index 9f6e404dd..ddd87841b 100644 --- a/compiler/runtime.ml +++ b/compiler/runtime.ml @@ -31,6 +31,10 @@ type source_position = { law_headings : string list; } +type 'a eoption = + | ENone of unit + | ESome of 'a + exception EmptyError exception AssertionFailed diff --git a/compiler/runtime.mli b/compiler/runtime.mli index 66d5aedd3..7b367bd05 100644 --- a/compiler/runtime.mli +++ b/compiler/runtime.mli @@ -33,6 +33,10 @@ type source_position = { law_headings : string list; } +type 'a eoption = + | ENone of unit + | ESome of 'a + (** {1 Exceptions} *) exception EmptyError From fcdaa21d54e7d45aa5b83012895b2d006cca8aee Mon Sep 17 00:00:00 2001 From: Alain Date: Thu, 25 Nov 2021 17:24:18 +0100 Subject: [PATCH 013/102] add utilities that replace to deal with options --- compiler/lcalc/ast.ml | 33 +++++++++++++++++++++++++++++++++ compiler/lcalc/ast.mli | 13 +++++++++++++ 2 files changed, 46 insertions(+) diff --git a/compiler/lcalc/ast.ml b/compiler/lcalc/ast.ml index a356a97a0..84ded36b9 100644 --- a/compiler/lcalc/ast.ml +++ b/compiler/lcalc/ast.ml @@ -119,6 +119,39 @@ let make_letopt_in (x : Var.t) (tau : D.typ Pos.marked) (e1 : expr Pos.marked Bi (EMatchopt (e1, (ENone, pos), e2), pos) + +let option_enum = D.EnumName.fresh ("eoption", Pos.no_pos) + +let make_none (pos: Pos.t) = + (* Hack: type is not printed in to_ocaml, so I ignore it. *) + + let mark : 'a -> 'a Pos.marked = Pos.mark pos in + Bindlib.box @@ mark @@ EInj (mark @@ ELit LUnit, 0, option_enum, []) + +let make_some (e: expr Pos.marked Bindlib.box): expr Pos.marked Bindlib.box = + + let pos = Pos.get_position @@ Bindlib.unbox e in + let mark: 'a -> 'a Pos.marked = Pos.mark pos in + + let+ e = e in + mark @@ EInj (e, 1, option_enum, []) + +let make_matchopt + (e: expr Pos.marked Bindlib.box) + (e_none: expr Pos.marked Bindlib.box) + (e_some: expr Pos.marked Bindlib.box): expr Pos.marked Bindlib.box = + + let pos = Pos.get_position @@ Bindlib.unbox e in + let mark: 'a -> 'a Pos.marked = Pos.mark pos in + + let+ e = e + and+ e_none = e_none + and+ e_some = e_some in + + mark @@ EMatch (e, [e_none; e_some], option_enum) + + + let handle_default = Var.make ("handle_default", Pos.no_pos) type binder = (expr, expr Pos.marked) Bindlib.binder diff --git a/compiler/lcalc/ast.mli b/compiler/lcalc/ast.mli index 53792c998..f4b451a1d 100644 --- a/compiler/lcalc/ast.mli +++ b/compiler/lcalc/ast.mli @@ -101,6 +101,19 @@ val make_letopt_in : expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box +val make_none : + Pos.t -> expr Pos.marked Bindlib.box + +val make_some : + expr Pos.marked Bindlib.box -> + expr Pos.marked Bindlib.box + +val make_matchopt: + expr Pos.marked Bindlib.box -> + expr Pos.marked Bindlib.box -> + expr Pos.marked Bindlib.box -> + expr Pos.marked Bindlib.box + val handle_default : Var.t type binder = (expr, expr Pos.marked) Bindlib.binder From 3bc71e8c439e65ee16cb639ec872595033dc4155 Mon Sep 17 00:00:00 2001 From: Alain Date: Thu, 25 Nov 2021 18:55:23 +0100 Subject: [PATCH 014/102] modification to take into account the prevous commit --- compiler/lcalc/ast.ml | 41 ++++++++------------ compiler/lcalc/compile_without_exceptions.ml | 2 +- 2 files changed, 18 insertions(+), 25 deletions(-) diff --git a/compiler/lcalc/ast.ml b/compiler/lcalc/ast.ml index 84ded36b9..87eebc63a 100644 --- a/compiler/lcalc/ast.ml +++ b/compiler/lcalc/ast.ml @@ -89,35 +89,15 @@ let make_app (e : expr Pos.marked Bindlib.box) (u : expr Pos.marked Bindlib.box let make_let_in (x : Var.t) (tau : D.typ Pos.marked) (e1 : expr Pos.marked Bindlib.box) (e2 : expr Pos.marked Bindlib.box) : expr Pos.marked Bindlib.box = - Bindlib.box_apply2 - (fun e u -> (EApp (e, u), Pos.get_position (Bindlib.unbox e2))) - (make_abs - (Array.of_list [ x ]) - e2 - (Pos.get_position (Bindlib.unbox e2)) - [ tau ] - (Pos.get_position (Bindlib.unbox e2))) - (Bindlib.box_list [ e1 ]) -let ( let+ ) x f = Bindlib.box_apply f x + let pos = Pos.get_position (Bindlib.unbox e2) in + make_app (make_abs (Array.of_list [ x ]) e2 pos [ tau ] pos) [ e1 ] pos -let ( and+ ) x y = Bindlib.box_pair x y -let make_letopt_in (x : Var.t) (tau : D.typ Pos.marked) (e1 : expr Pos.marked Bindlib.box) - (e2 : expr Pos.marked Bindlib.box) : expr Pos.marked Bindlib.box = - (* let%opt x: tau = e1 in e2 == matchopt e1 with | None -> None | Some x -> e2 *) - let pos = Pos.get_position (Bindlib.unbox e2) in +let ( let+ ) x f = Bindlib.box_apply f x - let+ e2 = - make_abs - (Array.of_list [ x ]) - e2 - (Pos.get_position (Bindlib.unbox e2)) - [ tau ] - (Pos.get_position (Bindlib.unbox e2)) - and+ e1 = e1 in +let ( and+ ) x y = Bindlib.box_pair x y - (EMatchopt (e1, (ENone, pos), e2), pos) let option_enum = D.EnumName.fresh ("eoption", Pos.no_pos) @@ -152,6 +132,19 @@ let make_matchopt +let make_letopt_in + (x : Var.t) + (tau : D.typ Pos.marked) + (e1 : expr Pos.marked Bindlib.box) + (e2 : expr Pos.marked Bindlib.box) : expr Pos.marked Bindlib.box = + (* let%opt x: tau = e1 in e2 == matchopt e1 with | None -> None | Some x -> e2 *) + let pos = Pos.get_position (Bindlib.unbox e2) in + + make_matchopt + e1 + (make_none pos) + (make_abs (Array.of_list [ x ]) e2 pos [ tau ] pos) + let handle_default = Var.make ("handle_default", Pos.no_pos) type binder = (expr, expr Pos.marked) Bindlib.binder diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index 50885f6ba..4afaccbc3 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -27,7 +27,7 @@ let translate_lit (l : D.lit) : A.expr = | D.LUnit -> A.ELit A.LUnit | D.LDate d -> A.ELit (A.LDate d) | D.LDuration d -> A.ELit (A.LDuration d) - | D.LEmptyError -> A.ENone + | D.LEmptyError -> fst @@ Bindlib.unbox @@ A.make_none Pos.no_pos let ( let+ ) x f = Bindlib.box_apply f x From c2db3a40c6b883cbe37b00218ce486315f2faa48 Mon Sep 17 00:00:00 2001 From: Alain Date: Fri, 26 Nov 2021 17:10:31 +0100 Subject: [PATCH 015/102] ref: use of built-in match instead of matchopt (wip) --- compiler/lcalc/ast.ml | 12 ++++++- compiler/lcalc/ast.mli | 6 ++++ compiler/lcalc/compile_without_exceptions.ml | 36 +++++++++++++------- 3 files changed, 41 insertions(+), 13 deletions(-) diff --git a/compiler/lcalc/ast.ml b/compiler/lcalc/ast.ml index 87eebc63a..e7329fb4b 100644 --- a/compiler/lcalc/ast.ml +++ b/compiler/lcalc/ast.ml @@ -100,7 +100,17 @@ let ( and+ ) x y = Bindlib.box_pair x y -let option_enum = D.EnumName.fresh ("eoption", Pos.no_pos) +let option_enum: D.EnumName.t = D.EnumName.fresh ("eoption", Pos.no_pos) + +let none_constr: D.EnumConstructor.t = D.EnumConstructor.fresh ("ENone", Pos.no_pos) +let some_constr: D.EnumConstructor.t = D.EnumConstructor.fresh ("ESome", Pos.no_pos) + + +let option_enum_config: (D.EnumConstructor.t * D.typ Pos.marked) list = + [ + none_constr, (D.TLit D.TUnit, Pos.no_pos); + some_constr, (D.TAny, Pos.no_pos); + ] let make_none (pos: Pos.t) = (* Hack: type is not printed in to_ocaml, so I ignore it. *) diff --git a/compiler/lcalc/ast.mli b/compiler/lcalc/ast.mli index f4b451a1d..eea63e6af 100644 --- a/compiler/lcalc/ast.mli +++ b/compiler/lcalc/ast.mli @@ -101,6 +101,12 @@ val make_letopt_in : expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box + +val option_enum: Dcalc.Ast.EnumName.t +val none_constr: Dcalc.Ast.EnumConstructor.t +val some_constr: Dcalc.Ast.EnumConstructor.t +val option_enum_config: (Dcalc.Ast.EnumConstructor.t * Dcalc.Ast.typ Pos.marked) list + val make_none : Pos.t -> expr Pos.marked Bindlib.box diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index 4afaccbc3..246443730 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -19,14 +19,15 @@ module A = Ast type ctx = A.expr Pos.marked Bindlib.box D.VarMap.t let translate_lit (l : D.lit) : A.expr = + let build lit = fst @@ Bindlib.unbox @@ A.make_some (Bindlib.box (Pos.mark Pos.no_pos (A.ELit lit))) in match l with - | D.LBool l -> A.ELit (A.LBool l) - | D.LInt i -> A.ELit (A.LInt i) - | D.LRat r -> A.ELit (A.LRat r) - | D.LMoney m -> A.ELit (A.LMoney m) - | D.LUnit -> A.ELit A.LUnit - | D.LDate d -> A.ELit (A.LDate d) - | D.LDuration d -> A.ELit (A.LDuration d) + | D.LBool l -> build (A.LBool l) + | D.LInt i -> build (A.LInt i) + | D.LRat r -> build (A.LRat r) + | D.LMoney m -> build (A.LMoney m) + | D.LUnit -> build A.LUnit + | D.LDate d -> build (A.LDate d) + | D.LDuration d -> build (A.LDuration d) | D.LEmptyError -> fst @@ Bindlib.unbox @@ A.make_none Pos.no_pos let ( let+ ) x f = Bindlib.box_apply f x @@ -132,7 +133,9 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl Bindlib.box_apply (fun es -> same_pos @@ A.ESome (same_pos @@ A.EArray es)) (Bindlib.box_list (List.map (translate_expr ctx) es)) - | D.ELit l -> Bindlib.box @@ same_pos @@ A.ESome (same_pos @@ translate_lit l) + | D.ELit l -> + Bindlib.box @@ same_pos @@ translate_lit l + (* Bindlib.box @@ same_pos @@ A.ESome (same_pos @@ translate_lit l) *) | D.EOp op -> Bindlib.box @@ same_pos @@ A.ESome (same_pos @@ A.EOp op) | D.EIfThenElse (e1, e2, e3) -> let e1 = translate_expr ctx e1 in @@ -163,6 +166,7 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl same_pos @@ A.EAssert (e1, pos) in A.make_letopt_in x tau e1 e2 + | D.ErrorOnEmpty arg -> let pos = Pos.get_position arg in let x = A.Var.make ("e1", pos) in @@ -170,14 +174,18 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl let tau = (D.TAny, pos) in - let+ e2 = + let e2 = A.make_abs (Array.of_list [ x ]) (Bindlib.box @@ same_pos @@ A.EVar (x, pos)) pos [ tau ] pos - and+ e1 = arg in + and e1 = arg in + + A.make_matchopt + e1 + (Bindlib.box @@ same_pos @@ A.ERaise A.NoValueProvided) + e2 - same_pos @@ A.EMatchopt (e1, same_pos @@ A.ERaise A.NoValueProvided, e2) | D.EApp (e1, args) -> let e1 = translate_expr ctx e1 in let pos = Pos.get_position (Bindlib.unbox e1) in @@ -227,5 +235,9 @@ let translate_program (prgm : D.program) : A.program = ([], D.VarMap.empty) prgm.scopes in List.rev acc); - decl_ctx = prgm.decl_ctx; + decl_ctx = { + ctx_enums = prgm.decl_ctx.ctx_enums + |> D.EnumMap.add A.option_enum A.option_enum_config; + ctx_structs = prgm.decl_ctx.ctx_structs; + } } From cf43e3d87ca0487232df2fc573723da244d9f499 Mon Sep 17 00:00:00 2001 From: Alain Date: Mon, 29 Nov 2021 17:40:13 +0100 Subject: [PATCH 016/102] add generic identity optimization helper peephole transform using generic transformation add iota reduction as an optimization --- compiler/lcalc/optimizations.ml | 151 +++++++++++++++++++++++--------- 1 file changed, 108 insertions(+), 43 deletions(-) diff --git a/compiler/lcalc/optimizations.ml b/compiler/lcalc/optimizations.ml index 2d15695cc..7102c39f3 100644 --- a/compiler/lcalc/optimizations.ml +++ b/compiler/lcalc/optimizations.ml @@ -14,59 +14,124 @@ open Utils open Ast -let rec peephole_expr (e : expr Pos.marked) : expr Pos.marked Bindlib.box = +let ( let+ ) x f = Bindlib.box_apply f x +let ( and+ ) x y = Bindlib.box_pair x y + +let transform + (t: 'a -> expr Pos.marked -> expr Pos.marked Bindlib.box) + (ctx: 'a) + (e: expr Pos.marked): expr Pos.marked Bindlib.box = + (* calls [t ctx] on every direct childs of [e], then rebuild an abstract syntax tree modified. Used in other transformations. *) + + let default_mark e' = Pos.mark (Pos.get_position e) e' in match Pos.unmark e with - | EVar (v, pos) -> Bindlib.box_apply (fun v -> (v, pos)) (Bindlib.box_var v) + | EVar (v, pos) -> + let+ v = Bindlib.box_var v in + (v, pos) + | ETuple (args, n) -> - Bindlib.box_apply - (fun args -> (ETuple (args, n), Pos.get_position e)) - (Bindlib.box_list (List.map peephole_expr args)) + let+ args = args + |> List.map (t ctx) + |> Bindlib.box_list + in + default_mark @@ ETuple (args, n) + | ETupleAccess (e1, i, n, ts) -> - Bindlib.box_apply - (fun e1 -> (ETupleAccess (e1, i, n, ts), Pos.get_position e)) - (peephole_expr e1) + let+ e1 = t ctx e1 in + default_mark @@ ETupleAccess (e1, i, n, ts) + | EInj (e1, i, n, ts) -> - Bindlib.box_apply (fun e1 -> (EInj (e1, i, n, ts), Pos.get_position e)) (peephole_expr e1) + let+ e1 = t ctx e1 in + default_mark @@ EInj (e1, i, n, ts) + | EMatch (arg, cases, n) -> - Bindlib.box_apply2 - (fun arg cases -> (EMatch (arg, cases, n), Pos.get_position e)) - (peephole_expr arg) - (Bindlib.box_list (List.map peephole_expr cases)) + let+ arg = t ctx arg + and+ cases = cases + |> List.map (t ctx) + |> Bindlib.box_list + in + default_mark @@ EMatch (arg, cases, n) + | EArray args -> - Bindlib.box_apply - (fun args -> (EArray args, Pos.get_position e)) - (Bindlib.box_list (List.map peephole_expr args)) + let+ args = args + |> List.map (t ctx) + |> Bindlib.box_list + in + default_mark @@ EArray args + | EAbs ((binder, pos_binder), ts) -> - let vars, body = Bindlib.unmbind binder in - let body = peephole_expr body in - Bindlib.box_apply - (fun binder -> (EAbs ((binder, pos_binder), ts), Pos.get_position e)) - (Bindlib.bind_mvar vars body) + let vars, body = Bindlib.unmbind binder in + let body = t ctx body in + let+ binder = Bindlib.bind_mvar vars body in + default_mark @@ EAbs ((binder, pos_binder), ts) + | EApp (e1, args) -> - Bindlib.box_apply2 - (fun e1 args -> (EApp (e1, args), Pos.get_position e)) - (peephole_expr e1) - (Bindlib.box_list (List.map peephole_expr args)) - | EAssert e1 -> Bindlib.box_apply (fun e1 -> (EAssert e1, Pos.get_position e)) (peephole_expr e1) + let+ e1 = t ctx e1 + and+ args = args + |> List.map (t ctx) + |> Bindlib.box_list + in + default_mark @@ EApp (e1, args) + + | EAssert e1 -> + let+ e1 = t ctx e1 in + default_mark @@ EAssert e1 + | EIfThenElse (e1, e2, e3) -> - Bindlib.box_apply3 - (fun e1 e2 e3 -> - match Pos.unmark e1 with - | ELit (LBool true) | EApp ((EOp (Unop (Log _)), _), [ (ELit (LBool true), _) ]) -> e2 - | ELit (LBool false) | EApp ((EOp (Unop (Log _)), _), [ (ELit (LBool false), _) ]) -> e3 - | _ -> (EIfThenElse (e1, e2, e3), Pos.get_position e)) - (peephole_expr e1) (peephole_expr e2) (peephole_expr e3) + let+ e1 = t ctx e1 + and+ e2 = t ctx e2 + and+ e3 = t ctx e3 in + default_mark @@ EIfThenElse (e1, e2, e3) + | ECatch (e1, exn, e2) -> - Bindlib.box_apply2 - (fun e1 e2 -> - ( (match Pos.unmark e2 with - | ERaise exn2 when exn2 = exn -> Pos.unmark e1 - | _ -> ECatch (e1, exn, e2)), - Pos.get_position e )) - (peephole_expr e1) (peephole_expr e2) - | ERaise _ | ELit _ | EOp _ | ENone | ESome _ | EMatchopt _ -> Bindlib.box e + let+ e1 = t ctx e1 + and+ e2 = t ctx e2 in + default_mark @@ ECatch (e1, exn, e2) + + (* temporary *) + | ESome e1 -> + let+ e1 = t ctx e1 in + default_mark @@ ESome e1 + + | ERaise _ | ELit _ | EOp _ | ENone -> Bindlib.box e + + +let rec iota_expr (_: unit) (e: expr Pos.marked) : expr Pos.marked Bindlib.box = + let default_mark e' = Pos.mark (Pos.get_position e) e' in + match Pos.unmark e with + | EMatch ((EInj (e1, i, n', _ts), _), cases, n) + when (Dcalc.Ast.EnumName.compare n n' = 0) -> + + let+ e1 = transform iota_expr () e1 + and+ case = transform iota_expr () (List.nth cases i) in + default_mark @@ EApp (case, [e1]) + + | _ -> transform iota_expr () e + +let iota_optimizations (p : program) : program = + { p with scopes = List.map (fun (var, e) -> (var, Bindlib.unbox (iota_expr () e))) p.scopes } + + +let rec peephole_expr (_: unit) (e : expr Pos.marked) : expr Pos.marked Bindlib.box = + + let default_mark e' = Pos.mark (Pos.get_position e) e' in + + match Pos.unmark e with + | EIfThenElse (e1, e2, e3) -> + let+ e1 = transform peephole_expr () e1 + and+ e2 = transform peephole_expr () e2 + and+ e3 = transform peephole_expr () e3 in + begin match Pos.unmark e1 with + | ELit (LBool true) | EApp ((EOp (Unop (Log _)), _), [ (ELit (LBool true), _)]) -> e2 + | ELit (LBool false) | EApp ((EOp (Unop (Log _)), _), [ (ELit (LBool false), _)]) -> e3 + | _ -> default_mark @@ EIfThenElse (e1, e2, e3) + end + | _ -> transform peephole_expr () e let peephole_optimizations (p : program) : program = - { p with scopes = List.map (fun (var, e) -> (var, Bindlib.unbox (peephole_expr e))) p.scopes } + { p with scopes = List.map (fun (var, e) -> (var, Bindlib.unbox (peephole_expr () e))) p.scopes } -let optimize_program (p : program) : program = peephole_optimizations p +let optimize_program (p : program) : program = + p + |> iota_optimizations + |> peephole_optimizations From 22af2a9335176a0773c2d7a90ad95c3c993f402f Mon Sep 17 00:00:00 2001 From: Alain Date: Mon, 29 Nov 2021 17:40:30 +0100 Subject: [PATCH 017/102] refactored transformation to remove matchopt construction --- compiler/lcalc/ast.ml | 3 +-- compiler/lcalc/ast.mli | 1 - compiler/lcalc/compile_without_exceptions.ml | 20 +++++++++++++++----- compiler/lcalc/print.ml | 5 ----- compiler/lcalc/to_ocaml.ml | 9 ++------- 5 files changed, 18 insertions(+), 20 deletions(-) diff --git a/compiler/lcalc/ast.ml b/compiler/lcalc/ast.ml index e7329fb4b..9c74f2856 100644 --- a/compiler/lcalc/ast.ml +++ b/compiler/lcalc/ast.ml @@ -57,7 +57,6 @@ type expr = ---------------------------------- matchopt (Some e1) e2 e3 ~~> e3 e1 -------------------------- matchopt None e2 e3 ~~> e2 *) - | EMatchopt of expr Pos.marked * expr Pos.marked * expr Pos.marked | ESome of expr Pos.marked | ENone @@ -152,7 +151,7 @@ let make_letopt_in make_matchopt e1 - (make_none pos) + (make_abs (Array.of_list [ x ]) (make_none pos) pos [ tau ] pos) (make_abs (Array.of_list [ x ]) e2 pos [ tau ] pos) let handle_default = Var.make ("handle_default", Pos.no_pos) diff --git a/compiler/lcalc/ast.mli b/compiler/lcalc/ast.mli index eea63e6af..e93812a9b 100644 --- a/compiler/lcalc/ast.mli +++ b/compiler/lcalc/ast.mli @@ -53,7 +53,6 @@ type expr = | ERaise of except | ECatch of expr Pos.marked * except * expr Pos.marked (* TODO: temporary *) - | EMatchopt of expr Pos.marked * expr Pos.marked * expr Pos.marked | ESome of expr Pos.marked | ENone diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index 246443730..d9ea02ae9 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -103,8 +103,7 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl let e2 = let+ e1 = Bindlib.box (A.EVar (x, pos)) - (* there is an issue here. *) - and+ cases = + and+ cases = cases |> List.map (fun (e', _pos) -> match e' with @@ -125,6 +124,8 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl | _ -> assert false) |> Bindlib.box_list in + + assert (List.for_all (fun (x, _) -> match x with A.EAbs _ -> true | _ -> false) cases); same_pos @@ A.EMatch ((e1, pos), cases, en) in @@ -174,18 +175,27 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl let tau = (D.TAny, pos) in - let e2 = + let e3 = A.make_abs (Array.of_list [ x ]) (Bindlib.box @@ same_pos @@ A.EVar (x, pos)) pos [ tau ] pos - and e1 = arg in + and e1 = arg + and e2 = + A.make_abs + (Array.of_list [ x ]) + (Bindlib.box @@ same_pos @@ A.ERaise A.NoValueProvided) + pos [ tau ] pos + in A.make_matchopt e1 - (Bindlib.box @@ same_pos @@ A.ERaise A.NoValueProvided) e2 + e3 + | D.EApp ((D.EOp op, pos), args) -> + let+ args = Bindlib.box_list (List.map (translate_expr ctx) args) in + same_pos @@ A.EApp ((A.EOp op, pos), args) | D.EApp (e1, args) -> let e1 = translate_expr ctx e1 in let pos = Pos.get_position (Bindlib.unbox e1) in diff --git a/compiler/lcalc/print.ml b/compiler/lcalc/print.ml index 68d73c1c3..fc995d480 100644 --- a/compiler/lcalc/print.ml +++ b/compiler/lcalc/print.ml @@ -184,8 +184,3 @@ let rec format_expr (ctx : Dcalc.Ast.decl_ctx) (fmt : Format.formatter) (e : exp | ESome e' -> Format.fprintf fmt "@[%a%a%a@]" format_punctuation "(" format_expr e' format_punctuation "(" - | EMatchopt (e1, e2, e3) -> - Format.fprintf fmt "@[%a@ %a@ %a@ @[%a%a%a%a@ %a%a%a%a@]@]" format_keyword - "match" format_expr e1 format_keyword "with" format_punctuation "\n|" format_keyword "None" - format_punctuation "->" format_expr e2 format_punctuation "\n|" format_keyword "Some" - format_punctuation "->" format_expr e3 diff --git a/compiler/lcalc/to_ocaml.ml b/compiler/lcalc/to_ocaml.ml index ab1ff4ee6..4f5b4ae8b 100644 --- a/compiler/lcalc/to_ocaml.ml +++ b/compiler/lcalc/to_ocaml.ml @@ -330,13 +330,8 @@ let rec format_expr (ctx : Dcalc.Ast.decl_ctx) (fmt : Format.formatter) (e : exp format_exception (exc, Pos.get_position e) format_with_parens e2 - | ESome e1 -> Format.fprintf fmt "@[ Some@ %a@ @]" format_with_parens e1 - | ENone -> Format.fprintf fmt "None" - | EMatchopt (e1, e2, e3) -> - let x = Ast.Var.make ("x", Pos.no_pos) in - Format.fprintf fmt - "@[match@ %a@]@ with@\n| None ->@[@ %a@]@\n| Some %a ->@[@ %a@ %a@]" - format_expr e1 format_with_parens e2 format_var x format_with_parens e3 format_var x + | ESome e1 -> Format.fprintf fmt "@[ ESome@ %a@ @]" format_with_parens e1 + | ENone -> Format.fprintf fmt "ENone" let format_struct_embedding (fmt : Format.formatter) ((struct_name, struct_fields) : D.StructName.t * (D.StructFieldName.t * D.typ Pos.marked) list) From 8d580f1db6d8f976154607888c9b942e9d1ef3ad Mon Sep 17 00:00:00 2001 From: Alain Date: Mon, 29 Nov 2021 17:53:07 +0100 Subject: [PATCH 018/102] fix: removed ESome and ENone constructions. --- compiler/lcalc/ast.ml | 19 +++++-------------- compiler/lcalc/ast.mli | 7 ++++--- compiler/lcalc/compile_without_exceptions.ml | 18 ++++++++++++------ compiler/lcalc/optimizations.ml | 9 ++------- compiler/lcalc/print.ml | 4 ---- compiler/lcalc/to_ocaml.ml | 2 -- 6 files changed, 23 insertions(+), 36 deletions(-) diff --git a/compiler/lcalc/ast.ml b/compiler/lcalc/ast.ml index 9c74f2856..13d92492d 100644 --- a/compiler/lcalc/ast.ml +++ b/compiler/lcalc/ast.ml @@ -44,21 +44,8 @@ type expr = | EOp of D.operator | EIfThenElse of expr Pos.marked * expr Pos.marked * expr Pos.marked | ERaise of except - | ECatch of expr Pos.marked * except * expr Pos.marked (* TODO: temporary *) - (* semantics of ESome and ENone should be easy to comprehend. *) - (* The semantics of EMatchopt i've choosen are as following : + | ECatch of expr Pos.marked * except * expr Pos.marked - Context : - - C := ... | matchopt [.] e2 e3 - - And the rules : - - ---------------------------------- matchopt (Some e1) e2 e3 ~~> e3 e1 - - -------------------------- matchopt None e2 e3 ~~> e2 *) - | ESome of expr Pos.marked - | ENone module Var = struct type t = expr Bindlib.var @@ -125,6 +112,10 @@ let make_some (e: expr Pos.marked Bindlib.box): expr Pos.marked Bindlib.box = let+ e = e in mark @@ EInj (e, 1, option_enum, []) +let make_some' (e: expr Pos.marked): expr = + + EInj (e, 1, option_enum, []) + let make_matchopt (e: expr Pos.marked Bindlib.box) (e_none: expr Pos.marked Bindlib.box) diff --git a/compiler/lcalc/ast.mli b/compiler/lcalc/ast.mli index e93812a9b..6317062bb 100644 --- a/compiler/lcalc/ast.mli +++ b/compiler/lcalc/ast.mli @@ -52,9 +52,6 @@ type expr = | EIfThenElse of expr Pos.marked * expr Pos.marked * expr Pos.marked | ERaise of except | ECatch of expr Pos.marked * except * expr Pos.marked - (* TODO: temporary *) - | ESome of expr Pos.marked - | ENone (** {1 Variable helpers} *) @@ -113,6 +110,10 @@ val make_some : expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box +val make_some' : + expr Pos.marked -> + expr + val make_matchopt: expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box -> diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index d9ea02ae9..4b6c9c550 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -131,13 +131,19 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl A.make_letopt_in x tau e1 e2 | D.EArray es -> - Bindlib.box_apply - (fun es -> same_pos @@ A.ESome (same_pos @@ A.EArray es)) - (Bindlib.box_list (List.map (translate_expr ctx) es)) + + let+ es = es + |> List.map (translate_expr ctx) + |> Bindlib.box_list + in + + same_pos @@ A.make_some' (same_pos @@ A.EArray es) + | D.ELit l -> Bindlib.box @@ same_pos @@ translate_lit l - (* Bindlib.box @@ same_pos @@ A.ESome (same_pos @@ translate_lit l) *) - | D.EOp op -> Bindlib.box @@ same_pos @@ A.ESome (same_pos @@ A.EOp op) + | D.EOp op -> + + Bindlib.box @@ same_pos @@ A.make_some' (same_pos @@ A.EOp op) | D.EIfThenElse (e1, e2, e3) -> let e1 = translate_expr ctx e1 in let pos = Pos.get_position (Bindlib.unbox e1) in @@ -223,7 +229,7 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl let lc_vars = Array.of_list lc_vars in let new_body = translate_expr ctx body in let+ new_binder = Bindlib.bind_mvar lc_vars new_body in - same_pos @@ A.ESome (same_pos @@ A.EAbs ((new_binder, pos_binder), List.map translate_typ ts)) + same_pos @@ A.make_some' (same_pos @@ A.EAbs ((new_binder, pos_binder), List.map translate_typ ts)) | D.EDefault (exceptions, just, cons) -> translate_default ctx exceptions just cons (Pos.get_position e) diff --git a/compiler/lcalc/optimizations.ml b/compiler/lcalc/optimizations.ml index 7102c39f3..56a3fd616 100644 --- a/compiler/lcalc/optimizations.ml +++ b/compiler/lcalc/optimizations.ml @@ -87,13 +87,8 @@ let transform let+ e1 = t ctx e1 and+ e2 = t ctx e2 in default_mark @@ ECatch (e1, exn, e2) - - (* temporary *) - | ESome e1 -> - let+ e1 = t ctx e1 in - default_mark @@ ESome e1 - - | ERaise _ | ELit _ | EOp _ | ENone -> Bindlib.box e + + | ERaise _ | ELit _ | EOp _ -> Bindlib.box e let rec iota_expr (_: unit) (e: expr Pos.marked) : expr Pos.marked Bindlib.box = diff --git a/compiler/lcalc/print.ml b/compiler/lcalc/print.ml index fc995d480..6df7a532d 100644 --- a/compiler/lcalc/print.ml +++ b/compiler/lcalc/print.ml @@ -180,7 +180,3 @@ let rec format_expr (ctx : Dcalc.Ast.decl_ctx) (fmt : Format.formatter) (e : exp | EAssert e' -> Format.fprintf fmt "@[%a@ %a%a%a@]" format_keyword "assert" format_punctuation "(" format_expr e' format_punctuation ")" - | ENone -> Format.fprintf fmt "%a@ " format_keyword "None" - | ESome e' -> - Format.fprintf fmt "@[%a%a%a@]" format_punctuation "(" format_expr e' - format_punctuation "(" diff --git a/compiler/lcalc/to_ocaml.ml b/compiler/lcalc/to_ocaml.ml index 4f5b4ae8b..07090c33a 100644 --- a/compiler/lcalc/to_ocaml.ml +++ b/compiler/lcalc/to_ocaml.ml @@ -330,8 +330,6 @@ let rec format_expr (ctx : Dcalc.Ast.decl_ctx) (fmt : Format.formatter) (e : exp format_exception (exc, Pos.get_position e) format_with_parens e2 - | ESome e1 -> Format.fprintf fmt "@[ ESome@ %a@ @]" format_with_parens e1 - | ENone -> Format.fprintf fmt "ENone" let format_struct_embedding (fmt : Format.formatter) ((struct_name, struct_fields) : D.StructName.t * (D.StructFieldName.t * D.typ Pos.marked) list) From 536dde9834612094194e535f28976bfc31bf9ef9 Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Tue, 30 Nov 2021 16:27:47 +0100 Subject: [PATCH 019/102] Formatting + CI + etc --- compiler/catala_web.ml | 2 +- compiler/lcalc/ast.ml | 59 +- compiler/lcalc/ast.mli | 23 +- compiler/lcalc/compile_without_exceptions.ml | 48 +- compiler/lcalc/optimizations.ml | 126 +- compiler/runtime.ml | 4 +- compiler/runtime.mli | 4 +- compiler/utils/pos.mli | 2 +- french_law/js/french_law.js | 4411 +++++----- .../law_source/allocations_familiales.ml | 25 +- .../python/src/allocations_familiales.py | 7195 +++++++++-------- 11 files changed, 6041 insertions(+), 5858 deletions(-) diff --git a/compiler/catala_web.ml b/compiler/catala_web.ml index 31d5289be..e4e3ad0fe 100644 --- a/compiler/catala_web.ml +++ b/compiler/catala_web.ml @@ -8,7 +8,7 @@ let _ = (language : Js.js_string Js.t) (trace : bool) = driver (Contents (Js.to_string contents)) - false false false "Interpret" + false false false false "Interpret" (Some (Js.to_string language)) None trace false (Some (Js.to_string scope)) diff --git a/compiler/lcalc/ast.ml b/compiler/lcalc/ast.ml index 13d92492d..b543d7f63 100644 --- a/compiler/lcalc/ast.ml +++ b/compiler/lcalc/ast.ml @@ -44,8 +44,7 @@ type expr = | EOp of D.operator | EIfThenElse of expr Pos.marked * expr Pos.marked * expr Pos.marked | ERaise of except - | ECatch of expr Pos.marked * except * expr Pos.marked - + | ECatch of expr Pos.marked * except * expr Pos.marked module Var = struct type t = expr Bindlib.var @@ -75,73 +74,51 @@ let make_app (e : expr Pos.marked Bindlib.box) (u : expr Pos.marked Bindlib.box let make_let_in (x : Var.t) (tau : D.typ Pos.marked) (e1 : expr Pos.marked Bindlib.box) (e2 : expr Pos.marked Bindlib.box) : expr Pos.marked Bindlib.box = - let pos = Pos.get_position (Bindlib.unbox e2) in make_app (make_abs (Array.of_list [ x ]) e2 pos [ tau ] pos) [ e1 ] pos - let ( let+ ) x f = Bindlib.box_apply f x let ( and+ ) x y = Bindlib.box_pair x y +let option_enum : D.EnumName.t = D.EnumName.fresh ("eoption", Pos.no_pos) +let none_constr : D.EnumConstructor.t = D.EnumConstructor.fresh ("ENone", Pos.no_pos) -let option_enum: D.EnumName.t = D.EnumName.fresh ("eoption", Pos.no_pos) - -let none_constr: D.EnumConstructor.t = D.EnumConstructor.fresh ("ENone", Pos.no_pos) -let some_constr: D.EnumConstructor.t = D.EnumConstructor.fresh ("ESome", Pos.no_pos) +let some_constr : D.EnumConstructor.t = D.EnumConstructor.fresh ("ESome", Pos.no_pos) +let option_enum_config : (D.EnumConstructor.t * D.typ Pos.marked) list = + [ (none_constr, (D.TLit D.TUnit, Pos.no_pos)); (some_constr, (D.TAny, Pos.no_pos)) ] -let option_enum_config: (D.EnumConstructor.t * D.typ Pos.marked) list = - [ - none_constr, (D.TLit D.TUnit, Pos.no_pos); - some_constr, (D.TAny, Pos.no_pos); - ] - -let make_none (pos: Pos.t) = +let make_none (pos : Pos.t) = (* Hack: type is not printed in to_ocaml, so I ignore it. *) - let mark : 'a -> 'a Pos.marked = Pos.mark pos in Bindlib.box @@ mark @@ EInj (mark @@ ELit LUnit, 0, option_enum, []) -let make_some (e: expr Pos.marked Bindlib.box): expr Pos.marked Bindlib.box = - +let make_some (e : expr Pos.marked Bindlib.box) : expr Pos.marked Bindlib.box = let pos = Pos.get_position @@ Bindlib.unbox e in - let mark: 'a -> 'a Pos.marked = Pos.mark pos in + let mark : 'a -> 'a Pos.marked = Pos.mark pos in let+ e = e in mark @@ EInj (e, 1, option_enum, []) -let make_some' (e: expr Pos.marked): expr = - - EInj (e, 1, option_enum, []) - -let make_matchopt - (e: expr Pos.marked Bindlib.box) - (e_none: expr Pos.marked Bindlib.box) - (e_some: expr Pos.marked Bindlib.box): expr Pos.marked Bindlib.box = +let make_some' (e : expr Pos.marked) : expr = EInj (e, 1, option_enum, []) +let make_matchopt (e : expr Pos.marked Bindlib.box) (e_none : expr Pos.marked Bindlib.box) + (e_some : expr Pos.marked Bindlib.box) : expr Pos.marked Bindlib.box = let pos = Pos.get_position @@ Bindlib.unbox e in - let mark: 'a -> 'a Pos.marked = Pos.mark pos in - - let+ e = e - and+ e_none = e_none - and+ e_some = e_some in - - mark @@ EMatch (e, [e_none; e_some], option_enum) + let mark : 'a -> 'a Pos.marked = Pos.mark pos in + let+ e = e and+ e_none = e_none and+ e_some = e_some in + mark @@ EMatch (e, [ e_none; e_some ], option_enum) -let make_letopt_in - (x : Var.t) - (tau : D.typ Pos.marked) - (e1 : expr Pos.marked Bindlib.box) - (e2 : expr Pos.marked Bindlib.box) : expr Pos.marked Bindlib.box = +let make_letopt_in (x : Var.t) (tau : D.typ Pos.marked) (e1 : expr Pos.marked Bindlib.box) + (e2 : expr Pos.marked Bindlib.box) : expr Pos.marked Bindlib.box = (* let%opt x: tau = e1 in e2 == matchopt e1 with | None -> None | Some x -> e2 *) let pos = Pos.get_position (Bindlib.unbox e2) in - make_matchopt - e1 + make_matchopt e1 (make_abs (Array.of_list [ x ]) (make_none pos) pos [ tau ] pos) (make_abs (Array.of_list [ x ]) e2 pos [ tau ] pos) diff --git a/compiler/lcalc/ast.mli b/compiler/lcalc/ast.mli index 6317062bb..7e4037e8d 100644 --- a/compiler/lcalc/ast.mli +++ b/compiler/lcalc/ast.mli @@ -97,24 +97,21 @@ val make_letopt_in : expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box +val option_enum : Dcalc.Ast.EnumName.t -val option_enum: Dcalc.Ast.EnumName.t -val none_constr: Dcalc.Ast.EnumConstructor.t -val some_constr: Dcalc.Ast.EnumConstructor.t -val option_enum_config: (Dcalc.Ast.EnumConstructor.t * Dcalc.Ast.typ Pos.marked) list +val none_constr : Dcalc.Ast.EnumConstructor.t -val make_none : - Pos.t -> expr Pos.marked Bindlib.box +val some_constr : Dcalc.Ast.EnumConstructor.t -val make_some : - expr Pos.marked Bindlib.box -> - expr Pos.marked Bindlib.box +val option_enum_config : (Dcalc.Ast.EnumConstructor.t * Dcalc.Ast.typ Pos.marked) list + +val make_none : Pos.t -> expr Pos.marked Bindlib.box + +val make_some : expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box -val make_some' : - expr Pos.marked -> - expr +val make_some' : expr Pos.marked -> expr -val make_matchopt: +val make_matchopt : expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box -> diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index 4b6c9c550..1b1c8876d 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -19,7 +19,9 @@ module A = Ast type ctx = A.expr Pos.marked Bindlib.box D.VarMap.t let translate_lit (l : D.lit) : A.expr = - let build lit = fst @@ Bindlib.unbox @@ A.make_some (Bindlib.box (Pos.mark Pos.no_pos (A.ELit lit))) in + let build lit = + fst @@ Bindlib.unbox @@ A.make_some (Bindlib.box (Pos.mark Pos.no_pos (A.ELit lit))) + in match l with | D.LBool l -> build (A.LBool l) | D.LInt i -> build (A.LInt i) @@ -131,19 +133,11 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl A.make_letopt_in x tau e1 e2 | D.EArray es -> + let+ es = es |> List.map (translate_expr ctx) |> Bindlib.box_list in - let+ es = es - |> List.map (translate_expr ctx) - |> Bindlib.box_list - in - - same_pos @@ A.make_some' (same_pos @@ A.EArray es) - - | D.ELit l -> - Bindlib.box @@ same_pos @@ translate_lit l - | D.EOp op -> - - Bindlib.box @@ same_pos @@ A.make_some' (same_pos @@ A.EOp op) + same_pos @@ A.make_some' (same_pos @@ A.EArray es) + | D.ELit l -> Bindlib.box @@ same_pos @@ translate_lit l + | D.EOp op -> Bindlib.box @@ same_pos @@ A.make_some' (same_pos @@ A.EOp op) | D.EIfThenElse (e1, e2, e3) -> let e1 = translate_expr ctx e1 in let pos = Pos.get_position (Bindlib.unbox e1) in @@ -173,7 +167,6 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl same_pos @@ A.EAssert (e1, pos) in A.make_letopt_in x tau e1 e2 - | D.ErrorOnEmpty arg -> let pos = Pos.get_position arg in let x = A.Var.make ("e1", pos) in @@ -187,21 +180,17 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl (Bindlib.box @@ same_pos @@ A.EVar (x, pos)) pos [ tau ] pos and e1 = arg - and e2 = + and e2 = A.make_abs (Array.of_list [ x ]) (Bindlib.box @@ same_pos @@ A.ERaise A.NoValueProvided) pos [ tau ] pos - in - - A.make_matchopt - e1 - e2 - e3 + in + A.make_matchopt e1 e2 e3 | D.EApp ((D.EOp op, pos), args) -> - let+ args = Bindlib.box_list (List.map (translate_expr ctx) args) in - same_pos @@ A.EApp ((A.EOp op, pos), args) + let+ args = Bindlib.box_list (List.map (translate_expr ctx) args) in + same_pos @@ A.EApp ((A.EOp op, pos), args) | D.EApp (e1, args) -> let e1 = translate_expr ctx e1 in let pos = Pos.get_position (Bindlib.unbox e1) in @@ -229,7 +218,8 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl let lc_vars = Array.of_list lc_vars in let new_body = translate_expr ctx body in let+ new_binder = Bindlib.bind_mvar lc_vars new_body in - same_pos @@ A.make_some' (same_pos @@ A.EAbs ((new_binder, pos_binder), List.map translate_typ ts)) + same_pos + @@ A.make_some' (same_pos @@ A.EAbs ((new_binder, pos_binder), List.map translate_typ ts)) | D.EDefault (exceptions, just, cons) -> translate_default ctx exceptions just cons (Pos.get_position e) @@ -251,9 +241,9 @@ let translate_program (prgm : D.program) : A.program = ([], D.VarMap.empty) prgm.scopes in List.rev acc); - decl_ctx = { - ctx_enums = prgm.decl_ctx.ctx_enums - |> D.EnumMap.add A.option_enum A.option_enum_config; - ctx_structs = prgm.decl_ctx.ctx_structs; - } + decl_ctx = + { + ctx_enums = prgm.decl_ctx.ctx_enums |> D.EnumMap.add A.option_enum A.option_enum_config; + ctx_structs = prgm.decl_ctx.ctx_structs; + }; } diff --git a/compiler/lcalc/optimizations.ml b/compiler/lcalc/optimizations.ml index 56a3fd616..640d46688 100644 --- a/compiler/lcalc/optimizations.ml +++ b/compiler/lcalc/optimizations.ml @@ -15,118 +15,78 @@ open Utils open Ast let ( let+ ) x f = Bindlib.box_apply f x -let ( and+ ) x y = Bindlib.box_pair x y -let transform - (t: 'a -> expr Pos.marked -> expr Pos.marked Bindlib.box) - (ctx: 'a) - (e: expr Pos.marked): expr Pos.marked Bindlib.box = - (* calls [t ctx] on every direct childs of [e], then rebuild an abstract syntax tree modified. Used in other transformations. *) +let ( and+ ) x y = Bindlib.box_pair x y +let transform (t : 'a -> expr Pos.marked -> expr Pos.marked Bindlib.box) (ctx : 'a) + (e : expr Pos.marked) : expr Pos.marked Bindlib.box = + (* calls [t ctx] on every direct childs of [e], then rebuild an abstract syntax tree modified. + Used in other transformations. *) let default_mark e' = Pos.mark (Pos.get_position e) e' in match Pos.unmark e with | EVar (v, pos) -> - let+ v = Bindlib.box_var v in - (v, pos) - + let+ v = Bindlib.box_var v in + (v, pos) | ETuple (args, n) -> - let+ args = args - |> List.map (t ctx) - |> Bindlib.box_list - in - default_mark @@ ETuple (args, n) - + let+ args = args |> List.map (t ctx) |> Bindlib.box_list in + default_mark @@ ETuple (args, n) | ETupleAccess (e1, i, n, ts) -> - let+ e1 = t ctx e1 in - default_mark @@ ETupleAccess (e1, i, n, ts) - + let+ e1 = t ctx e1 in + default_mark @@ ETupleAccess (e1, i, n, ts) | EInj (e1, i, n, ts) -> - let+ e1 = t ctx e1 in - default_mark @@ EInj (e1, i, n, ts) - + let+ e1 = t ctx e1 in + default_mark @@ EInj (e1, i, n, ts) | EMatch (arg, cases, n) -> - let+ arg = t ctx arg - and+ cases = cases - |> List.map (t ctx) - |> Bindlib.box_list - in - default_mark @@ EMatch (arg, cases, n) - + let+ arg = t ctx arg and+ cases = cases |> List.map (t ctx) |> Bindlib.box_list in + default_mark @@ EMatch (arg, cases, n) | EArray args -> - let+ args = args - |> List.map (t ctx) - |> Bindlib.box_list - in - default_mark @@ EArray args - + let+ args = args |> List.map (t ctx) |> Bindlib.box_list in + default_mark @@ EArray args | EAbs ((binder, pos_binder), ts) -> - let vars, body = Bindlib.unmbind binder in - let body = t ctx body in - let+ binder = Bindlib.bind_mvar vars body in - default_mark @@ EAbs ((binder, pos_binder), ts) - + let vars, body = Bindlib.unmbind binder in + let body = t ctx body in + let+ binder = Bindlib.bind_mvar vars body in + default_mark @@ EAbs ((binder, pos_binder), ts) | EApp (e1, args) -> - let+ e1 = t ctx e1 - and+ args = args - |> List.map (t ctx) - |> Bindlib.box_list - in - default_mark @@ EApp (e1, args) - + let+ e1 = t ctx e1 and+ args = args |> List.map (t ctx) |> Bindlib.box_list in + default_mark @@ EApp (e1, args) | EAssert e1 -> - let+ e1 = t ctx e1 in - default_mark @@ EAssert e1 - + let+ e1 = t ctx e1 in + default_mark @@ EAssert e1 | EIfThenElse (e1, e2, e3) -> - let+ e1 = t ctx e1 - and+ e2 = t ctx e2 - and+ e3 = t ctx e3 in - default_mark @@ EIfThenElse (e1, e2, e3) - + let+ e1 = t ctx e1 and+ e2 = t ctx e2 and+ e3 = t ctx e3 in + default_mark @@ EIfThenElse (e1, e2, e3) | ECatch (e1, exn, e2) -> - let+ e1 = t ctx e1 - and+ e2 = t ctx e2 in - default_mark @@ ECatch (e1, exn, e2) - + let+ e1 = t ctx e1 and+ e2 = t ctx e2 in + default_mark @@ ECatch (e1, exn, e2) | ERaise _ | ELit _ | EOp _ -> Bindlib.box e - -let rec iota_expr (_: unit) (e: expr Pos.marked) : expr Pos.marked Bindlib.box = +let rec iota_expr (_ : unit) (e : expr Pos.marked) : expr Pos.marked Bindlib.box = let default_mark e' = Pos.mark (Pos.get_position e) e' in match Pos.unmark e with - | EMatch ((EInj (e1, i, n', _ts), _), cases, n) - when (Dcalc.Ast.EnumName.compare n n' = 0) -> - - let+ e1 = transform iota_expr () e1 - and+ case = transform iota_expr () (List.nth cases i) in - default_mark @@ EApp (case, [e1]) - + | EMatch ((EInj (e1, i, n', _ts), _), cases, n) when Dcalc.Ast.EnumName.compare n n' = 0 -> + let+ e1 = transform iota_expr () e1 and+ case = transform iota_expr () (List.nth cases i) in + default_mark @@ EApp (case, [ e1 ]) | _ -> transform iota_expr () e let iota_optimizations (p : program) : program = { p with scopes = List.map (fun (var, e) -> (var, Bindlib.unbox (iota_expr () e))) p.scopes } - -let rec peephole_expr (_: unit) (e : expr Pos.marked) : expr Pos.marked Bindlib.box = - +let rec peephole_expr (_ : unit) (e : expr Pos.marked) : expr Pos.marked Bindlib.box = let default_mark e' = Pos.mark (Pos.get_position e) e' in match Pos.unmark e with - | EIfThenElse (e1, e2, e3) -> - let+ e1 = transform peephole_expr () e1 - and+ e2 = transform peephole_expr () e2 - and+ e3 = transform peephole_expr () e3 in - begin match Pos.unmark e1 with - | ELit (LBool true) | EApp ((EOp (Unop (Log _)), _), [ (ELit (LBool true), _)]) -> e2 - | ELit (LBool false) | EApp ((EOp (Unop (Log _)), _), [ (ELit (LBool false), _)]) -> e3 - | _ -> default_mark @@ EIfThenElse (e1, e2, e3) - end + | EIfThenElse (e1, e2, e3) -> ( + let+ e1 = transform peephole_expr () e1 + and+ e2 = transform peephole_expr () e2 + and+ e3 = transform peephole_expr () e3 in + match Pos.unmark e1 with + | ELit (LBool true) | EApp ((EOp (Unop (Log _)), _), [ (ELit (LBool true), _) ]) -> e2 + | ELit (LBool false) | EApp ((EOp (Unop (Log _)), _), [ (ELit (LBool false), _) ]) -> e3 + | _ -> default_mark @@ EIfThenElse (e1, e2, e3)) | _ -> transform peephole_expr () e let peephole_optimizations (p : program) : program = { p with scopes = List.map (fun (var, e) -> (var, Bindlib.unbox (peephole_expr () e))) p.scopes } -let optimize_program (p : program) : program = - p - |> iota_optimizations - |> peephole_optimizations +let optimize_program (p : program) : program = p |> iota_optimizations |> peephole_optimizations diff --git a/compiler/runtime.ml b/compiler/runtime.ml index ddd87841b..7dfc0f14f 100644 --- a/compiler/runtime.ml +++ b/compiler/runtime.ml @@ -31,9 +31,7 @@ type source_position = { law_headings : string list; } -type 'a eoption = - | ENone of unit - | ESome of 'a +type 'a eoption = ENone of unit | ESome of 'a exception EmptyError diff --git a/compiler/runtime.mli b/compiler/runtime.mli index 7b367bd05..8cc832a34 100644 --- a/compiler/runtime.mli +++ b/compiler/runtime.mli @@ -33,9 +33,7 @@ type source_position = { law_headings : string list; } -type 'a eoption = - | ENone of unit - | ESome of 'a +type 'a eoption = ENone of unit | ESome of 'a (** {1 Exceptions} *) diff --git a/compiler/utils/pos.mli b/compiler/utils/pos.mli index 12d649aa9..b1f3d519f 100644 --- a/compiler/utils/pos.mli +++ b/compiler/utils/pos.mli @@ -64,7 +64,7 @@ type 'a marked = 'a * t val no_pos : t (** Placeholder position *) -val mark: t -> 'a -> 'a marked +val mark : t -> 'a -> 'a marked val unmark : 'a marked -> 'a diff --git a/french_law/js/french_law.js b/french_law/js/french_law.js index e1e915700..ec30f44d9 100644 --- a/french_law/js/french_law.js +++ b/french_law/js/french_law.js @@ -1,93 +1,93 @@ -// Generated by js_of_ocaml 3.9.1 -(function(E){"use strict";var -iv=214,iu=" is too large for shifting.",jS="Invalid_argument",it="0.08",eg="Map.bal",jj=640,x="Code de la s\xc3\xa9curit\xc3\xa9 sociale",ky="Article L521-1",ji=123,jR="577500",er=152,jQ="%ni",kx=43200.,fS="ml_z_overflow",Z=86400.,aI=2020,jh=139,aX=0xff,f1=-12,jP=-45,eq="Titre 5 : Dispositions particuli\xc3\xa8res \xc3\xa0 la Guadeloupe, \xc3\xa0 la Guyane, \xc3\xa0 la Martinique, \xc3\xa0 La R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy et \xc3\xa0 Saint-Martin",kw="559500",b1="Article 1",ga=122,is="582700",kv=992015837,k="0",eu="date_courante",jg="0.5",cf=128,ir="Sys_blocked_io",jf="fd ",iq=548,fR="Chapitre 2 : Champ d'application",ip="0.0588",R=248,eC=">",bn=153,ku=1027,io="montant_vers\xc3\xa9",je="enfants_\xc3\xa0_charge",jO="562800",b0="Chapitre 5 : Prestations familiales et prestations assimil\xc3\xa9es",im=246,jN=555,ik=598,il="%u",jM="resetLog",kt=358,cL=2011,e="AllocationsFamiliales",jL=3268,ij=298,jd=633,ii="./securite_sociale_R.catala_fr",F="Livre 5 : Prestations familiales et prestations assimil\xc3\xa9es",jc=108,ay="2",a$=127,dt=1024,X="1",et=133,eB="e",fQ="Montant de la base mensuelle des allocations familiales",ih=" : flags Open_rdonly and Open_wronly are not compatible",jb="ressources_m\xc3\xa9nage",ja="([^/]*)",ig="D\xc3\xa9cret n\xc2\xb0 2019-1387 du 18 d\xc3\xa9cembre 2019 portant rel\xc3\xa8vement du salaire minimum de croissance",aC="-",ks=505,bW=803994948,id=216,ie=" : file already exists",kr="smic",i$="Article D521-3",jK=184,bG=0xffffff,cD=2012,kp=-43,kq=612,W="./securite_sociale_D.catala_fr",ep=86400,i_="Out_of_memory",ko="inf",f0="index out of bounds",eo="_bigarr02",kn="Circulaire interminist\xc3\xa9rielle N\xc2\xb0 DSS/SD2B/2017/352 du 22 d\xc3\xa9cembre 2017 relative \xc3\xa0 la revalorisation au 1er janvier 2018 des plafonds de ressources d\xe2\x80\x99attribution de certaines prestations familiales servies en m\xc3\xa9tropole, en Guadeloupe, en Guyane, en Martinique, \xc3\xa0 la R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy, \xc3\xa0 Saint-Martin et \xc3\xa0 Mayotte",i9=0xffffffff,f$=111,jI=2147483647,jJ=208,km=180,ic="Martinique",bj=0xffff,en=417088404,ib=12520,i8=400,kl=619,ia=-46,aM=3600,i7=143,G="Chapitre 1er : Allocations familiales",f4="AllocationFamilialesAvril2008",cx=2016,jH="retrieveLog",bi="\xc3\xa2ge_minimum_alin\xc3\xa9a_1_l521_3",kk="infinity",a4=1000,i6=142,u="",fP="^",bV=3600.,h$=86400000,i5=264,ak="Partie l\xc3\xa9gislative",cw=0x3f,dq=124,aW="./epilogue.catala_fr",fZ="Article L512-3",v="./decrets_divers.catala_fr",H="Titre 2 : Prestations g\xc3\xa9n\xc3\xa9rales d'entretien",f_=112,h_="Match_failure",jG=140,bX="Montant des plafonds de ressources",O="Annexe",kj="enfants",em=135,ki="personne_charge_effective_permanente_est_parent",bh=2021,i4="enfant_le_plus_\xc3\xa2g\xc3\xa9",fY=252,bB=".",dh="montant_initial_majoration",bA="+",i3=0xf0,a6="12.",i2="Guadeloupe",f9=110,ac="PrestationsFamiliales",fX=116,h9="%li",i1=576,cH=2015,el=365,bF="prise_en_compte",dg="Smic",f8=-32,i0="avait_enfant_\xc3\xa0_charge_avant_1er_janvier_2012",bm=1023,iZ=-1080,al="./securite_sociale_L.catala_fr",p="./prologue.catala_fr",ef=2299161,iY=969837588,f3="nan",kh=605,h8=0xe0,iX=-1023,kg=117,jF=0xdfff,dx="compl\xc3\xa9ment_d\xc3\xa9gressif",fW="Article L755-12",bE="/",kf="Assert_failure",ee=2400000.5,ke="568400",iW=541,kd="0.32",f2=1073741823,kc=308,eA="r\xc3\xa9sidence",ed=250,dp=1582,jD=154,jE=513,h7=115,jC="src/time_Zone.ml",kb=1e14,iV="Arr\xc3\xaat\xc3\xa9 du 14 d\xc3\xa9cembre 2020 relatif au montant des plafonds de ressources de certaines prestations familiales et aux tranches du bar\xc3\xa8me applicable au recouvrement des indus et \xc3\xa0 la saisie des prestations",jB="Guyane",h6="allocations_familiales",fO=1255,fV="<",iT=196,iU=0x800,cG=255,aL=2019,fN="jsError",bg=0x8000,jA="Partie r\xc3\xa9glementaire - D\xc3\xa9crets en Conseil d'Etat",Y="droit_ouvert_majoration",dw=146097,cK=256,iS=0.012,ka="Article L521-3",jz="End_of_file",iQ="M\xc3\xa9tropole",iR=156,jy="Failure",j$=367,h5=129,iP=204,dn="conditions_hors_\xc3\xa2ge",jx=218,iO=534,J="Dispositions sp\xc3\xa9ciales relatives \xc3\xa0 Mayotte",iN=562,j_=315,ez="EnfantLePlus\xc3\x82g\xc3\xa9",fU=0xf,ec=-48,jw=0xdc00,dm="montant_initial_m\xc3\xa9tropole_majoration",aq="camlinternalFormat.ml",iM="Division_by_zero",fT=520,jv="Sys_error",j8=647,j9="x",j7=335,cv=2017,cF="Article D521-2",ey="Article D755-5",fM="Titre 1 : Champ d'application - G\xc3\xa9n\xc3\xa9ralit\xc3\xa9s",bD=60.,cC=2014,j6="%d",h4=32082,bZ=1900,h3=121,j5="buffer.ml",iL=119,dl="montant_avec_garde_altern\xc3\xa9e_majoration",iK="version_avril_2008",bU=120,ek=127686388,ce=103,fL="16",cA=2013,cB=102,fK=512,j4=527,cJ=113,h2=0x7ff0,s="D\xc3\xa9crets divers",ej=101,cE=132,h1="0x",h0="D\xc3\xa9cret n\xc2\xb0 2020-1598 du 16 d\xc3\xa9cembre 2020 portant rel\xc3\xa8vement du salaire minimum de croissance",cd=1e7,o="Prologue",dk=254,aT=100,ds="Article 7",iJ=" : flags Open_text and Open_binary are not compatible",ju="%Li",ex="3",V="Partie r\xc3\xa9glementaire - D\xc3\xa9crets simples",hZ=105,j2="169.",j3=230,hY="Instruction interminist\xc3\xa9rielle n\xc2\xb0 DSS/SD2B/2018/279 du 17 d\xc3\xa9cembre 2018 relative \xc3\xa0 la revalorisation au 1er janvier 2019 des plafonds de ressources d\xe2\x80\x99attribution de certaines prestations familiales servies en m\xc3\xa9tropole, en Guadeloupe, en Guyane, en Martinique, \xc3\xa0 la R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy, \xc3\xa0 Saint-Martin et \xc3\xa0 Mayotte",jt=591,bY=0.5,iI=584,aS="Article D521-1",iH="Instruction interministerielle no DSS/SD2B/2019/261 du 18 d\xc3\xa9cembre 2019 relative \xc3\xa0 la revalorisation au 1er janvier 2020 des plafonds de ressources d\xe2\x80\x99attribution de certaines prestations familiales servies en m\xc3\xa9tropole, en Guadeloupe, en Guyane, en Martinique, \xc3\xa0 La R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy, \xc3\xa0 Saint-Martin et \xc3\xa0 Mayotte",iG=188,bH="Livre 7 : R\xc3\xa9gimes divers - Dispositions diverses",ax="input",hX="str.ml",iF=160,hW="personne_charge_effective_permanente_remplit_titre_I",j1="prestations_familiales",dv="est_enfant_le_plus_\xc3\xa2g\xc3\xa9",iE="0.0463",hV="D\xc3\xa9cret n\xc2\xb0 2018-1173 du 19 d\xc3\xa9cembre 2018 portant rel\xc3\xa8vement du salaire minimum de croissance",es="_z",jZ="Unix.Unix_error",j0="computeAllocationsFamiliales",iD="0.55",iC=109,dj="droit_ouvert",js=136,jY="Stack_overflow",a5="Interface du programme",df="Titre 5 : D\xc3\xa9partements d'outre-mer",iB=-97,jX="Not_found",di=1461,aA="InterfaceAllocationsFamiliales",fJ=151,I="D\xc3\xa9cret n\xc2\xb02002-423 du 29 mars 2002 relatif aux prestations familiales \xc3\xa0 Mayotte",cz="1.",jq=32044,jr=", ",hU=626,bk=2018,jp="static/",jW="Mayotte",f7=243,iA=2440588,jo="src/date.ml",jV=32752,ei=141,jU=280,aV="\xc3\x89pilogue",jT=1026,bl="Article L521-2",ew="Invalid integer: ",eh=2440587.5,jn=359,iz=155,jm=258,bC=" ",a7=0x80,jl="Undefined_recursive_module",az="output",iy=569,fI=376,ix=215,ev="src/calendar_builder.ml",cy="Montant du salaire minimum de croissance",f6="compare: functional value",fH="0.16",dr="droit_ouvert_forfaitaire",du="0.",eb=134,jk="%i",f5=114,cI=529348384,hT=176,iw=426;function -Eg(d,b,e,c,f){if(c<=b)for(var +// Generated by js_of_ocaml 3.11.0 +(function(B){"use strict";var +jq=214,jp=" is too large for shifting.",ll="Invalid_argument",jo="0.08",es="Map.bal",jn="@[",ky=640,x="Code de la s\xc3\xa9curit\xc3\xa9 sociale",mg="Article L521-1",kx=123,lk="577500",eF=152,lj="%ni",mf=43200.,gf="ml_z_overflow",me="EMFILE",_=86400.,aI=2020,kw=139,a1=0xff,li="ENOMEM",gp=-12,lh=-45,eE="Titre 5 : Dispositions particuli\xc3\xa8res \xc3\xa0 la Guadeloupe, \xc3\xa0 la Guyane, \xc3\xa0 la Martinique, \xc3\xa0 La R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy et \xc3\xa0 Saint-Martin",md="559500",b5="Article 1",gE=122,jm="582700",mc=992015837,lg="EPROTONOSUPPORT",k="0",lf="ENETRESET",mb="EACCES",eK="date_courante",le="EINVAL",kv="0.5",ld="EDOM",ck=128,jl="Sys_blocked_io",ku="fd ",lc="EFBIG",jk=548,ge="Chapitre 2 : Champ d'application",jj="0.0588",O=248,ji="EXDEV",eT=">",bu=153,ma=1027,l$="EINPROGRESS",jh="montant_vers\xc3\xa9",kt="enfants_\xc3\xa0_charge",lb="562800",b4="Chapitre 5 : Prestations familiales et prestations assimil\xc3\xa9es",jg=246,la=555,je=598,jf="%u",k$="resetLog",l_=358,cS=2011,e="AllocationsFamiliales",k_=3268,jc=298,jd="EHOSTUNREACH",ks=633,jb="./securite_sociale_R.catala_fr",F="Livre 5 : Prestations familiales et prestations assimil\xc3\xa9es",kr=108,az="2",bd=127,dC=1024,ja="@{",Y="1",eJ=133,eS="e",gd="Montant de la base mensuelle des allocations familiales",i$=" : flags Open_rdonly and Open_wronly are not compatible",kq="ressources_m\xc3\xa9nage",i_="D\xc3\xa9cret n\xc2\xb0 2019-1387 du 18 d\xc3\xa9cembre 2019 portant rel\xc3\xa8vement du salaire minimum de croissance",aC="-",l9=505,b0=803994948,kp="EAGAIN",go=": Not a directory",i8=216,i9=" : file already exists",l8="smic",ko="Article D521-3",k9=184,bM=0xffffff,cK=2012,kn="EDESTADDRREQ",k8="EISCONN",l5=-43,l6=612,X="./securite_sociale_D.catala_fr",l7="EROFS",eD=86400,km="Out_of_memory",l4="inf",gn="index out of bounds",l3="EPIPE",i7="ENOEXEC",eC="_bigarr02",l2="Circulaire interminist\xc3\xa9rielle N\xc2\xb0 DSS/SD2B/2017/352 du 22 d\xc3\xa9cembre 2017 relative \xc3\xa0 la revalorisation au 1er janvier 2018 des plafonds de ressources d\xe2\x80\x99attribution de certaines prestations familiales servies en m\xc3\xa9tropole, en Guadeloupe, en Guyane, en Martinique, \xc3\xa0 la R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy, \xc3\xa0 Saint-Martin et \xc3\xa0 Mayotte",kl=0xffffffff,gD=111,k6=2147483647,k7=208,l1=180,i6="Martinique",k5=", characters ",i5="EPFNOSUPPORT",bp=0xffff,kk="EBUSY",eB=417088404,kj="ENETUNREACH",l0="ENOLCK",i3="ENOTTY",i4=12520,gm=400,k4="ESHUTDOWN",lZ=619,i0=-46,i1="(Program not linked with -g, cannot print stack backtrace)\n",i2="ENXIO",aO=3600,ki=143,H="Chapitre 1er : Allocations familiales",gs="AllocationFamilialesAvril2008",lY="ERANGE",cE=2016,k3="retrieveLog",bo="\xc3\xa2ge_minimum_alin\xc3\xa9a_1_l521_3",lX="infinity",a8=1000,kh=142,o="",iZ="^",bZ=3600.,iY=86400000,kg=264,al="Partie l\xc3\xa9gislative",cD=0x3f,dz=124,a0="./epilogue.catala_fr",gl="Article L512-3",v="./decrets_divers.catala_fr",I="Titre 2 : Prestations g\xc3\xa9n\xc3\xa9rales d'entretien",gC=112,iX="Match_failure",k2=140,b1="Montant des plafonds de ressources",P="Annexe",lW="enfants",eA=135,lV="personne_charge_effective_permanente_est_parent",bm=2021,kf="enfant_le_plus_\xc3\xa2g\xc3\xa9",ez=252,ke="EPROTOTYPE",bn=".",dr="montant_initial_majoration",bI="+",kd="EINTR",iW="ESRCH",kc=0xf0,a_="12.",kb="Guadeloupe",lU="ESOCKTNOSUPPORT",gB=110,ac="PrestationsFamiliales",gk=116,iV="%li",j$=576,ka="EALREADY",cO=2015,ey=365,bL="prise_en_compte",dq="Smic",gA=-32,j_="avait_enfant_\xc3\xa0_charge_avant_1er_janvier_2012",bt=1023,j8=-1080,j9="EAFNOSUPPORT",am="./securite_sociale_L.catala_fr",q="./prologue.catala_fr",er=2299161,j7=969837588,gr="nan",lT=605,j6="ENFILE",iU=0xe0,j5=-1023,lS=117,k0="ECHILD",k1=0xdfff,dH="compl\xc3\xa9ment_d\xc3\xa9gressif",gj="Article L755-12",kZ="ETOOMANYREFS",br="/",lR="Assert_failure",eq=2400000.5,iT="ENAMETOOLONG",lQ="568400",j4=541,eI="ENOTDIR",lP="0.32",gq=1073741823,kY="ETIMEDOUT",lO=308,eR="r\xc3\xa9sidence",iS="EMSGSIZE",ep=250,dy=1582,kW=154,kX=513,lN="ENOTCONN",iQ=115,iR="ECONNREFUSED",kV="src/time_Zone.ml",lM=1e14,j3="Arr\xc3\xaat\xc3\xa9 du 14 d\xc3\xa9cembre 2020 relatif au montant des plafonds de ressources de certaines prestations familiales et aux tranches du bar\xc3\xa8me applicable au recouvrement des indus et \xc3\xa0 la saisie des prestations",ex='"',kT="Guyane",kU="EWOULDBLOCK",iP="allocations_familiales",gc=1255,gi="<",lL="Fatal error: exception %s\n",j1=196,j2=0x800,cN=255,j0="EPERM",aN=2019,gb="jsError",bl=0x8000,kS="Partie r\xc3\xa9glementaire - D\xc3\xa9crets en Conseil d'Etat",Z="droit_ouvert_majoration",dG=146097,cR=256,jZ=0.012,lK="Article L521-3",kR="End_of_file",jX="M\xc3\xa9tropole",jY=156,kQ="Failure",lI=367,lJ="ENOSPC",iO=129,iN="\n",jW=204,dx="conditions_hors_\xc3\xa2ge",kP=218,eQ="ENOENT",jV=534,L="Dispositions sp\xc3\xa9ciales relatives \xc3\xa0 Mayotte",jU=562,jT="([^/]+)",lH=315,kO="ENETDOWN",eP="EnfantLePlus\xc3\x82g\xc3\xa9",gh=0xf,lG="EOVERFLOW",eo=-48,kN=0xdc00,dw="montant_initial_m\xc3\xa9tropole_majoration",gz="ENOTEMPTY",iM="EBADF",aq="camlinternalFormat.ml",jS="Division_by_zero",gg=520,iL="EMLINK",kM="Sys_error",lE=647,lF="x",lD=335,cC=2017,cM="Article D521-2",eO="Article D755-5",ga="Titre 1 : Champ d'application - G\xc3\xa9n\xc3\xa9ralit\xc3\xa9s",bK=60.,f$="EEXIST",cJ=2014,gy="%d",kL="Printexc.handle_uncaught_exception",iK=32082,b3=1900,iJ=121,jR="EADDRNOTAVAIL",lC="buffer.ml",jQ=119,dv="montant_avec_garde_altern\xc3\xa9e_majoration",jP="version_avril_2008",bY=120,ew=127686388,cj=103,lB="ENOBUFS",f_="16",cH=2013,cI=102,f9=512,lA=527,cQ=113,iI=0x7ff0,t="D\xc3\xa9crets divers",ev=101,cL=132,iH="0x",iG="D\xc3\xa9cret n\xc2\xb0 2020-1598 du 16 d\xc3\xa9cembre 2020 portant rel\xc3\xa8vement du salaire minimum de croissance",ci=1e7,p="Prologue",du=254,aW=100,jN="ECONNABORTED",jO="EFAULT",dB="Article 7",kK="ENODEV",jM=" : flags Open_text and Open_binary are not compatible",kJ="%Li",jK="EIO",jL="EDEADLK",eN="3",W="Partie r\xc3\xa9glementaire - D\xc3\xa9crets simples",iF=105,ly="169.",lz=230,iE="Instruction interminist\xc3\xa9rielle n\xc2\xb0 DSS/SD2B/2018/279 du 17 d\xc3\xa9cembre 2018 relative \xc3\xa0 la revalorisation au 1er janvier 2019 des plafonds de ressources d\xe2\x80\x99attribution de certaines prestations familiales servies en m\xc3\xa9tropole, en Guadeloupe, en Guyane, en Martinique, \xc3\xa0 la R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy, \xc3\xa0 Saint-Martin et \xc3\xa0 Mayotte",kI=591,b2=0.5,jJ=584,aV="Article D521-1",jI="Instruction interministerielle no DSS/SD2B/2019/261 du 18 d\xc3\xa9cembre 2019 relative \xc3\xa0 la revalorisation au 1er janvier 2020 des plafonds de ressources d\xe2\x80\x99attribution de certaines prestations familiales servies en m\xc3\xa9tropole, en Guadeloupe, en Guyane, en Martinique, \xc3\xa0 La R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy, \xc3\xa0 Saint-Martin et \xc3\xa0 Mayotte",jH=188,bN="Livre 7 : R\xc3\xa9gimes divers - Dispositions diverses",ay="input",iD="str.ml",jG=160,iC="personne_charge_effective_permanente_remplit_titre_I",lx="prestations_familiales",dF="est_enfant_le_plus_\xc3\xa2g\xc3\xa9",jF="0.0463",iB="D\xc3\xa9cret n\xc2\xb0 2018-1173 du 19 d\xc3\xa9cembre 2018 portant rel\xc3\xa8vement du salaire minimum de croissance",eH="_z",lw="computeAllocationsFamiliales",dE="Unix.Unix_error",jD="0.55",jE="EHOSTDOWN",jC=109,dt="droit_ouvert",f8="mkdir",jB="ENOTSOCK",kH=136,lv="Stack_overflow",en=": No such file or directory",a9="Interface du programme",lu="/static/",dp="Titre 5 : D\xc3\xa9partements d'outre-mer",jA=-97,lt=253,ls="Not_found",ds=1461,aB="InterfaceAllocationsFamiliales",f7=151,K="D\xc3\xa9cret n\xc2\xb02002-423 du 29 mars 2002 relatif aux prestations familiales \xc3\xa0 Mayotte",cG="1.",kG=32044,eG=", ",iA=626,bq=2018,lr="Mayotte",jz="EOPNOTSUPP",iz="ENOPROTOOPT",gx=243,jy=2440588,gw="rmdir",kF="src/date.ml",lq=32752,jx="ECONNRESET",lp="ELOOP",eu=141,jw="ESPIPE",lo=280,aZ="\xc3\x89pilogue",kE="EADDRINUSE",ln=1026,bs="Article L521-2",kD="ENOSYS",eM="Invalid integer: ",et=2440587.5,jv="E2BIG",kC=359,ix="Pervasives.do_at_exit",iy="utf8",ju=155,kB=258,bJ=" ",gv="Fatal error: exception ",a$=0x80,kA="Undefined_recursive_module",aA="output",jt=569,f6=376,js=215,eL="src/calendar_builder.ml",iw="EISDIR",lm="_",cF="Montant du salaire minimum de croissance",gu="compare: functional value",f5="0.16",dA="droit_ouvert_forfaitaire",dD="0.",em=134,kz="%i",gt=114,cP=529348384,iv=176,jr=426;function +GC(d,b,e,c,f){if(c<=b)for(var a=1;a<=f;a++)e[c+a]=d[b+a];else for(var a=f;a>=1;a--)e[c+a]=d[b+a];return 0}function -Ej(e,f,d){var +GF(e,f,d){var a=new Array(d+1);a[0]=0;for(var b=1,c=f+1;b<=d;b++,c++)a[b]=e[c];return a}function -eO(c,b,a){var +e5(c,b,a){var d=String.fromCharCode;if(b==0&&a<=4096&&a==c.length)return d.apply(null,c);var -e=u;for(;0=b.l||b.t==2&&c>=b.c.length)){b.c=d.t==4?eO(d.c,e,c):e==0&&d.c.length==c?d.c:d.c.substr(e,c);b.t=b.c.length==b.l?0:2}else -if(b.t==2&&f==b.c.length){b.c+=d.t==4?eO(d.c,e,c):e==0&&d.c.length==c?d.c:d.c.substr(e,c);b.t=b.c.length==b.l?0:2}else{if(b.t!=4)eD(b);var +b7(d,e,b,f,c){if(c==0)return 0;if(f==0&&(c>=b.l||b.t==2&&c>=b.c.length)){b.c=d.t==4?e5(d.c,e,c):e==0&&d.c.length==c?d.c:d.c.substr(e,c);b.t=b.c.length==b.l?0:2}else +if(b.t==2&&f==b.c.length){b.c+=d.t==4?e5(d.c,e,c):e==0&&d.c.length==c?d.c:d.c.substr(e,c);b.t=b.c.length==b.l?0:2}else{if(b.t!=4)eU(b);var g=d.c,h=b.c;if(d.t==4)if(f<=e)for(var a=0;a=0;a--)h[f+a]=g[e+a];else{var i=Math.min(c,g.length-e);for(var a=0;a>=1;if(b==0)return d;a+=a;c++;if(c==9)a.slice(0,1)}}function -b6(a){if(a.t==2)a.c+=cS(a.l-a.c.length,"\0");else -a.c=eO(a.c,0,a.c.length);a.t=0}function -kI(a,b){if(a===b)return 1;a.t&6&&b6(a);b.t&6&&b6(b);return a.c==b.c?1:0}function -EZ(b,a){throw[0,b,a]}function -k0(a){if(a.length<24){for(var -b=0;ba$)return false;return true}else +bO(a){return a}function +b8(a,b,c,d,e){b7(bO(a),b,c,d,e);return 0}function +cY(b,a){if(b==0)return o;if(a.repeat)return a.repeat(b);var +d=o,c=0;for(;;){if(b&1)d+=a;b>>=1;if(b==0)return d;a+=a;c++;if(c==9)a.slice(0,1)}}function +b_(a){if(a.t==2)a.c+=cY(a.l-a.c.length,"\0");else +a.c=e5(a.c,0,a.c.length);a.t=0}function +mq(a,b){if(a===b)return 1;a.t&6&&b_(a);b.t&6&&b_(b);return a.c==b.c?1:0}function +Hn(b,a){throw[0,b,a]}function +mN(a){if(a.length<24){for(var +b=0;bbd)return false;return true}else return!/[^\x00-\x7f]/.test(a)}function -gs(e){for(var -j=u,c=u,g,f,h,a,b=0,i=e.length;bfK){c.substr(0,1);j+=c;c=u;j+=e.slice(b,d)}else -c+=e.slice(b,d);if(d==i)break;b=d}a=1;if(++b=0xd7ff&&a<0xe000)a=2}else{a=3;if(++b0x10ffff)a=3}}}}}if(a<4){b-=a;c+="\ufffd"}else -if(a>bj)c+=String.fromCharCode(0xd7c0+(a>>10),jw+(a&0x3FF));else -c+=String.fromCharCode(a);if(c.length>dt){c.substr(0,1);j+=c;c=u}}return j+c}function -bI(c,a,b){this.t=c;this.c=a;this.l=b}bI.prototype.toString=function(){switch(this.t){case -9:return this.c;default:b6(this);case -0:if(k0(this.c)){this.t=9;return this.c}this.t=8;case -8:return this.c}};bI.prototype.toUtf16=function(){var -a=this.toString();if(this.t==9)return a;return gs(a)};bI.prototype.slice=function(){var +gY(e){for(var +j=o,c=o,g,f,h,a,b=0,i=e.length;bf9){c.substr(0,1);j+=c;c=o;j+=e.slice(b,d)}else +c+=e.slice(b,d);if(d==i)break;b=d}a=1;if(++b=0xd7ff&&a<0xe000)a=2}else{a=3;if(++b0x10ffff)a=3}}}}}if(a<4){b-=a;c+="\ufffd"}else +if(a>bp)c+=String.fromCharCode(0xd7c0+(a>>10),kN+(a&0x3FF));else +c+=String.fromCharCode(a);if(c.length>dC){c.substr(0,1);j+=c;c=o}}return j+c}function +bv(c,a,b){this.t=c;this.c=a;this.l=b}bv.prototype.toString=function(){switch(this.t){case +9:return this.c;default:b_(this);case +0:if(mN(this.c)){this.t=9;return this.c}this.t=8;case +8:return this.c}};bv.prototype.toUtf16=function(){var +a=this.toString();if(this.t==9)return a;return gY(a)};bv.prototype.slice=function(){var a=this.t==4?this.c.slice():this.c;return new -bI(this.t,a,this.l)};function -kJ(a){return new -bI(0,a,a.length)}function -a(a){return kJ(a)}function -gp(c,b){EZ(c,a(b))}var -af=[0];function -ag(a){gp(af.Invalid_argument,a)}function -kG(){ag(f0)}function -dz(a,b){switch(a.t&6){default:if(b>=a.c.length)return 0;case +bv(this.t,a,this.l)};function +mr(a){return new +bv(0,a,a.length)}function +a(a){return mr(a)}function +gU(c,b){Hn(c,a(b))}var +ag=[0];function +ah(a){gU(ag.Invalid_argument,a)}function +mo(){ah(gn)}function +dJ(a,b){switch(a.t&6){default:if(b>=a.c.length)return 0;case 0:return a.c.charCodeAt(b);case 4:return a.c[b]}}function -b5(b,a){if(a>>>0>=b.l)kG();return dz(b,a)}function -ad(a,c,b){b&=aX;if(a.t!=4){if(c==a.c.length){a.c+=String.fromCharCode(b);if(c+1==a.l)a.t=0;return 0}eD(a)}a.c[c]=b;return 0}function -a9(b,a,c){if(a>>>0>=b.l)kG();return ad(b,a,c)}function -bK(c,a){if(c.fun)return bK(c.fun,a);if(typeof +b9(b,a){if(a>>>0>=b.l)mo();return dJ(b,a)}function +ad(a,c,b){b&=a1;if(a.t!=4){if(c==a.c.length){a.c+=String.fromCharCode(b);if(c+1==a.l)a.t=0;return 0}eU(a)}a.c[c]=b;return 0}function +ba(b,a,c){if(a>>>0>=b.l)mo();return ad(b,a,c)}function +be(c,a){if(c.fun)return be(c.fun,a);if(typeof c!=="function")return c;var b=c.length|0;if(b===0)return c.apply(null,a);var e=a.length|0,d=b-e|0;if(d==0)return c.apply(null,a);else -if(d<0)return bK(c.apply(null,a.slice(0,b)),a.slice(b));else +if(d<0)return be(c.apply(null,a.slice(0,b)),a.slice(b));else return function(){var e=arguments.length==0?1:arguments.length,d=new Array(a.length+e);for(var b=0;b>>0>=a.length-1)dy();return a}function -Eo(a){if(isFinite(a)){if(Math.abs(a)>=2.2250738585072014e-308)return 0;if(a!=0)return 1;return 2}return isNaN(a)?4:3}function -ba(a){if((a.t&6)!=0)b6(a);return a.c}var -Ff=Math.log2&&Math.log2(1.1235582092889474E+307)==1020;function -Fd(a){if(Ff)return Math.floor(Math.log2(a));var +b=0;b>>0>=a.length-1)dI();return a}function +GK(a){if(isFinite(a)){if(Math.abs(a)>=2.2250738585072014e-308)return 0;if(a!=0)return 1;return 2}return isNaN(a)?4:3}function +bf(a){if((a.t&6)!=0)b_(a);return a.c}var +HE=Math.log2&&Math.log2(1.1235582092889474E+307)==1020;function +HC(a){if(HE)return Math.floor(Math.log2(a));var b=0;if(a==0)return-Infinity;if(a>=1)while(a>=2){a/=2;b++}else while(a<1){a*=2;b--}return b}function -gg(c){var -a=new(E.Float32Array)(1);a[0]=c;var -b=new(E.Int32Array)(a.buffer);return b[0]|0}var -kS=Math.pow(2,-24);function -eN(a){throw a}function -cQ(){eN(af.Division_by_zero)}function -z(b,c,a){this.lo=b&bG;this.mi=c&bG;this.hi=a&bj}z.prototype.caml_custom="_j";z.prototype.copy=function(){return new +gL(c){var +a=new(B.Float32Array)(1);a[0]=c;var +b=new(B.Int32Array)(a.buffer);return b[0]|0}var +mC=Math.pow(2,-24);function +e3(a){throw a}function +cX(){e3(ag.Division_by_zero)}function +z(b,c,a){this.lo=b&bM;this.mi=c&bM;this.hi=a&bp}z.prototype.caml_custom="_j";z.prototype.copy=function(){return new z(this.lo,this.mi,this.hi)};z.prototype.ucompare=function(a){if(this.hi>a.hi)return 1;if(this.hia.mi)return 1;if(this.mia.lo)return 1;if(this.loc)return 1;if(ba.mi)return 1;if(this.mia.lo)return 1;if(this.lo>24),c=-this.hi+(b>>24);return new @@ -96,7 +96,7 @@ b=this.lo+a.lo,c=this.mi+a.mi+(b>>24),d=this.hi+a.hi+(c>>24);return new z(b,c,d)};z.prototype.sub=function(a){var b=this.lo-a.lo,c=this.mi-a.mi+(b>>24),d=this.hi-a.hi+(c>>24);return new z(b,c,d)};z.prototype.mul=function(a){var -b=this.lo*a.lo,c=(b*kS|0)+this.mi*a.lo+this.lo*a.mi,d=(c*kS|0)+this.hi*a.lo+this.mi*a.mi+this.lo*a.hi;return new +b=this.lo*a.lo,c=(b*mC|0)+this.mi*a.lo+this.lo*a.mi,d=(c*mC|0)+this.hi*a.lo+this.mi*a.mi+this.lo*a.hi;return new z(b,c,d)};z.prototype.isZero=function(){return(this.lo|this.mi|this.hi)==0};z.prototype.isNeg=function(){return this.hi<<16<0};z.prototype.and=function(a){return new z(this.lo&a.lo,this.mi&a.mi,this.hi&a.hi)};z.prototype.or=function(a){return new z(this.lo|a.lo,this.mi|a.mi,this.hi|a.hi)};z.prototype.xor=function(a){return new @@ -110,27 +110,27 @@ z(this.hi>>a-48,0,0)};z.prototype.shift_right=function(a){a=a&63;if(a==0)return c=this.hi<<16>>16;if(a<24)return new z(this.lo>>a|this.mi<<24-a,this.mi>>a|c<<24-a,this.hi<<16>>a>>>16);var b=this.hi<<16>>31;if(a<48)return new -z(this.mi>>a-24|this.hi<<48-a,this.hi<<16>>a-24>>16,b&bj);return new -z(this.hi<<16>>a-32,b,b)};z.prototype.lsl1=function(){this.hi=this.hi<<1|this.mi>>23;this.mi=(this.mi<<1|this.lo>>23)&bG;this.lo=this.lo<<1&bG};z.prototype.lsr1=function(){this.lo=(this.lo>>>1|this.mi<<23)&bG;this.mi=(this.mi>>>1|this.hi<<23)&bG;this.hi=this.hi>>>1};z.prototype.udivmod=function(e){var +z(this.mi>>a-24|this.hi<<48-a,this.hi<<16>>a-24>>16,b&bp);return new +z(this.hi<<16>>a-32,b,b)};z.prototype.lsl1=function(){this.hi=this.hi<<1|this.mi>>23;this.mi=(this.mi<<1|this.lo>>23)&bM;this.lo=this.lo<<1&bM};z.prototype.lsr1=function(){this.lo=(this.lo>>>1|this.mi<<23)&bM;this.mi=(this.mi>>>1|this.hi<<23)&bM;this.hi=this.hi>>>1};z.prototype.udivmod=function(e){var c=0,b=this.copy(),a=e.copy(),d=new z(0,0,0);while(b.ucompare(a)>0){c++;a.lsl1()}while(c>=0){c--;d.lsl1();if(b.ucompare(a)>=0){d.lo++;b=b.sub(a)}a.lsr1()}return{quotient:d,modulus:b}};z.prototype.div=function(a){var -b=this;if(a.isZero())cQ();var -d=b.hi^a.hi;if(b.hi&bg)b=b.neg();if(a.hi&bg)a=a.neg();var -c=b.udivmod(a).quotient;if(d&bg)c=c.neg();return c};z.prototype.mod=function(b){var -a=this;if(b.isZero())cQ();var -d=a.hi;if(a.hi&bg)a=a.neg();if(b.hi&bg)b=b.neg();var -c=a.udivmod(b).modulus;if(d&bg)c=c.neg();return c};z.prototype.toInt=function(){return this.lo|this.mi<<24};z.prototype.toFloat=function(){return(this.hi<<16)*Math.pow(2,32)+this.mi*Math.pow(2,24)+this.lo};z.prototype.toArray=function(){return[this.hi>>8,this.hi&aX,this.mi>>16,this.mi>>8&aX,this.mi&aX,this.lo>>16,this.lo>>8&aX,this.lo&aX]};z.prototype.lo32=function(){return this.lo|(this.mi&aX)<<24};z.prototype.hi32=function(){return this.mi>>>8&bj|this.hi<<16};function -b7(b,c,a){return new +b=this;if(a.isZero())cX();var +d=b.hi^a.hi;if(b.hi&bl)b=b.neg();if(a.hi&bl)a=a.neg();var +c=b.udivmod(a).quotient;if(d&bl)c=c.neg();return c};z.prototype.mod=function(b){var +a=this;if(b.isZero())cX();var +d=a.hi;if(a.hi&bl)a=a.neg();if(b.hi&bl)b=b.neg();var +c=a.udivmod(b).modulus;if(d&bl)c=c.neg();return c};z.prototype.toInt=function(){return this.lo|this.mi<<24};z.prototype.toFloat=function(){return(this.hi<<16)*Math.pow(2,32)+this.mi*Math.pow(2,24)+this.lo};z.prototype.toArray=function(){return[this.hi>>8,this.hi&a1,this.mi>>16,this.mi>>8&a1,this.mi&a1,this.lo>>16,this.lo>>8&a1,this.lo&a1]};z.prototype.lo32=function(){return this.lo|(this.mi&a1)<<24};z.prototype.hi32=function(){return this.mi>>>8&bp|this.hi<<16};function +ca(b,c,a){return new z(b,c,a)}function -eG(a){if(!isFinite(a)){if(isNaN(a))return b7(1,0,h2);return a>0?b7(0,0,h2):b7(0,0,0xfff0)}var -f=a==0&&1/a==-Infinity?bg:a>=0?0:bg;if(f)a=-a;var -b=Fd(a)+bm;if(b<=0){b=0;a/=Math.pow(2,-jT)}else{a/=Math.pow(2,b-ku);if(a<16){a*=2;b-=1}if(b==0)a/=2}var +eX(a){if(!isFinite(a)){if(isNaN(a))return ca(1,0,iI);return a>0?ca(0,0,iI):ca(0,0,0xfff0)}var +f=a==0&&1/a==-Infinity?bl:a>=0?0:bl;if(f)a=-a;var +b=HC(a)+bt;if(b<=0){b=0;a/=Math.pow(2,-ln)}else{a/=Math.pow(2,b-ma);if(a<16){a*=2;b-=1}if(b==0)a/=2}var d=Math.pow(2,24),c=a|0;a=(a-c)*d;var e=a|0;a=(a-e)*d;var -g=a|0;c=c&fU|f|b<<4;return b7(g,e,c)}function -dC(a){return a.toArray()}function -kF(c,b,g){c.write(32,b.dims.length);c.write(32,b.kind|b.layout<<8);if(b.caml_custom==eo)for(var -a=0;a>4;if(c==2047)return(f|g|b&fU)==0?b&bg?-Infinity:Infinity:NaN;var -e=Math.pow(2,-24),a=(f*e+g)*e+(b&fU);if(c>0){a+=16;a*=Math.pow(2,c-ku)}else -a*=Math.pow(2,-jT);if(b&bg)a=-a;return a}function -gb(b){var +cW(d){var +f=d.lo,g=d.mi,b=d.hi,c=(b&0x7fff)>>4;if(c==2047)return(f|g|b&gh)==0?b&bl?-Infinity:Infinity:NaN;var +e=Math.pow(2,-24),a=(f*e+g)*e+(b&gh);if(c>0){a+=16;a*=Math.pow(2,c-ma)}else +a*=Math.pow(2,-ln);if(b&bl)a=-a;return a}function +gF(b){var d=b.length,c=1;for(var -a=0;a>>24&aX|(a&bj)<<8,a>>>16&bj)}function -gi(a){return a.hi32()}function -gj(a){return a.lo32()}var -El=eo;function -b2(c,d,b,a){this.kind=c;this.layout=d;this.dims=b;this.data=a}b2.prototype.caml_custom=El;b2.prototype.offset=function(b){var +a=0;a>>24&a1|(a&bp)<<8,a>>>16&bp)}function +gN(a){return a.hi32()}function +gO(a){return a.lo32()}var +GH=eC;function +b6(c,d,b,a){this.kind=c;this.layout=d;this.dims=b;this.data=a}b6.prototype.caml_custom=GH;b6.prototype.offset=function(b){var c=0;if(typeof b==="number")b=[b];if(!(b instanceof -Array))ag("bigarray.js: invalid offset");if(this.dims.length!=b.length)ag("Bigarray.get/set: bad number of dimensions");if(this.layout==0)for(var -a=0;a=this.dims[a])dy();c=c*this.dims[a]+b[a]}else +Array))ah("bigarray.js: invalid offset");if(this.dims.length!=b.length)ah("Bigarray.get/set: bad number of dimensions");if(this.layout==0)for(var +a=0;a=this.dims[a])dI();c=c*this.dims[a]+b[a]}else for(var -a=this.dims.length-1;a>=0;a--){if(b[a]<1||b[a]>this.dims[a])dy();c=c*this.dims[a]+(b[a]-1)}return c};b2.prototype.get=function(a){switch(this.kind){case +a=this.dims.length-1;a>=0;a--){if(b[a]<1||b[a]>this.dims[a])dI();c=c*this.dims[a]+(b[a]-1)}return c};b6.prototype.get=function(a){switch(this.kind){case 7:var -d=this.data[a*2+0],b=this.data[a*2+1];return kR(d,b);case +d=this.data[a*2+0],b=this.data[a*2+1];return mB(d,b);case 10:case 11:var -e=this.data[a*2+0],c=this.data[a*2+1];return[dk,e,c];default:return this.data[a]}};b2.prototype.set=function(a,b){switch(this.kind){case -7:this.data[a*2+0]=gj(b);this.data[a*2+1]=gi(b);break;case +e=this.data[a*2+0],c=this.data[a*2+1];return[du,e,c];default:return this.data[a]}};b6.prototype.set=function(a,b){switch(this.kind){case +7:this.data[a*2+0]=gO(b);this.data[a*2+1]=gN(b);break;case 10:case -11:this.data[a*2+0]=b[1];this.data[a*2+1]=b[2];break;default:this.data[a]=b;break}return 0};b2.prototype.fill=function(b){switch(this.kind){case +11:this.data[a*2+0]=b[1];this.data[a*2+1]=b[2];break;default:this.data[a]=b;break}return 0};b6.prototype.fill=function(b){switch(this.kind){case 7:var -c=gj(b),e=gi(b);if(c==e)this.data.fill(c);else +c=gO(b),e=gN(b);if(c==e)this.data.fill(c);else for(var a=0;ab.data[a])return 1}break}return 0};function -cM(c,d,b,a){this.kind=c;this.layout=d;this.dims=b;this.data=a}cM.prototype=new -b2();cM.prototype.offset=function(a){if(typeof +cT(c,d,b,a){this.kind=c;this.layout=d;this.dims=b;this.data=a}cT.prototype=new +b6();cT.prototype.offset=function(a){if(typeof a!=="number")if(a instanceof Array&&a.length==1)a=a[0];else -ag("Ml_Bigarray_c_1_1.offset");if(a<0||a>=this.dims[0])dy();return a};cM.prototype.get=function(a){return this.data[a]};cM.prototype.set=function(a,b){this.data[a]=b;return 0};cM.prototype.fill=function(a){this.data.fill(a);return 0};function -kB(c,d,a,b){var -e=kD(c);if(gb(a)*e!=b.length)ag("length doesn't match dims");if(d==0&&a.length==1&&e==1)return new -cM(c,d,a,b);return new -b2(c,d,a,b)}function -cg(a){gp(af.Failure,a)}function -kC(b,v,r){var -i=b.read32s();if(i<0||i>16)cg("input_value: wrong number of bigarray dimensions");var -p=b.read32s(),j=p&aX,o=p>>8&1,h=[];if(r==eo)for(var +ah("Ml_Bigarray_c_1_1.offset");if(a<0||a>=this.dims[0])dI();return a};cT.prototype.get=function(a){return this.data[a]};cT.prototype.set=function(a,b){this.data[a]=b;return 0};cT.prototype.fill=function(a){this.data.fill(a);return 0};function +mj(c,d,a,b){var +e=ml(c);if(gF(a)*e!=b.length)ah("length doesn't match dims");if(d==0&&a.length==1&&e==1)return new +cT(c,d,a,b);return new +b6(c,d,a,b)}function +b$(a){gU(ag.Failure,a)}function +mk(b,v,r){var +i=b.read32s();if(i<0||i>16)b$("input_value: wrong number of bigarray dimensions");var +p=b.read32s(),j=p&a1,o=p>>8&1,h=[];if(r==eC)for(var a=0;a>>32-15;a=br(a,0x1b873593);b^=a;b=b<<13|b>>>32-13;return(b+(b<<2)|0)+(0xe6546b64|0)|0}function -Ev(a,b){a=au(a,gj(b));a=au(a,gi(b));return a}function -ge(a,b){return Ev(a,eG(b))}function -kE(c){var -b=gb(c.dims),d=0;switch(c.kind){case +l=cW(dL(e));g.set(a,[du,m,l])}break}v[0]=(4+i)*4;return mj(j,o,h,f)}function +mi(a,b,c){return a.compare(b,c)}function +by(a,b){return Math.imul(a,b)}function +av(b,a){a=by(a,0xcc9e2d51|0);a=a<<15|a>>>32-15;a=by(a,0x1b873593);b^=a;b=b<<13|b>>>32-13;return(b+(b<<2)|0)+(0xe6546b64|0)|0}function +GU(a,b){a=av(a,gO(b));a=av(a,gN(b));return a}function +gJ(a,b){return GU(a,eX(b))}function +mm(c){var +b=gF(c.dims),d=0;switch(c.kind){case 2:case 3:case -12:if(b>cK)b=cK;var -e=0,a=0;for(a=0;a+4<=c.data.length;a+=4){e=c.data[a+0]|c.data[a+1]<<8|c.data[a+2]<<16|c.data[a+3]<<24;d=au(d,e)}e=0;switch(b&3){case +12:if(b>cR)b=cR;var +e=0,a=0;for(a=0;a+4<=c.data.length;a+=4){e=c.data[a+0]|c.data[a+1]<<8|c.data[a+2]<<16|c.data[a+3]<<24;d=av(d,e)}e=0;switch(b&3){case 3:e=c.data[a+2]<<16;case 2:e|=c.data[a+1]<<8;case -1:e|=c.data[a+0];d=au(d,e)}break;case +1:e|=c.data[a+0];d=av(d,e)}break;case 4:case -5:if(b>cf)b=cf;var -e=0,a=0;for(a=0;a+2<=c.data.length;a+=2){e=c.data[a+0]|c.data[a+1]<<16;d=au(d,e)}if((b&1)!=0)d=au(d,c.data[a]);break;case +5:if(b>ck)b=ck;var +e=0,a=0;for(a=0;a+2<=c.data.length;a+=2){e=c.data[a+0]|c.data[a+1]<<16;d=av(d,e)}if((b&1)!=0)d=av(d,c.data[a]);break;case 6:if(b>64)b=64;for(var -a=0;a64)b=64;for(var -a=0;a32)b=32;b*=2;for(var -a=0;a64)b=64;for(var -a=0;a32)b=32;for(var -a=0;a0?b(c,f,e):b(f,c,e);if(e&&a!=a)return d;if(+a!=+a)return+a;if((a|0)!=0)return a|0}return d}function -dD(a){return a +dN(a){return a instanceof -bI}function -eJ(a){return dD(a)}function -kM(a){if(typeof -a==="number")return a4;else -if(dD(a))return fY;else -if(eJ(a))return 1252;else +bv}function +e0(a){return dN(a)}function +mu(a){if(typeof +a==="number")return a8;else +if(dN(a))return ez;else +if(e0(a))return 1252;else if(a instanceof -Array&&a[0]===a[0]>>>0&&a[0]<=cG){var -b=a[0]|0;return b==dk?0:b}else +Array&&a[0]===a[0]>>>0&&a[0]<=cN){var +b=a[0]|0;return b==du?0:b}else if(a instanceof -String)return ib;else +String)return i4;else if(typeof -a=="string")return ib;else +a=="string")return i4;else if(a instanceof -Number)return a4;else -if(a&&a.caml_custom)return fO;else +Number)return a8;else +if(a&&a.caml_custom)return gc;else if(a&&a.compare)return 1256;else if(typeof a=="function")return 1247;else if(typeof a=="symbol")return 1251;return 1001}function -eI(a,b){if(ab.c?1:0}function -gq(a,b){return kH(a,b)}function -cN(a,b,d){var +eZ(a,b){if(ab.c?1:0}function +gW(a,b){return mp(a,b)}function +cU(a,b,d){var e=[];for(;;){if(!(d&&a===b)){var -f=kM(a);if(f==ed){a=a[1];continue}var -g=kM(b);if(g==ed){b=b[1];continue}if(f!==g){if(f==a4){if(g==fO)return kL(a,b,-1,d);return-1}if(g==a4){if(f==fO)return kL(b,a,1,d);return 1}return fb)return 1;if(a!=b){if(!d)return NaN;if(a==a)return 1;if(b==b)return-1}break;case 1251:if(a!==b){if(!d)return NaN;return 1}break;case 1252:var -a=ba(a),b=ba(b);if(a!==b){if(ab)return 1}break;case +a=bf(a),b=bf(b);if(a!==b){if(ab)return 1}break;case 12520:var a=a.toString(),b=b.toString();if(a!==b){if(ab)return 1}break;case 246:case 254:default:if(a.length!=b.length)return a.length1)e.push(a,b,1);break}}if(e.length==0)return 0;var h=e.pop();b=e.pop();a=e.pop();if(h+10)if(c==0&&(b>=a.l||a.t==2&&b>=a.c.length))if(d==0){a.c=u;a.t=2}else{a.c=cS(b,String.fromCharCode(d));a.t=b==a.l?0:2}else{if(a.t!=4)eD(a);for(b+=c;c31)ag("format_int: format too long");var -a={justify:bA,signstyle:aC,filler:bC,alternate:false,base:0,signedconv:false,width:0,uppercase:false,sign:1,prec:-1,conv:"f"};for(var +ms(a,b){return cU(a,b,true)}function +GL(){return[0]}function +af(a){if(a<0)ah("Bytes.create");return new +bv(a?2:9,o,a)}function +mw(b,a){if(a==0)cX();return b/a|0}function +A(a,b){return+(cU(a,b,false)==0)}function +GM(a,c,b,d){if(b>0)if(c==0&&(b>=a.l||a.t==2&&b>=a.c.length))if(d==0){a.c=o;a.t=2}else{a.c=cY(b,String.fromCharCode(d));a.t=b==a.l?0:2}else{if(a.t!=4)eU(a);for(b+=c;c31)ah("format_int: format too long");var +a={justify:bI,signstyle:aC,filler:bJ,alternate:false,base:0,signedconv:false,width:0,uppercase:false,sign:1,prec:-1,conv:"f"};for(var c=0;c=0&&b<=9){a.width=a.width*10+b;c++}c--;break;case".":a.prec=0;c++;while(b=d.charCodeAt(c)-48,b>=0&&b<=9){a.prec=a.prec*10+b;c++}c--;case"d":case"i":a.signedconv=true;case"u":a.base=10;break;case"x":a.base=16;break;case"X":a.base=16;a.uppercase=true;break;case"o":a.base=8;break;case"e":case"f":case"g":a.signedconv=true;a.conv=b;break;case"E":case"F":case"G":a.signedconv=true;a.uppercase=true;a.conv=b.toLowerCase();break}}return a}function -gd(b,f){if(b.uppercase)f=f.toUpperCase();var +gH(b,f){if(b.uppercase)f=f.toUpperCase();var e=f.length;if(b.signedconv&&(b.sign<0||b.signstyle!=aC))e++;if(b.alternate){if(b.base==8)e+=1;if(b.base==16)e+=2}var -c=u;if(b.justify==bA&&b.filler==bC)for(var -d=e;d20){c-=20;a/=Math.pow(10,c);a+=new -Array(c+1).join(k);if(b>0)a=a+bB+new +c=parseInt(a.toString().split(bI)[1]);if(c>20){c-=20;a/=Math.pow(10,c);a+=new +Array(c+1).join(k);if(b>0)a=a+bn+new Array(b+1).join(k);return a}else return a.toFixed(b)}}var -a,e=go(i),d=e.prec<0?6:e.prec;if(c<0||c==0&&1/c==-Infinity){e.sign=-1;c=-c}if(isNaN(c)){a=f3;e.filler=bC}else -if(!isFinite(c)){a=ko;e.filler=bC}else +a,e=gT(i),d=e.prec<0?6:e.prec;if(c<0||c==0&&1/c==-Infinity){e.sign=-1;c=-c}if(isNaN(c)){a=gr;e.filler=bJ}else +if(!isFinite(c)){a=l4;e.filler=bJ}else switch(e.conv){case"e":var -a=c.toExponential(d),b=a.length;if(a.charAt(b-3)==eB)a=a.slice(0,b-1)+k+a.slice(b-1);break;case"f":a=j(c,d);break;case"g":d=d?d:1;a=c.toExponential(d-1);var -h=a.indexOf(eB),g=+a.slice(h+1);if(g<-4||c>=1e21||c.toFixed(0).length>d){var -b=h-1;while(a.charAt(b)==k)b--;if(a.charAt(b)==bB)b--;a=a.slice(0,b+1)+a.slice(h);b=a.length;if(a.charAt(b-3)==eB)a=a.slice(0,b-1)+k+a.slice(b-1);break}else{var +a=c.toExponential(d),b=a.length;if(a.charAt(b-3)==eS)a=a.slice(0,b-1)+k+a.slice(b-1);break;case"f":a=j(c,d);break;case"g":d=d?d:1;a=c.toExponential(d-1);var +h=a.indexOf(eS),g=+a.slice(h+1);if(g<-4||c>=1e21||c.toFixed(0).length>d){var +b=h-1;while(a.charAt(b)==k)b--;if(a.charAt(b)==bn)b--;a=a.slice(0,b+1)+a.slice(h);b=a.length;if(a.charAt(b-3)==eS)a=a.slice(0,b-1)+k+a.slice(b-1);break}else{var f=d;if(g<0){f-=g+1;a=c.toFixed(f)}else while(a=c.toFixed(f),a.length>d+1)f--;if(f){var -b=a.length-1;while(a.charAt(b)==k)b--;if(a.charAt(b)==bB)b--;a=a.slice(0,b+1)}}break}return gd(e,a)}function -eE(e,c){if(ba(e)==j6)return a(u+c);var -b=go(e);if(c<0)if(b.signedconv){b.sign=-1;c=-c}else +b=a.length-1;while(a.charAt(b)==k)b--;if(a.charAt(b)==bn)b--;a=a.slice(0,b+1)}}break}return gH(e,a)}function +eV(e,c){if(bf(e)==gy)return a(o+c);var +b=gT(e);if(c<0)if(b.signedconv){b.sign=-1;c=-c}else c>>>=0;var -d=c.toString(b.base);if(b.prec>=0){b.filler=bC;var -f=b.prec-d.length;if(f>0)d=cS(f,k)+d}return gd(b,d)}var -kX=0;function -an(){return kX++}function -aY(a){return a.toUtf16()}if(E.process&&E.process.cwd)var -dA=E.process.cwd().replace(/\\/g,bE);else +d=c.toString(b.base);if(b.prec>=0){b.filler=bJ;var +f=b.prec-d.length;if(f>0)d=cY(f,k)+d}return gH(b,d)}var +mH=0;function +aj(){return mH++}function +a2(a){return a.toUtf16()}function +HF(){function +a(a){if(a.charAt(0)===br)return[o,a.substring(1)];return}function +b(c){var +g=/^([a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)?([\\/])?([\s\S]*?)$/,a=g.exec(c),b=a[1]||o,e=Boolean(b&&b.charAt(1)!==":");if(Boolean(a[2]||e)){var +d=a[1]||o,f=a[2]||o;return[d,c.substring(d.length+f.length)]}return}return B.process&&B.process.platform?B.process.platform==="win32"?b:a:a}var +g0=HF();function +mL(a){return a.slice(-1)!==br?a+br:a}if(B.process&&B.process.cwd)var +dK=B.process.cwd().replace(/\\/g,br);else var -dA="/static";if(dA.slice(-1)!==bE)dA+=bE;function -EN(a){a=aY(a);if(a.charCodeAt(0)!=47)a=dA+a;var -d=a.split(bE),b=[];for(var -c=0;c1)b.pop();break;case".":break;case"":if(b.length==0)b.push(u);break;default:b.push(d[c]);break}b.orig=a;return b}function -Em(a){return new -bI(4,a,a.length)}function -E9(e){for(var -f=u,b=f,a,h,c=0,g=e.length;cfK){b.substr(0,1);f+=b;b=u;f+=e.slice(c,d)}else -b+=e.slice(c,d);if(d==g)break;c=d}if(a>6);b+=String.fromCharCode(a7|a&cw)}else -if(a<0xd800||a>=jF)b+=String.fromCharCode(h8|a>>12,a7|a>>6&cw,a7|a&cw);else -if(a>=0xdbff||c+1==g||(h=e.charCodeAt(c+1))jF)b+="\xef\xbf\xbd";else{c++;a=(a<<10)+h-0x35fdc00;b+=String.fromCharCode(i3|a>>18,a7|a>>12&cw,a7|a>>6&cw,a7|a&cw)}if(b.length>dt){b.substr(0,1);f+=b;b=u}}return f+b}function -En(a){var -b=9;if(!k0(a))b=8,a=E9(a);return new -bI(b,a,a.length)}function -bb(a){return En(a)}function -_(a){gp(af.Sys_error,a)}function -EX(a){a=ba(a);_(a+": No such file or directory")}function -aZ(a){return a.l}function -kz(){}function +dK="/static";dK=mL(dK);function +Hb(a){a=a2(a);if(!g0(a))a=dK+a;var +e=g0(a),d=e[1].split(br),b=[];for(var +c=0;c1)b.pop();break;case".":break;default:b.push(d[c]);break}b.unshift(e[0]);b.orig=a;return b}function +Hx(e){for(var +f=o,b=f,a,h,c=0,g=e.length;cf9){b.substr(0,1);f+=b;b=o;f+=e.slice(c,d)}else +b+=e.slice(c,d);if(d==g)break;c=d}if(a>6);b+=String.fromCharCode(a$|a&cD)}else +if(a<0xd800||a>=k1)b+=String.fromCharCode(iU|a>>12,a$|a>>6&cD,a$|a&cD);else +if(a>=0xdbff||c+1==g||(h=e.charCodeAt(c+1))k1)b+="\xef\xbf\xbd";else{c++;a=(a<<10)+h-0x35fdc00;b+=String.fromCharCode(kc|a>>18,a$|a>>12&cD,a$|a>>6&cD,a$|a&cD)}if(b.length>dC){b.substr(0,1);f+=b;b=o}}return f+b}function +GJ(a){var +b=9;if(!mN(a))b=8,a=Hx(a);return new +bv(b,a,a.length)}function +aP(a){return GJ(a)}var +HR=[jv,mb,kp,iM,kk,k0,jL,ld,f$,jO,lc,kd,le,jK,iw,me,iL,iT,j6,kK,eQ,i7,l0,li,lJ,kD,eI,gz,i3,i2,j0,l3,lY,l7,jw,iW,ji,kU,l$,ka,jB,kn,iS,ke,iz,lg,lU,jz,i5,j9,kE,jR,kO,kj,lf,jN,jx,lB,k8,lN,k4,kZ,kY,iR,jE,jd,lp,lG];function +cp(d,f,e,a){var +b=HR.indexOf(d);if(b<0){if(a==null)a=-9999;b=[0,a]}var +c=[b,aP(f||o),aP(e||o)];return c}var +mF={};function +bQ(a){return mF[a]}function +co(b,a){throw[0,b].concat(a)}function +GI(a){return new +bv(4,a,a.length)}function +S(a){gU(ag.Sys_error,a)}function +Hl(a){a=bf(a);S(a+en)}function +a3(a){return a.l}function +mh(){}function at(a){this.data=a}at.prototype=new -kz();at.prototype.truncate=function(a){var -b=this.data;this.data=ae(a|0);b3(b,0,this.data,0,a)};at.prototype.length=function(){return aZ(this.data)};at.prototype.write=function(b,d,g,a){var +mh();at.prototype.truncate=function(a){var +b=this.data;this.data=af(a|0);b7(b,0,this.data,0,a)};at.prototype.length=function(){return a3(this.data)};at.prototype.write=function(b,d,g,a){var c=this.length();if(b+a>=c){var -e=ae(b+a),f=this.data;this.data=e;b3(f,0,this.data,0,c)}b4(d,g,this.data,b,a);return 0};at.prototype.read=function(c,a,d,b){var -e=this.length();b3(this.data,c,a,d,b);return 0};at.prototype.read_one=function(a){return b5(this.data,a)};at.prototype.close=function(){};at.prototype.constructor=at;function -a8(b,a){this.content={};this.root=b;this.lookupFun=a}a8.prototype.nm=function(a){return this.root+a};a8.prototype.lookup=function(b){if(!this.content[b]&&this.lookupFun){var -c=this.lookupFun(a(this.root),a(b));if(c!==0)this.content[b]=new -at(bJ(c[1]))}};a8.prototype.exists=function(a){if(a==u)return 1;var -c=a+bE,d=new -RegExp(fP+c);for(var -b +e=af(b+a),f=this.data;this.data=e;b7(f,0,this.data,0,c)}b8(d,g,this.data,b,a);return 0};at.prototype.read=function(c,a,d,b){var +e=this.length();b7(this.data,c,a,d,b);return 0};at.prototype.read_one=function(a){return b9(this.data,a)};at.prototype.close=function(){};at.prototype.constructor=at;function +aJ(b,a){this.content={};this.root=b;this.lookupFun=a}aJ.prototype.nm=function(a){return this.root+a};aJ.prototype.create_dir_if_needed=function(d){var +c=d.split(br),b=o;for(var +a=0;a>1|1;if(h=0)}function -gf(d,b){var -e=b.length,a,c;for(a=0;a+4<=e;a+=4){c=b.charCodeAt(a)|b.charCodeAt(a+1)<<8|b.charCodeAt(a+2)<<16|b.charCodeAt(a+3)<<24;d=au(d,c)}c=0;switch(e&3){case +a=c}e2[d]=a+1;return h==b[a+1]?b[a]:0}function +mA(a,b){return+(cU(a,b,false)>=0)}function +gK(d,b){var +e=b.length,a,c;for(a=0;a+4<=e;a+=4){c=b.charCodeAt(a)|b.charCodeAt(a+1)<<8|b.charCodeAt(a+2)<<16|b.charCodeAt(a+3)<<24;d=av(d,c)}c=0;switch(e&3){case 3:c=b.charCodeAt(a+2)<<16;case 2:c|=b.charCodeAt(a+1)<<8;case -1:c|=b.charCodeAt(a);d=au(d,c)}d^=e;return d}function -Ew(a,b){return gf(a,ba(b))}function -Et(d,b){var -e=b.length,a,c;for(a=0;a+4<=e;a+=4){c=b[a]|b[a+1]<<8|b[a+2]<<16|b[a+3]<<24;d=au(d,c)}c=0;switch(e&3){case +1:c|=b.charCodeAt(a);d=av(d,c)}d^=e;return d}function +GV(a,b){return gK(a,bf(b))}function +GS(d,b){var +e=b.length,a,c;for(a=0;a+4<=e;a+=4){c=b[a]|b[a+1]<<8|b[a+2]<<16|b[a+3]<<24;d=av(d,c)}c=0;switch(e&3){case 3:c=b[a+2]<<16;case 2:c|=b[a+1]<<8;case -1:c|=b[a];d=au(d,c)}d^=e;return d}function -Es(a,b){switch(b.t&6){default:b6(b);case -0:a=gf(a,b.c);break;case -2:a=Et(a,b.c)}return a}function -Eu(a){a^=a>>>16;a=br(a,0x85ebca6b|0);a^=a>>>13;a=br(a,0xc2b2ae35|0);a^=a>>>16;return a}function -Er(j,l,n,m){var -f,g,h,d,c,b,a,e,i;d=l;if(d<0||d>cK)d=cK;c=j;b=n;f=[m];g=0;h=1;while(g0){a=f[g++];if(a&&a.caml_custom){if(cO[a.caml_custom]&&cO[a.caml_custom].hash){var -k=cO[a.caml_custom].hash(a);b=au(b,k);c--}}else +1:c|=b[a];d=av(d,c)}d^=e;return d}function +GR(a,b){switch(b.t&6){default:b_(b);case +0:a=gK(a,b.c);break;case +2:a=GS(a,b.c)}return a}function +GT(a){a^=a>>>16;a=by(a,0x85ebca6b|0);a^=a>>>13;a=by(a,0xc2b2ae35|0);a^=a>>>16;return a}function +GQ(j,l,n,m){var +f,g,h,d,c,b,a,e,i;d=l;if(d<0||d>cR)d=cR;c=j;b=n;f=[m];g=0;h=1;while(g0){a=f[g++];if(a&&a.caml_custom){if(cV[a.caml_custom]&&cV[a.caml_custom].hash){var +k=cV[a.caml_custom].hash(a);b=av(b,k);c--}}else if(a instanceof Array&&a[0]===(a[0]|0))switch(a[0]){case -248:b=au(b,a[2]);c--;break;case +248:b=av(b,a[2]);c--;break;case 250:f[--g]=a[1];break;default:var -o=a.length-1<<10|a[0];b=au(b,o);for(e=1,i=a.length;e=d)break;f[h++]=a[e]}break}else -if(dD(a)){b=Es(b,a);c--}else -if(eJ(a)){b=Ew(b,a);c--}else +o=a.length-1<<10|a[0];b=av(b,o);for(e=1,i=a.length;e=d)break;f[h++]=a[e]}break}else +if(dN(a)){b=GR(b,a);c--}else +if(e0(a)){b=GV(b,a);c--}else if(typeof -a==="string"){b=gf(b,a);c--}else -if(a===(a|0)){b=au(b,a+a+1);c--}else -if(a===+a){b=ge(b,a);c--}}b=Eu(b);return b&0x3FFFFFFF}function -Ex(a,c,l){if(!isFinite(a)){if(isNaN(a))return bb(f3);return bb(a>0?kk:"-infinity")}var +a==="string"){b=gK(b,a);c--}else +if(a===(a|0)){b=av(b,a+a+1);c--}else +if(a===+a){b=gJ(b,a);c--}}b=GT(b);return b&0x3FFFFFFF}function +GW(a,c,l){if(!isFinite(a)){if(isNaN(a))return aP(gr);return aP(a>0?lX:"-infinity")}var i=a==0&&1/a==-Infinity?1:a>=0?0:1;if(i)a=-a;var d=0;if(a==0);else if(a<1)while(a<1&&d>-1022){a*=2;d--}else while(a>=2){a/=2;d++}var -j=d<0?u:bA,e=u;if(i)e=aC;else +j=d<0?o:bI,e=o;if(i)e=aC;else switch(l){case -43:e=bA;break;case -32:e=bC;break;default:break}if(c>=0&&c<13){var +43:e=bI;break;case +32:e=bJ;break;default:break}if(c>=0&&c<13){var g=Math.pow(2,c*4);a=Math.round(a*g)/g}var b=a.toString(16);if(c>=0){var -h=b.indexOf(bB);if(h<0)b+=bB+cS(c,k);else{var -f=h+1+c;if(b.length>24&bG,a>>31&bj)}function -EI(a){return a.toInt()}function -EC(a){return+a.isNeg()}function -EF(a){return a.neg()}function -EA(g,c){var -a=go(g);if(a.signedconv&&EC(c)){a.sign=-1;c=EF(c)}var -b=u,h=EG(a.base),f="0123456789abcdef";do{var -e=c.udivmod(h);c=e.quotient;b=f.charAt(EI(e.modulus))+b}while(!ED(c));if(a.prec>=0){a.filler=bC;var -d=a.prec-b.length;if(d>0)b=cS(d,k)+b}return gd(a,b)}function -EH(a,b){return a.or(b)}function -eH(a){return a.toFloat()}function -EK(){return typeof -module!=="undefined"&&module&&module.exports?module.exports:E}function -ch(a){return a.slice(1)}function -EL(c){var +h=b.indexOf(bn);if(h<0)b+=bn+cY(c,k);else{var +f=h+1+c;if(b.length>24&bM,a>>31&bp)}function +G7(a){return a.toInt()}function +G1(a){return+a.isNeg()}function +G4(a){return a.neg()}function +GZ(g,c){var +a=gT(g);if(a.signedconv&&G1(c)){a.sign=-1;c=G4(c)}var +b=o,h=G5(a.base),f="0123456789abcdef";do{var +e=c.udivmod(h);c=e.quotient;b=f.charAt(G7(e.modulus))+b}while(!G2(c));if(a.prec>=0){a.filler=bJ;var +d=a.prec-b.length;if(d>0)b=cY(d,k)+b}return gH(a,b)}function +G6(a,b){return a.or(b)}function +eY(a){return a.toFloat()}function +G_(){return typeof +module!=="undefined"&&module&&module.exports?module.exports:B}function +cl(a){return a.slice(1)}function +G$(c){var d=c.length,b=new Array(d+1);b[0]=0;for(var a=0;a0){var c=new Array(b);for(var -a=0;abm){a-=bm;b*=Math.pow(2,bm);if(a>bm){a-=bm;b*=Math.pow(2,bm)}}if(a<-bm){a+=bm;b*=Math.pow(2,-bm)}b*=Math.pow(2,a);return b}function -EM(a,b){return+(cN(a,b,false)<=0)}function -gm(a,b){return+(cN(a,b,false)<0)}function -bL(a,d){if(a<0)dy();var +a=0;abt){a-=bt;b*=Math.pow(2,bt);if(a>bt){a-=bt;b*=Math.pow(2,bt)}}if(a<-bt){a+=bt;b*=Math.pow(2,-bt)}b*=Math.pow(2,a);return b}function +Ha(a,b){return+(cU(a,b,false)<=0)}function +gR(a,b){return+(cU(a,b,false)<0)}function +bP(a,d){if(a<0)dI();var a=a+1|0,b=new Array(a);b[0]=0;for(var c=1;c>>32-b,c)}function g(c,b,d,e,h,f,g){return a(b&d|~b&e,c,b,h,f,g)}function @@ -669,14 +713,14 @@ h(d,b,e,c,h,f,g){return a(b&c|e&~c,d,b,h,f,g)}function i(c,b,d,e,h,f,g){return a(b^d^e,c,b,h,f,g)}function j(c,b,d,e,h,f,g){return a(d^(b|~e),c,b,h,f,g)}function k(f,n){var -e=n;f[e>>2]|=a7<<8*(e&3);for(e=(e&~0x3)+8;(e&0x3F)<60;e+=4)f[(e>>2)-1]=0;f[(e>>2)-1]=n<<3;f[e>>2]=n>>29&0x1FFFFFFF;var +e=n;f[e>>2]|=a$<<8*(e&3);for(e=(e&~0x3)+8;(e&0x3F)<60;e+=4)f[(e>>2)-1]=0;f[(e>>2)-1]=n<<3;f[e>>2]=n>>29&0x1FFFFFFF;var k=[0x67452301,0xEFCDAB89,0x98BADCFE,0x10325476];for(e=0;e>8*m&0xFF;return o}return function(h,g,f){var -e=[];switch(h.t&6){default:b6(h);case +e=[];switch(h.t&6){default:b_(h);case 0:var d=h.c;for(var a=0;a>2]=d.charCodeAt(b)|d.charCodeAt(b+1)<<8|d.charCodeAt(b+2)<<16|d.charC 4:var c=h.c;for(var a=0;a>2]=c[b]|c[b+1]<<8|c[b+2]<<16|c[b+3]<<24}for(;a>2]|=c[a+g]<<8*(a&3)}return E3(k(e,f))}}();function -EP(c,b,a){return EO(bJ(c),b,a)}var -bq=new +b=a+g;e[a>>2]=c[b]|c[b+1]<<8|c[b+2]<<16|c[b+3]<<24}for(;a>2]|=c[a+g]<<8*(a&3)}return Hr(k(e,f))}}();function +Hd(c,b,a){return Hc(bO(c),b,a)}function +He(){return 0}var +bx=new Array();function -gn(c){var -a=bq[c];if(!a.opened)_("Cannot flush a closed channel");if(!a.buffer||a.buffer==u)return 0;if(a.fd&&af.fds[a.fd]&&af.fds[a.fd].output){var -b=af.fds[a.fd].output;switch(b.length){case -2:b(c,a.buffer);break;default:b(a.buffer)}}a.buffer=u;return 0}function -kZ(e,f){var -b=bq[e],d=a(f),c=K(d);b.file.write(b.offset,d,0,c);b.offset+=c;return 0}function -Fb(a){var -a=gs(a),b=E;if(b.process&&b.process.stdout&&b.process.stdout.write)b.process.stderr.write(a);else{if(a.charCodeAt(a.length-1)==10)a=a.substr(0,a.length-1);var +cm(c){var +a=bx[c];if(!a.opened)S("Cannot flush a closed channel");if(!a.buffer||a.buffer==o)return 0;if(a.fd&&ag.fds[a.fd]&&ag.fds[a.fd].output){var +b=ag.fds[a.fd].output;switch(b.length){case +2:b(c,a.buffer);break;default:b(a.buffer)}}a.buffer=o;return 0}function +mJ(e,f){var +b=bx[e],d=a(f),c=G(d);b.file.write(b.offset,d,0,c);b.offset+=c;return 0}function +HA(a){var +a=gY(a),b=B;if(b.process&&b.process.stdout&&b.process.stdout.write)b.process.stderr.write(a);else{if(a.charCodeAt(a.length-1)==10)a=a.substr(0,a.length-1);var c=b.console;c&&c.error&&c.error(a)}}function -Fc(a){var -a=gs(a),b=E;if(b.process&&b.process.stdout&&b.process.stdout.write)b.process.stdout.write(a);else{if(a.charCodeAt(a.length-1)==10)a=a.substr(0,a.length-1);var +HB(a){var +a=gY(a),b=B;if(b.process&&b.process.stdout&&b.process.stdout.write)b.process.stdout.write(a);else{if(a.charCodeAt(a.length-1)==10)a=a.substr(0,a.length-1);var c=b.console;c&&c.log&&c.log(a)}}function -eQ(c,e,d,a){if(af.fds===undefined)af.fds=new +e6(c,e,d,a){if(ag.fds===undefined)ag.fds=new Array();a=a?a:{};var -b={};b.file=d;b.offset=a.append?d.length():0;b.flags=a;b.output=e;af.fds[c]=b;if(!af.fd_last_idx||c>af.fd_last_idx)af.fd_last_idx=c;return c}function -Fs(c,b,g){var +b={};b.file=d;b.offset=a.append?d.length():0;b.flags=a;b.output=e;ag.fds[c]=b;if(!ag.fd_last_idx||c>ag.fd_last_idx)ag.fd_last_idx=c;return c}function +HT(c,b,g){var a={};while(b){switch(b[1]){case 0:a.rdonly=1;break;case 1:a.wronly=1;break;case @@ -713,125 +758,127 @@ a={};while(b){switch(b[1]){case 5:a.excl=1;break;case 6:a.binary=1;break;case 7:a.text=1;break;case -8:a.nonblock=1;break}b=b[2]}if(a.rdonly&&a.wronly)_(ba(c)+ih);if(a.text&&a.binary)_(ba(c)+iJ);var -d=k5(c),e=d.device.open(d.rest,a),f=af.fd_last_idx?af.fd_last_idx:0;return eQ(f+1,kZ,e,a)}eQ(0,kZ,new -at(ae(0)));eQ(1,Fc,new -at(ae(0)));eQ(2,Fb,new -at(ae(0)));function -EQ(c){var -b=af.fds[c];if(b.flags.wronly)_(jf+c+" is writeonly");var -a={file:b.file,offset:b.offset,fd:c,opened:true,out:false,refill:null};bq[a.fd]=a;return a.fd}function -kT(c){var -b=af.fds[c];if(b.flags.rdonly)_(jf+c+" is readonly");var -a={file:b.file,offset:b.offset,fd:c,opened:true,out:true,buffer:u};bq[a.fd]=a;return a.fd}function -ER(){var +8:a.nonblock=1;break}b=b[2]}if(a.rdonly&&a.wronly)S(bf(c)+i$);if(a.text&&a.binary)S(bf(c)+jM);var +d=mS(c),e=d.device.open(d.rest,a),f=ag.fd_last_idx?ag.fd_last_idx:0;return e6(f+1,mJ,e,a)}e6(0,mJ,new +at(af(0)));e6(1,HB,new +at(af(0)));e6(2,HA,new +at(af(0)));function +Hf(a){var +c=ag.fds[a];if(c.flags.wronly)S(ku+a+" is writeonly");var +d=null;if(a==0&&mM()){var +e=require("fs");d=function(){return aP(e.readFileSync(0,iy))}}var +b={file:c.file,offset:c.offset,fd:a,opened:true,out:false,refill:d};bx[b.fd]=b;return b.fd}function +mD(c){var +b=ag.fds[c];if(b.flags.rdonly)S(ku+c+" is readonly");var +a={file:b.file,offset:b.offset,fd:c,opened:true,out:true,buffer:o};bx[a.fd]=a;return a.fd}function +Hg(){var b=0;for(var -a=0;a>>0)return a[0];else -if(dD(a))return fY;else -if(eJ(a))return fY;else +if(dN(a))return ez;else +if(e0(a))return ez;else if(a instanceof Function||typeof a=="function")return 247;else -if(a&&a.caml_custom)return cG;else -return a4}function -a_(b,c,a){if(a&&E.toplevelReloc)b=E.toplevelReloc(a);af[b+1]=c;if(a)af[a]=c}var -kU={};function -E0(a,b){kU[ba(a)]=b;return 0}function -E1(a){a[2]=kX++;return a}function -gr(a,b){return kI(a,b)}function -E2(){ag(f0)}function -D(b,a){if(a>>>0>=K(b))E2();return cT(b,a)}function -ah(a,b){return 1-gr(a,b)}function -E4(){return[0,a("js_of_ocaml")]}function -E5(){return 0x7FFFFFFF/4|0}function -E6(){return[0,a("Unix"),32,0]}function -EY(){eN(af.Not_found)}function -eP(c){var -a=E,b=aY(c);if(a.process&&a.process.env&&a.process.env[b]!=undefined)return bb(a.process.env[b]);if(E.jsoo_static_env&&E.jsoo_static_env[b])return bb(E.jsoo_static_env[b]);EY()}function -E7(){var +if(a&&a.caml_custom)return cN;else +return a8}function +bb(b,c,a){if(a&&B.toplevelReloc)b=B.toplevelReloc(a);ag[b+1]=c;if(a)ag[a]=c}function +gV(a,b){mF[bf(a)]=b;return 0}function +Ho(a){a[2]=mH++;return a}function +gX(a,b){return mq(a,b)}function +Hq(){ah(gn)}function +E(b,a){if(a>>>0>=G(b))Hq();return cZ(b,a)}function +an(a,b){return 1-gX(a,b)}function +Hs(){return[0,a("js_of_ocaml")]}function +Ht(){return 0x7FFFFFFF/4|0}function +Hu(a){return 0}function +Hm(){e3(ag.Not_found)}function +mK(c){var +a=B,b=a2(c);if(a.process&&a.process.env&&a.process.env[b]!=undefined)return aP(a.process.env[b]);if(B.jsoo_static_env&&B.jsoo_static_env[b])return aP(B.jsoo_static_env[b]);Hm()}function +Hv(){var a=new -Date().getTime(),b=a^i9*Math.random();return[0,b]}function -dF(a){var +Date().getTime(),b=a^kl*Math.random();return[0,b]}function +dQ(a){var b=1;while(a&&a.joo_tramp){a=a.joo_tramp.apply(null,a.joo_args);b++}return a}function ao(b,a){return{joo_tramp:b,joo_args:a}}function -E8(c,a){if(typeof +Hw(c,a){if(typeof a==="function"){c.fun=a;return 0}if(a.fun){c.fun=a.fun;return 0}var b=a.length;while(b--)c[b]=a[b];return 0}function -kY(a){return a}function -eM(a){return kU[a]}function +mI(a){return a}function d(a){if(a instanceof -Array)return a;if(E.RangeError&&a +Array)return a;if(B.RangeError&&a instanceof -E.RangeError&&a.message&&a.message.match(/maximum call stack/i))return kY(af.Stack_overflow);if(E.InternalError&&a +B.RangeError&&a.message&&a.message.match(/maximum call stack/i))return mI(ag.Stack_overflow);if(B.InternalError&&a instanceof -E.InternalError&&a.message&&a.message.match(/too much recursion/i))return kY(af.Stack_overflow);if(a +B.InternalError&&a.message&&a.message.match(/too much recursion/i))return mI(ag.Stack_overflow);if(a instanceof -E.Error&&eM(fN))return[0,eM(fN),a];return[0,af.Failure,bb(String(a))]}var -t=function(A){"use strict";var -f=cd,ac=7,s=9007199254740992,J=p(s),O="0123456789abcdefghijklmnopqrstuvwxyz",g=E.BigInt,H=typeof +B.Error&&bQ(gb))return[0,bQ(gb),a];return[0,ag.Failure,aP(String(a))]}var +u=function(A){"use strict";var +f=ci,ac=7,t=9007199254740992,J=q(t),O="0123456789abcdefghijklmnopqrstuvwxyz",g=B.BigInt,H=typeof g==="function";function d(a,b,c,f){if(typeof a==="undefined")return d[0];if(typeof b!=="undefined")return+b===10&&!c?e(a):ag(a,b,c,f);return e(a)}function -a(b,a){this.value=b;this.sign=a;this.isSmall=false;this.caml_custom=es}a.prototype=Object.create(d.prototype);function -b(a){this.value=a;this.sign=a<0;this.isSmall=true;this.caml_custom=es}b.prototype=Object.create(d.prototype);function -c(a){this.value=a;this.caml_custom=es}c.prototype=Object.create(d.prototype);function -m(a){return-s0)return Math.floor(a);return Math.ceil(a)}function +s(a){if(a>0)return Math.floor(a);return Math.ceil(a)}function P(g,h){var i=g.length,j=h.length,e=new Array(i),b=0,d=f,c,a;for(a=0;a=d?1:0;e[a]=c-b*d}while(a0)e.push(b);return e}function v(a,b){if(a.length>=b.length)return P(a,b);return P(b,a)}function -B(g,a){var +C(g,a){var h=g.length,d=new Array(h),c=f,e,b;for(b=0;b0){d[b++]=a%c;a=Math.floor(a/c)}return d}a.prototype.add=function(f){var b=e(f);if(this.sign!==b.sign)return this.subtract(b.negate());var c=this.value,d=b.value;if(b.isSmall)return new -a(B(c,Math.abs(d)),this.sign);return new +a(C(c,Math.abs(d)),this.sign);return new a(v(c,d),this.sign)};a.prototype.plus=a.prototype.add;b.prototype.add=function(g){var f=e(g),c=this.value;if(c<0!==f.sign)return this.subtract(f.negate());var d=f.value;if(f.isSmall){if(m(c+d))return new -b(c+d);d=p(Math.abs(d))}return new -a(B(d,Math.abs(c)),c<0)};b.prototype.plus=b.prototype.add;c.prototype.add=function(a){return new +b(c+d);d=q(Math.abs(d))}return new +a(C(d,Math.abs(c)),c<0)};b.prototype.plus=b.prototype.add;c.prototype.add=function(a){return new c(this.value+e(a).value)};c.prototype.plus=c.prototype.add;function y(d,h){var g=d.length,i=h.length,c=new Array(g),e=0,j=f,a,b;for(a=0;a=0)c=y(e,f);else{c=y(f,e);d=!d}c=n(c);if(typeof +c;if(p(e,f)>=0)c=y(e,f);else{c=y(f,e);d=!d}c=n(c);if(typeof c==="number"){if(d)c=-c;return new b(c)}return new a(c,d)}function @@ -855,56 +902,56 @@ a(this.value,false)};b.prototype.abs=function(){return new b(Math.abs(this.value))};c.prototype.abs=function(){return new c(this.value>=0?this.value:-this.value)};function N(g,j){var -i=g.length,l=j.length,n=i+l,c=C(n),m=f,e,d,a,h,k;for(a=0;a0){e[b++]=a%c;a=Math.floor(a/c)}return e}function Z(c,b){var a=[];while(b-->0)a.push(0);return a.concat(c)}function -D(b,c){var +E(b,c){var a=Math.max(b.length,c.length);if(a<=30)return N(b,c);a=Math.ceil(a/2);var -f=b.slice(a),d=b.slice(0,a),i=c.slice(a),h=c.slice(0,a),e=D(d,h),g=D(f,i),k=D(v(d,f),v(h,i)),j=v(v(e,Z(y(y(k,e),g),a)),Z(g,2*a));q(j);return j}function -al(a,b){return-(iS*a)-iS*b+0.000015*a*b>0}a.prototype.multiply=function(j){var +f=b.slice(a),d=b.slice(0,a),i=c.slice(a),h=c.slice(0,a),e=E(d,h),g=E(f,i),k=E(v(d,f),v(h,i)),j=v(v(e,Z(y(y(k,e),g),a)),Z(g,2*a));r(j);return j}function +al(a,b){return-(jZ*a)-jZ*b+0.000015*a*b>0}a.prototype.multiply=function(j){var h=e(j),c=this.value,b=h.value,i=this.sign!==h.sign,g;if(h.isSmall){if(b===0)return d[0];if(b===1)return this;if(b===-1)return this.negate();g=Math.abs(b);if(g=0;d--){j=g-1;if(b[d+h]!==l)j=Math.floor((b[d+h]*g+b[d+h-1])/l);c=0;e=0;m=i.length;for(a=0;a=0;d--){j=g-1;if(b[d+h]!==l)j=Math.floor((b[d+h]*g+b[d+h-1])/l);c=0;e=0;m=i.length;for(a=0;ah)d=(d+1)*i;c=Math.ceil(d/m);do{j=w(b,c);if(o(j,a)<=0)break;c--}while(c);e.push(c);a=y(a,j)}e.reverse();return[n(e),n(a)]}function +l=k.length,h=b.length,e=[],a=[],i=f,c,g,d,m,j;while(l){a.unshift(k[--l]);r(a);if(p(a,b)<0){e.push(0);continue}g=a.length;d=a[g-1]*i+a[g-2];m=b[h-1]*i+b[h-2];if(g>h)d=(d+1)*i;c=Math.ceil(d/m);do{j=w(b,c);if(p(j,a)<=0)break;c--}while(c);e.push(c);a=y(a,j)}e.reverse();return[n(e),n(a)]}function Q(i,e){var -g=i.length,h=C(g),j=f,a,d,b,c;b=0;for(a=g-1;a>=0;--a){c=b*j+i[a];d=r(c/e);b=c-d*e;h[a]=d|0}return[h,b|0]}function +g=i.length,h=D(g),j=f,a,d,b,c;b=0;for(a=g-1;a>=0;--a){c=b*j+i[a];d=s(c/e);b=c-d*e;h[a]=d|0}return[h,b|0]}function i(h,w){var m,j=e(w);if(H)return[new c(h.value/j.value),new c(h.value%j.value)];var l=h.value,i=j.value,g;if(i===0)throw new Error("Cannot divide by zero");if(h.isSmall){if(j.isSmall)return[new -b(r(l/i)),new +b(s(l/i)),new b(l%i)];return[d[0],h]}if(j.isSmall){if(i===1)return[h,d[0]];if(i==-1)return[h.negate(),d[0]];var -s=Math.abs(i);if(sc.length?1:-1;for(var +p(b,c){if(b.length!==c.length)return b.length>c.length?1:-1;for(var a=b.length-1;a>=0;a--)if(b[a]!==c[a])return b[a]>c[a]?1:-1;return 0}a.prototype.compareAbs=function(d){var -a=e(d),b=this.value,c=a.value;if(a.isSmall)return 1;return o(b,c)};b.prototype.compareAbs=function(d){var +a=e(d),b=this.value,c=a.value;if(a.isSmall)return 1;return p(b,c)};b.prototype.compareAbs=function(d){var c=e(d),b=Math.abs(this.value),a=c.value;if(c.isSmall){a=Math.abs(a);return b===a?0:b>a?1:-1}return-1};c.prototype.compareAbs=function(c){var a=this.value,b=e(c).value;a=a>=0?a:-a;b=b>=0?b:-b;return a===b?0:a>b?1:-1};a.prototype.compare=function(b){if(b===Infinity)return-1;if(b===-Infinity)return 1;var -a=e(b),c=this.value,d=a.value;if(this.sign!==a.sign)return a.sign?1:-1;if(a.isSmall)return this.sign?-1:1;return o(c,d)*(this.sign?-1:1)};a.prototype.compareTo=a.prototype.compare;b.prototype.compare=function(c){if(c===Infinity)return-1;if(c===-Infinity)return 1;var +a=e(b),c=this.value,d=a.value;if(this.sign!==a.sign)return a.sign?1:-1;if(a.isSmall)return this.sign?-1:1;return p(c,d)*(this.sign?-1:1)};a.prototype.compareTo=a.prototype.compare;b.prototype.compare=function(c){if(c===Infinity)return-1;if(c===-Infinity)return 1;var b=e(c),a=this.value,d=b.value;if(b.isSmall)return a==d?0:a>d?1:-1;if(a<0!==b.sign)return a<0?-1:1;return a<0?1:-1};b.prototype.compareTo=b.prototype.compare;c.prototype.compare=function(a){if(a===Infinity)return-1;if(a===-Infinity)return 1;var b=this.value,c=e(a).value;return b===c?0:b>c?1:-1};c.prototype.compareTo=c.prototype.compare;a.prototype.equals=function(a){return this.compare(a)===0};c.prototype.eq=c.prototype.equals=b.prototype.eq=b.prototype.equals=a.prototype.eq=a.prototype.equals;a.prototype.notEquals=function(a){return this.compare(a)!==0};c.prototype.neq=c.prototype.notEquals=b.prototype.neq=b.prototype.notEquals=a.prototype.neq=a.prototype.notEquals;a.prototype.greater=function(a){return this.compare(a)>0};c.prototype.gt=c.prototype.greater=b.prototype.gt=b.prototype.greater=a.prototype.gt=a.prototype.greater;a.prototype.lesser=function(a){return this.compare(a)<0};c.prototype.lt=c.prototype.lesser=b.prototype.lt=b.prototype.lesser=a.prototype.lt=a.prototype.lesser;a.prototype.greaterOrEquals=function(a){return this.compare(a)>=0};c.prototype.geq=c.prototype.greaterOrEquals=b.prototype.geq=b.prototype.greaterOrEquals=a.prototype.geq=a.prototype.greaterOrEquals;a.prototype.lesserOrEquals=function(a){return this.compare(a)<=0};c.prototype.leq=c.prototype.lesserOrEquals=b.prototype.leq=b.prototype.lesserOrEquals=a.prototype.leq=a.prototype.lesserOrEquals;a.prototype.isEven=function(){return(this.value[0]&1)===0};b.prototype.isEven=function(){return(this.value&1)===0};c.prototype.isEven=function(){return(this.value&g(1))===g(0)};a.prototype.isOdd=function(){return(this.value[0]&1)===1};b.prototype.isOdd=function(){return(this.value&1)===1};c.prototype.isOdd=function(){return(this.value&g(1))===g(1)};a.prototype.isPositive=function(){return!this.sign};b.prototype.isPositive=function(){return this.value>0};c.prototype.isPositive=b.prototype.isPositive;a.prototype.isNegative=function(){return this.sign};b.prototype.isNegative=function(){return this.value<0};c.prototype.isNegative=b.prototype.isNegative;a.prototype.isUnit=function(){return false};b.prototype.isUnit=function(){return Math.abs(this.value)===1};c.prototype.isUnit=function(){return this.abs().value===g(1)};a.prototype.isZero=function(){return false};b.prototype.isZero=function(){return this.value===0};c.prototype.isZero=function(){return this.value===g(0)};a.prototype.isDivisibleBy=function(b){var a=e(b);if(a.isZero())return false;if(a.isUnit())return true;if(a.compareAbs(2)===0)return this.isEven();return this.mod(a).isZero()};c.prototype.isDivisibleBy=b.prototype.isDivisibleBy=a.prototype.isDivisibleBy;function T(b){var a=b.abs();if(a.isUnit())return false;if(a.equals(2)||a.equals(3)||a.equals(5))return true;if(a.isEven()||a.isDivisibleBy(3)||a.isDivisibleBy(5))return false;if(a.lesser(49))return true}function L(d,e){var -g=d.prev(),c=g,h=0,f,i,b,a;while(c.isEven())c=c.divide(2),h++;next:for(b=0;b-s)return new +a(C(b,1),true);return G(b,1,this.sign)};b.prototype.prev=function(){var +c=this.value;if(c-1>-t)return new b(c-1);return new a(J,true)};c.prototype.prev=function(){return new c(this.value-g(1))};var @@ -964,23 +1011,23 @@ h=[1];while(2*h[h.length-1]<=f)h.push(2*h[h.length-1]);var x=h.length,j=h[x-1];function _(a){return Math.abs(a)<=f}a.prototype.shiftLeft=function(c){var a=e(c).toJSNumber();if(!_(a))throw new -Error(String(a)+iu);if(a<0)return this.shiftRight(-a);var +Error(String(a)+jp);if(a<0)return this.shiftRight(-a);var b=this;if(b.isZero())return b;while(a>=x){b=b.multiply(j);a-=x-1}return b.multiply(h[a])};c.prototype.shiftLeft=b.prototype.shiftLeft=a.prototype.shiftLeft;a.prototype.shiftRight=function(d){var a,b=e(d).toJSNumber();if(!_(b))throw new -Error(String(b)+iu);if(b<0)return this.shiftLeft(-b);var +Error(String(b)+jp);if(b<0)return this.shiftLeft(-b);var c=this;while(b>=x){if(c.isZero()||c.isNegative()&&c.isUnit())return c;a=i(c,j);c=a[1].isNegative()?a[0].prev():a[0];b-=x-1}a=i(c,h[b]);return a[1].isNegative()?a[0].prev():a[0]};c.prototype.shiftRight=b.prototype.shiftRight=a.prototype.shiftRight;function K(h,a,q){a=e(a);var m=h.isNegative(),p=a.isNegative(),l=m?h.not():h,o=p?a.not():a,b=0,c=0,k=null,n=null,f=[];while(!l.isZero()||!o.isZero()){k=i(l,j);b=k[1].toJSNumber();if(m)b=j-1-b;n=i(o,j);c=n[1].toJSNumber();if(p)c=j-1-c;l=k[0];o=n[0];f.push(q(b,c))}var -g=q(m?1:0,p?1:0)!==0?t(-1):t(0);for(var -d=f.length-1;d>=0;d-=1)g=g.multiply(j).add(t(f[d]));return g}a.prototype.not=function(){return this.negate().prev()};c.prototype.not=b.prototype.not=a.prototype.not;a.prototype.and=function(a){return K(this,a,function(a,b){return a&b})};c.prototype.and=b.prototype.and=a.prototype.and;a.prototype.or=function(a){return K(this,a,function(a,b){return a|b})};c.prototype.or=b.prototype.or=a.prototype.or;a.prototype.xor=function(a){return K(this,a,function(a,b){return a^b})};c.prototype.xor=b.prototype.xor=a.prototype.xor;var +g=q(m?1:0,p?1:0)!==0?u(-1):u(0);for(var +d=f.length-1;d>=0;d-=1)g=g.multiply(j).add(u(f[d]));return g}a.prototype.not=function(){return this.negate().prev()};c.prototype.not=b.prototype.not=a.prototype.not;a.prototype.and=function(a){return K(this,a,function(a,b){return a&b})};c.prototype.and=b.prototype.and=a.prototype.and;a.prototype.or=function(a){return K(this,a,function(a,b){return a|b})};c.prototype.or=b.prototype.or=a.prototype.or;a.prototype.xor=function(a){return K(this,a,function(a,b){return a^b})};c.prototype.xor=b.prototype.xor=a.prototype.xor;var I=1<<30,ab=(f&-f)*(f&-f)|I;function F(c){var a=c.value,b=typeof a==="number"?a|I:typeof a==="bigint"?a|g(I):a[0]+a[1]*f|ab;return b&-b}function S(b,a){if(a.compareTo(b)<=0){var -f=S(b,a.square(a)),d=f.p,c=f.e,e=d.multiply(a);return e.compareTo(b)<=0?{p:e,e:c*2+1}:{p:d,e:c*2}}return{p:t(1),e:0}}a.prototype.bitLength=function(){var -a=this;if(a.compareTo(t(0))<0)a=a.negate().subtract(t(1));if(a.compareTo(t(0))===0)return t(0);return t(S(a,t(2)).e).add(t(1))};c.prototype.bitLength=b.prototype.bitLength=a.prototype.bitLength;function +f=S(b,a.square(a)),d=f.p,c=f.e,e=d.multiply(a);return e.compareTo(b)<=0?{p:e,e:c*2+1}:{p:d,e:c*2}}return{p:u(1),e:0}}a.prototype.bitLength=function(){var +a=this;if(a.compareTo(u(0))<0)a=a.negate().subtract(u(1));if(a.compareTo(u(0))===0)return u(0);return u(S(a,u(2)).e).add(u(1))};c.prototype.bitLength=b.prototype.bitLength=a.prototype.bitLength;function U(a,b){a=e(a);b=e(b);return a.greater(b)?a:b}function M(a,b){a=e(a);b=e(b);return a.lesser(b)?a:b}function R(a,b){a=e(a).abs();b=e(b).abs();if(a.equals(b))return a;if(a.isZero())return b;if(b.isZero())return a;var @@ -990,141 +1037,168 @@ ai(a,b){a=e(a);b=e(b);var g=M(a,b),n=U(a,b),h=n.subtract(g).add(1);if(h.isSmall)return g.add(Math.floor(Math.random()*h));var j=z(h,f).value,l=[],k=true;for(var c=0;c=i){if(c===X&&i===1)continue;throw new -Error(c+" is not a valid digit in base "+g+bB)}}g=e(g);var +f)if(f[c]>=i){if(c===Y&&i===1)continue;throw new +Error(c+" is not a valid digit in base "+g+bn)}}g=e(g);var h=[],j=b[0]===aC;for(a=j?1:0;a=0;a--){b=b.add(e[a].times(c));c=c.times(f)}return g?b.negate():b}function -aj(b,a){a=a||O;if(b=0){e=c.divmod(b);c=e.quotient;var d=e.remainder;if(d.isNegative()){d=b.minus(d).abs();c=c.next()}g.push(d.toJSNumber())}g.push(c.toJSNumber());return{value:g.reverse(),isNegative:f}}function aa(d,c,b){var -a=z(d,c);return(a.isNegative?aC:u)+a.value.map(function(a){return aj(a,b)}).join(u)}a.prototype.toArray=function(a){return z(this,a)};b.prototype.toArray=function(a){return z(this,a)};c.prototype.toArray=function(a){return z(this,a)};a.prototype.toString=function(a,f){if(a===A)a=10;if(a!==10)return aa(this,a,f);var +a=z(d,c);return(a.isNegative?aC:o)+a.value.map(function(a){return aj(a,b)}).join(o)}a.prototype.toArray=function(a){return z(this,a)};b.prototype.toArray=function(a){return z(this,a)};c.prototype.toArray=function(a){return z(this,a)};a.prototype.toString=function(a,f){if(a===A)a=10;if(a!==10)return aa(this,a,f);var d=this.value,c=d.length,e=String(d[--c]),h="0000000",b;while(--c>=0){b=String(d[c]);e+=h.slice(b.length)+b}var -g=this.sign?aC:u;return g+e};b.prototype.toString=function(a,b){if(a===A)a=10;if(a!=10)return aa(this,a,b);return String(this.value)};c.prototype.toString=b.prototype.toString;c.prototype.toJSON=a.prototype.toJSON=b.prototype.toJSON=function(){return this.toString()};a.prototype.valueOf=function(){return parseInt(this.toString(),10)};a.prototype.toJSNumber=a.prototype.valueOf;b.prototype.valueOf=function(){return this.value};b.prototype.toJSNumber=b.prototype.valueOf;c.prototype.valueOf=c.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};function -Y(d){if(m(+d)){var -n=+d;if(n===r(n))return H?new +g=this.sign?aC:o;return g+e};b.prototype.toString=function(a,b){if(a===A)a=10;if(a!=10)return aa(this,a,b);return String(this.value)};c.prototype.toString=b.prototype.toString;c.prototype.toJSON=a.prototype.toJSON=b.prototype.toJSON=function(){return this.toString()};a.prototype.valueOf=function(){return parseInt(this.toString(),10)};a.prototype.toJSNumber=a.prototype.valueOf;b.prototype.valueOf=function(){return this.value};b.prototype.toJSNumber=b.prototype.valueOf;c.prototype.valueOf=c.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};function +X(d){if(m(+d)){var +n=+d;if(n===s(n))return H?new c(g(n)):new b(n);throw new -Error(ew+d)}var -s=d[0]===aC;if(s)d=d.slice(1);var +Error(eM+d)}var +q=d[0]===aC;if(q)d=d.slice(1);var h=d.split(/e/i);if(h.length>2)throw new -Error(ew+h.join(eB));if(h.length===2){var -e=h[1];if(e[0]===bA)e=e.slice(1);e=+e;if(e!==r(e)||!m(e))throw new -Error(ew+e+" is not a valid exponent.");var -f=h[0],i=f.indexOf(bB);if(i>=0){e-=f.length-i-1;f=f.slice(0,i)+f.slice(i+1)}if(e<0)throw new +Error(eM+h.join(eS));if(h.length===2){var +e=h[1];if(e[0]===bI)e=e.slice(1);e=+e;if(e!==s(e)||!m(e))throw new +Error(eM+e+" is not a valid exponent.");var +f=h[0],i=f.indexOf(bn);if(i>=0){e-=f.length-i-1;f=f.slice(0,i)+f.slice(i+1)}if(e<0)throw new Error("Cannot include negative exponent part for integers");f+=new Array(e+1).join(k);d=f}var t=/^([0-9][0-9]*)$/.test(d);if(!t)throw new -Error(ew+d);if(H)return new -c(g(s?aC+d:d));var -p=[],j=d.length,o=ac,l=j-o;while(j>0){p.push(+d.slice(l,j));l-=o;if(l<0)l=0;j-=o}q(p);return new -a(p,s)}function +Error(eM+d);if(H)return new +c(g(q?aC+d:d));var +p=[],j=d.length,o=ac,l=j-o;while(j>0){p.push(+d.slice(l,j));l-=o;if(l<0)l=0;j-=o}r(p);return new +a(p,q)}function ah(a){if(H)return new -c(g(a));if(m(a)){if(a!==r(a))throw new +c(g(a));if(m(a)){if(a!==s(a))throw new Error(a+" is not an integer.");return new -b(a)}return Y(a.toString())}function +b(a)}return X(a.toString())}function e(a){if(typeof a==="number")return ah(a);if(typeof -a==="string")return Y(a);if(typeof +a==="string")return X(a);if(typeof a==="bigint")return new c(a);return a}for(var -l=0;l0)d[-l]=e(-l)}d.one=d[1];d.zero=d[0];d.minusOne=d[-1];d.max=U;d.min=M;d.gcd=R;d.lcm=af;d.isInstance=function(d){return d +l=0;l0)d[-l]=e(-l)}d.one=d[1];d.zero=d[0];d.minusOne=d[-1];d.max=U;d.min=M;d.gcd=R;d.lcm=af;d.isInstance=function(d){return d instanceof a||d instanceof b||d instanceof c};d.randBetween=ai;d.fromArray=function(b,a,c){return W(b.map(e),e(a||10),c)};return d}();function -aJ(a){var -b=a.toJSNumber()|0;if(a.equals(t(b)))return b;return a}function -Fg(a){return aJ(t(a).abs())}function -M(a,b){return aJ(t(a).add(t(b)))}function -cj(a,b){return t(a).compare(t(b))}function -k1(b,a){a=t(a);if(a.equals(t(0)))cQ();return aJ(t(b).divide(t(a)))}function -Fo(b,a){a=t(a);if(a.equals(t(0)))cQ();return aJ(t(b).mod(a))}function -k2(a,b){return[0,k1(a,b),Fo(a,b)]}function -k3(a,b){return k1(a,b)}function -Fh(a,b){return t(a).equals(t(b))}function -Fj(a,b){return aJ(t.gcd(t(a),t(b)).abs())}function -E_(c,e,g){e=t(e);var +aK(a){var +b=a.toJSNumber()|0;if(a.equals(u(b)))return b;return a}function +HG(a){return aK(u(a).abs())}function +N(a,b){return aK(u(a).add(u(b)))}function +cq(a,b){return u(a).compare(u(b))}function +mO(b,a){a=u(a);if(a.equals(u(0)))cX();return aK(u(b).divide(u(a)))}function +HO(b,a){a=u(a);if(a.equals(u(0)))cX();return aK(u(b).mod(a))}function +mP(a,b){return[0,mO(a,b),HO(a,b)]}function +mQ(a,b){return mO(a,b)}function +HH(a,b){return u(a).equals(u(b))}function +HJ(a,b){return aK(u.gcd(u(a),u(b)).abs())}function +Hy(c,e,g){e=u(e);var a=e.toArray(Math.pow(2,32));c.write(8,a.isNegative?1:0);var f=a.value.length,d=f*4;c.write(32,d);for(var -b=f-1;b>=0;b--){c.write(8,a.value[b]>>>0&aX);c.write(8,a.value[b]>>>8&aX);c.write(8,a.value[b]>>>16&aX);c.write(8,a.value[b]>>>24&aX)}g[0]=4*(1+((d+3)/4|0));g[1]=8*(1+((d+7)/8|0))}function -E$(b,g){var +b=f-1;b>=0;b--){c.write(8,a.value[b]>>>0&a1);c.write(8,a.value[b]>>>8&a1);c.write(8,a.value[b]>>>16&a1);c.write(8,a.value[b]>>>24&a1)}g[0]=4*(1+((d+3)/4|0));g[1]=8*(1+((d+7)/8|0))}function +Hz(b,g){var e;switch(b.read8u()){case 1:e=true;break;case -0:e=false;break;default:cg("input_value: z (malformed input)")}var -f=b.read32u(),c=t(0);for(var +0:e=false;break;default:b$("input_value: z (malformed input)")}var +f=b.read32u(),c=u(0);for(var d=0;d>>0);c=a.shiftLeft(d*32).add(c)}if(e)c=c.negate();g[0]=f+4;return aJ(c)}function -Fk(d){var -b=t(d).toArray(Math.pow(2,32)),a=0;for(var -c=0;c>>0);c=a.shiftLeft(d*32).add(c)}if(e)c=c.negate();g[0]=f+4;return aK(c)}function +HK(d){var +b=u(d).toArray(Math.pow(2,32)),a=0;for(var +c=0;c=48&&a<=57)return a-48;if(a>=97&&a<=cB)return a-97+10;if(a>=65&&a<=70)return a-65+10}var +if(d==lF||d=="X")c=16;else +if(d=="b"||d=="B")c=2;if(c!=10){a=a.substring(b+1);if(g==-1)a=aC+a}}}}if(a[0]==bI)a=a.substring(1);a=a.replace(/^0+/,o);if(a==aC||a==o)a=k;function +h(a){if(a>=48&&a<=57)return a-48;if(a>=97&&a<=cI)return a-97+10;if(a>=65&&a<=70)return a-65+10}var e=0;if(a[e]==aC)e++;for(;e=c)ag("Z.of_substring_base: invalid digit")}return aJ(t(a,c))}function -ck(d,a,b,c){a=ba(a);if(b!=0||c!=a.length){if(a.length-b=0?1:0}function -eR(a){a=t(a);if(!Fi(a))eN(eM(fS));var -b=t(i9),d=a.and(b).toJSNumber(),c=a.shiftRight(32).and(b).toJSNumber(),e=kR(d,c);return e}function -eS(){return new -Date().getTime()/a4}function -cV(e){var +f=h(a.charCodeAt(e));if(f==undefined||f>=c)ah("Z.of_substring_base: invalid digit")}return aK(u(a,c))}function +cr(d,a,b,c){a=bf(a);if(b!=0||c!=a.length){if(a.length-b=0?1:0}function +e7(a){a=u(a);if(!HI(a))e3(bQ(gf));var +b=u(kl),d=a.and(b).toJSNumber(),c=a.shiftRight(32).and(b).toJSNumber(),e=mB(d,c);return e}function +e8(){return new +Date().getTime()/a8}function +c2(e){var a=new -Date(e*a4),b=a.getTime(),d=new -Date(Date.UTC(a.getUTCFullYear(),0,1)).getTime(),c=Math.floor((b-d)/h$);return[0,a.getUTCSeconds(),a.getUTCMinutes(),a.getUTCHours(),a.getUTCDate(),a.getUTCMonth(),a.getUTCFullYear()-bZ,a.getUTCDay(),c,false|0]}function -eT(){return 0}function -Fr(h){var +Date(e*a8),b=a.getTime(),d=new +Date(Date.UTC(a.getUTCFullYear(),0,1)).getTime(),c=Math.floor((b-d)/iY);return[0,a.getUTCSeconds(),a.getUTCMinutes(),a.getUTCHours(),a.getUTCDate(),a.getUTCMonth(),a.getUTCFullYear()-b3,a.getUTCDay(),c,false|0]}function +e9(){return 0}function +HS(h){var a=new -Date(h*a4),b=a.getTime(),e=new -Date(a.getFullYear(),0,1).getTime(),c=Math.floor((b-e)/h$),d=new +Date(h*a8),b=a.getTime(),e=new +Date(a.getFullYear(),0,1).getTime(),c=Math.floor((b-e)/iY),d=new Date(a.getFullYear(),0,1),f=new -Date(a.getFullYear(),6,1),g=Math.max(d.getTimezoneOffset(),f.getTimezoneOffset());return[0,a.getSeconds(),a.getMinutes(),a.getHours(),a.getDate(),a.getMonth(),a.getFullYear()-bZ,a.getDay(),c,a.getTimezoneOffset()f)a+=eG;var +c=e[d];if(typeof +c=="number")a+=c.toString();else +if(c +instanceof +bv)a+=ex+c.toString()+ex;else +if(typeof +c=="string")a+=ex+c.toString()+ex;else +a+=lm}a+=")"}else +if(b[0]==O)a+=b[1];return a}function +mx(a){if(a +instanceof +Array&&(a[0]==0||a[0]==O)){var +c=bQ(kL);if(c)c(a,false);else{var +d=GN(a),b=bQ(ix);if(b)b(0);B.console.error(gv+d+iN)}}else +throw a}function +Hp(){var +a=B;if(a.process&&a.process.on)a.process.on("uncaughtException",function(b,c){mx(b);a.process.exit(2)});else +if(a.addEventListener)a.addEventListener("error",function(a){if(a.error)mx(a.error)})}Hp();function +c(a,b){return a.length==1?a(b):be(a,[b])}function +h(a,b,c){return a.length==2?a(b,c):be(a,[b,c])}function +R(a,b,c,d){return a.length==3?a(b,c,d):be(a,[b,c,d])}function +f4(a,b,c,d,e,f){return a.length==5?a(b,c,d,e,f):be(a,[b,c,d,e,f])}function +GB(a,b,c,d,e,f,g,h){return a.length==7?a(b,c,d,e,f,g,h):be(a,[b,c,d,e,f,g,h])}GO();var +e$=[O,a(km),-1],g6=[O,a(kM),-2],dT=[O,a(kQ),-3],g2=[O,a(ll),-4],g7=[O,a(jS),-6],aL=[O,a(ls),-7],g4=[O,a(iX),-8],g5=[O,a(lv),-9],J=[O,a(lR),-11],g8=[O,a(kA),gp],ht=[0,cj],GA=[4,0,0,0,[12,45,[4,0,0,0,0]]],fl=[0,[11,a('File "'),[2,0,[11,a('", line '),[4,0,0,0,[11,a(k5),[4,0,0,0,[12,45,[4,0,0,0,[11,a(": "),[2,0,0]]]]]]]]]],a('File "%s", line %d, characters %d-%d: %s')],cA=[0,0,0],el=[0,a(k$),a(k3),a(lw)];bb(11,g8,kA);bb(10,J,lR);bb(9,[O,a(jl),-10],jl);bb(8,g5,lv);bb(7,g4,iX);bb(6,aL,ls);bb(5,g7,jS);bb(4,[O,a(kR),-5],kR);bb(3,g2,ll);bb(2,dT,kQ);bb(1,g6,kM);bb(0,e$,km);var +m8=a("output_substring"),m5=a("%.12g"),m4=a(bn),m2=a("true"),m3=a("false"),mT=a("Stdlib.Exit"),mV=ca(0,0,lq),mX=ca(0,0,65520),mZ=ca(1,0,lq),m_=a("\\\\"),m$=a("\\'"),na=a("\\b"),nb=a("\\t"),nc=a("\\n"),nd=a("\\r"),m9=a("Char.chr"),nf=a("hd"),ni=a("String.blit / Bytes.blit_string"),nh=a("Bytes.blit"),ng=a("String.sub / Bytes.sub"),nk=a("String.contains_from / Bytes.contains_from"),nn=a("Array.blit"),nm=a("Array.sub"),ns=a("Map.remove_min_elt"),nt=[0,0,0,0],nu=[0,a("map.ml"),gm,10],nv=[0,0,0],no=a(es),np=a(es),nq=a(es),nr=a(es),nw=a("Stdlib.Queue.Empty"),ny=a("CamlinternalLazy.Undefined"),nF=a("Buffer.add_substring/add_subbytes"),nE=a("Buffer.add: cannot grow buffer"),nD=[0,a(lC),93,2],nC=[0,a(lC),94,2],nO=a("%c"),nP=a("%s"),nQ=a(kz),nR=a(iV),nS=a(lj),nT=a(kJ),nU=a("%f"),nV=a("%B"),nW=a("%{"),nX=a("%}"),nY=a("%("),nZ=a("%)"),n0=a("%a"),n1=a("%t"),n2=a("%?"),n3=a("%r"),n4=a("%_r"),n5=[0,a(aq),850,23],oe=[0,a(aq),814,21],n8=[0,a(aq),815,21],of=[0,a(aq),818,21],n9=[0,a(aq),819,21],og=[0,a(aq),822,19],n_=[0,a(aq),823,19],oh=[0,a(aq),826,22],n$=[0,a(aq),827,22],oi=[0,a(aq),831,30],oa=[0,a(aq),832,30],oc=[0,a(aq),836,26],n6=[0,a(aq),837,26],od=[0,a(aq),846,28],n7=[0,a(aq),847,28],ob=[0,a(aq),851,23],pk=a(jf),pi=[0,a(aq),1558,4],pj=a("Printf: bad conversion %["),pl=[0,a(aq),1626,39],pm=[0,a(aq),1649,31],pn=[0,a(aq),1650,31],po=a("Printf: bad conversion %_"),pp=a(ja),pq=a(jn),pr=a(ja),ps=a(jn),pg=a(gr),pe=a("neg_infinity"),pf=a(lX),pd=a(bn),oZ=a("%+nd"),o0=a("% nd"),o2=a("%+ni"),o3=a("% ni"),o4=a("%nx"),o5=a("%#nx"),o6=a("%nX"),o7=a("%#nX"),o8=a("%no"),o9=a("%#no"),oY=a("%nd"),o1=a(lj),o_=a("%nu"),oM=a("%+ld"),oN=a("% ld"),oP=a("%+li"),oQ=a("% li"),oR=a("%lx"),oS=a("%#lx"),oT=a("%lX"),oU=a("%#lX"),oV=a("%lo"),oW=a("%#lo"),oL=a("%ld"),oO=a(iV),oX=a("%lu"),oz=a("%+Ld"),oA=a("% Ld"),oC=a("%+Li"),oD=a("% Li"),oE=a("%Lx"),oF=a("%#Lx"),oG=a("%LX"),oH=a("%#LX"),oI=a("%Lo"),oJ=a("%#Lo"),oy=a("%Ld"),oB=a(kJ),oK=a("%Lu"),om=a("%+d"),on=a("% d"),op=a("%+i"),oq=a("% i"),or=a("%x"),os=a("%#x"),ot=a("%X"),ou=a("%#X"),ov=a("%o"),ow=a("%#o"),ol=a(gy),oo=a(kz),ox=a(jf),nG=a("@]"),nH=a("@}"),nI=a("@?"),nJ=a("@\n"),nK=a("@."),nL=a("@@"),nM=a("@%"),nN=a("@"),oj=a("CamlinternalFormat.Type_mismatch"),pw=a(o),px=[0,[11,a(eG),[2,0,[2,0,0]]],a(", %s%s")],pX=[0,[11,a(gv),[2,0,[12,10,0]]],a(lL)],pY=[0,[11,a("Fatal error in uncaught exception handler: exception "),[2,0,[12,10,0]]],a("Fatal error in uncaught exception handler: exception %s\n")],pW=a("Fatal error: out of memory in uncaught exception handler"),pU=[0,[11,a(gv),[2,0,[12,10,0]]],a(lL)],pP=[0,[2,0,[12,10,0]],a("%s\n")],pQ=[0,[11,a(i1),0],a(i1)],pH=a("Raised at"),pI=a("Re-raised at"),pJ=a("Raised by primitive operation at"),pK=a("Called from"),pL=a(" (inlined)"),pN=a(o),pM=[0,[2,0,[12,32,[2,0,[11,a(' in file "'),[2,0,[12,34,[2,0,[11,a(", line "),[4,0,0,0,[11,a(k5),GA]]]]]]]]]],a('%s %s in file "%s"%s, line %d, characters %d-%d')],pO=[0,[2,0,[11,a(" unknown location"),0]],a("%s unknown location")],pC=a("Out of memory"),pD=a("Stack overflow"),pE=a("Pattern matching failed"),pF=a("Assertion failed"),pG=a("Undefined recursive module"),py=[0,[12,40,[2,0,[2,0,[12,41,0]]]],a("(%s%s)")],pz=a(o),pA=a(o),pB=[0,[12,40,[2,0,[12,41,0]]],a("(%s)")],pv=[0,[4,0,0,0,0],a(gy)],pt=[0,[3,0,0],a("%S")],pu=a(lm),pR=[0,a(o),a("(Cannot print locations:\n bytecode executable program file not found)"),a("(Cannot print locations:\n bytecode executable program file appears to be corrupt)"),a("(Cannot print locations:\n bytecode executable program file has wrong magic number)"),a("(Cannot print locations:\n bytecode executable program file cannot be opened;\n -- too many open files. Try running with OCAMLRUNPARAM=b=2)")],p1=a("Fun.Finally_raised: "),pZ=a("Stdlib.Fun.Finally_raised"),p2=a(lF),Gy=a("OCAMLRUNPARAM"),Gw=a("CAMLRUNPARAM"),p3=a(o),qn=[3,0,3],qo=a(bn),qi=a(eT),qj=a("<\/"),qk=a(o),qe=a(eT),qf=a(gi),qg=a(o),qc=a("\n"),qb=[0,a(o)],p9=a(o),p_=a(o),p$=a(o),qa=a(o),p8=[0,a(o),0,a(o)],p7=a(o),p6=a("Stdlib.Format.String_tag"),qB=a(o),qG=a(jv),qI=a(mb),qJ=a(kp),qK=a(iM),qL=a(kk),qM=a(k0),qN=a(jL),qO=a(ld),qP=a(f$),qQ=a(jO),qR=a(lc),qS=a(kd),qT=a(le),qU=a(jK),qV=a(iw),qW=a(me),qX=a(iL),qY=a(iT),qZ=a(j6),q0=a(kK),q1=a(eQ),q2=a(i7),q3=a(l0),q4=a(li),q5=a(lJ),q6=a(kD),q7=a(eI),q8=a(gz),q9=a(i3),q_=a(i2),q$=a(j0),ra=a(l3),rb=a(lY),rc=a(l7),rd=a(jw),re=a(iW),rf=a(ji),rg=a(kU),rh=a(l$),ri=a(ka),rj=a(jB),rk=a(kn),rl=a(iS),rm=a(ke),rn=a(iz),ro=a(lg),rp=a(lU),rq=a(jz),rr=a(i5),rs=a(j9),rt=a(kE),ru=a(jR),rv=a(kO),rw=a(kj),rx=a(lf),ry=a(jN),rz=a(jx),rA=a(lB),rB=a(k8),rC=a(lN),rD=a(k4),rE=a(kZ),rF=a(kY),rG=a(iR),rH=a(jE),rI=a(jd),rJ=a(lp),rK=a(lG),rL=[0,[11,a("EUNKNOWNERR "),[4,0,0,0,0]],a("EUNKNOWNERR %d")],qH=[0,[11,a("Unix.Unix_error(Unix."),[2,0,[11,a(eG),[3,0,[11,a(eG),[3,0,[12,41,0]]]]]]],a("Unix.Unix_error(Unix.%s, %S, %S)")],qC=a(dE),qD=a(o),qE=a(o),qF=a(dE),rM=a("0.0.0.0"),rN=a("127.0.0.1"),Gv=a("::"),Gu=a("::1"),r3=a(o),r4=a(o),r_=[0,92],sa=a("\\( group not closed by \\)"),r$=[0,a(iD),gg,10],sb=a("[ class not closed by ]"),sc=a("spurious \\) in regular expression"),r6=a("too many r* or r+ where r is nullable"),r7=a(o),r8=a(o),r5=[0,a(iD),213,11],si=[0,a(kV),52,4],sh=[0,a(kV),58,34],sg=a("Not a valid time zone"),uu=a("Not a month"),us=a("Not a day"),up=a("from_business: bad week"),uq=a("from_business: bad date"),tC=[0,a(kF),jQ,4],tB=[0,a(kF),gE,4],tu=[0,-4713,12,31],tv=[0,k_,1,23],tw=[0,dy,10,14],tx=[0,dy,10,5],ts=a("Date.Out_of_bounds"),tt=a("Date.Undefined"),tS=a("Date.Period.Not_computable"),t1=[0,31,59,90,bY,f7,181,212,gx,273,304,334,ey],uy=[0,a(eL),429,6],ux=[0,a(eL),lz,4],uw=[0,a(eL),167,6],uv=[0,a(eL),67,4],uC=a("[a-zA-Z]+"),uI=ca(1,0,0),uD=a("Z.Overflow"),uF=a(gf),uM=a(o),uN=a("+inf"),uO=a("-inf"),uP=a(l4),uQ=a("undef"),uS=[0,a("q.ml"),486,25],uR=a("Q.of_string: invalid digit"),uK=a("impossible case"),uT=a("Runtime.EmptyError"),uU=a("Runtime.AssertionFailed"),uW=a("Runtime.ConflictError"),uY=a("Runtime.ImpossibleDate"),u0=a("Runtime.NoValueProvided"),FE=[0,a(a0),96,20,96,64,[0,a(a9),[0,a(aZ),[0,a(t),0]]]],FD=[0,a(aB),[0,a("allocations_familiales.avait_enfant_\xc3\xa0_charge_avant_1er_janvier_2012"),0]],FC=[0,a(aB),[0,a("allocations_familiales.enfants_\xc3\xa0_charge"),0]],FB=[0,a(aB),[0,a("allocations_familiales.date_courante"),0]],FA=[0,a(aB),[0,a("allocations_familiales.r\xc3\xa9sidence"),0]],Fz=[0,a(aB),[0,a("allocations_familiales.ressources_m\xc3\xa9nage"),0]],Fy=[0,a(a0),93,20,93,72,[0,a(a9),[0,a(aZ),[0,a(t),0]]]],Fx=[0,a(aB),[0,a("allocations_familiales.personne_charge_effective_permanente_remplit_titre_I"),0]],Fw=[0,a(a0),90,20,90,67,[0,a(a9),[0,a(aZ),[0,a(t),0]]]],Fv=[0,a(aB),[0,a("allocations_familiales.personne_charge_effective_permanente_est_parent"),0]],Fr=[0,0],Fs=[1,0],Ft=[2,0],Fc=[0,a(a0),72,12,72,25,[0,a(a9),[0,a(aZ),[0,a(t),0]]]],Fd=[0,a(aB),[0,a(eK),0]],Fe=[0,a(a0),73,12,73,19,[0,a(a9),[0,a(aZ),[0,a(t),0]]]],Ff=[0,a(aB),[0,a(lW),0]],Fg=[0,a(a0),76,12,76,29,[0,a(a9),[0,a(aZ),[0,a(t),0]]]],Fh=[0,a(aB),[0,a(kq),0]],Fi=[0,a(a0),77,12,77,21,[0,a(a9),[0,a(aZ),[0,a(t),0]]]],Fj=[0,a(aB),[0,a(eR),0]],Fk=[0,a(a0),79,12,79,59,[0,a(a9),[0,a(aZ),[0,a(t),0]]]],Fl=[0,a(aB),[0,a(lV),0]],Fm=[0,a(a0),80,12,80,64,[0,a(a9),[0,a(aZ),[0,a(t),0]]]],Fn=[0,a(aB),[0,a(iC),0]],Fo=[0,a(a0),81,12,81,56,[0,a(a9),[0,a(aZ),[0,a(t),0]]]],Fp=[0,a(aB),[0,a(j_),0]],Fq=[0,a(a0),74,12,74,28,[0,a(a9),[0,a(aZ),[0,a(t),0]]]],Fu=[0,a(aB),[0,a(kt),0]],FF=[0,a(aB),[0,a(iP),[0,a(e),0]]],FG=[0,a(aB),[0,a(iP),[0,a(e),0]]],FH=[0,a(a0),78,12,78,25,[0,a(a9),[0,a(aZ),[0,a(t),0]]]],FI=[0,a(aB),[0,a(jh),0]],EH=[0,a(e),[0,a(dv),[0,a(ay),0]]],EI=[0,a(e),[0,a(dv),0]],EJ=[0,a(e),[0,a(dv),[0,a(aA),0]]],EK=[0,a(e),[0,a(dv),0]],Er=[0,a(e),[0,a(bL),[0,a(ay),0]]],Es=[0,a(e),[0,a(bL),0]],Et=[0,a(e),[0,a(bL),[0,a(aA),0]]],Eu=[0,a(e),[0,a(bL),0]],Ev=a(cG),EA=a(kv),EB=a(dD),Ew=[0,a(e),[0,a(dr),[0,a(ay),0]]],Ex=[0,a(e),[0,a(dr),0]],Ey=[0,a(e),[0,a(dr),[0,a(aA),0]]],Ez=[0,a(e),[0,a(dr),0]],Eq=[0,a(q),eA,12,eA,50,[0,a(p),0]],Eh=a(a_),Ei=[0,a(X),272,5,274,41,[0,a(cM),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],Ej=a(a_),Ek=a(cG),El=a(a_),Ec=a(a_),Ed=[0,a(X),262,5,kg,42,[0,a(cM),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],Ee=a(a_),Ef=a(cG),Eg=a(a_),Eb=[0,a(X),lo,14,lo,55,[0,a(cM),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],Ea=a(k),D2=[0,a(e),[0,a(Z),[0,a(ay),0]]],D3=[0,a(e),[0,a(Z),0]],D4=[0,a(e),[0,a(Z),[0,a(aA),0]]],D5=[0,a(e),[0,a(Z),0]],D6=a(Y),D7=a(f_),D8=[0,a(X),382,5,385,23,[0,a(eO),[0,a(b4),[0,a(dp),[0,a(bN),[0,a(W),[0,a(x),0]]]]]]],D9=a("0.0567"),DT=[0,a(e),[0,a(Z),[0,a(ay),0]]],DU=[0,a(e),[0,a(Z),0]],DV=[0,a(e),[0,a(Z),[0,a(aA),0]]],DW=[0,a(e),[0,a(Z),0]],DX=a(Y),DY=a("11"),DZ=a(f_),D0=[0,a(X),373,5,f6,42,[0,a(eO),[0,a(b4),[0,a(dp),[0,a(bN),[0,a(W),[0,a(x),0]]]]]]],D1=a("0.0369"),DS=[0,a(X),22,14,22,40,[0,a(aV),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],DO=[0,a(e),[0,a(dw),[0,a(ay),0]]],DP=[0,a(e),[0,a(dw),0]],DQ=[0,a(e),[0,a(dw),[0,a(aA),0]]],DR=[0,a(e),[0,a(dw),0]],DN=[0,a(q),em,12,em,38,[0,a(p),0]],DJ=[8,0],DK=[0,a(v),lD,5,lD,24,[0,a(dB),[0,a(K),[0,a(L),[0,a(t),0]]]]],DH=a(Y),DI=[0,a(X),350,5,351,69,[0,a(eO),[0,a(b4),[0,a(dp),[0,a(bN),[0,a(W),[0,a(x),0]]]]]]],DG=[0,a(X),18,14,18,34,[0,a(aV),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],Dz=[0,a(e),[0,a(dA),[0,a(ay),0]]],DA=[0,a(e),[0,a(dA),0]],DB=[0,a(e),[0,a(dA),[0,a(aA),0]]],DC=[0,a(e),[0,a(dA),0]],DD=a(Y),Dq=[0,a(e),[0,a(Z),[0,a(ay),0]]],Dr=[0,a(e),[0,a(Z),0]],Ds=[0,a(e),[0,a(Z),[0,a(aA),0]]],Dt=[0,a(e),[0,a(Z),0]],Du=[0,a(a0),27,5,27,44,[0,a("R\xc3\xa8gles diverses"),[0,a(aZ),[0,a(t),0]]]],Dv=a(k),Dk=[0,a(e),[0,a(Z),[0,a(ay),0]]],Dl=[0,a(e),[0,a(Z),0]],Dm=[0,a(e),[0,a(Z),[0,a(aA),0]]],Dn=[0,a(e),[0,a(Z),0]],Do=[0,a(X),cL,3,cL,41,[0,a(aV),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],Dp=a("0.04"),De=[0,a(e),[0,a(Z),[0,a(ay),0]]],Df=[0,a(e),[0,a(Z),0]],Dg=[0,a(e),[0,a(Z),[0,a(aA),0]]],Dh=[0,a(e),[0,a(Z),0]],Di=[0,a(X),95,3,96,44,[0,a(aV),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],Dj=a(jo),C_=[0,a(e),[0,a(Z),[0,a(ay),0]]],C$=[0,a(e),[0,a(Z),0]],Da=[0,a(e),[0,a(Z),[0,a(aA),0]]],Db=[0,a(e),[0,a(Z),0]],Dc=[0,a(X),55,3,55,41,[0,a(aV),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],Dd=a(f5),C9=[0,a(o),0,1,0,1,0],C8=[0,a(q),eJ,12,eJ,48,[0,a(p),0]],CY=[0,a(X),cQ,3,cQ,41,[0,a(aV),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],CZ=a(Y),C0=a(jo),C1=a(k),CU=[0,a(X),74,3,75,44,[0,a(aV),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],CV=a(Y),CW=a(f5),CX=a(k),CQ=[0,a(X),35,3,35,41,[0,a(aV),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],CR=a(Y),CS=a(lP),CT=a(k),CP=[0,a(o),0,1,0,1,0],CI=[0,a(X),cQ,3,cQ,41,[0,a(aV),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],CJ=a(az),CK=a(az),CL=a("0.1025"),CM=a(k),CD=[0,a(X),74,3,75,44,[0,a(aV),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],CE=a(az),CF=a(az),CG=a("0.205"),CH=a(k),Cy=[0,a(X),35,3,35,41,[0,a(aV),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],Cz=a(az),CA=a(az),CB=a("0.41"),CC=a(k),Cx=[0,a(o),0,1,0,1,0],Ct=[0,a(X),gx,5,gx,43,[0,a(cM),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],Cu=a("0.0559"),Cr=[0,a(X),229,5,lz,46,[0,a(cM),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],Cs=a("0.1117"),Cp=[0,a(X),js,5,js,43,[0,a(cM),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],Cq=a("0.20234"),Co=[0,a(o),0,1,0,1,0],Ch=a(a_),Ci=[0,a(X),170,5,171,68,[0,a(aV),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],Cj=a(a_),Ck=a(cG),Cl=a(a_),Cc=a(a_),Cd=[0,a(X),162,5,163,68,[0,a(aV),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],Ce=a(a_),Cf=a(cG),Cg=a(a_),Cb=[0,a(X),iv,14,iv,34,[0,a(aV),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],Ca=a(k),B$=[0,a(q),eu,12,eu,32,[0,a(p),0]],B4=[0,a(e),[0,a(bo),[0,a(ay),0]]],B5=[0,a(e),[0,a(bo),0]],B6=[0,a(e),[0,a(bo),[0,a(aA),0]]],B7=[0,a(e),[0,a(bo),0]],B8=[0,a(am),313,5,lH,58,[0,a(lK),[0,a(H),[0,a(I),[0,a(F),[0,a(al),[0,a(x),0]]]]]]],BV=[0,a(e),[0,a(dF),[0,a(ay),0]]],BW=[0,a(e),[0,a(dF),0]],BX=[0,a(e),[0,a(dF),[0,a(aA),0]]],BY=[0,a(e),[0,a(dF),0]],BZ=[0,a(e),[0,a(bo),[0,a(ay),0]]],B0=[0,a(e),[0,a(bo),0]],B1=[0,a(e),[0,a(bo),[0,a(aA),0]]],B2=[0,a(e),[0,a(bo),0]],B3=[0,a(am),299,5,300,58,[0,a(lK),[0,a(H),[0,a(I),[0,a(F),[0,a(al),[0,a(x),0]]]]]]],BU=[0,a(q),cL,12,cL,35,[0,a(p),0]],E4=[8,0],E5=a(Y),E6=[0,a(v),344,5,345,72,[0,a(dB),[0,a(K),[0,a(L),[0,a(t),0]]]]],E2=a(Y),E3=[0,a(am),406,5,407,72,[0,a(gj),[0,a(b4),[0,a(eE),[0,a(bN),[0,a(al),[0,a(x),0]]]]]]],E0=a(az),E1=[0,a(am),ev,5,ev,70,[0,a(mg),[0,a(H),[0,a(I),[0,a(F),[0,a(al),[0,a(x),0]]]]]]],BG=[0,a(e),[0,a(bL),[0,a(ay),0]]],BH=[0,a(e),[0,a(bL),0]],BI=[0,a(e),[0,a(bL),[0,a(aA),0]]],BJ=[0,a(e),[0,a(bL),0]],BK=a(cG),BL=a(kv),BM=a(dD),Bx=[0,a(v),l9,5,l9,49,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],By=a(k),Bz=a("5728"),BA=a(k),Bt=[0,a(v),497,5,498,53,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],Bu=a(k),Bv=a("0.0717"),Bw=a(k),Bp=[0,a(v),489,5,490,53,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],Bq=a(k),Br=a("0.0847"),Bs=a(k),Bl=[0,a(v),481,5,482,53,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],Bm=a(k),Bn=a("0.0976"),Bo=a(k),Bh=[0,a(v),473,5,474,53,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],Bi=a(k),Bj=a("0.115"),Bk=a(k),Bd=[0,a(v),465,5,466,53,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],Be=a(k),Bf=a("0.1163"),Bg=a(k),A$=[0,a(v),457,5,458,53,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],Ba=a(k),Bb=a("0.122"),Bc=a(k),A7=[0,a(v),449,5,450,53,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],A8=a(k),A9=a("0.1278"),A_=a(k),A3=[0,a(v),441,5,442,53,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],A4=a(k),A5=a("0.1335"),A6=a(k),AZ=[0,a(v),433,5,434,53,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],A0=a(k),A1=a("0.1393"),A2=a(k),AV=[0,a(v),425,5,jr,53,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],AW=a(k),AX=a("0.145"),AY=a(k),AU=[0,a(v),l_,14,l_,57,[0,a(dB),[0,a(K),[0,a(L),[0,a(t),0]]]]],AR=a(k),AS=a(jj),AT=a(k),AL=[0,a(v),j$,5,j$,69,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],AM=a(Y),AN=a("0.3068"),AO=a(k),AH=[0,a(v),jt,5,jt,69,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],AI=a(Y),AJ=a("0.2936"),AK=a(k),AD=[0,a(v),jU,5,jU,69,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],AE=a(Y),AF=a("0.284"),AG=a(k),Az=[0,a(v),la,5,la,69,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],AA=a(Y),AB=a("0.2672"),AC=a(k),Av=[0,a(v),jk,5,jk,69,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],Aw=a(Y),Ax=a("0.273"),Ay=a(k),Ar=[0,a(v),j4,5,j4,69,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],As=a(Y),At=a("0.2555"),Au=a(k),An=[0,a(v),jV,5,jV,69,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],Ao=a(Y),Ap=a("0.2496"),Aq=a(k),Aj=[0,a(v),lA,5,lA,69,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],Ak=a(Y),Al=a("0.2437"),Am=a(k),Af=[0,a(v),gg,5,gg,69,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],Ag=a(Y),Ah=a("0.2379"),Ai=a(k),Ab=[0,a(v),kX,5,kX,69,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],Ac=a(Y),Ad=a("0.232"),Ae=a(k),Aa=[0,a(v),lI,14,lI,58,[0,a(dB),[0,a(K),[0,a(L),[0,a(t),0]]]]],z9=a(Y),z_=a(lP),z$=a(k),z3=[0,a(v),lE,5,lE,69,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],z4=a(az),z5=a("0.143"),z6=a(k),zZ=[0,a(v),ky,5,ky,69,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],z0=a(az),z1=a("0.1259"),z2=a(k),zV=[0,a(v),ks,5,ks,69,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],zW=a(az),zX=a("0.1089"),zY=a(k),zR=[0,a(v),iA,5,iA,69,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],zS=a(az),zT=a("0.0918"),zU=a(k),zN=[0,a(v),lZ,5,lZ,69,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],zO=a(az),zP=a("0.0842"),zQ=a(k),zJ=[0,a(v),l6,5,l6,69,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],zK=a(az),zL=a("0.0766"),zM=a(k),zF=[0,a(v),lT,5,lT,69,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],zG=a(az),zH=a("0.069"),zI=a(k),zB=[0,a(v),je,5,je,69,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],zC=a(az),zD=a("0.075"),zE=a(k),zx=[0,a(v),kI,5,kI,69,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],zy=a(az),zz=a("0.0539"),zA=a(k),zt=[0,a(v),jJ,5,jJ,69,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],zu=a(az),zv=a(jF),zw=a(k),zs=[0,a(v),f6,14,f6,59,[0,a(dB),[0,a(K),[0,a(L),[0,a(t),0]]]]],zp=a(az),zq=a(f5),zr=a(k),zg=a(Y),zh=[0,a(am),420,6,421,72,[0,a(gj),[0,a(b4),[0,a(eE),[0,a(bN),[0,a(al),[0,a(x),0]]]]]]],zb=[0,a(ac),[0,a(dx),[0,a(ay),0]]],zc=[0,a(ac),[0,a(dx),0]],zd=[0,a(ac),[0,a(dx),[0,a(aA),0]]],ze=[0,a(ac),[0,a(dx),0]],zf=[0,a(am),jQ,5,125,59,[0,a(mg),[0,a(H),[0,a(I),[0,a(F),[0,a(al),[0,a(x),0]]]]]]],za=[0,a(q),bd,12,bd,36,[0,a(p),0]],y5=[0,a(v),l1,5,l1,69,[0,a(b5),[0,a(j3),[0,a(b1),[0,a(t),0]]]]],y6=a(jm),y7=a("5827900"),y2=[0,a(v),bu,5,bu,69,[0,a(jI),[0,a(b1),[0,a(t),0]]]],y3=a(lk),y4=a("5775900"),yZ=[0,a(v),bY,5,bY,69,[0,a(iE),[0,a(b1),[0,a(t),0]]]],y0=a(lQ),y1=a("5684900"),yW=[0,a(v),87,5,87,69,[0,a(l2),[0,a(b1),[0,a(t),0]]]],yX=a(lb),yY=a("5628600"),yV=[0,a(X),jc,14,jc,30,[0,a(ko),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],yT=a(md),yU=a("5595000"),yO=[0,a(v),j1,5,j1,69,[0,a(b5),[0,a(j3),[0,a(b1),[0,a(t),0]]]]],yP=a(jm),yQ=a("8155800"),yL=[0,a(v),jG,5,jG,69,[0,a(jI),[0,a(b1),[0,a(t),0]]]],yM=a(lk),yN=a("8083100"),yI=[0,a(v),bd,5,bd,69,[0,a(iE),[0,a(b1),[0,a(t),0]]]],yJ=a(lQ),yK=a("7955800"),yF=[0,a(v),94,5,94,69,[0,a(l2),[0,a(b1),[0,a(t),0]]]],yG=a(lb),yH=a("7877000"),yE=[0,a(X),lO,14,lO,31,[0,a(ko),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],yC=a(md),yD=a("7830000"),yu=[0,a(ac),[0,a(dt),[0,a(ay),0]]],yv=[0,a(ac),[0,a(dt),0]],yw=[0,a(ac),[0,a(dt),[0,a(aA),0]]],yx=[0,a(ac),[0,a(dt),0]],yr=[0,a(jb),83,19,83,69,[0,a("Article R521-1"),[0,a(H),[0,a(I),[0,a(F),[0,a(kS),[0,a(x),0]]]]]]],yq=a("14"),yp=[0,a(q),eF,12,eF,39,[0,a(p),0]],yl=[0,a(e),[0,a("enfant_le_plus_\xc3\xa2g\xc3\xa9.enfants"),0]],yi=[0,a(e),[0,a("prestations_familiales.r\xc3\xa9sidence"),0]],yg=[1,0],yh=[0,a(e),[0,a("prestations_familiales.prestation_courante"),0]],yf=[0,a(e),[0,a("prestations_familiales.date_courante"),0]],x4=[0,a(am),269,5,270,48,[0,a(bs),[0,a(H),[0,a(I),[0,a(F),[0,a(al),[0,a(x),0]]]]]]],x5=[0,0],x2=[0,a(am),kB,5,259,56,[0,a(bs),[0,a(H),[0,a(I),[0,a(F),[0,a(al),[0,a(x),0]]]]]]],x3=[1,0],x0=[0,a(am),kP,5,kP,70,[0,a(bs),[0,a(H),[0,a(I),[0,a(F),[0,a(al),[0,a(x),0]]]]]]],x1=[0,0],xY=[0,a(am),k7,5,k7,69,[0,a(bs),[0,a(H),[0,a(I),[0,a(F),[0,a(al),[0,a(x),0]]]]]]],xZ=[0,0],xW=[0,a(am),jH,5,jH,60,[0,a(bs),[0,a(H),[0,a(I),[0,a(F),[0,a(al),[0,a(x),0]]]]]]],xX=[0,0],xV=[0,a(o),0,1,0,1,0],xU=[0,a(q),cj,12,cj,21,[0,a(p),0]],xQ=[0,a(am),263,5,kg,48,[0,a(bs),[0,a(H),[0,a(I),[0,a(F),[0,a(al),[0,a(x),0]]]]]]],xR=[0,0],xO=[0,a(am),lt,5,du,56,[0,a(bs),[0,a(H),[0,a(I),[0,a(F),[0,a(al),[0,a(x),0]]]]]]],xP=[2,0],xM=[0,a(am),jq,5,jq,70,[0,a(bs),[0,a(H),[0,a(I),[0,a(F),[0,a(al),[0,a(x),0]]]]]]],xN=[1,0],xK=[0,a(am),jW,5,jW,69,[0,a(bs),[0,a(H),[0,a(I),[0,a(F),[0,a(al),[0,a(x),0]]]]]]],xL=[0,0],xI=[0,a(am),k9,5,k9,60,[0,a(bs),[0,a(H),[0,a(I),[0,a(F),[0,a(al),[0,a(x),0]]]]]]],xJ=[0,0],xH=[0,a(o),0,1,0,1,0],xG=[0,a(q),cI,12,cI,27,[0,a(p),0]],xt=[0,a(q),90,12,90,59,[0,a(p),0]],xu=[0,a(e),[0,a(lV),0]],xv=[0,a(q),91,12,91,64,[0,a(p),0]],xw=[0,a(e),[0,a(iC),0]],xx=[0,a(q),92,12,92,29,[0,a(p),0]],xy=[0,a(e),[0,a(kq),0]],xz=[0,a(q),93,12,93,21,[0,a(p),0]],xA=[0,a(e),[0,a(eR),0]],xB=[0,a(q),96,12,96,25,[0,a(p),0]],xC=[0,a(e),[0,a(eK),0]],xD=[0,a(q),99,12,99,28,[0,a(p),0]],xE=[0,a(e),[0,a(kt),0]],xF=[0,a(q),cI,12,cI,27,[0,a(p),0]],xS=[0,a(e),[0,a(bL),0]],xT=[0,a(q),cj,12,cj,21,[0,a(p),0]],x6=[0,a(e),[0,a("versement"),0]],x7=[0,a(q),bY,12,bY,56,[0,a(p),0]],x8=[0,a(e),[0,a(j_),0]],x_=a(eN),x9=[0,a(q),f7,12,f7,33,[0,a(p),0]],x$=[0,a(e),[0,a("nombre_enfants_l521_1"),0]],yb=a(eN),ya=[0,a(q),bu,12,bu,42,[0,a(p),0]],yc=[0,a(e),[0,a("nombre_enfants_alin\xc3\xa9a_2_l521_3"),0]],yd=[0,a(e),[0,a(jP),[0,a(gs),0]]],ye=[0,a(e),[0,a(jP),[0,a(gs),0]]],yj=[0,a(e),[0,a(lx),[0,a(ac),0]]],yk=[0,a(e),[0,a(lx),[0,a(ac),0]]],ym=[0,a(e),[0,a(kf),[0,a(eP),0]]],yn=[0,a(e),[0,a(kf),[0,a(eP),0]]],yo=[0,a(q),eF,12,eF,39,[0,a(p),0]],ys=[0,a(e),[0,a(bo),0]],yt=[0,a(q),aW,12,aW,62,[0,a(p),0]],yy=[0,a(e),[0,a("enfants_\xc3\xa0_charge_droit_ouvert_prestation_familiale"),0]],yz=[0,a(q),kW,12,kW,34,[0,a(p),0]],yA=[0,a(e),[0,a(dF),0]],yB=[0,a(q),jY,12,jY,29,[0,a(p),0]],yR=[0,a(e),[0,a("plafond_II_d521_3"),0]],yS=[0,a(q),ju,12,ju,28,[0,a(p),0]],y8=[0,a(e),[0,a("plafond_I_d521_3"),0]],E$=a(Y),Fa=[0,a(am),jr,5,427,71,[0,a(gj),[0,a(b4),[0,a(eE),[0,a(bN),[0,a(al),[0,a(x),0]]]]]]],y9=[0,a(q),kw,12,kw,35,[0,a(p),0]],y_=[0,a(e),[0,a("droit_ouvert_compl\xc3\xa9ment"),0]],y$=[0,a(q),bd,12,bd,36,[0,a(p),0]],zi=[0,a(e),[0,a(dA),0]],zk=a(eN),zl=a(eN),zm=a(jF),E_=a(k),zj=[0,a(q),dz,12,dz,65,[0,a(p),0]],zn=[0,a(e),[0,a("montant_initial_base_quatri\xc3\xa8me_enfant_et_plus_mayotte"),0]],zo=[0,a(q),kx,12,kx,57,[0,a(p),0]],z7=[0,a(e),[0,a("montant_initial_base_troisi\xc3\xa8me_enfant_mayotte"),0]],z8=[0,a(q),gE,12,gE,56,[0,a(p),0]],AP=[0,a(e),[0,a("montant_initial_base_deuxi\xc3\xa8me_enfant_mayotte"),0]],AQ=[0,a(q),iJ,12,iJ,55,[0,a(p),0]],BB=[0,a(e),[0,a("montant_initial_base_premier_enfant_mayotte"),0]],BC=[0,a(q),iQ,12,iQ,32,[0,a(p),0]],BD=[0,a(e),[0,a("nombre_total_enfants"),0]],BF=a(dD),BE=[0,a(q),gt,12,gt,32,[0,a(p),0]],BN=[0,a(e),[0,a("nombre_moyen_enfants"),0]],E7=a(Y),E8=[0,a(X),kC,5,360,71,[0,a(eO),[0,a(b4),[0,a(dp),[0,a(bN),[0,a(W),[0,a(x),0]]]]]]],E9=a(jj),BP=a(k),BO=[0,a(q),gB,12,gB,47,[0,a(p),0]],BQ=[0,a(e),[0,a("montant_initial_base_premier_enfant"),0]],BR=[0,a(q),kr,12,kr,29,[0,a(p),0]],BS=[0,a(e),[0,a("droit_ouvert_base"),0]],BT=[0,a(q),cL,12,cL,35,[0,a(p),0]],B9=[0,a(e),[0,a(Z),0]],B_=[0,a(q),eu,12,eu,32,[0,a(p),0]],Cm=[0,a(e),[0,a(dH),0]],Cn=[0,a(q),ck,12,ck,48,[0,a(p),0]],Cv=[0,a(e),[0,a("montant_vers\xc3\xa9_forfaitaire_par_enfant"),0]],Cw=[0,a(q),gC,12,gC,57,[0,a(p),0]],CN=[0,a(e),[0,a("montant_initial_base_troisi\xc3\xa8me_enfant_et_plus"),0]],CO=[0,a(q),gD,12,gD,48,[0,a(p),0]],C2=[0,a(e),[0,a("montant_initial_base_deuxi\xc3\xa8me_enfant"),0]],C4=a(dD),C5=a(dD),C3=[0,a(q),cQ,12,cQ,39,[0,a(p),0]],C6=[0,a(e),[0,a("rapport_enfants_total_moyen"),0]],C7=[0,a(q),eJ,12,eJ,48,[0,a(p),0]],Dw=[0,a(e),[0,a(dw),0]],Dy=a(k),Dx=[0,a(q),iO,12,iO,37,[0,a(p),0]],DE=[0,a(e),[0,a("montant_vers\xc3\xa9_forfaitaire"),0]],DF=[0,a(q),jC,12,jC,32,[0,a(p),0]],DL=[0,a(e),[0,a("montant_initial_base"),0]],DM=[0,a(q),em,12,em,38,[0,a(p),0]],D_=[0,a(e),[0,a(dr),0]],D$=[0,a(q),ki,12,ki,53,[0,a(p),0]],Em=[0,a(e),[0,a("montant_vers\xc3\xa9_compl\xc3\xa9ment_pour_forfaitaire"),0]],En=[0,a(q),gk,12,gk,44,[0,a(p),0]],Eo=[0,a(e),[0,a("montant_avec_garde_altern\xc3\xa9e_base"),0]],Ep=[0,a(q),eA,12,eA,50,[0,a(p),0]],EC=[0,a(e),[0,a(dv),0]],EZ=a(k),ED=[0,a(q),lS,12,lS,30,[0,a(p),0]],EE=[0,a(e),[0,a("montant_vers\xc3\xa9_base"),0]],EG=a(k),EY=a(k),EF=[0,a(q),kH,12,kH,36,[0,a(p),0]],EL=[0,a(e),[0,a("montant_vers\xc3\xa9_majoration"),0]],EM=[0,a(q),k2,12,k2,59,[0,a(p),0]],EN=[0,a(e),[0,a("montant_base_compl\xc3\xa9ment_pour_base_et_majoration"),0]],EP=[0,a(e),[0,a(dH),[0,a(ay),0]]],EQ=[0,a(e),[0,a(dH),0]],ER=[0,a(e),[0,a(dH),[0,a(aA),0]]],ES=[0,a(e),[0,a(dH),0]],EX=a(k),EO=[0,a(q),kh,12,kh,60,[0,a(p),0]],ET=[0,a(e),[0,a("montant_vers\xc3\xa9_compl\xc3\xa9ment_pour_base_et_majoration"),0]],EW=a(k),EU=[0,a(q),iF,12,iF,25,[0,a(p),0]],EV=[0,a(e),[0,a(jh),0]],xg=[0,a(am),60,5,62,32,[0,a(gl),[0,a(ge),[0,a(ga),[0,a(F),[0,a(al),[0,a(x),0]]]]]]],xf=[0,a(am),49,5,50,50,[0,a(gl),[0,a(ge),[0,a(ga),[0,a(F),[0,a(al),[0,a(x),0]]]]]]],xe=[0,a(o),0,1,0,1,0],xd=[0,a(q),65,12,65,24,[0,a(p),0]],xa=[0,a(am),68,5,71,57,[0,a(gl),[0,a(ge),[0,a(ga),[0,a(F),[0,a(al),[0,a(x),0]]]]]]],w$=[0,a(q),66,12,66,31,[0,a(p),0]],w1=[0,a(ac),[0,a("smic.r\xc3\xa9sidence"),0]],w0=[0,a(ac),[0,a("smic.date_courante"),0]],wX=[0,a(v),60,5,61,34,[0,a("Instruction interminist\xc3\xa9rielle n\xc2\xb0DSS/2B/2021/65 du 19 mars 2021 relative \xc3\xa0 la revalorisation au 1er avril 2021 des prestations familiales servies en m\xc3\xa9tropole, en Guadeloupe, en Guyane, en Martinique, \xc3\xa0 la R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy, \xc3\xa0 Saint-Martin et dans le d\xc3\xa9partement de Mayotte"),[0,a(gd),[0,a(t),0]]]],wY=a("41481"),wV=[0,a(v),44,5,45,34,[0,a("Instruction interminist\xc3\xa9rielle no DSS/SD2B/2020/33 du 18 f\xc3\xa9vrier 2020 relative \xc3\xa0 la revalorisation au 1er avril 2020 des prestations familiales servies en m\xc3\xa9tropole, en Guadeloupe, en Guyane, en Martinique, \xc3\xa0 La R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy, \xc3\xa0 Saint-Martin et dans le d\xc3\xa9partement de Mayotte"),[0,a(gd),[0,a(t),0]]]],wW=a("41404"),wT=[0,a(v),24,5,25,34,[0,a("Instruction minist\xc3\xa9rielle N\xc2\xb0DSS/SD2B/2019/65 du 25 mars 2019 relative \xc3\xa0 la revalorisation au 1er avril 2019 des prestations familiales servies en m\xc3\xa9tropole"),[0,a(gd),[0,a(t),0]]]],wU=a("41316"),wS=[0,a(o),0,1,0,1,0],wJ=a("20"),wI=[0,a(q),68,12,68,24,[0,a(p),0]],wK=[0,a(ac),[0,a("\xc3\xa2ge_l512_3_2"),0]],wL=[0,a(q),70,12,70,25,[0,a(p),0]],wM=[0,a(ac),[0,a(eK),0]],wN=[0,a(q),71,12,71,31,[0,a(p),0]],wO=[0,a(ac),[0,a("prestation_courante"),0]],wP=[0,a(q),72,12,72,21,[0,a(p),0]],wQ=[0,a(ac),[0,a(eR),0]],wR=[0,a(q),74,12,74,26,[0,a(p),0]],wZ=[0,a(ac),[0,a("base_mensuelle"),0]],w2=[0,a(ac),[0,a(l8),[0,a(dq),0]]],w3=[0,a(ac),[0,a(l8),[0,a(dq),0]]],xl=[0,0],xn=[1,0],xo=[2,0],xp=[3,0],xq=[4,0],xr=[5,0],xm=[0,a(am),354,5,kC,30,[0,a("Article L751-1"),[0,a("Chapitre 1er : G\xc3\xa9n\xc3\xa9ralit\xc3\xa9s"),[0,a(eE),[0,a(bN),[0,a(al),[0,a(x),0]]]]]]],w4=[0,a(q),69,12,69,35,[0,a(p),0]],w5=[0,a(ac),[0,a("r\xc3\xa9gime_outre_mer_l751_1"),0]],xi=[0,a(jb),i8,18,i8,41,[0,a("Article R755-0-2"),[0,a(b4),[0,a(dp),[0,a(bN),[0,a(kS),[0,a(x),0]]]]]]],xj=a(ly),xk=a(jD),w7=a(ly),w8=a(jD),w6=[0,a(q),67,12,67,28,[0,a(p),0]],w9=[0,a(ac),[0,a("plafond_l512_3_2"),0]],w_=[0,a(q),66,12,66,31,[0,a(p),0]],xb=[0,a(ac),[0,a(dx),0]],xc=[0,a(q),65,12,65,24,[0,a(p),0]],xh=[0,a(ac),[0,a(dt),0]],wy=[0,a(q),84,12,84,19,[0,a(p),0]],wz=[0,a(eP),[0,a(lW),0]],wB=[2,0],wC=a(k),wD=a(k),wE=[1,0],wF=a(Y),wA=[0,a(q),85,12,85,23,[0,a(p),0]],wG=[0,a(eP),[0,a("le_plus_\xc3\xa2g\xc3\xa9"),0]],wv=a(f_),wu=[0,a(q),81,12,81,39,[0,a(p),0]],ww=[0,a(gs),[0,a(bo),0]],wp=[8,0],wq=[0,a(v),lH,5,317,6,[0,a(b5),[0,a(iG),[0,a(cF),[0,a(t),0]]]]],wr=a("774"),wf=[6,0],wi=[0,0],wj=[1,0],wk=[2,0],wl=[3,0],wm=[4,0],wn=[5,0],wo=[7,0],wg=[0,a(v),297,5,306,6,[0,a(b5),[0,a(iG),[0,a(cF),[0,a(t),0]]]]],wh=a("1025"),wc=[8,0],wd=[0,a(v),276,5,278,6,[0,a(b5),[0,a(i_),[0,a(cF),[0,a(t),0]]]]],we=a("766"),v4=[6,0],v7=[0,0],v8=[1,0],v9=[2,0],v_=[3,0],v$=[4,0],wa=[5,0],wb=[7,0],v5=[0,a(v),kB,5,267,6,[0,a(b5),[0,a(i_),[0,a(cF),[0,a(t),0]]]]],v6=a("1015"),v1=[8,0],v2=[0,a(v),237,5,239,6,[0,a(b5),[0,a(iB),[0,a(cF),[0,a(t),0]]]]],v3=a("757"),vR=[6,0],vU=[0,0],vV=[1,0],vW=[2,0],vX=[3,0],vY=[4,0],vZ=[5,0],v0=[7,0],vS=[0,a(v),219,5,228,6,[0,a(b5),[0,a(iB),[0,a(cF),[0,a(t),0]]]]],vT=a("1003"),vQ=[0,a(o),0,1,0,1,0],vL=[0,a(q),41,12,41,25,[0,a(p),0]],vM=[0,a(dq),[0,a(eK),0]],vN=[0,a(q),42,12,42,21,[0,a(p),0]],vO=[0,a(dq),[0,a(eR),0]],vP=[0,a(q),43,12,43,24,[0,a(p),0]],ws=[0,a(dq),[0,a("brut_horaire"),0]],vC=a("a_d\xc3\xa9j\xc3\xa0_ouvert_droit_aux_allocations_familiales"),vD=a("prise_en_charge"),vE=a("\xc3\xa2ge"),vF=a("date_de_naissance"),vG=a("r\xc3\xa9muneration_mensuelle"),vH=a("obligation_scolaire"),vI=a("identifiant"),vJ=[0,a("Enfant"),0],vw=a("d_a_d\xc3\xa9j\xc3\xa0_ouvert_droit_aux_allocations_familiales"),vx=a("d_prise_en_charge"),vy=a("d_date_de_naissance"),vz=a("d_r\xc3\xa9muneration_mensuelle"),vA=a("d_identifiant"),vB=[0,a("EnfantEntr\xc3\xa9e"),0],vm=a("PrestationAccueilJeuneEnfant"),vo=a(e),vp=a("Compl\xc3\xa9mentFamilial"),vq=a("AllocationLogement"),vr=a("Allocation\xc3\x89ducationEnfantHandicap\xc3\xa9"),vs=a("AllocationSoutienFamilial"),vt=a("AllocationRentr\xc3\xa9eScolaire"),vu=a("AllocationJournali\xc3\xa8rePresenceParentale"),vn=[0,a("\xc3\x89l\xc3\xa9mentPrestationsFamiliales"),0],vc=a(kb),ve=a(kT),vf=a(i6),vg=a("LaR\xc3\xa9union"),vh=a("SaintBarth\xc3\xa9lemy"),vi=a("SaintMartin"),vj=a(jX),vk=a("SaintPierreEtMiquelon"),vl=a(lr),vd=[0,a("Collectivit\xc3\xa9"),0],u_=a("Avant"),va=a("Pendant"),vb=a("Apr\xc3\xa8s"),u$=[0,a("SituationObligationScolaire"),0],u4=a("GardeAltern\xc3\xa9ePartageAllocations"),u6=a("GardeAltern\xc3\xa9eAllocataireUnique"),u7=a("EffectiveEtPermanente"),u8=a("ServicesSociauxAllocationVers\xc3\xa9e\xc3\x80LaFamille"),u9=a("ServicesSociauxAllocationVers\xc3\xa9eAuxServicesSociaux"),u5=[0,a("PriseEnCharge"),0],FN=a("Js_of_ocaml__Js.Error"),FO=a(gb),Go=a("Begin call"),Gp=a("End call"),Gq=a("Variable definition"),Gr=a("Decision taken"),Gc=a("Confi\xc3\xa9 aux service sociaux, allocation vers\xc3\xa9e aux services sociaux"),Gd=a("Confi\xc3\xa9 aux service sociaux, allocation vers\xc3\xa9e \xc3\xa0 la famille"),Ge=a("Effective et permanente"),Gf=a("Garde altern\xc3\xa9e, allocataire unique"),Gg=a("Garde altern\xc3\xa9e, partage des allocations"),Gi=[0,0],Gj=[1,0],Gk=[2,0],Gl=[3,0],Gm=[4,0],Gh=a("Unknown prise en charge"),FV=a(kb),FW=a(kT),FX=a("La R\xc3\xa9union"),FY=a(i6),FZ=a(lr),F0=a(jX),F1=a("Saint Barth\xc3\xa9lemy"),F2=a("Saint Martin"),F3=a("Saint Pierre et Miquelon"),F5=[7,0],F6=[5,0],F7=[4,0],F8=[6,0],F9=[8,0],F_=[2,0],F$=[3,0],Ga=[1,0],Gb=[0,0],F4=a("unknown collectivite!"),FT=a(o),FR=[0,[4,0,0,0,[12,68,[4,0,0,0,[12,77,[4,0,0,0,[12,89,0]]]]]],a("%dD%dM%dY")],FQ=[0,a(k3),a(k$),a(lw)];function $(a){if(typeof a==="number")return 0;else switch(a[0]){case @@ -1163,124 +1237,129 @@ d=a[2],e=a[1];return[9,e,d,aF(a[3],b)];case 11:return[11,aF(a[1],b)];case 12:return[12,aF(a[1],b)];case 13:return[13,aF(a[1],b)];default:return[14,aF(a[1],b)]}}function -T(a,b){if(typeof +U(a,b){if(typeof a==="number")return b;else switch(a[0]){case -0:return[0,T(a[1],b)];case -1:return[1,T(a[1],b)];case +0:return[0,U(a[1],b)];case +1:return[1,U(a[1],b)];case 2:var -c=a[1];return[2,c,T(a[2],b)];case +c=a[1];return[2,c,U(a[2],b)];case 3:var -d=a[1];return[3,d,T(a[2],b)];case +d=a[1];return[3,d,U(a[2],b)];case 4:var -e=a[3],f=a[2],g=a[1];return[4,g,f,e,T(a[4],b)];case +e=a[3],f=a[2],g=a[1];return[4,g,f,e,U(a[4],b)];case 5:var -h=a[3],i=a[2],j=a[1];return[5,j,i,h,T(a[4],b)];case +h=a[3],i=a[2],j=a[1];return[5,j,i,h,U(a[4],b)];case 6:var -k=a[3],l=a[2],m=a[1];return[6,m,l,k,T(a[4],b)];case +k=a[3],l=a[2],m=a[1];return[6,m,l,k,U(a[4],b)];case 7:var -n=a[3],o=a[2],p=a[1];return[7,p,o,n,T(a[4],b)];case +n=a[3],o=a[2],p=a[1];return[7,p,o,n,U(a[4],b)];case 8:var -q=a[3],r=a[2],s=a[1];return[8,s,r,q,T(a[4],b)];case +q=a[3],r=a[2],s=a[1];return[8,s,r,q,U(a[4],b)];case 9:var -t=a[1];return[9,t,T(a[2],b)];case -10:return[10,T(a[1],b)];case +t=a[1];return[9,t,U(a[2],b)];case +10:return[10,U(a[1],b)];case 11:var -u=a[1];return[11,u,T(a[2],b)];case +u=a[1];return[11,u,U(a[2],b)];case 12:var -v=a[1];return[12,v,T(a[2],b)];case +v=a[1];return[12,v,U(a[2],b)];case 13:var -w=a[2],x=a[1];return[13,x,w,T(a[3],b)];case +w=a[2],x=a[1];return[13,x,w,U(a[3],b)];case 14:var -y=a[2],z=a[1];return[14,z,y,T(a[3],b)];case -15:return[15,T(a[1],b)];case -16:return[16,T(a[1],b)];case +y=a[2],z=a[1];return[14,z,y,U(a[3],b)];case +15:return[15,U(a[1],b)];case +16:return[16,U(a[1],b)];case 17:var -A=a[1];return[17,A,T(a[2],b)];case +A=a[1];return[17,A,U(a[2],b)];case 18:var -B=a[1];return[18,B,T(a[2],b)];case -19:return[19,T(a[1],b)];case +B=a[1];return[18,B,U(a[2],b)];case +19:return[19,U(a[1],b)];case 20:var -C=a[2],D=a[1];return[20,D,C,T(a[3],b)];case +C=a[2],D=a[1];return[20,D,C,U(a[3],b)];case 21:var -E=a[1];return[21,E,T(a[2],b)];case -22:return[22,T(a[1],b)];case +E=a[1];return[21,E,U(a[2],b)];case +22:return[22,U(a[1],b)];case 23:var -F=a[1];return[23,F,T(a[2],b)];default:var -G=a[2],H=a[1];return[24,H,G,T(a[3],b)]}}function -bu(a){throw[0,dJ,a]}function -ai(a){throw[0,gv,a]}var -gw=[R,k6,an(0)];function -dK(b,a){return kQ(b,a)?b:a}function -dL(a){return 0<=a?a:-a|0}var -k7=jI,k9=cP(k8),k$=cP(k_),lb=cP(la);function -bM(d,c){var -a=K(d),e=K(c),b=ae(a+e|0);b4(d,0,b,0,a);b4(c,0,b,a,e);return aD(b)}function -lc(a){return a?ld:le}EQ(0);var -lf=kT(1),lg=kT(2),eU=[0,function(b){function +F=a[1];return[23,F,U(a[2],b)];default:var +G=a[2],H=a[1];return[24,H,G,U(a[3],b)]}}function +e_(a,c,b){return a[1]===c?(a[1]=b,1):0}function +bB(a){throw[0,dT,a]}function +ai(a){throw[0,g2,a]}var +g3=[O,mT,aj(0)];function +dU(b,a){return mA(b,a)?b:a}function +c3(a){return 0<=a?a:-a|0}var +mU=k6,mW=cW(mV),mY=cW(mX),m0=cW(mZ);function +bc(d,c){var +a=G(d),e=G(c),b=af(a+e|0);b8(d,0,b,0,a);b8(c,0,b,a,e);return aD(b)}function +m1(a){return a?m2:m3}Hf(0);var +m6=mD(1),bg=mD(2);function +m7(b){function a(b){var a=b;for(;;){if(a){var -c=a[2],e=a[1];try{gn(e)}catch(a){a=d(a);if(a[1]!==gx)throw a;var +c=a[2],e=a[1];try{cm(e)}catch(a){a=d(a);if(a[1]!==g6)throw a;var f=a}var -a=c;continue}return 0}}return a(ER(0))}];function -li(b){var -a=[0,0],d=eU[1];eU[1]=function(e){if(1-a[1]){a[1]=1;c(b,0)}return c(d,0)};return 0}function -lj(a){return c(eU[1],0)}function -cl(a){if(0<=a&&!(cG>>0){if(!(25<(b+a$|0)>>>0))c=1}else +a=c;continue}return 0}}return a(Hg(0))}function +c4(b,a){return gS(b,a,0,G(a))}function +g9(a){c4(bg,a);mE(bg,10);return cm(bg)}var +fa=[0,m7];function +g_(d){for(;;){var +a=fa[1],e=[0,1],b=1-e_(fa,a,function(a,b){return function(e){if(e_(a,1,0))c(d,0);return c(b,0)}}(e,a));if(b)continue;return b}}function +fb(a){return c(fa[1],0)}gV(a(ix),fb);if(Hu(0))g_(function(a){return GP(a)});function +cs(a){if(0<=a&&!(cN>>0){if(!(25<(b+bd|0)>>>0))c=1}else if(23!==b)c=1;return c?a+32|0:a}var -gA=E6(0)[1],gB=E5(0),cW=(4*gB|0)-1|0;an(0);var -lr=E4(0);function -gC(c){var +ha=Ht(0),c5=(4*ha|0)-1|0;aj(0);var +ne=Hs(0);function +hb(c){var b=0,a=c;for(;;){if(a){var b=b+1|0,a=a[2];continue}return b}}function -gD(a){return a?a[1]:bu(ls)}function -dM(d){var +hc(a){return a?a[1]:bB(nf)}function +dV(d){var a=d,b=0;for(;;){if(a){var c=[0,a[1],b],a=a[2],b=c;continue}return b}}typeof -lr==="number";function -b9(b,a){if(a){var -d=a[2],e=c(b,a[1]);return[0,e,b9(b,d)]}return 0}function -bc(a,c){var -b=ae(a);Ep(b,0,a,c);return b}function -gE(a){var -b=aZ(a),c=ae(b);b3(a,0,c,0,b);return c}function -dN(a){return aD(gE(a))}function -gF(c,b,a){if(0<=b&&0<=a&&!((aZ(c)-a|0)>>0))e=1}else +f=0;if(1>>0))e=1}else if(65<=d)e=1}else{var -f=0;if(32!==d)if(43<=d)switch(d+kp|0){case +f=0;if(32!==d)if(43<=d)switch(d+l5|0){case 5:if(a<(c+2|0)&&1>>0){if(33<(n-61|0)>>>0)p=1}else +n=cZ(k,j)+gA|0,p=0;if(59>>0){if(33<(n-61|0)>>>0)p=1}else if(2===n)p=1;if(!p){var j=j+1|0;continue}var -e=bJ(k),a=[0,0],r=aZ(e)-1|0,w=0;if(!(r<0)){var +e=bO(k),a=[0,0],r=a3(e)-1|0,w=0;if(!(r<0)){var i=w;for(;;){var -f=dz(e,i),g=0;if(32<=f){var +f=dJ(e,i),g=0;if(32<=f){var l=f-34|0,q=0;if(58>>0){if(93<=l)q=1}else if(56<(l-1|0)>>>0){g=1;q=1}if(!q){var m=1;g=2}}else @@ -1980,40 +2077,40 @@ m=4;break;case 1:var m=2;break}a[1]=a[1]+m|0;var z=i+1|0;if(r!==i){var -i=z;continue}break}}if(a[1]===aZ(e))var -t=gE(e);else{var -b=ae(a[1]);a[1]=0;var -s=aZ(e)-1|0,x=0;if(!(s<0)){var +i=z;continue}break}}if(a[1]===a3(e))var +t=hd(e);else{var +b=af(a[1]);a[1]=0;var +s=a3(e)-1|0,x=0;if(!(s<0)){var h=x;for(;;){var -c=dz(e,h),d=0;if(35<=c)if(92===c)d=2;else -if(a$<=c)d=1;else +c=dJ(e,h),d=0;if(35<=c)if(92===c)d=2;else +if(bd<=c)d=1;else d=3;else if(32<=c)if(34<=c)d=2;else d=3;else if(14<=c)d=1;else switch(c){case 8:ad(b,a[1],92);a[1]++;ad(b,a[1],98);break;case -9:ad(b,a[1],92);a[1]++;ad(b,a[1],fX);break;case -10:ad(b,a[1],92);a[1]++;ad(b,a[1],f9);break;case -13:ad(b,a[1],92);a[1]++;ad(b,a[1],f5);break;default:d=1}switch(d){case -1:ad(b,a[1],92);a[1]++;ad(b,a[1],48+(c/aT|0)|0);a[1]++;ad(b,a[1],48+((c/10|0)%10|0)|0);a[1]++;ad(b,a[1],48+(c%10|0)|0);break;case +9:ad(b,a[1],92);a[1]++;ad(b,a[1],gk);break;case +10:ad(b,a[1],92);a[1]++;ad(b,a[1],gB);break;case +13:ad(b,a[1],92);a[1]++;ad(b,a[1],gt);break;default:d=1}switch(d){case +1:ad(b,a[1],92);a[1]++;ad(b,a[1],48+(c/aW|0)|0);a[1]++;ad(b,a[1],48+((c/10|0)%10|0)|0);a[1]++;ad(b,a[1],48+(c%10|0)|0);break;case 2:ad(b,a[1],92);a[1]++;ad(b,a[1],c);break;case 3:ad(b,a[1],c);break}a[1]++;var y=h+1|0;if(s!==h){var h=y;continue}break}}var t=b}var o=aD(t)}var -u=K(o),v=bc(u+2|0,34);b4(o,0,v,1,u);return aD(v)}}function -gS(d,f){var -g=dL(f),e=gT?gT[1]:70;switch(d[2]){case +u=G(o),v=bh(u+2|0,34);b8(o,0,v,1,u);return aD(v)}}function +hs(d,f){var +g=c3(f),e=ht?ht[1]:70;switch(d[2]){case 0:var -b=cB;break;case +b=cI;break;case 1:var -b=ej;break;case +b=ev;break;case 2:var b=69;break;case 3:var -b=ce;break;case +b=cj;break;case 4:var b=71;break;case 5:var @@ -2023,210 +2120,210 @@ b=104;break;case 7:var b=72;break;default:var b=70}var -c=gP(16);cq(c,37);switch(d[1]){case +c=ho(16);cx(c,37);switch(d[1]){case 0:break;case -1:cq(c,43);break;default:cq(c,32)}if(8<=d[2])cq(c,35);cq(c,46);av(c,a(u+g));cq(c,b);return gR(c)}function -dR(m,a){if(13<=m){var -g=[0,0],h=K(a)-1|0,n=0;if(!(h<0)){var -c=n;for(;;){if(!(9<(cT(a,c)+ec|0)>>>0))g[1]++;var +1:cx(c,43);break;default:cx(c,32)}if(8<=d[2])cx(c,35);cx(c,46);aw(c,a(o+g));cx(c,b);return hq(c)}function +d0(m,a){if(13<=m){var +g=[0,0],h=G(a)-1|0,n=0;if(!(h<0)){var +c=n;for(;;){if(!(9<(cZ(a,c)+eo|0)>>>0))g[1]++;var q=c+1|0;if(h!==c){var c=q;continue}break}}var -i=g[1],j=ae(K(a)+((i-1|0)/3|0)|0),k=[0,0],d=function(a){a9(j,k[1],a);k[1]++;return 0},e=[0,((i-1|0)%3|0)+1|0],l=K(a)-1|0,o=0;if(!(l<0)){var +i=g[1],j=af(G(a)+((i-1|0)/3|0)|0),k=[0,0],d=function(a){ba(j,k[1],a);k[1]++;return 0},e=[0,((i-1|0)%3|0)+1|0],l=G(a)-1|0,o=0;if(!(l<0)){var b=o;for(;;){var -f=cT(a,b);if(9<(f+ec|0)>>>0)d(f);else{if(0===e[1]){d(95);e[1]=3}e[1]+=-1;d(f)}var +f=cZ(a,b);if(9<(f+eo|0)>>>0)d(f);else{if(0===e[1]){d(95);e[1]=3}e[1]+=-1;d(f)}var p=b+1|0;if(l!==b){var b=p;continue}break}}return aD(j)}return a}function -nm(b,c){switch(b){case +o$(b,c){switch(b){case 1:var -a=mz;break;case +a=om;break;case 2:var -a=mA;break;case +a=on;break;case 4:var -a=mC;break;case +a=op;break;case 5:var -a=mD;break;case +a=oq;break;case 6:var -a=mE;break;case +a=or;break;case 7:var -a=mF;break;case +a=os;break;case 8:var -a=mG;break;case +a=ot;break;case 9:var -a=mH;break;case +a=ou;break;case 10:var -a=mI;break;case +a=ov;break;case 11:var -a=mJ;break;case +a=ow;break;case 0:case 13:var -a=my;break;case +a=ol;break;case 3:case 14:var -a=mB;break;default:var -a=mK}return dR(b,eE(a,c))}function -nn(b,c){switch(b){case +a=oo;break;default:var +a=ox}return d0(b,eV(a,c))}function +pa(b,c){switch(b){case 1:var -a=mZ;break;case +a=oM;break;case 2:var -a=m0;break;case +a=oN;break;case 4:var -a=m2;break;case +a=oP;break;case 5:var -a=m3;break;case +a=oQ;break;case 6:var -a=m4;break;case +a=oR;break;case 7:var -a=m5;break;case +a=oS;break;case 8:var -a=m6;break;case +a=oT;break;case 9:var -a=m7;break;case +a=oU;break;case 10:var -a=m8;break;case +a=oV;break;case 11:var -a=m9;break;case +a=oW;break;case 0:case 13:var -a=mY;break;case +a=oL;break;case 3:case 14:var -a=m1;break;default:var -a=m_}return dR(b,eE(a,c))}function -no(b,c){switch(b){case +a=oO;break;default:var +a=oX}return d0(b,eV(a,c))}function +pb(b,c){switch(b){case 1:var -a=na;break;case +a=oZ;break;case 2:var -a=nb;break;case +a=o0;break;case 4:var -a=nd;break;case +a=o2;break;case 5:var -a=ne;break;case +a=o3;break;case 6:var -a=nf;break;case +a=o4;break;case 7:var -a=ng;break;case +a=o5;break;case 8:var -a=nh;break;case +a=o6;break;case 9:var -a=ni;break;case +a=o7;break;case 10:var -a=nj;break;case +a=o8;break;case 11:var -a=nk;break;case +a=o9;break;case 0:case 13:var -a=m$;break;case +a=oY;break;case 3:case 14:var -a=nc;break;default:var -a=nl}return dR(b,eE(a,c))}function -np(b,c){switch(b){case +a=o1;break;default:var +a=o_}return d0(b,eV(a,c))}function +pc(b,c){switch(b){case 1:var -a=mM;break;case +a=oz;break;case 2:var -a=mN;break;case +a=oA;break;case 4:var -a=mP;break;case +a=oC;break;case 5:var -a=mQ;break;case +a=oD;break;case 6:var -a=mR;break;case +a=oE;break;case 7:var -a=mS;break;case +a=oF;break;case 8:var -a=mT;break;case +a=oG;break;case 9:var -a=mU;break;case +a=oH;break;case 10:var -a=mV;break;case +a=oI;break;case 11:var -a=mW;break;case +a=oJ;break;case 0:case 13:var -a=mL;break;case +a=oy;break;case 3:case 14:var -a=mO;break;default:var -a=mX}return dR(b,EA(a,c))}function -bw(c,i,b){function +a=oB;break;default:var +a=oK}return d0(b,GZ(a,c))}function +bD(c,i,b){function j(d){switch(c[1]){case 0:var a=45;break;case 1:var a=43;break;default:var -a=32}return Ex(b,i,a)}function +a=32}return GW(b,i,a)}function q(c){var -a=Eo(b);return 3===a?b<0.?nr:ns:4<=a?nt:c}switch(c[2]){case +a=GK(b);return 3===a?b<0.?pe:pf:4<=a?pg:c}switch(c[2]){case 5:var -e=kP(gS(c,i),b),d=0,u=K(e);for(;;){if(d===u)var +e=gI(hs(c,i),b),d=0,u=G(e);for(;;){if(d===u)var p=0;else{var -k=D(e,d)+ia|0,l=0;if(23>>0){if(55===k)l=1}else +k=E(e,d)+i0|0,l=0;if(23>>0){if(55===k)l=1}else if(21<(k-1|0)>>>0)l=1;if(!l){var d=d+1|0;continue}var p=1}var -v=p?e:bM(e,nq);return q(v)}case +v=p?e:bc(e,pd);return q(v)}case 6:return j(0);case 7:var -h=bJ(j(0)),f=aZ(h);if(0===f)var +h=bO(j(0)),f=a3(h);if(0===f)var o=h;else{var -m=ae(f),n=f-1|0,r=0;if(!(n<0)){var +m=af(f),n=f-1|0,r=0;if(!(n<0)){var a=r;for(;;){var -g=dz(h,a),s=25<(g+iB|0)>>>0?g:g+f8|0;ad(m,a,s);var +g=dJ(h,a),s=25<(g+jA|0)>>>0?g:g+gA|0;ad(m,a,s);var t=a+1|0;if(n!==a){var a=t;continue}break}}var o=m}return aD(o);case -8:return q(j(0));default:return kP(gS(c,i),b)}}function -de(e,y,x,w){var +8:return q(j(0));default:return gI(hs(c,i),b)}}function +dn(e,y,x,w){var b=y,a=x,d=w;for(;;)if(typeof d==="number")return c(b,a);else switch(d[0]){case 0:var -z=d[1];return function(c){return N(b,[5,a,c],z)};case +z=d[1];return function(c){return M(b,[5,a,c],z)};case 1:var A=d[1];return function(c){var e=0;if(40<=c)if(92===c)var -d=ll;else -if(a$<=c)e=1;else +d=m_;else +if(bd<=c)e=1;else e=2;else if(32<=c)if(39<=c)var -d=lm;else +d=m$;else e=2;else if(14<=c)e=1;else switch(c){case 8:var -d=ln;break;case +d=na;break;case 9:var -d=lo;break;case +d=nb;break;case 10:var -d=lp;break;case +d=nc;break;case 13:var -d=lq;break;default:e=1}switch(e){case +d=nd;break;default:e=1}switch(e){case 1:var -f=ae(4);ad(f,0,92);ad(f,1,48+(c/aT|0)|0);ad(f,2,48+((c/10|0)%10|0)|0);ad(f,3,48+(c%10|0)|0);var +f=af(4);ad(f,0,92);ad(f,1,48+(c/aW|0)|0);ad(f,2,48+((c/10|0)%10|0)|0);ad(f,3,48+(c%10|0)|0);var d=aD(f);break;case 2:var -g=ae(1);ad(g,0,c);var +g=af(1);ad(g,0,c);var d=aD(g);break}var -h=K(d),i=bc(h+2|0,39);b4(d,0,i,1,h);return N(b,[4,a,aD(i)],A)};case +h=G(d),i=bh(h+2|0,39);b8(d,0,i,1,h);return M(b,[4,a,aD(i)],A)};case 2:var -B=d[2],C=d[1];return e0(b,a,B,C,function(a){return a});case -3:return e0(b,a,d[2],d[1],mx);case -4:return dS(b,a,d[4],d[2],d[3],nm,d[1]);case -5:return dS(b,a,d[4],d[2],d[3],nn,d[1]);case -6:return dS(b,a,d[4],d[2],d[3],no,d[1]);case -7:return dS(b,a,d[4],d[2],d[3],np,d[1]);case +B=d[2],C=d[1];return fh(b,a,B,C,function(a){return a});case +3:return fh(b,a,d[2],d[1],ok);case +4:return d1(b,a,d[4],d[2],d[3],o$,d[1]);case +5:return d1(b,a,d[4],d[2],d[3],pa,d[1]);case +6:return d1(b,a,d[4],d[2],d[3],pb,d[1]);case +7:return d1(b,a,d[4],d[2],d[3],pc,d[1]);case 8:var i=d[4],j=d[3],k=d[2],g=d[1];if(typeof k==="number"){if(typeof -j==="number")return j?function(d,c){return N(b,[4,a,bw(g,d,c)],i)}:function(c){return N(b,[4,a,bw(g,eY(g),c)],i)};var -Z=j[1];return function(c){return N(b,[4,a,bw(g,Z,c)],i)}}else{if(0===k[0]){var +j==="number")return j?function(d,c){return M(b,[4,a,bD(g,d,c)],i)}:function(c){return M(b,[4,a,bD(g,ff(g),c)],i)};var +Z=j[1];return function(c){return M(b,[4,a,bD(g,Z,c)],i)}}else{if(0===k[0]){var n=k[2],o=k[1];if(typeof -j==="number")return j?function(d,c){return N(b,[4,a,aO(o,n,bw(g,d,c))],i)}:function(c){return N(b,[4,a,aO(o,n,bw(g,eY(g),c))],i)};var -_=j[1];return function(c){return N(b,[4,a,aO(o,n,bw(g,_,c))],i)}}var +j==="number")return j?function(d,c){return M(b,[4,a,aR(o,n,bD(g,d,c))],i)}:function(c){return M(b,[4,a,aR(o,n,bD(g,ff(g),c))],i)};var +_=j[1];return function(c){return M(b,[4,a,aR(o,n,bD(g,_,c))],i)}}var p=k[1];if(typeof -j==="number")return j?function(e,d,c){return N(b,[4,a,aO(p,e,bw(g,d,c))],i)}:function(d,c){return N(b,[4,a,aO(p,d,bw(g,eY(g),c))],i)};var -aa=j[1];return function(d,c){return N(b,[4,a,aO(p,d,bw(g,aa,c))],i)}}case -9:return e0(b,a,d[2],d[1],lc);case +j==="number")return j?function(e,d,c){return M(b,[4,a,aR(p,e,bD(g,d,c))],i)}:function(d,c){return M(b,[4,a,aR(p,d,bD(g,ff(g),c))],i)};var +aa=j[1];return function(d,c){return M(b,[4,a,aR(p,d,bD(g,aa,c))],i)}}case +9:return fh(b,a,d[2],d[1],m1);case 10:var a=[7,a],d=d[1];continue;case 11:var @@ -2234,522 +2331,581 @@ a=[2,a,d[1]],d=d[2];continue;case 12:var a=[3,a,d[1]],d=d[2];continue;case 13:var -D=d[3],E=d[2],q=gP(16);eZ(q,E);var -v=gR(q);return function(c){return N(b,[4,a,v],D)};case +D=d[3],E=d[2],q=ho(16);fg(q,E);var +v=hq(q);return function(c){return M(b,[4,a,v],D)};case 14:var -F=d[3],G=d[2];return function(d){var -e=d[1],c=S(e,$(aj(G)));if(typeof -c[2]==="number")return N(b,a,T(c[1],F));throw ar};case +F=d[3],H=d[2];return function(d){var +e=d[1],c=T(e,$(ak(H)));if(typeof +c[2]==="number")return M(b,a,U(c[1],F));throw ar};case 15:var -H=d[1];return function(d,c){return N(b,[6,a,function(a){return h(d,a,c)}],H)};case +I=d[1];return function(d,c){return M(b,[6,a,function(a){return h(d,a,c)}],I)};case 16:var -I=d[1];return function(c){return N(b,[6,a,c],I)};case +K=d[1];return function(c){return M(b,[6,a,c],K)};case 17:var a=[0,a,d[1]],d=d[2];continue;case 18:var m=d[1];if(0===m[0]){var -J=d[2],M=m[1][1],O=0,b=function(b,c,d){return function(a){return N(c,[1,b,[0,a]],d)}}(a,b,J),a=O,d=M;continue}var -Q=d[2],R=m[1][1],U=0,b=function(b,c,d){return function(a){return N(c,[1,b,[1,a]],d)}}(a,b,Q),a=U,d=R;continue;case -19:throw[0,L,nv];case +L=d[2],N=m[1][1],O=0,b=function(b,c,d){return function(a){return M(c,[1,b,[0,a]],d)}}(a,b,L),a=O,d=N;continue}var +P=d[2],R=m[1][1],S=0,b=function(b,c,d){return function(a){return M(c,[1,b,[1,a]],d)}}(a,b,P),a=S,d=R;continue;case +19:throw[0,J,pi];case 20:var -V=d[3],W=[8,a,nw];return function(a){return N(b,W,V)};case +V=d[3],W=[8,a,pj];return function(a){return M(b,W,V)};case 21:var -X=d[2];return function(c){return N(b,[4,a,eE(nx,c)],X)};case +X=d[2];return function(c){return M(b,[4,a,eV(pk,c)],X)};case 22:var -Y=d[1];return function(c){return N(b,[5,a,c],Y)};case +Y=d[1];return function(c){return M(b,[5,a,c],Y)};case 23:var f=d[2],l=d[1];if(typeof l==="number")switch(l){case -0:return e<50?P(e+1|0,b,a,f):ao(P,[0,b,a,f]);case -1:return e<50?P(e+1|0,b,a,f):ao(P,[0,b,a,f]);case -2:throw[0,L,ny];default:return e<50?P(e+1|0,b,a,f):ao(P,[0,b,a,f])}else +0:return e<50?Q(e+1|0,b,a,f):ao(Q,[0,b,a,f]);case +1:return e<50?Q(e+1|0,b,a,f):ao(Q,[0,b,a,f]);case +2:throw[0,J,pl];default:return e<50?Q(e+1|0,b,a,f):ao(Q,[0,b,a,f])}else switch(l[0]){case -0:return e<50?P(e+1|0,b,a,f):ao(P,[0,b,a,f]);case -1:return e<50?P(e+1|0,b,a,f):ao(P,[0,b,a,f]);case -2:return e<50?P(e+1|0,b,a,f):ao(P,[0,b,a,f]);case -3:return e<50?P(e+1|0,b,a,f):ao(P,[0,b,a,f]);case -4:return e<50?P(e+1|0,b,a,f):ao(P,[0,b,a,f]);case -5:return e<50?P(e+1|0,b,a,f):ao(P,[0,b,a,f]);case -6:return e<50?P(e+1|0,b,a,f):ao(P,[0,b,a,f]);case -7:return e<50?P(e+1|0,b,a,f):ao(P,[0,b,a,f]);case -8:return e<50?P(e+1|0,b,a,f):ao(P,[0,b,a,f]);case +0:return e<50?Q(e+1|0,b,a,f):ao(Q,[0,b,a,f]);case +1:return e<50?Q(e+1|0,b,a,f):ao(Q,[0,b,a,f]);case +2:return e<50?Q(e+1|0,b,a,f):ao(Q,[0,b,a,f]);case +3:return e<50?Q(e+1|0,b,a,f):ao(Q,[0,b,a,f]);case +4:return e<50?Q(e+1|0,b,a,f):ao(Q,[0,b,a,f]);case +5:return e<50?Q(e+1|0,b,a,f):ao(Q,[0,b,a,f]);case +6:return e<50?Q(e+1|0,b,a,f):ao(Q,[0,b,a,f]);case +7:return e<50?Q(e+1|0,b,a,f):ao(Q,[0,b,a,f]);case +8:return e<50?Q(e+1|0,b,a,f):ao(Q,[0,b,a,f]);case 9:var -u=l[2];return e<50?fE(e+1|0,b,a,u,f):ao(fE,[0,b,a,u,f]);case -10:return e<50?P(e+1|0,b,a,f):ao(P,[0,b,a,f]);default:return e<50?P(e+1|0,b,a,f):ao(P,[0,b,a,f])}default:var -r=d[3],s=d[1],t=c(d[2],0);return e<50?fD(e+1|0,b,a,r,s,t):ao(fD,[0,b,a,r,s,t])}}function -fE(e,d,c,a,b){if(typeof -a==="number")return e<50?P(e+1|0,d,c,b):ao(P,[0,d,c,b]);else +u=l[2];return e<50?f1(e+1|0,b,a,u,f):ao(f1,[0,b,a,u,f]);case +10:return e<50?Q(e+1|0,b,a,f):ao(Q,[0,b,a,f]);default:return e<50?Q(e+1|0,b,a,f):ao(Q,[0,b,a,f])}default:var +r=d[3],s=d[1],t=c(d[2],0);return e<50?f0(e+1|0,b,a,r,s,t):ao(f0,[0,b,a,r,s,t])}}function +f1(e,d,c,a,b){if(typeof +a==="number")return e<50?Q(e+1|0,d,c,b):ao(Q,[0,d,c,b]);else switch(a[0]){case 0:var -f=a[1];return function(a){return aU(d,c,f,b)};case +f=a[1];return function(a){return aX(d,c,f,b)};case 1:var -g=a[1];return function(a){return aU(d,c,g,b)};case +g=a[1];return function(a){return aX(d,c,g,b)};case 2:var -h=a[1];return function(a){return aU(d,c,h,b)};case +h=a[1];return function(a){return aX(d,c,h,b)};case 3:var -i=a[1];return function(a){return aU(d,c,i,b)};case +i=a[1];return function(a){return aX(d,c,i,b)};case 4:var -j=a[1];return function(a){return aU(d,c,j,b)};case +j=a[1];return function(a){return aX(d,c,j,b)};case 5:var -k=a[1];return function(a){return aU(d,c,k,b)};case +k=a[1];return function(a){return aX(d,c,k,b)};case 6:var -l=a[1];return function(a){return aU(d,c,l,b)};case +l=a[1];return function(a){return aX(d,c,l,b)};case 7:var -m=a[1];return function(a){return aU(d,c,m,b)};case +m=a[1];return function(a){return aX(d,c,m,b)};case 8:var -n=a[2];return function(a){return aU(d,c,n,b)};case +n=a[2];return function(a){return aX(d,c,n,b)};case 9:var -o=a[3],p=a[2],q=ap(aj(a[1]),p);return function(a){return aU(d,c,aF(q,o),b)};case +o=a[3],p=a[2],q=ap(ak(a[1]),p);return function(a){return aX(d,c,aF(q,o),b)};case 10:var -r=a[1];return function(e,a){return aU(d,c,r,b)};case +r=a[1];return function(e,a){return aX(d,c,r,b)};case 11:var -s=a[1];return function(a){return aU(d,c,s,b)};case +s=a[1];return function(a){return aX(d,c,s,b)};case 12:var -t=a[1];return function(a){return aU(d,c,t,b)};case -13:throw[0,L,nz];default:throw[0,L,nA]}}function -P(d,b,e,a){var -c=[8,e,nB];return d<50?de(d+1|0,b,c,a):ao(de,[0,b,c,a])}function -fD(h,b,f,a,e,d){if(e){var -i=e[1];return function(e){return nu(b,f,a,i,c(d,e))}}var -g=[4,f,d];return h<50?de(h+1|0,b,g,a):ao(de,[0,b,g,a])}function -N(a,b,c){return dF(de(0,a,b,c))}function -aU(a,b,c,d){return dF(fE(0,a,b,c,d))}function -nu(a,b,c,d,e){return dF(fD(0,a,b,c,d,e))}function -e0(f,e,d,a,b){if(typeof -a==="number")return function(a){return N(f,[4,e,c(b,a)],d)};else{if(0===a[0]){var -g=a[2],h=a[1];return function(a){return N(f,[4,e,aO(h,g,c(b,a))],d)}}var -i=a[1];return function(g,a){return N(f,[4,e,aO(i,g,c(b,a))],d)}}}function -dS(f,e,d,g,c,b,a){if(typeof +t=a[1];return function(a){return aX(d,c,t,b)};case +13:throw[0,J,pm];default:throw[0,J,pn]}}function +Q(d,b,e,a){var +c=[8,e,po];return d<50?dn(d+1|0,b,c,a):ao(dn,[0,b,c,a])}function +f0(h,b,f,a,e,d){if(e){var +i=e[1];return function(e){return ph(b,f,a,i,c(d,e))}}var +g=[4,f,d];return h<50?dn(h+1|0,b,g,a):ao(dn,[0,b,g,a])}function +M(a,b,c){return dQ(dn(0,a,b,c))}function +aX(a,b,c,d){return dQ(f1(0,a,b,c,d))}function +ph(a,b,c,d,e){return dQ(f0(0,a,b,c,d,e))}function +fh(f,e,d,a,b){if(typeof +a==="number")return function(a){return M(f,[4,e,c(b,a)],d)};else{if(0===a[0]){var +g=a[2],h=a[1];return function(a){return M(f,[4,e,aR(h,g,c(b,a))],d)}}var +i=a[1];return function(g,a){return M(f,[4,e,aR(i,g,c(b,a))],d)}}}function +d1(f,e,d,g,c,b,a){if(typeof g==="number"){if(typeof -c==="number")return c?function(g,c){return N(f,[4,e,cr(g,h(b,a,c))],d)}:function(c){return N(f,[4,e,h(b,a,c)],d)};var -l=c[1];return function(c){return N(f,[4,e,cr(l,h(b,a,c))],d)}}else{if(0===g[0]){var +c==="number")return c?function(g,c){return M(f,[4,e,cy(g,h(b,a,c))],d)}:function(c){return M(f,[4,e,h(b,a,c)],d)};var +l=c[1];return function(c){return M(f,[4,e,cy(l,h(b,a,c))],d)}}else{if(0===g[0]){var i=g[2],j=g[1];if(typeof -c==="number")return c?function(g,c){return N(f,[4,e,aO(j,i,cr(g,h(b,a,c)))],d)}:function(c){return N(f,[4,e,aO(j,i,h(b,a,c))],d)};var -m=c[1];return function(c){return N(f,[4,e,aO(j,i,cr(m,h(b,a,c)))],d)}}var +c==="number")return c?function(g,c){return M(f,[4,e,aR(j,i,cy(g,h(b,a,c)))],d)}:function(c){return M(f,[4,e,aR(j,i,h(b,a,c))],d)};var +m=c[1];return function(c){return M(f,[4,e,aR(j,i,cy(m,h(b,a,c)))],d)}}var k=g[1];if(typeof -c==="number")return c?function(i,g,c){return N(f,[4,e,aO(k,i,cr(g,h(b,a,c)))],d)}:function(g,c){return N(f,[4,e,aO(k,g,h(b,a,c))],d)};var -n=c[1];return function(g,c){return N(f,[4,e,aO(k,g,cr(n,h(b,a,c)))],d)}}}function -bN(b,h){var -a=h;for(;;)if(typeof +c==="number")return c?function(i,g,c){return M(f,[4,e,aR(k,i,cy(g,h(b,a,c)))],d)}:function(g,c){return M(f,[4,e,aR(k,g,h(b,a,c))],d)};var +n=c[1];return function(g,c){return M(f,[4,e,aR(k,g,cy(n,h(b,a,c)))],d)}}}function +bE(b,f){var +a=f;for(;;)if(typeof a==="number")return 0;else switch(a[0]){case 0:var -e=a[2],i=a[1];if(typeof -e==="number")switch(e){case -0:var -d=lT;break;case +g=a[1],h=hr(a[2]);bE(b,g);return c4(b,h);case 1:var -d=lU;break;case -2:var -d=lV;break;case -3:var -d=lW;break;case +d=a[2],e=a[1];if(0===d[0]){var +i=d[1];bE(b,e);c4(b,pp);var +a=i;continue}var +j=d[1];bE(b,e);c4(b,pq);var +a=j;continue;case +6:var +m=a[2];bE(b,a[1]);return c(m,b);case +7:bE(b,a[1]);return cm(b);case +8:var +n=a[2];bE(b,a[1]);return ai(n);case +2:case 4:var -d=lX;break;case -5:var -d=lY;break;default:var -d=lZ}else -switch(e[0]){case +k=a[2];bE(b,a[1]);return c4(b,k);default:var +l=a[2];bE(b,a[1]);return mE(b,l)}}function +bR(b,f){var +a=f;for(;;)if(typeof +a==="number")return 0;else +switch(a[0]){case 0:var -d=e[1];break;case +g=a[1],h=hr(a[2]);bR(b,g);return c9(b,h);case 1:var -d=e[1];break;default:var -d=bM(l0,gI(1,e[1]))}bN(b,i);return c0(b,d);case -1:var -f=a[2],g=a[1];if(0===f[0]){var -j=f[1];bN(b,g);c0(b,nC);var -a=j;continue}var -k=f[1];bN(b,g);c0(b,nD);var -a=k;continue;case +d=a[2],e=a[1];if(0===d[0]){var +i=d[1];bR(b,e);c9(b,pr);var +a=i;continue}var +j=d[1];bR(b,e);c9(b,ps);var +a=j;continue;case 6:var -n=a[2];bN(b,a[1]);return c0(b,c(n,0));case +m=a[2];bR(b,a[1]);return c9(b,c(m,0));case 7:var a=a[1];continue;case 8:var -o=a[2];bN(b,a[1]);return ai(o);case +n=a[2];bR(b,a[1]);return ai(n);case 2:case 4:var -l=a[2];bN(b,a[1]);return c0(b,l);default:var -m=a[2];bN(b,a[1]);return gO(b,m)}}function -e1(b){var -a=b[1];return N(function(b){var -a=eW(64);bN(a,b);return gN(a)},0,a)}var -gU=[0,0];function -e2(a){gU[1]=[0,a,gU[1]];return 0}try{var -Ef=eP(Ee),gW=Ef}catch(a){a=d(a);if(a!==aB)throw a;try{var -Ed=eP(Ec),gV=Ed}catch(a){a=d(a);if(a!==aB)throw a;var -gV=nF}var -gW=gV}var -nG=ly(gW,82),dT=[im,function(x){var -m=E7(0),c=[0,bL(55,0),0],i=0===m.length-1?[0,0]:m,j=i.length-1,b=0;for(;;){am(c[1],b)[1+b]=b;var +k=a[2];bR(b,a[1]);return c9(b,k);default:var +l=a[2];bR(b,a[1]);return hn(b,l)}}function +fi(d,c){var +a=c[1],b=0;return M(function(a){bE(d,a);return 0},b,a)}function +fj(a){return fi(bg,a)}function +aY(b){var +a=b[1];return M(function(b){var +a=fd(64);bR(a,b);return hm(a)},0,a)}var +fk=[0,0];function +fm(i,h){var +a=i[1+h];if(1-(typeof +a==="number"?1:0)){if(dP(a)===ez)return c(aY(pt),a);if(dP(a)===lt){var +d=gI(m5,a),b=0,g=G(d);for(;;){if(g<=b)return bc(d,m4);var +e=E(d,b),f=0;if(48<=e){if(!(58<=e))f=1}else +if(45===e)f=1;if(f){var +b=b+1|0;continue}return d}}return pu}return c(aY(pv),a)}function +hu(b,a){if(b.length-1<=a)return pw;var +c=hu(b,a+1|0),d=fm(b,a);return h(aY(px),d,c)}function +d2(a){function +p(f){var +b=f;for(;;){if(b){var +g=b[2],h=b[1];try{var +e=0,d=c(h,a);e=1}catch(a){}if(e&&d)return[0,d[1]];var +b=g;continue}return 0}}var +i=p(fk[1]);if(i)return i[1];if(a===e$)return pC;if(a===g5)return pD;if(a[1]===g4){var +d=a[2],j=d[3],q=d[2],r=d[1];return f4(aY(fl),r,q,j,j+5|0,pE)}if(a[1]===J){var +e=a[2],k=e[3],s=e[2],t=e[1];return f4(aY(fl),t,s,k,k+6|0,pF)}if(a[1]===g8){var +f=a[2],l=f[3],u=f[2],v=f[1];return f4(aY(fl),v,u,l,l+6|0,pG)}if(0===dP(a)){var +g=a.length-1,w=a[1][1];if(2>>0)var +m=hu(a,2),n=fm(a,1),b=h(aY(py),n,m);else +switch(g){case +0:var +b=pz;break;case +1:var +b=pA;break;default:var +o=fm(a,1),b=c(aY(pB),o)}return bc(w,b)}return a[1]}function +fn(h,t){var +e=GL(t);if([0,e]){var +g=e.length-1-1|0,q=0;if(!(g<0)){var +b=q;for(;;){var +a=ae(e,b)[1+b],f=function(a){return function(b){return b?0===a?pH:pI:0===a?pJ:pK}}(b);if(0===a[0])var +i=a[5],j=a[4],k=a[3],l=a[6]?pL:pN,m=a[2],n=a[7],o=f(a[1]),d=[0,GB(aY(pM),o,n,m,l,k,j,i)];else +if(a[1])var +d=0;else +var +p=f(0),d=[0,c(aY(pO),p)];if(d){var +r=d[1];c(fi(h,pP),r)}var +s=b+1|0;if(g!==b){var +b=s;continue}break}}return 0}return fi(h,pQ)}function +d3(c){for(;;){var +a=fk[1],b=1-e_(fk,a,[0,c,a]);if(b)continue;return b}}var +pS=pR.slice();function +pT(e,d){var +f=d2(e);c(fj(pU),f);fn(bg,d);var +a=He(0);if(a<0){var +b=c3(a);g9(ae(pS,b)[1+b])}return cm(bg)}var +pV=[0];gV(a(kL),function(f,j){try{try{var +b=j?pV:my(0);try{fb(0)}catch(a){}try{var +a=pT(f,b),e=a}catch(a){a=d(a);var +h=d2(f);c(fj(pX),h);fn(bg,b);var +i=d2(a);c(fj(pY),i);fn(bg,my(0));var +e=cm(bg)}var +g=e}catch(a){a=d(a);if(a!==e$)throw a;var +g=g9(pW)}return g}catch(a){return 0}});var +p0=[O,pZ,aj(0)];d3(function(a){return a[1]===p0?[0,bc(p1,d2(a[2]))]:0});try{var +Gz=mK(Gy),hw=Gz}catch(a){a=d(a);if(a!==aL)throw a;try{var +Gx=mK(Gw),hv=Gx}catch(a){a=d(a);if(a!==aL)throw a;var +hv=p3}var +hw=hv}var +p4=nl(hw,82),d4=[jg,function(x){var +m=Hv(0),c=[0,bP(55,0),0],i=0===m.length-1?[0,0]:m,j=i.length-1,b=0;for(;;){ae(c[1],b)[1+b]=b;var w=b+1|0;if(54!==b){var b=w;continue}var -g=[0,nE],k=54+dK(55,j)|0,r=0;if(!(k<0)){var -d=r;for(;;){var -e=d%55|0,l=EU(d,j),s=am(i,l)[1+l],h=bM(g[1],a(u+s));g[1]=EP(h,0,K(h));var -f=g[1],n=D(f,3)<<24,o=D(f,2)<<16,p=D(f,1)<<8,q=((D(f,0)+p|0)+o|0)+n|0,t=(am(c[1],e)[1+e]^q)&f2;am(c[1],e)[1+e]=t;var +g=[0,p2],k=54+dU(55,j)|0,s=0;if(!(k<0)){var +d=s;for(;;){var +e=d%55|0,l=Hi(d,j),t=ae(i,l)[1+l],h=bc(g[1],a(o+t));g[1]=Hd(h,0,G(h));var +f=g[1],n=E(f,3)<<24,p=E(f,2)<<16,q=E(f,1)<<8,r=((E(f,0)+q|0)+p|0)+n|0,u=(ae(c[1],e)[1+e]^r)&gq;ae(c[1],e)[1+e]=u;var v=d+1|0;if(k!==d){var d=v;continue}break}}c[2]=0;return c}}];function -nH(h,k){var -l=h?h[1]:nG,b=16;for(;;){if(!(k<=b)&&!(gB<(b*2|0))){var +p5(h,k){var +l=h?h[1]:p4,b=16;for(;;){if(!(k<=b)&&!(ha<(b*2|0))){var b=b*2|0;continue}if(l){var -i=kW(dT),a=ed===i?dT[1]:im===i?lO(dT):dT;a[2]=(a[2]+1|0)%55|0;var -c=a[2],d=am(a[1],c)[1+c],e=(a[2]+24|0)%55|0,f=(am(a[1],e)[1+e]+(d^(d>>>25|0)&31)|0)&f2,g=a[2];am(a[1],g)[1+g]=f;var +i=dP(d4),a=ep===i?d4[1]:jg===i?nB(d4):d4;a[2]=(a[2]+1|0)%55|0;var +c=a[2],d=ae(a[1],c)[1+c],e=(a[2]+24|0)%55|0,f=(ae(a[1],e)[1+e]+(d^(d>>>25|0)&31)|0)&gq,g=a[2];ae(a[1],g)[1+g]=f;var j=f}else var -j=0;return[0,0,bL(b,0),j,b]}}function -bd(a){return Er(10,aT,0,a)}var -gZ=[R,nI,an(0)],gX=0,gY=-1;function -dU(a,b){a[13]=a[13]+b[3]|0;return gM(b,a[28])}var -g0=1000000010;function -e3(b,a){return Q(b[17],a,0,K(a))}function -e4(a){return c(a[19],0)}function -g1(a,c,b){a[9]=a[9]-c|0;e3(a,b);a[11]=0;return 0}function -dV(c,a){var -b=ah(a,nJ);return b?g1(c,K(a),a):b}function -cs(a,b,f){var -g=b[3],h=b[2];dV(a,b[1]);e4(a);a[11]=1;var -d=(a[6]-f|0)+h|0,e=a[8],i=EM(e,d)?e:d;a[10]=i;a[9]=a[6]-a[10]|0;c(a[21],a[10]);return dV(a,g)}function -g2(b,a){return cs(b,nK,a)}function -c2(a,b){var -d=b[2],e=b[3];dV(a,b[1]);a[9]=a[9]-d|0;c(a[20],d);return dV(a,e)}function -g3(a){for(;;){var +j=0;return[0,0,bP(b,0),j,b]}}function +bi(a){return GQ(10,aW,0,a)}var +hz=[O,p6,aj(0)],hx=0,hy=-1;function +d5(a,b){a[13]=a[13]+b[3]|0;return hl(b,a[28])}var +hA=1000000010;function +fo(b,a){return R(b[17],a,0,G(a))}function +fp(a){return c(a[19],0)}function +hB(a,c,b){a[9]=a[9]-c|0;fo(a,b);a[11]=0;return 0}function +d6(c,a){var +b=an(a,p7);return b?hB(c,G(a),a):b}function +cz(a,b,f){var +g=b[3],h=b[2];d6(a,b[1]);fp(a);a[11]=1;var +d=(a[6]-f|0)+h|0,e=a[8],i=Ha(e,d)?e:d;a[10]=i;a[9]=a[6]-a[10]|0;c(a[21],a[10]);return d6(a,g)}function +hC(b,a){return cz(b,p8,a)}function +c$(a,b){var +d=b[2],e=b[3];d6(a,b[1]);a[9]=a[9]-d|0;c(a[20],d);return d6(a,e)}function +hD(a){for(;;){var r=a[28][2],O=r?[0,r[1]]:0;if(O){var p=O[1],q=p[1],b=p[2],ac=0<=q?1:0,aa=p[3],ab=a[13]-a[12]|0,P=ac||(a[9]<=ab?1:0);if(P){var g=a[28],m=g[2];if(m){if(m[2]){var Q=m[2];g[1]=g[1]-1|0;g[2]=Q}else -eV(g);var -l=0<=q?q:g0;if(typeof +fc(g);var +l=0<=q?q:hA;if(typeof b==="number")switch(b){case 0:var -x=cp(a[3]);if(x){var +x=cw(a[3]);if(x){var y=x[1][1],z=function(b,a){if(a){var -c=a[1],d=a[2];return gm(b,c)?[0,b,a]:[0,c,z(b,d)]}return[0,b,0]};y[1]=z(a[6]-a[9]|0,y[1])}break;case -1:co(a[2]);break;case -2:co(a[3]);break;case +c=a[1],d=a[2];return gR(b,c)?[0,b,a]:[0,c,z(b,d)]}return[0,b,0]};y[1]=z(a[6]-a[9]|0,y[1])}break;case +1:cv(a[2]);break;case +2:cv(a[3]);break;case 3:var -A=cp(a[2]);if(A)g2(a,A[1][2]);else -e4(a);break;case +A=cw(a[2]);if(A)hC(a,A[1][2]);else +fp(a);break;case 4:if(a[10]!==(a[6]-a[9]|0)){var e=a[28],h=e[2];if(h){var s=h[1];if(h[2]){var R=h[2];e[1]=e[1]-1|0;e[2]=R;var -i=[0,s]}else{eV(e);var +i=[0,s]}else{fc(e);var i=[0,s]}}else var i=0;if(i){var w=i[1],T=w[1];a[12]=a[12]-w[3]|0;a[9]=a[9]+T|0}}break;default:var -B=co(a[5]);if(B)e3(a,c(a[25],B[1]))}else +B=cv(a[5]);if(B)fo(a,c(a[25],B[1]))}else switch(b[0]){case -0:g1(a,l,b[1]);break;case +0:hB(a,l,b[1]);break;case 1:var -d=b[2],j=b[1],C=d[1],U=d[2],D=cp(a[2]);if(D){var +d=b[2],j=b[1],C=d[1],U=d[2],D=cw(a[2]);if(D){var E=D[1],f=E[2];switch(E[1]){case -0:c2(a,j);break;case -1:cs(a,d,f);break;case -2:cs(a,d,f);break;case -3:if(a[9]<(l+K(C)|0))cs(a,d,f);else -c2(a,j);break;case -4:if(a[11]||!(a[9]<(l+K(C)|0)||((a[6]-f|0)+U|0)>>0))g2(a,v)}else -e4(a)}var -_=a[9]-Z|0,$=1===M?1:a[9]>>0))hC(a,v)}else +fp(a)}var +_=a[9]-Z|0,$=1===M?1:a[9]>>3|0,cl(b5(b,a>>>3|0)|1<<(a&7)))}function -dZ(b){var -a=e_(0);c3(a,b);return a}function -d0(c){var -b=ae(32),a=0;for(;;){a9(b,a,cl(b5(c,a)^cG));var +h=d[1],a=c(aY(rL),h);return[0,R(aY(qH),a,g,f)]}return 0});e9(rM);e9(rN);try{e9(Gv)}catch(a){a=d(a);if(a[1]!==dT)throw a}try{e9(Gu)}catch(a){a=d(a);if(a[1]!==dT)throw a}p5(0,7);function +rO(b,a){return dX(b,0,a)}function +rP(b,a){return dX(b,a,G(b)-a|0)}var +bF=bh(32,cN);function +fv(a){return bh(32,0)}function +da(b,a){return ba(b,a>>>3|0,cs(b9(b,a>>>3|0)|1<<(a&7)))}function +d_(b){var +a=fv(0);da(a,b);return a}function +d$(c){var +b=af(32),a=0;for(;;){ba(b,a,cs(b9(c,a)^cN));var d=a+1|0;if(31!==a){var a=d;continue}return b}}function -e$(d,c){var -b=ae(32),a=0;for(;;){var -e=b5(c,a);a9(b,a,cl(b5(d,a)|e));var +fw(d,c){var +b=af(32),a=0;for(;;){var +e=b9(c,a);ba(b,a,cs(b9(d,a)|e));var f=a+1|0;if(31!==a){var a=f;continue}return b}}function -pu(c,b){try{var +rQ(c,b){try{var a=0;for(;;){var -f=b5(b,a);if(0!==(b5(c,a)&f))throw gw;var +f=b9(b,a);if(0!==(b9(c,a)&f))throw g3;var g=a+1|0;if(31!==a){var a=g;continue}var -e=1;return e}}catch(a){a=d(a);if(a===gw)return 0;throw a}}function -hd(f,e){var +e=1;return e}}catch(a){a=d(a);if(a===g3)return 0;throw a}}function +hP(f,e){var a=0;for(;;){var -d=b5(e,a);if(0!==d){var -b=0;for(;;){if(0!==(d&1<>>0){if(!(25<(b+a$|0)>>>0))d=1}else +c=fv(0);hP(function(a){da(c,g$(a));var +b=a-224|0,d=0;if(30>>0){if(!(25<(b+bd|0)>>>0))d=1}else if(23!==b)d=1;var -e=d?a+f8|0:a;return c3(c,e)},b);var +e=d?a+gA|0:a;return da(c,e)},b);var d=c}else var d=b;var -h=f?d0(d):d;return dN(h)}throw[0,L,pJ]}var -hh=ae(cK),dd=0;for(;;){a9(hh,dd,gz(cl(dd)));var -D9=dd+1|0;if(cG!==dd){var -dd=D9;continue}dN(hh);var -d3=dP([0,gq]),hi=function(a){var -b=gN(a[1]);a[1][2]=0;var -c=K(b);if(0===c)return 0;if(1===c){var -d=a[2];a[2]=[0,[0,D(b,0)],d];return 0}a[2]=[0,[1,b],a[2]];return 0},pN=d0(dZ(10)),fe=A,ff=kK,pT=function(b){var -f=K(b),z=[0,1];function +h=f?d$(d):d;return dW(h)}throw[0,J,r5]}var +hT=af(cR),dm=0;for(;;){ba(hT,dm,g$(cs(dm)));var +Gt=dm+1|0;if(cN!==dm){var +dm=Gt;continue}dW(hT);var +ec=dY([0,gW]),hU=function(a){var +b=hm(a[1]);a[1][2]=0;var +c=G(b);if(0===c)return 0;if(1===c){var +d=a[2];a[2]=[0,[0,E(b,0)],d];return 0}a[2]=[0,[1,b],a[2]];return 0},r9=d$(d_(10)),fB=A,fC=ms,sd=function(b){var +f=G(b),z=[0,1];function C(g){var -d=e_(0),a=g;for(;;){if(f<=a)bu(pR);if(93===D(b,a)&&g>>0)if(9<=r)var -j=[0,[9,k+ec|0],g+1|0];else +j=[0,[9,k+eo|0],g+1|0];else l=1;else if(r)l=2;else{var H=z[1];z[1]++;var -t=A(g+1|0),o=t[2],y=0,I=t[1];if((o+1|0)>>0)){if(q){var +q=E(b,d)-42|0;if(!(1>>0)){if(q){var c=[6,c],d=d+1|0;continue}var c=[5,c],d=d+1|0;continue}if(21===q){var c=[7,c],d=d+1|0;continue}}var B=0;if(typeof -c!=="number"&&0===c[0]){gO(h[1],c[1]);B=1}if(!B){hi(h);h[2]=[0,c,h[2]]}var -a=d;continue a}}}hi(h);return[0,[3,dM(h[2])],a]}}function +c!=="number"&&0===c[0]){hn(h[1],c[1]);B=1}if(!B){hU(h);h[2]=[0,c,h[2]]}var +a=d;continue a}}}hU(h);return[0,[3,dV(h[2])],a]}}function A(g){var -d=B(g),c=d[1],a=d[2];for(;;){if((a+2|0)<=f&&92===D(b,a)&&dq===D(b,a+1|0)){var +d=B(g),c=d[1],a=d[2];for(;;){if((a+2|0)<=f&&92===E(b,a)&&dz===E(b,a+1|0)){var e=B(a+2|0),c=[4,c,e[1]],a=e[2];continue}return[0,c,a]}}var -E=A(0),O=E[1],F=E[2]===f?O:bu(pS),g=[0,bL(32,0)],c=[0,0],m=[0,d3[1]],n=[0,0],j=[0,1],o=[0,0],r=0;function +D=A(0),O=D[1],F=D[2]===f?O:bB(sc),g=[0,bP(32,0)],c=[0,0],m=[0,ec[1]],n=[0,0],j=[0,1],o=[0,0],r=0;function a(f,e){if(g[1].length-1<=c[1]){var a=[0,g[1].length-1];for(;;){if(a[1]<=c[1]){a[1]=a[1]*2|0;continue}var -b=bL(a[1],0);gL(g[1],0,b,0,g[1].length-1);g[1]=b;break}}var -h=hg(f,e),d=c[1];am(g[1],d)[1+d]=h;c[1]++;return 0}function +b=bP(a[1],0);hk(g[1],0,b,0,g[1].length-1);g[1]=b;break}}var +h=hS(f,e),d=c[1];ae(g[1],d)[1+d]=h;c[1]++;return 0}function k(d){var -b=c[1];a(d1,0);return b}function +b=c[1];a(ea,0);return b}function l(a,c,b){var -d=hg(c,fb(b,a));am(g[1],a)[1+a]=d;return 0}function +d=hS(c,fy(b,a));ae(g[1],a)[1+a]=d;return 0}function i(b){try{var -a=h(d3[28],b,m[1]);return a}catch(a){a=d(a);if(a===aB){var -c=n[1];m[1]=Q(d3[4],b,c,m[1]);n[1]++;return c}throw a}}function -t(b){if(fc(b)){var -a=o[1];if(64<=a)bu(pK);o[1]++;return a}return-1}function -p(b,a){return pu(b,a)}function +a=h(ec[28],b,m[1]);return a}catch(a){a=d(a);if(a===aL){var +c=n[1];m[1]=R(ec[4],b,c,m[1]);n[1]++;return c}throw a}}function +t(b){if(fz(b)){var +a=o[1];if(64<=a)bB(r6);o[1]++;return a}return-1}function +p(b,a){return rQ(b,a)}function e(b){if(typeof b==="number")switch(b){case -0:return a(px,0);case -1:return a(py,0);default:return a(pz,0)}else +0:return a(rT,0);case +1:return a(rU,0);default:return a(rV,0)}else switch(b[0]){case -0:return a(d1,b[1]);case +0:return a(ea,b[1]);case 1:var -f=b[1],n=K(f);if(0===n)return 0;if(1===n)return a(d1,D(f,0));try{var -o=gK(f,0);e([1,ps(f,o)]);a(d1,0);var -v=e([1,pt(f,o+1|0)]);return v}catch(b){b=d(b);if(b===aB)return a(pv,i(f));throw b}case +f=b[1],n=G(f);if(0===n)return 0;if(1===n)return a(ea,E(f,0));try{var +o=hj(f,0);e([1,rO(f,o)]);a(ea,0);var +v=e([1,rP(f,o+1|0)]);return v}catch(b){b=d(b);if(b===aL)return a(rR,i(f));throw b}case 2:var -p=b[1],w=b[2]?d0(p):p;return a(pw,i(dN(w)));case -3:return H(b[1]);case +p=b[1],w=b[2]?d$(p):p;return a(rS,i(dW(w)));case +3:return I(b[1]);case 4:var x=b[2],y=b[1],z=k(0);e(y);var A=k(0),B=c[1];e(x);var -C=c[1];l(z,d2,B);return l(A,fa,C);case +C=c[1];l(z,eb,B);return l(A,fx,C);case 5:var -q=b[1],g=t(q),r=k(0);if(0<=g)a(he,g);e(q);if(0<=g)a(hf,g);a(fa,fb(r,c[1]));return l(r,d2,c[1]);case +q=b[1],g=t(q),r=k(0);if(0<=g)a(hQ,g);e(q);if(0<=g)a(hR,g);a(fx,fy(r,c[1]));return l(r,eb,c[1]);case 6:var -s=b[1],h=t(s),E=c[1];e(s);if(0<=h)a(hf,h);var -F=k(0);if(0<=h)a(he,h);a(fa,fb(E,c[1]));return l(F,d2,c[1]);case +s=b[1],h=t(s),D=c[1];e(s);if(0<=h)a(hR,h);var +F=k(0);if(0<=h)a(hQ,h);a(fx,fy(D,c[1]));return l(F,eb,c[1]);case 7:var -G=b[1],I=k(0);e(G);return l(I,d2,c[1]);case +H=b[1],J=k(0);e(H);return l(J,eb,c[1]);case 8:var -m=b[1],J=b[2];a(pA,m);e(J);a(pB,m);j[1]=dK(j[1],m+1|0);return 0;default:var -u=b[1];a(pC,u);j[1]=dK(j[1],u+1|0);return 0}}function -H(o){var +m=b[1],K=b[2];a(rW,m);e(K);a(rX,m);j[1]=dU(j[1],m+1|0);return 0;default:var +u=b[1];a(rY,u);j[1]=dU(j[1],u+1|0);return 0}}function +I(o){var b=o;for(;;){if(b){var c=b[1];if(typeof c!=="number")switch(c[0]){case @@ -2923,7 +3079,7 @@ d==="number")l=1;else switch(d[0]){case 0:case 2:var -h=b[2],s=c4(h);if(p(bO(d),s)){a(pF,i(fd(r,d)));var +h=b[2],s=db(h);if(p(bS(d),s)){a(r1,i(fA(r,d)));var b=h;continue}break;default:l=1}break;case 6:var f=c[1],m=0;if(typeof @@ -2931,7 +3087,7 @@ f==="number")m=1;else switch(f[0]){case 0:case 2:var -j=b[2],t=c4(j);if(p(bO(f),t)){a(pG,i(fd(r,f)));var +j=b[2],t=db(j);if(p(bS(f),t)){a(r2,i(fA(r,f)));var b=j;continue}break;default:m=1}break;case 7:var g=c[1],n=0;if(typeof @@ -2939,118 +3095,118 @@ g==="number")n=1;else switch(g[0]){case 0:case 2:var -k=b[2],u=c4(k);if(p(bO(g),u)){a(pE,i(fd(r,g)));var +k=b[2],u=db(k);if(p(bS(g),u)){a(r0,i(fA(r,g)));var b=k;continue}break;default:n=1}break}var q=b[2];e(c);var -b=q;continue}return 0}}e(F);a(pD,0);var -u=bO(F);if(kI(u,bx))var +b=q;continue}return 0}}e(F);a(rZ,0);var +u=bS(F);if(mq(u,bF))var v=-1;else{var -s=bc(cK,0);hd(function(a){return a9(s,a,1)},u);var -v=i(dN(s))}var -w=bL(n[1],pL),I=m[1];function -J(b,a){am(w,a)[1+a]=b;return 0}h(d3[12],J,I);var -q=c[1],x=g[1],G=0,M=o[1],N=j[1];if(0<=q&&!((x.length-1-q|0)<0)){var -y=Ej(x,0,q);G=1}if(!G)var -y=ai(lz);return[0,y,w,pM,N,M,v]},d4=function(b,a){return Math.abs(b-a)<0.001?1:0},fg=function(b,a){return d4(b,a)?0:b>>0))switch(b){case +d=gZ(a);if(63>>0))switch(b){case 0:return 2;case -1:break;default:return 1}return 3}return a[1]===aG?0:4},sn=function(a){return[0,dH(a[1]),a[2]]},fu=function(b,a){if(b[2]!==aG&&a[2]!==aG)return da(b8(b[1],a[1]),b8(b[2],a[2]));return[0,aE(br(bs(b[1]),bs(a[1]))),aG]},fv=function(a){switch(a){case +1:break;default:return 1}return 3}return a[1]===aG?0:4},uJ=function(a){return[0,dR(a[1]),a[2]]},fR=function(b,a){if(b[2]!==aG&&a[2]!==aG)return dj(cb(b[1],a[1]),cb(b[2],a[2]));return[0,aE(by(bz(b[1]),bz(a[1]))),aG]},fS=function(a){switch(a){case 0:return 2;case 1:return 8;case -2:return 10;default:return 16}},fw=function(f,e,d,b){var -a=e;for(;;){if(d<=a)return 0;if(c(b,D(f,a)))return[0,a];var -a=a+1|0;continue}},sp=function(a){if(ah(a,sq)){if(ah(a,sr)){if(!ah(a,ss))return hK;if(ah(a,st)){if(ah(a,su))try{var -l=gK(a,47),Z=ck(0,a,l+1|0,(K(a)-l|0)-1|0),_=hH(ck(0,a,0,l),Z);return _}catch(l){l=d(l);if(l===aB){var -j=K(a),x=0;if(j<1)var +2:return 10;default:return 16}},fT=function(f,e,d,b){var +a=e;for(;;){if(d<=a)return 0;if(c(b,E(f,a)))return[0,a];var +a=a+1|0;continue}},uL=function(a){if(an(a,uM)){if(an(a,uN)){if(!an(a,uO))return il;if(an(a,uP)){if(an(a,uQ))try{var +l=hj(a,47),Z=cr(0,a,l+1|0,(G(a)-l|0)-1|0),_=ii(cr(0,a,0,l),Z);return _}catch(l){l=d(l);if(l===aL){var +j=G(a),x=0;if(j<1)var s=[0,0,x];else{var -P=D(a,0)+kp|0,S=0;if(!(2

>>0)){var +P=E(a,0)+l5|0,S=0;if(!(2

>>0)){var T=0;switch(P){case 0:var R=[0,0,1];break;case @@ -3334,10 +3490,10 @@ Q=[0,0,x];var s=Q}var c=s[2];if(j<(c+2|0))var t=[0,2,c];else{var -Y=D(a,c),h=D(a,c+1|0),r=0;if(48===Y){var +Y=E(a,c),h=E(a,c+1|0),r=0;if(48===Y){var i=0;if(89<=h){if(98===h)i=2;else -if(f$===h)i=1;else -if(bU!==h){r=1;i=3}}else +if(gD===h)i=1;else +if(bY!==h){r=1;i=3}}else if(66===h)i=2;else if(79===h)i=1;else if(!(88<=h)){r=1;i=3}switch(i){case @@ -3350,222 +3506,222 @@ q=[0,0,c+2|0]}}else r=1;if(r)var q=[0,2,c];var t=q}var -e=t[2],b=t[1],U=2===b?function(a){if(69!==a&&ej!==a)return 0;return 1}:3<=b?function(a){if(80!==a&&f_!==a)return 0;return 1}:function(a){return 0},y=fw(a,e,j,U);if(y)var -z=y[1],A=z+1|0,f=z,B=dI(ck(10,a,A,j-A|0));else +e=t[2],b=t[1],U=2===b?function(a){if(69!==a&&ev!==a)return 0;return 1}:3<=b?function(a){if(80!==a&&gC!==a)return 0;return 1}:function(a){return 0},y=fT(a,e,j,U);if(y)var +z=y[1],A=z+1|0,f=z,B=dS(cr(10,a,A,j-A|0));else var f=j,B=0;if(2<=b){var -C=fw(a,e,f,function(a){return 46===a?1:0});if(C){var +C=fT(a,e,f,function(a){return 46===a?1:0});if(C){var u=C[1];if(2===b)var -E=1;else{if(!(3<=b))throw[0,L,sw];var -E=4}var -G=u+1|0,H=f-1|0,F=0;if(H true + (((match param_.obligation_scolaire with + | Avant _ -> true + | Pendant _ -> false + | Apres _ -> false) + || (match param_.obligation_scolaire with + | Avant _ -> false + | Pendant _ -> true + | Apres _ -> false) + || + match param_.obligation_scolaire with + | Avant _ -> false | Pendant _ -> false - | Apres _ -> false) - || (match param_.obligation_scolaire with - | Avant _ -> false - | Pendant _ -> true - | Apres _ -> false) - || (match param_.obligation_scolaire with - | Avant _ -> false - | Pendant _ -> false - | Apres _ -> true) - && param_.remuneration_mensuelle <=$ plafond_l512_3_2_) + | Apres _ -> true) + && param_.remuneration_mensuelle <=$ plafond_l512_3_2_) then true else raise EmptyError with EmptyError -> false diff --git a/french_law/python/src/allocations_familiales.py b/french_law/python/src/allocations_familiales.py index 6219e2bbc..b162982f5 100644 --- a/french_law/python/src/allocations_familiales.py +++ b/french_law/python/src/allocations_familiales.py @@ -4,7 +4,6 @@ from typing import Any, List, Callable, Tuple from enum import Enum - class PriseEnCharge_Code(Enum): GardeAlterneePartageAllocations = 0 GardeAlterneeAllocataireUnique = 1 @@ -12,48 +11,48 @@ class PriseEnCharge_Code(Enum): ServicesSociauxAllocationVerseeALaFamille = 3 ServicesSociauxAllocationVerseeAuxServicesSociaux = 4 - class PriseEnCharge: - def __init__(self, code: PriseEnCharge_Code, value: Any) -> None: - self.code = code - self.value = value + def __init__(self, code: PriseEnCharge_Code, value: Any) -> None: + self.code = code + self.value = value - def __eq__(self, other: object) -> bool: - if isinstance(other, PriseEnCharge): - return self.code == other.code and self.value == other.value - else: - return False - def __ne__(self, other: object) -> bool: - return not (self == other) + def __eq__(self, other: object) -> bool: + if isinstance(other, PriseEnCharge): + return self.code == other.code and self.value == other.value + else: + return False - def __str__(self) -> str: - return "{}({})".format(self.code, self.value) + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) class SituationObligationScolaire_Code(Enum): Avant = 0 Pendant = 1 Apres = 2 - class SituationObligationScolaire: - def __init__(self, code: SituationObligationScolaire_Code, value: Any) -> None: - self.code = code - self.value = value + def __init__(self, code: SituationObligationScolaire_Code, value: Any) -> None: + self.code = code + self.value = value - def __eq__(self, other: object) -> bool: - if isinstance(other, SituationObligationScolaire): - return self.code == other.code and self.value == other.value - else: - return False - def __ne__(self, other: object) -> bool: - return not (self == other) + def __eq__(self, other: object) -> bool: + if isinstance(other, SituationObligationScolaire): + return self.code == other.code and self.value == other.value + else: + return False - def __str__(self) -> str: - return "{}({})".format(self.code, self.value) + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) class Collectivite_Code(Enum): Guadeloupe = 0 @@ -66,71 +65,71 @@ class Collectivite_Code(Enum): SaintPierreEtMiquelon = 7 Mayotte = 8 - class Collectivite: - def __init__(self, code: Collectivite_Code, value: Any) -> None: - self.code = code - self.value = value + def __init__(self, code: Collectivite_Code, value: Any) -> None: + self.code = code + self.value = value - def __eq__(self, other: object) -> bool: - if isinstance(other, Collectivite): - return self.code == other.code and self.value == other.value - else: - return False - def __ne__(self, other: object) -> bool: - return not (self == other) + def __eq__(self, other: object) -> bool: + if isinstance(other, Collectivite): + return self.code == other.code and self.value == other.value + else: + return False - def __str__(self) -> str: - return "{}({})".format(self.code, self.value) + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) class PriseEnCompte_Code(Enum): Complete = 0 Partagee = 1 Zero = 2 - class PriseEnCompte: - def __init__(self, code: PriseEnCompte_Code, value: Any) -> None: - self.code = code - self.value = value + def __init__(self, code: PriseEnCompte_Code, value: Any) -> None: + self.code = code + self.value = value - def __eq__(self, other: object) -> bool: - if isinstance(other, PriseEnCompte): - return self.code == other.code and self.value == other.value - else: - return False - def __ne__(self, other: object) -> bool: - return not (self == other) + def __eq__(self, other: object) -> bool: + if isinstance(other, PriseEnCompte): + return self.code == other.code and self.value == other.value + else: + return False - def __str__(self) -> str: - return "{}({})".format(self.code, self.value) + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) class VersementAllocations_Code(Enum): Normal = 0 AllocationVerseeAuxServicesSociaux = 1 - class VersementAllocations: - def __init__(self, code: VersementAllocations_Code, value: Any) -> None: - self.code = code - self.value = value + def __init__(self, code: VersementAllocations_Code, value: Any) -> None: + self.code = code + self.value = value - def __eq__(self, other: object) -> bool: - if isinstance(other, VersementAllocations): - return self.code == other.code and self.value == other.value - else: - return False - def __ne__(self, other: object) -> bool: - return not (self == other) + def __eq__(self, other: object) -> bool: + if isinstance(other, VersementAllocations): + return self.code == other.code and self.value == other.value + else: + return False - def __str__(self) -> str: - return "{}({})".format(self.code, self.value) + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) class ElementPrestationsFamiliales_Code(Enum): PrestationAccueilJeuneEnfant = 0 @@ -142,858 +141,865 @@ class ElementPrestationsFamiliales_Code(Enum): AllocationRentreeScolaire = 6 AllocationJournalierePresenceParentale = 7 - class ElementPrestationsFamiliales: - def __init__(self, code: ElementPrestationsFamiliales_Code, value: Any) -> None: - self.code = code - self.value = value + def __init__(self, code: ElementPrestationsFamiliales_Code, value: Any) -> None: + self.code = code + self.value = value - def __eq__(self, other: object) -> bool: - if isinstance(other, ElementPrestationsFamiliales): - return self.code == other.code and self.value == other.value - else: - return False - def __ne__(self, other: object) -> bool: - return not (self == other) - - def __str__(self) -> str: - return "{}({})".format(self.code, self.value) - - -class EnfantEntree: - def __init__(self, d_identifiant: Integer, d_remuneration_mensuelle: Money, d_date_de_naissance: Date, d_prise_en_charge: PriseEnCharge, d_a_deja_ouvert_droit_aux_allocations_familiales: bool) -> None: - self.d_identifiant = d_identifiant - self.d_remuneration_mensuelle = d_remuneration_mensuelle - self.d_date_de_naissance = d_date_de_naissance - self.d_prise_en_charge = d_prise_en_charge - self.d_a_deja_ouvert_droit_aux_allocations_familiales = d_a_deja_ouvert_droit_aux_allocations_familiales + def __eq__(self, other: object) -> bool: + if isinstance(other, ElementPrestationsFamiliales): + return self.code == other.code and self.value == other.value + else: + return False - def __eq__(self, other: object) -> bool: - if isinstance(other, EnfantEntree): - return (self.d_identifiant == other.d_identifiant and - self.d_remuneration_mensuelle == other.d_remuneration_mensuelle and - self.d_date_de_naissance == other.d_date_de_naissance and - self.d_prise_en_charge == other.d_prise_en_charge and - self.d_a_deja_ouvert_droit_aux_allocations_familiales == other.d_a_deja_ouvert_droit_aux_allocations_familiales) - else: - return False - def __ne__(self, other: object) -> bool: - return not (self == other) + def __ne__(self, other: object) -> bool: + return not (self == other) - def __str__(self) -> str: - return "EnfantEntree(d_identifiant={},d_remuneration_mensuelle={},d_date_de_naissance={},d_prise_en_charge={},d_a_deja_ouvert_droit_aux_allocations_familiales={})".format(self.d_identifiant, - self.d_remuneration_mensuelle, self.d_date_de_naissance, - self.d_prise_en_charge, - self.d_a_deja_ouvert_droit_aux_allocations_familiales) + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) +class EnfantEntree: + def __init__(self, d_identifiant: Integer, d_remuneration_mensuelle: Money, d_date_de_naissance: Date, d_prise_en_charge: PriseEnCharge, d_a_deja_ouvert_droit_aux_allocations_familiales: bool) -> None: + self.d_identifiant = d_identifiant + self.d_remuneration_mensuelle = d_remuneration_mensuelle + self.d_date_de_naissance = d_date_de_naissance + self.d_prise_en_charge = d_prise_en_charge + self.d_a_deja_ouvert_droit_aux_allocations_familiales = d_a_deja_ouvert_droit_aux_allocations_familiales + + def __eq__(self, other: object) -> bool: + if isinstance(other, EnfantEntree): + return (self.d_identifiant == other.d_identifiant and + self.d_remuneration_mensuelle == other.d_remuneration_mensuelle and + self.d_date_de_naissance == other.d_date_de_naissance and + self.d_prise_en_charge == other.d_prise_en_charge and + self.d_a_deja_ouvert_droit_aux_allocations_familiales == other.d_a_deja_ouvert_droit_aux_allocations_familiales) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "EnfantEntree(d_identifiant={},d_remuneration_mensuelle={},d_date_de_naissance={},d_prise_en_charge={},d_a_deja_ouvert_droit_aux_allocations_familiales={})".format(self.d_identifiant, + self.d_remuneration_mensuelle, self.d_date_de_naissance, + self.d_prise_en_charge, + self.d_a_deja_ouvert_droit_aux_allocations_familiales) class Enfant: - def __init__(self, identifiant: Integer, obligation_scolaire: SituationObligationScolaire, remuneration_mensuelle: Money, date_de_naissance: Date, age: Integer, prise_en_charge: PriseEnCharge, a_deja_ouvert_droit_aux_allocations_familiales: bool) -> None: - self.identifiant = identifiant - self.obligation_scolaire = obligation_scolaire - self.remuneration_mensuelle = remuneration_mensuelle - self.date_de_naissance = date_de_naissance - self.age = age - self.prise_en_charge = prise_en_charge - self.a_deja_ouvert_droit_aux_allocations_familiales = a_deja_ouvert_droit_aux_allocations_familiales - - def __eq__(self, other: object) -> bool: - if isinstance(other, Enfant): - return (self.identifiant == other.identifiant and - self.obligation_scolaire == other.obligation_scolaire and - self.remuneration_mensuelle == other.remuneration_mensuelle and - self.date_de_naissance == other.date_de_naissance and - self.age == other.age and - self.prise_en_charge == other.prise_en_charge and - self.a_deja_ouvert_droit_aux_allocations_familiales == other.a_deja_ouvert_droit_aux_allocations_familiales) - else: - return False - - def __ne__(self, other: object) -> bool: - return not (self == other) - - def __str__(self) -> str: - return "Enfant(identifiant={},obligation_scolaire={},remuneration_mensuelle={},date_de_naissance={},age={},prise_en_charge={},a_deja_ouvert_droit_aux_allocations_familiales={})".format(self.identifiant, - self.obligation_scolaire, self.remuneration_mensuelle, - self.date_de_naissance, self.age, self.prise_en_charge, - self.a_deja_ouvert_droit_aux_allocations_familiales) - + def __init__(self, identifiant: Integer, obligation_scolaire: SituationObligationScolaire, remuneration_mensuelle: Money, date_de_naissance: Date, age: Integer, prise_en_charge: PriseEnCharge, a_deja_ouvert_droit_aux_allocations_familiales: bool) -> None: + self.identifiant = identifiant + self.obligation_scolaire = obligation_scolaire + self.remuneration_mensuelle = remuneration_mensuelle + self.date_de_naissance = date_de_naissance + self.age = age + self.prise_en_charge = prise_en_charge + self.a_deja_ouvert_droit_aux_allocations_familiales = a_deja_ouvert_droit_aux_allocations_familiales + + def __eq__(self, other: object) -> bool: + if isinstance(other, Enfant): + return (self.identifiant == other.identifiant and + self.obligation_scolaire == other.obligation_scolaire and + self.remuneration_mensuelle == other.remuneration_mensuelle and + self.date_de_naissance == other.date_de_naissance and + self.age == other.age and + self.prise_en_charge == other.prise_en_charge and + self.a_deja_ouvert_droit_aux_allocations_familiales == other.a_deja_ouvert_droit_aux_allocations_familiales) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "Enfant(identifiant={},obligation_scolaire={},remuneration_mensuelle={},date_de_naissance={},age={},prise_en_charge={},a_deja_ouvert_droit_aux_allocations_familiales={})".format(self.identifiant, + self.obligation_scolaire, self.remuneration_mensuelle, + self.date_de_naissance, self.age, self.prise_en_charge, + self.a_deja_ouvert_droit_aux_allocations_familiales) class SmicOut: - def __init__(self, date_courante_out: Date, residence_out: Collectivite, brut_horaire_out: Money) -> None: - self.date_courante_out = date_courante_out - self.residence_out = residence_out - self.brut_horaire_out = brut_horaire_out - - def __eq__(self, other: object) -> bool: - if isinstance(other, SmicOut): - return (self.date_courante_out == other.date_courante_out and - self.residence_out == other.residence_out and - self.brut_horaire_out == other.brut_horaire_out) - else: - return False - - def __ne__(self, other: object) -> bool: - return not (self == other) - - def __str__(self) -> str: - return "SmicOut(date_courante_out={},residence_out={},brut_horaire_out={})".format(self.date_courante_out, - self.residence_out, self.brut_horaire_out) - + def __init__(self, date_courante_out: Date, residence_out: Collectivite, brut_horaire_out: Money) -> None: + self.date_courante_out = date_courante_out + self.residence_out = residence_out + self.brut_horaire_out = brut_horaire_out + + def __eq__(self, other: object) -> bool: + if isinstance(other, SmicOut): + return (self.date_courante_out == other.date_courante_out and + self.residence_out == other.residence_out and + self.brut_horaire_out == other.brut_horaire_out) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "SmicOut(date_courante_out={},residence_out={},brut_horaire_out={})".format(self.date_courante_out, + self.residence_out, self.brut_horaire_out) class SmicIn: - def __init__(self, date_courante_in: Callable[[Unit], Date], residence_in: Callable[[Unit], Collectivite], brut_horaire_in: Callable[[Unit], Money]) -> None: - self.date_courante_in = date_courante_in - self.residence_in = residence_in - self.brut_horaire_in = brut_horaire_in - - def __eq__(self, other: object) -> bool: - if isinstance(other, SmicIn): - return (self.date_courante_in == other.date_courante_in and - self.residence_in == other.residence_in and - self.brut_horaire_in == other.brut_horaire_in) - else: - return False - - def __ne__(self, other: object) -> bool: - return not (self == other) - - def __str__(self) -> str: - return "SmicIn(date_courante_in={},residence_in={},brut_horaire_in={})".format(self.date_courante_in, - self.residence_in, self.brut_horaire_in) - + def __init__(self, date_courante_in: Callable[[Unit], Date], residence_in: Callable[[Unit], Collectivite], brut_horaire_in: Callable[[Unit], Money]) -> None: + self.date_courante_in = date_courante_in + self.residence_in = residence_in + self.brut_horaire_in = brut_horaire_in + + def __eq__(self, other: object) -> bool: + if isinstance(other, SmicIn): + return (self.date_courante_in == other.date_courante_in and + self.residence_in == other.residence_in and + self.brut_horaire_in == other.brut_horaire_in) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "SmicIn(date_courante_in={},residence_in={},brut_horaire_in={})".format(self.date_courante_in, + self.residence_in, self.brut_horaire_in) class PrestationsFamilialesOut: - def __init__(self, droit_ouvert_out: Callable[[Enfant], bool], conditions_hors_age_out: Callable[[Enfant], bool], plafond_l512_3_2_out: Money, age_l512_3_2_out: Integer, regime_outre_mer_l751_1_out: bool, date_courante_out: Date, prestation_courante_out: ElementPrestationsFamiliales, residence_out: Collectivite, base_mensuelle_out: Money) -> None: - self.droit_ouvert_out = droit_ouvert_out - self.conditions_hors_age_out = conditions_hors_age_out - self.plafond_l512_3_2_out = plafond_l512_3_2_out - self.age_l512_3_2_out = age_l512_3_2_out - self.regime_outre_mer_l751_1_out = regime_outre_mer_l751_1_out - self.date_courante_out = date_courante_out - self.prestation_courante_out = prestation_courante_out - self.residence_out = residence_out - self.base_mensuelle_out = base_mensuelle_out - - def __eq__(self, other: object) -> bool: - if isinstance(other, PrestationsFamilialesOut): - return (self.droit_ouvert_out == other.droit_ouvert_out and - self.conditions_hors_age_out == other.conditions_hors_age_out and - self.plafond_l512_3_2_out == other.plafond_l512_3_2_out and - self.age_l512_3_2_out == other.age_l512_3_2_out and - self.regime_outre_mer_l751_1_out == other.regime_outre_mer_l751_1_out and - self.date_courante_out == other.date_courante_out and - self.prestation_courante_out == other.prestation_courante_out and - self.residence_out == other.residence_out and - self.base_mensuelle_out == other.base_mensuelle_out) - else: - return False - - def __ne__(self, other: object) -> bool: - return not (self == other) - - def __str__(self) -> str: - return "PrestationsFamilialesOut(droit_ouvert_out={},conditions_hors_age_out={},plafond_l512_3_2_out={},age_l512_3_2_out={},regime_outre_mer_l751_1_out={},date_courante_out={},prestation_courante_out={},residence_out={},base_mensuelle_out={})".format(self.droit_ouvert_out, - self.conditions_hors_age_out, self.plafond_l512_3_2_out, - self.age_l512_3_2_out, self.regime_outre_mer_l751_1_out, - self.date_courante_out, self.prestation_courante_out, - self.residence_out, self.base_mensuelle_out) - + def __init__(self, droit_ouvert_out: Callable[[Enfant], bool], conditions_hors_age_out: Callable[[Enfant], bool], plafond_l512_3_2_out: Money, age_l512_3_2_out: Integer, regime_outre_mer_l751_1_out: bool, date_courante_out: Date, prestation_courante_out: ElementPrestationsFamiliales, residence_out: Collectivite, base_mensuelle_out: Money) -> None: + self.droit_ouvert_out = droit_ouvert_out + self.conditions_hors_age_out = conditions_hors_age_out + self.plafond_l512_3_2_out = plafond_l512_3_2_out + self.age_l512_3_2_out = age_l512_3_2_out + self.regime_outre_mer_l751_1_out = regime_outre_mer_l751_1_out + self.date_courante_out = date_courante_out + self.prestation_courante_out = prestation_courante_out + self.residence_out = residence_out + self.base_mensuelle_out = base_mensuelle_out + + def __eq__(self, other: object) -> bool: + if isinstance(other, PrestationsFamilialesOut): + return (self.droit_ouvert_out == other.droit_ouvert_out and + self.conditions_hors_age_out == other.conditions_hors_age_out and + self.plafond_l512_3_2_out == other.plafond_l512_3_2_out and + self.age_l512_3_2_out == other.age_l512_3_2_out and + self.regime_outre_mer_l751_1_out == other.regime_outre_mer_l751_1_out and + self.date_courante_out == other.date_courante_out and + self.prestation_courante_out == other.prestation_courante_out and + self.residence_out == other.residence_out and + self.base_mensuelle_out == other.base_mensuelle_out) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "PrestationsFamilialesOut(droit_ouvert_out={},conditions_hors_age_out={},plafond_l512_3_2_out={},age_l512_3_2_out={},regime_outre_mer_l751_1_out={},date_courante_out={},prestation_courante_out={},residence_out={},base_mensuelle_out={})".format(self.droit_ouvert_out, + self.conditions_hors_age_out, self.plafond_l512_3_2_out, + self.age_l512_3_2_out, self.regime_outre_mer_l751_1_out, + self.date_courante_out, self.prestation_courante_out, + self.residence_out, self.base_mensuelle_out) class PrestationsFamilialesIn: - def __init__(self, droit_ouvert_in: Callable[[Unit], (Callable[[Enfant], bool])], conditions_hors_age_in: Callable[[Unit], (Callable[[Enfant], bool])], plafond_l512_3_2_in: Callable[[Unit], Money], age_l512_3_2_in: Callable[[Unit], Integer], regime_outre_mer_l751_1_in: Callable[[Unit], bool], date_courante_in: Callable[[Unit], Date], prestation_courante_in: Callable[[Unit], ElementPrestationsFamiliales], residence_in: Callable[[Unit], Collectivite], base_mensuelle_in: Callable[[Unit], Money]) -> None: - self.droit_ouvert_in = droit_ouvert_in - self.conditions_hors_age_in = conditions_hors_age_in - self.plafond_l512_3_2_in = plafond_l512_3_2_in - self.age_l512_3_2_in = age_l512_3_2_in - self.regime_outre_mer_l751_1_in = regime_outre_mer_l751_1_in - self.date_courante_in = date_courante_in - self.prestation_courante_in = prestation_courante_in - self.residence_in = residence_in - self.base_mensuelle_in = base_mensuelle_in - - def __eq__(self, other: object) -> bool: - if isinstance(other, PrestationsFamilialesIn): - return (self.droit_ouvert_in == other.droit_ouvert_in and - self.conditions_hors_age_in == other.conditions_hors_age_in and - self.plafond_l512_3_2_in == other.plafond_l512_3_2_in and - self.age_l512_3_2_in == other.age_l512_3_2_in and - self.regime_outre_mer_l751_1_in == other.regime_outre_mer_l751_1_in and - self.date_courante_in == other.date_courante_in and - self.prestation_courante_in == other.prestation_courante_in and - self.residence_in == other.residence_in and - self.base_mensuelle_in == other.base_mensuelle_in) - else: - return False - - def __ne__(self, other: object) -> bool: - return not (self == other) - - def __str__(self) -> str: - return "PrestationsFamilialesIn(droit_ouvert_in={},conditions_hors_age_in={},plafond_l512_3_2_in={},age_l512_3_2_in={},regime_outre_mer_l751_1_in={},date_courante_in={},prestation_courante_in={},residence_in={},base_mensuelle_in={})".format(self.droit_ouvert_in, - self.conditions_hors_age_in, self.plafond_l512_3_2_in, - self.age_l512_3_2_in, self.regime_outre_mer_l751_1_in, - self.date_courante_in, self.prestation_courante_in, self.residence_in, - self.base_mensuelle_in) - + def __init__(self, droit_ouvert_in: Callable[[Unit], (Callable[[Enfant], bool])], conditions_hors_age_in: Callable[[Unit], (Callable[[Enfant], bool])], plafond_l512_3_2_in: Callable[[Unit], Money], age_l512_3_2_in: Callable[[Unit], Integer], regime_outre_mer_l751_1_in: Callable[[Unit], bool], date_courante_in: Callable[[Unit], Date], prestation_courante_in: Callable[[Unit], ElementPrestationsFamiliales], residence_in: Callable[[Unit], Collectivite], base_mensuelle_in: Callable[[Unit], Money]) -> None: + self.droit_ouvert_in = droit_ouvert_in + self.conditions_hors_age_in = conditions_hors_age_in + self.plafond_l512_3_2_in = plafond_l512_3_2_in + self.age_l512_3_2_in = age_l512_3_2_in + self.regime_outre_mer_l751_1_in = regime_outre_mer_l751_1_in + self.date_courante_in = date_courante_in + self.prestation_courante_in = prestation_courante_in + self.residence_in = residence_in + self.base_mensuelle_in = base_mensuelle_in + + def __eq__(self, other: object) -> bool: + if isinstance(other, PrestationsFamilialesIn): + return (self.droit_ouvert_in == other.droit_ouvert_in and + self.conditions_hors_age_in == other.conditions_hors_age_in and + self.plafond_l512_3_2_in == other.plafond_l512_3_2_in and + self.age_l512_3_2_in == other.age_l512_3_2_in and + self.regime_outre_mer_l751_1_in == other.regime_outre_mer_l751_1_in and + self.date_courante_in == other.date_courante_in and + self.prestation_courante_in == other.prestation_courante_in and + self.residence_in == other.residence_in and + self.base_mensuelle_in == other.base_mensuelle_in) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "PrestationsFamilialesIn(droit_ouvert_in={},conditions_hors_age_in={},plafond_l512_3_2_in={},age_l512_3_2_in={},regime_outre_mer_l751_1_in={},date_courante_in={},prestation_courante_in={},residence_in={},base_mensuelle_in={})".format(self.droit_ouvert_in, + self.conditions_hors_age_in, self.plafond_l512_3_2_in, + self.age_l512_3_2_in, self.regime_outre_mer_l751_1_in, + self.date_courante_in, self.prestation_courante_in, self.residence_in, + self.base_mensuelle_in) class AllocationFamilialesAvril2008Out: - def __init__(self, age_minimum_alinea_1_l521_3_out: Integer) -> None: - self.age_minimum_alinea_1_l521_3_out = age_minimum_alinea_1_l521_3_out - - def __eq__(self, other: object) -> bool: - if isinstance(other, AllocationFamilialesAvril2008Out): - return (self.age_minimum_alinea_1_l521_3_out == other.age_minimum_alinea_1_l521_3_out) - else: - return False + def __init__(self, age_minimum_alinea_1_l521_3_out: Integer) -> None: + self.age_minimum_alinea_1_l521_3_out = age_minimum_alinea_1_l521_3_out - def __ne__(self, other: object) -> bool: - return not (self == other) + def __eq__(self, other: object) -> bool: + if isinstance(other, AllocationFamilialesAvril2008Out): + return (self.age_minimum_alinea_1_l521_3_out == other.age_minimum_alinea_1_l521_3_out) + else: + return False - def __str__(self) -> str: - return "AllocationFamilialesAvril2008Out(age_minimum_alinea_1_l521_3_out={})".format(self.age_minimum_alinea_1_l521_3_out) + def __ne__(self, other: object) -> bool: + return not (self == other) + def __str__(self) -> str: + return "AllocationFamilialesAvril2008Out(age_minimum_alinea_1_l521_3_out={})".format(self.age_minimum_alinea_1_l521_3_out) class AllocationFamilialesAvril2008In: - def __init__(self, age_minimum_alinea_1_l521_3_in: Callable[[Unit], Integer]) -> None: - self.age_minimum_alinea_1_l521_3_in = age_minimum_alinea_1_l521_3_in + def __init__(self, age_minimum_alinea_1_l521_3_in: Callable[[Unit], Integer]) -> None: + self.age_minimum_alinea_1_l521_3_in = age_minimum_alinea_1_l521_3_in - def __eq__(self, other: object) -> bool: - if isinstance(other, AllocationFamilialesAvril2008In): - return (self.age_minimum_alinea_1_l521_3_in == other.age_minimum_alinea_1_l521_3_in) - else: - return False + def __eq__(self, other: object) -> bool: + if isinstance(other, AllocationFamilialesAvril2008In): + return (self.age_minimum_alinea_1_l521_3_in == other.age_minimum_alinea_1_l521_3_in) + else: + return False - def __ne__(self, other: object) -> bool: - return not (self == other) - - def __str__(self) -> str: - return "AllocationFamilialesAvril2008In(age_minimum_alinea_1_l521_3_in={})".format(self.age_minimum_alinea_1_l521_3_in) + def __ne__(self, other: object) -> bool: + return not (self == other) + def __str__(self) -> str: + return "AllocationFamilialesAvril2008In(age_minimum_alinea_1_l521_3_in={})".format(self.age_minimum_alinea_1_l521_3_in) class EnfantLePlusAgeOut: - def __init__(self, enfants_out: List[Enfant], le_plus_age_out: Enfant) -> None: - self.enfants_out = enfants_out - self.le_plus_age_out = le_plus_age_out - - def __eq__(self, other: object) -> bool: - if isinstance(other, EnfantLePlusAgeOut): - return (self.enfants_out == other.enfants_out and - self.le_plus_age_out == other.le_plus_age_out) - else: - return False + def __init__(self, enfants_out: List[Enfant], le_plus_age_out: Enfant) -> None: + self.enfants_out = enfants_out + self.le_plus_age_out = le_plus_age_out - def __ne__(self, other: object) -> bool: - return not (self == other) + def __eq__(self, other: object) -> bool: + if isinstance(other, EnfantLePlusAgeOut): + return (self.enfants_out == other.enfants_out and + self.le_plus_age_out == other.le_plus_age_out) + else: + return False - def __str__(self) -> str: - return "EnfantLePlusAgeOut(enfants_out={},le_plus_age_out={})".format(self.enfants_out, - self.le_plus_age_out) + def __ne__(self, other: object) -> bool: + return not (self == other) + def __str__(self) -> str: + return "EnfantLePlusAgeOut(enfants_out={},le_plus_age_out={})".format(self.enfants_out, + self.le_plus_age_out) class EnfantLePlusAgeIn: - def __init__(self, enfants_in: Callable[[Unit], (List[Enfant])], le_plus_age_in: Callable[[Unit], Enfant]) -> None: - self.enfants_in = enfants_in - self.le_plus_age_in = le_plus_age_in + def __init__(self, enfants_in: Callable[[Unit], (List[Enfant])], le_plus_age_in: Callable[[Unit], Enfant]) -> None: + self.enfants_in = enfants_in + self.le_plus_age_in = le_plus_age_in - def __eq__(self, other: object) -> bool: - if isinstance(other, EnfantLePlusAgeIn): - return (self.enfants_in == other.enfants_in and - self.le_plus_age_in == other.le_plus_age_in) - else: - return False + def __eq__(self, other: object) -> bool: + if isinstance(other, EnfantLePlusAgeIn): + return (self.enfants_in == other.enfants_in and + self.le_plus_age_in == other.le_plus_age_in) + else: + return False - def __ne__(self, other: object) -> bool: - return not (self == other) - - def __str__(self) -> str: - return "EnfantLePlusAgeIn(enfants_in={},le_plus_age_in={})".format(self.enfants_in, - self.le_plus_age_in) + def __ne__(self, other: object) -> bool: + return not (self == other) + def __str__(self) -> str: + return "EnfantLePlusAgeIn(enfants_in={},le_plus_age_in={})".format(self.enfants_in, + self.le_plus_age_in) class AllocationsFamilialesOut: - def __init__(self, personne_charge_effective_permanente_est_parent_out: bool, personne_charge_effective_permanente_remplit_titre_I_out: bool, ressources_menage_out: Money, residence_out: Collectivite, date_courante_out: Date, enfants_a_charge_out: List[Enfant], enfants_a_charge_droit_ouvert_prestation_familiale_out: List[Enfant], prise_en_compte_out: Callable[[Enfant], PriseEnCompte], versement_out: Callable[[Enfant], VersementAllocations], montant_verse_out: Money, droit_ouvert_base_out: bool, montant_initial_base_out: Money, montant_initial_base_premier_enfant_out: Money, montant_initial_base_deuxieme_enfant_out: Money, montant_initial_base_troisieme_enfant_et_plus_out: Money, rapport_enfants_total_moyen_out: Decimal, nombre_moyen_enfants_out: Decimal, nombre_total_enfants_out: Decimal, montant_avec_garde_alternee_base_out: Money, montant_verse_base_out: Money, avait_enfant_a_charge_avant_1er_janvier_2012_out: bool, montant_initial_base_premier_enfant_mayotte_out: Money, montant_initial_base_deuxieme_enfant_mayotte_out: Money, montant_initial_base_troisieme_enfant_mayotte_out: Money, montant_initial_base_quatrieme_enfant_et_plus_mayotte_out: Money, droit_ouvert_forfaitaire_out: Callable[[Enfant], bool], montant_verse_forfaitaire_par_enfant_out: Money, montant_verse_forfaitaire_out: Money, droit_ouvert_majoration_out: Callable[[Enfant], bool], montant_initial_metropole_majoration_out: Callable[[Enfant], Money], montant_initial_majoration_out: Callable[[Enfant], Money], montant_avec_garde_alternee_majoration_out: Callable[[Enfant], Money], montant_verse_majoration_out: Money, droit_ouvert_complement_out: bool, montant_base_complement_pour_base_et_majoration_out: Money, complement_degressif_out: Callable[[Money], Money], montant_verse_complement_pour_base_et_majoration_out: Money, montant_verse_complement_pour_forfaitaire_out: Money, nombre_enfants_l521_1_out: Integer, age_minimum_alinea_1_l521_3_out: Callable[[Enfant], Integer], nombre_enfants_alinea_2_l521_3_out: Integer, est_enfant_le_plus_age_out: Callable[[Enfant], bool], plafond_I_d521_3_out: Money, plafond_II_d521_3_out: Money) -> None: - self.personne_charge_effective_permanente_est_parent_out = personne_charge_effective_permanente_est_parent_out - self.personne_charge_effective_permanente_remplit_titre_I_out = personne_charge_effective_permanente_remplit_titre_I_out - self.ressources_menage_out = ressources_menage_out - self.residence_out = residence_out - self.date_courante_out = date_courante_out - self.enfants_a_charge_out = enfants_a_charge_out - self.enfants_a_charge_droit_ouvert_prestation_familiale_out = enfants_a_charge_droit_ouvert_prestation_familiale_out - self.prise_en_compte_out = prise_en_compte_out - self.versement_out = versement_out - self.montant_verse_out = montant_verse_out - self.droit_ouvert_base_out = droit_ouvert_base_out - self.montant_initial_base_out = montant_initial_base_out - self.montant_initial_base_premier_enfant_out = montant_initial_base_premier_enfant_out - self.montant_initial_base_deuxieme_enfant_out = montant_initial_base_deuxieme_enfant_out - self.montant_initial_base_troisieme_enfant_et_plus_out = montant_initial_base_troisieme_enfant_et_plus_out - self.rapport_enfants_total_moyen_out = rapport_enfants_total_moyen_out - self.nombre_moyen_enfants_out = nombre_moyen_enfants_out - self.nombre_total_enfants_out = nombre_total_enfants_out - self.montant_avec_garde_alternee_base_out = montant_avec_garde_alternee_base_out - self.montant_verse_base_out = montant_verse_base_out - self.avait_enfant_a_charge_avant_1er_janvier_2012_out = avait_enfant_a_charge_avant_1er_janvier_2012_out - self.montant_initial_base_premier_enfant_mayotte_out = montant_initial_base_premier_enfant_mayotte_out - self.montant_initial_base_deuxieme_enfant_mayotte_out = montant_initial_base_deuxieme_enfant_mayotte_out - self.montant_initial_base_troisieme_enfant_mayotte_out = montant_initial_base_troisieme_enfant_mayotte_out - self.montant_initial_base_quatrieme_enfant_et_plus_mayotte_out = montant_initial_base_quatrieme_enfant_et_plus_mayotte_out - self.droit_ouvert_forfaitaire_out = droit_ouvert_forfaitaire_out - self.montant_verse_forfaitaire_par_enfant_out = montant_verse_forfaitaire_par_enfant_out - self.montant_verse_forfaitaire_out = montant_verse_forfaitaire_out - self.droit_ouvert_majoration_out = droit_ouvert_majoration_out - self.montant_initial_metropole_majoration_out = montant_initial_metropole_majoration_out - self.montant_initial_majoration_out = montant_initial_majoration_out - self.montant_avec_garde_alternee_majoration_out = montant_avec_garde_alternee_majoration_out - self.montant_verse_majoration_out = montant_verse_majoration_out - self.droit_ouvert_complement_out = droit_ouvert_complement_out - self.montant_base_complement_pour_base_et_majoration_out = montant_base_complement_pour_base_et_majoration_out - self.complement_degressif_out = complement_degressif_out - self.montant_verse_complement_pour_base_et_majoration_out = montant_verse_complement_pour_base_et_majoration_out - self.montant_verse_complement_pour_forfaitaire_out = montant_verse_complement_pour_forfaitaire_out - self.nombre_enfants_l521_1_out = nombre_enfants_l521_1_out - self.age_minimum_alinea_1_l521_3_out = age_minimum_alinea_1_l521_3_out - self.nombre_enfants_alinea_2_l521_3_out = nombre_enfants_alinea_2_l521_3_out - self.est_enfant_le_plus_age_out = est_enfant_le_plus_age_out - self.plafond_I_d521_3_out = plafond_I_d521_3_out - self.plafond_II_d521_3_out = plafond_II_d521_3_out - - def __eq__(self, other: object) -> bool: - if isinstance(other, AllocationsFamilialesOut): - return (self.personne_charge_effective_permanente_est_parent_out == other.personne_charge_effective_permanente_est_parent_out and - self.personne_charge_effective_permanente_remplit_titre_I_out == other.personne_charge_effective_permanente_remplit_titre_I_out and - self.ressources_menage_out == other.ressources_menage_out and - self.residence_out == other.residence_out and - self.date_courante_out == other.date_courante_out and - self.enfants_a_charge_out == other.enfants_a_charge_out and - self.enfants_a_charge_droit_ouvert_prestation_familiale_out == other.enfants_a_charge_droit_ouvert_prestation_familiale_out and - self.prise_en_compte_out == other.prise_en_compte_out and - self.versement_out == other.versement_out and - self.montant_verse_out == other.montant_verse_out and - self.droit_ouvert_base_out == other.droit_ouvert_base_out and - self.montant_initial_base_out == other.montant_initial_base_out and - self.montant_initial_base_premier_enfant_out == other.montant_initial_base_premier_enfant_out and - self.montant_initial_base_deuxieme_enfant_out == other.montant_initial_base_deuxieme_enfant_out and - self.montant_initial_base_troisieme_enfant_et_plus_out == other.montant_initial_base_troisieme_enfant_et_plus_out and - self.rapport_enfants_total_moyen_out == other.rapport_enfants_total_moyen_out and - self.nombre_moyen_enfants_out == other.nombre_moyen_enfants_out and - self.nombre_total_enfants_out == other.nombre_total_enfants_out and - self.montant_avec_garde_alternee_base_out == other.montant_avec_garde_alternee_base_out and - self.montant_verse_base_out == other.montant_verse_base_out and - self.avait_enfant_a_charge_avant_1er_janvier_2012_out == other.avait_enfant_a_charge_avant_1er_janvier_2012_out and - self.montant_initial_base_premier_enfant_mayotte_out == other.montant_initial_base_premier_enfant_mayotte_out and - self.montant_initial_base_deuxieme_enfant_mayotte_out == other.montant_initial_base_deuxieme_enfant_mayotte_out and - self.montant_initial_base_troisieme_enfant_mayotte_out == other.montant_initial_base_troisieme_enfant_mayotte_out and - self.montant_initial_base_quatrieme_enfant_et_plus_mayotte_out == other.montant_initial_base_quatrieme_enfant_et_plus_mayotte_out and - self.droit_ouvert_forfaitaire_out == other.droit_ouvert_forfaitaire_out and - self.montant_verse_forfaitaire_par_enfant_out == other.montant_verse_forfaitaire_par_enfant_out and - self.montant_verse_forfaitaire_out == other.montant_verse_forfaitaire_out and - self.droit_ouvert_majoration_out == other.droit_ouvert_majoration_out and - self.montant_initial_metropole_majoration_out == other.montant_initial_metropole_majoration_out and - self.montant_initial_majoration_out == other.montant_initial_majoration_out and - self.montant_avec_garde_alternee_majoration_out == other.montant_avec_garde_alternee_majoration_out and - self.montant_verse_majoration_out == other.montant_verse_majoration_out and - self.droit_ouvert_complement_out == other.droit_ouvert_complement_out and - self.montant_base_complement_pour_base_et_majoration_out == other.montant_base_complement_pour_base_et_majoration_out and - self.complement_degressif_out == other.complement_degressif_out and - self.montant_verse_complement_pour_base_et_majoration_out == other.montant_verse_complement_pour_base_et_majoration_out and - self.montant_verse_complement_pour_forfaitaire_out == other.montant_verse_complement_pour_forfaitaire_out and - self.nombre_enfants_l521_1_out == other.nombre_enfants_l521_1_out and - self.age_minimum_alinea_1_l521_3_out == other.age_minimum_alinea_1_l521_3_out and - self.nombre_enfants_alinea_2_l521_3_out == other.nombre_enfants_alinea_2_l521_3_out and - self.est_enfant_le_plus_age_out == other.est_enfant_le_plus_age_out and - self.plafond_I_d521_3_out == other.plafond_I_d521_3_out and - self.plafond_II_d521_3_out == other.plafond_II_d521_3_out) - else: - return False - - def __ne__(self, other: object) -> bool: - return not (self == other) - - def __str__(self) -> str: - return "AllocationsFamilialesOut(personne_charge_effective_permanente_est_parent_out={},personne_charge_effective_permanente_remplit_titre_I_out={},ressources_menage_out={},residence_out={},date_courante_out={},enfants_a_charge_out={},enfants_a_charge_droit_ouvert_prestation_familiale_out={},prise_en_compte_out={},versement_out={},montant_verse_out={},droit_ouvert_base_out={},montant_initial_base_out={},montant_initial_base_premier_enfant_out={},montant_initial_base_deuxieme_enfant_out={},montant_initial_base_troisieme_enfant_et_plus_out={},rapport_enfants_total_moyen_out={},nombre_moyen_enfants_out={},nombre_total_enfants_out={},montant_avec_garde_alternee_base_out={},montant_verse_base_out={},avait_enfant_a_charge_avant_1er_janvier_2012_out={},montant_initial_base_premier_enfant_mayotte_out={},montant_initial_base_deuxieme_enfant_mayotte_out={},montant_initial_base_troisieme_enfant_mayotte_out={},montant_initial_base_quatrieme_enfant_et_plus_mayotte_out={},droit_ouvert_forfaitaire_out={},montant_verse_forfaitaire_par_enfant_out={},montant_verse_forfaitaire_out={},droit_ouvert_majoration_out={},montant_initial_metropole_majoration_out={},montant_initial_majoration_out={},montant_avec_garde_alternee_majoration_out={},montant_verse_majoration_out={},droit_ouvert_complement_out={},montant_base_complement_pour_base_et_majoration_out={},complement_degressif_out={},montant_verse_complement_pour_base_et_majoration_out={},montant_verse_complement_pour_forfaitaire_out={},nombre_enfants_l521_1_out={},age_minimum_alinea_1_l521_3_out={},nombre_enfants_alinea_2_l521_3_out={},est_enfant_le_plus_age_out={},plafond_I_d521_3_out={},plafond_II_d521_3_out={})".format(self.personne_charge_effective_permanente_est_parent_out, - self.personne_charge_effective_permanente_remplit_titre_I_out, - self.ressources_menage_out, self.residence_out, self.date_courante_out, - self.enfants_a_charge_out, - self.enfants_a_charge_droit_ouvert_prestation_familiale_out, - self.prise_en_compte_out, self.versement_out, self.montant_verse_out, - self.droit_ouvert_base_out, self.montant_initial_base_out, - self.montant_initial_base_premier_enfant_out, - self.montant_initial_base_deuxieme_enfant_out, - self.montant_initial_base_troisieme_enfant_et_plus_out, - self.rapport_enfants_total_moyen_out, self.nombre_moyen_enfants_out, - self.nombre_total_enfants_out, - self.montant_avec_garde_alternee_base_out, self.montant_verse_base_out, - self.avait_enfant_a_charge_avant_1er_janvier_2012_out, - self.montant_initial_base_premier_enfant_mayotte_out, - self.montant_initial_base_deuxieme_enfant_mayotte_out, - self.montant_initial_base_troisieme_enfant_mayotte_out, - self.montant_initial_base_quatrieme_enfant_et_plus_mayotte_out, - self.droit_ouvert_forfaitaire_out, - self.montant_verse_forfaitaire_par_enfant_out, - self.montant_verse_forfaitaire_out, self.droit_ouvert_majoration_out, - self.montant_initial_metropole_majoration_out, - self.montant_initial_majoration_out, - self.montant_avec_garde_alternee_majoration_out, - self.montant_verse_majoration_out, self.droit_ouvert_complement_out, - self.montant_base_complement_pour_base_et_majoration_out, - self.complement_degressif_out, - self.montant_verse_complement_pour_base_et_majoration_out, - self.montant_verse_complement_pour_forfaitaire_out, - self.nombre_enfants_l521_1_out, self.age_minimum_alinea_1_l521_3_out, - self.nombre_enfants_alinea_2_l521_3_out, - self.est_enfant_le_plus_age_out, self.plafond_I_d521_3_out, - self.plafond_II_d521_3_out) - + def __init__(self, personne_charge_effective_permanente_est_parent_out: bool, personne_charge_effective_permanente_remplit_titre_I_out: bool, ressources_menage_out: Money, residence_out: Collectivite, date_courante_out: Date, enfants_a_charge_out: List[Enfant], enfants_a_charge_droit_ouvert_prestation_familiale_out: List[Enfant], prise_en_compte_out: Callable[[Enfant], PriseEnCompte], versement_out: Callable[[Enfant], VersementAllocations], montant_verse_out: Money, droit_ouvert_base_out: bool, montant_initial_base_out: Money, montant_initial_base_premier_enfant_out: Money, montant_initial_base_deuxieme_enfant_out: Money, montant_initial_base_troisieme_enfant_et_plus_out: Money, rapport_enfants_total_moyen_out: Decimal, nombre_moyen_enfants_out: Decimal, nombre_total_enfants_out: Decimal, montant_avec_garde_alternee_base_out: Money, montant_verse_base_out: Money, avait_enfant_a_charge_avant_1er_janvier_2012_out: bool, montant_initial_base_premier_enfant_mayotte_out: Money, montant_initial_base_deuxieme_enfant_mayotte_out: Money, montant_initial_base_troisieme_enfant_mayotte_out: Money, montant_initial_base_quatrieme_enfant_et_plus_mayotte_out: Money, droit_ouvert_forfaitaire_out: Callable[[Enfant], bool], montant_verse_forfaitaire_par_enfant_out: Money, montant_verse_forfaitaire_out: Money, droit_ouvert_majoration_out: Callable[[Enfant], bool], montant_initial_metropole_majoration_out: Callable[[Enfant], Money], montant_initial_majoration_out: Callable[[Enfant], Money], montant_avec_garde_alternee_majoration_out: Callable[[Enfant], Money], montant_verse_majoration_out: Money, droit_ouvert_complement_out: bool, montant_base_complement_pour_base_et_majoration_out: Money, complement_degressif_out: Callable[[Money], Money], montant_verse_complement_pour_base_et_majoration_out: Money, montant_verse_complement_pour_forfaitaire_out: Money, nombre_enfants_l521_1_out: Integer, age_minimum_alinea_1_l521_3_out: Callable[[Enfant], Integer], nombre_enfants_alinea_2_l521_3_out: Integer, est_enfant_le_plus_age_out: Callable[[Enfant], bool], plafond_I_d521_3_out: Money, plafond_II_d521_3_out: Money) -> None: + self.personne_charge_effective_permanente_est_parent_out = personne_charge_effective_permanente_est_parent_out + self.personne_charge_effective_permanente_remplit_titre_I_out = personne_charge_effective_permanente_remplit_titre_I_out + self.ressources_menage_out = ressources_menage_out + self.residence_out = residence_out + self.date_courante_out = date_courante_out + self.enfants_a_charge_out = enfants_a_charge_out + self.enfants_a_charge_droit_ouvert_prestation_familiale_out = enfants_a_charge_droit_ouvert_prestation_familiale_out + self.prise_en_compte_out = prise_en_compte_out + self.versement_out = versement_out + self.montant_verse_out = montant_verse_out + self.droit_ouvert_base_out = droit_ouvert_base_out + self.montant_initial_base_out = montant_initial_base_out + self.montant_initial_base_premier_enfant_out = montant_initial_base_premier_enfant_out + self.montant_initial_base_deuxieme_enfant_out = montant_initial_base_deuxieme_enfant_out + self.montant_initial_base_troisieme_enfant_et_plus_out = montant_initial_base_troisieme_enfant_et_plus_out + self.rapport_enfants_total_moyen_out = rapport_enfants_total_moyen_out + self.nombre_moyen_enfants_out = nombre_moyen_enfants_out + self.nombre_total_enfants_out = nombre_total_enfants_out + self.montant_avec_garde_alternee_base_out = montant_avec_garde_alternee_base_out + self.montant_verse_base_out = montant_verse_base_out + self.avait_enfant_a_charge_avant_1er_janvier_2012_out = avait_enfant_a_charge_avant_1er_janvier_2012_out + self.montant_initial_base_premier_enfant_mayotte_out = montant_initial_base_premier_enfant_mayotte_out + self.montant_initial_base_deuxieme_enfant_mayotte_out = montant_initial_base_deuxieme_enfant_mayotte_out + self.montant_initial_base_troisieme_enfant_mayotte_out = montant_initial_base_troisieme_enfant_mayotte_out + self.montant_initial_base_quatrieme_enfant_et_plus_mayotte_out = montant_initial_base_quatrieme_enfant_et_plus_mayotte_out + self.droit_ouvert_forfaitaire_out = droit_ouvert_forfaitaire_out + self.montant_verse_forfaitaire_par_enfant_out = montant_verse_forfaitaire_par_enfant_out + self.montant_verse_forfaitaire_out = montant_verse_forfaitaire_out + self.droit_ouvert_majoration_out = droit_ouvert_majoration_out + self.montant_initial_metropole_majoration_out = montant_initial_metropole_majoration_out + self.montant_initial_majoration_out = montant_initial_majoration_out + self.montant_avec_garde_alternee_majoration_out = montant_avec_garde_alternee_majoration_out + self.montant_verse_majoration_out = montant_verse_majoration_out + self.droit_ouvert_complement_out = droit_ouvert_complement_out + self.montant_base_complement_pour_base_et_majoration_out = montant_base_complement_pour_base_et_majoration_out + self.complement_degressif_out = complement_degressif_out + self.montant_verse_complement_pour_base_et_majoration_out = montant_verse_complement_pour_base_et_majoration_out + self.montant_verse_complement_pour_forfaitaire_out = montant_verse_complement_pour_forfaitaire_out + self.nombre_enfants_l521_1_out = nombre_enfants_l521_1_out + self.age_minimum_alinea_1_l521_3_out = age_minimum_alinea_1_l521_3_out + self.nombre_enfants_alinea_2_l521_3_out = nombre_enfants_alinea_2_l521_3_out + self.est_enfant_le_plus_age_out = est_enfant_le_plus_age_out + self.plafond_I_d521_3_out = plafond_I_d521_3_out + self.plafond_II_d521_3_out = plafond_II_d521_3_out + + def __eq__(self, other: object) -> bool: + if isinstance(other, AllocationsFamilialesOut): + return (self.personne_charge_effective_permanente_est_parent_out == other.personne_charge_effective_permanente_est_parent_out and + self.personne_charge_effective_permanente_remplit_titre_I_out == other.personne_charge_effective_permanente_remplit_titre_I_out and + self.ressources_menage_out == other.ressources_menage_out and + self.residence_out == other.residence_out and + self.date_courante_out == other.date_courante_out and + self.enfants_a_charge_out == other.enfants_a_charge_out and + self.enfants_a_charge_droit_ouvert_prestation_familiale_out == other.enfants_a_charge_droit_ouvert_prestation_familiale_out and + self.prise_en_compte_out == other.prise_en_compte_out and + self.versement_out == other.versement_out and + self.montant_verse_out == other.montant_verse_out and + self.droit_ouvert_base_out == other.droit_ouvert_base_out and + self.montant_initial_base_out == other.montant_initial_base_out and + self.montant_initial_base_premier_enfant_out == other.montant_initial_base_premier_enfant_out and + self.montant_initial_base_deuxieme_enfant_out == other.montant_initial_base_deuxieme_enfant_out and + self.montant_initial_base_troisieme_enfant_et_plus_out == other.montant_initial_base_troisieme_enfant_et_plus_out and + self.rapport_enfants_total_moyen_out == other.rapport_enfants_total_moyen_out and + self.nombre_moyen_enfants_out == other.nombre_moyen_enfants_out and + self.nombre_total_enfants_out == other.nombre_total_enfants_out and + self.montant_avec_garde_alternee_base_out == other.montant_avec_garde_alternee_base_out and + self.montant_verse_base_out == other.montant_verse_base_out and + self.avait_enfant_a_charge_avant_1er_janvier_2012_out == other.avait_enfant_a_charge_avant_1er_janvier_2012_out and + self.montant_initial_base_premier_enfant_mayotte_out == other.montant_initial_base_premier_enfant_mayotte_out and + self.montant_initial_base_deuxieme_enfant_mayotte_out == other.montant_initial_base_deuxieme_enfant_mayotte_out and + self.montant_initial_base_troisieme_enfant_mayotte_out == other.montant_initial_base_troisieme_enfant_mayotte_out and + self.montant_initial_base_quatrieme_enfant_et_plus_mayotte_out == other.montant_initial_base_quatrieme_enfant_et_plus_mayotte_out and + self.droit_ouvert_forfaitaire_out == other.droit_ouvert_forfaitaire_out and + self.montant_verse_forfaitaire_par_enfant_out == other.montant_verse_forfaitaire_par_enfant_out and + self.montant_verse_forfaitaire_out == other.montant_verse_forfaitaire_out and + self.droit_ouvert_majoration_out == other.droit_ouvert_majoration_out and + self.montant_initial_metropole_majoration_out == other.montant_initial_metropole_majoration_out and + self.montant_initial_majoration_out == other.montant_initial_majoration_out and + self.montant_avec_garde_alternee_majoration_out == other.montant_avec_garde_alternee_majoration_out and + self.montant_verse_majoration_out == other.montant_verse_majoration_out and + self.droit_ouvert_complement_out == other.droit_ouvert_complement_out and + self.montant_base_complement_pour_base_et_majoration_out == other.montant_base_complement_pour_base_et_majoration_out and + self.complement_degressif_out == other.complement_degressif_out and + self.montant_verse_complement_pour_base_et_majoration_out == other.montant_verse_complement_pour_base_et_majoration_out and + self.montant_verse_complement_pour_forfaitaire_out == other.montant_verse_complement_pour_forfaitaire_out and + self.nombre_enfants_l521_1_out == other.nombre_enfants_l521_1_out and + self.age_minimum_alinea_1_l521_3_out == other.age_minimum_alinea_1_l521_3_out and + self.nombre_enfants_alinea_2_l521_3_out == other.nombre_enfants_alinea_2_l521_3_out and + self.est_enfant_le_plus_age_out == other.est_enfant_le_plus_age_out and + self.plafond_I_d521_3_out == other.plafond_I_d521_3_out and + self.plafond_II_d521_3_out == other.plafond_II_d521_3_out) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "AllocationsFamilialesOut(personne_charge_effective_permanente_est_parent_out={},personne_charge_effective_permanente_remplit_titre_I_out={},ressources_menage_out={},residence_out={},date_courante_out={},enfants_a_charge_out={},enfants_a_charge_droit_ouvert_prestation_familiale_out={},prise_en_compte_out={},versement_out={},montant_verse_out={},droit_ouvert_base_out={},montant_initial_base_out={},montant_initial_base_premier_enfant_out={},montant_initial_base_deuxieme_enfant_out={},montant_initial_base_troisieme_enfant_et_plus_out={},rapport_enfants_total_moyen_out={},nombre_moyen_enfants_out={},nombre_total_enfants_out={},montant_avec_garde_alternee_base_out={},montant_verse_base_out={},avait_enfant_a_charge_avant_1er_janvier_2012_out={},montant_initial_base_premier_enfant_mayotte_out={},montant_initial_base_deuxieme_enfant_mayotte_out={},montant_initial_base_troisieme_enfant_mayotte_out={},montant_initial_base_quatrieme_enfant_et_plus_mayotte_out={},droit_ouvert_forfaitaire_out={},montant_verse_forfaitaire_par_enfant_out={},montant_verse_forfaitaire_out={},droit_ouvert_majoration_out={},montant_initial_metropole_majoration_out={},montant_initial_majoration_out={},montant_avec_garde_alternee_majoration_out={},montant_verse_majoration_out={},droit_ouvert_complement_out={},montant_base_complement_pour_base_et_majoration_out={},complement_degressif_out={},montant_verse_complement_pour_base_et_majoration_out={},montant_verse_complement_pour_forfaitaire_out={},nombre_enfants_l521_1_out={},age_minimum_alinea_1_l521_3_out={},nombre_enfants_alinea_2_l521_3_out={},est_enfant_le_plus_age_out={},plafond_I_d521_3_out={},plafond_II_d521_3_out={})".format(self.personne_charge_effective_permanente_est_parent_out, + self.personne_charge_effective_permanente_remplit_titre_I_out, + self.ressources_menage_out, self.residence_out, self.date_courante_out, + self.enfants_a_charge_out, + self.enfants_a_charge_droit_ouvert_prestation_familiale_out, + self.prise_en_compte_out, self.versement_out, self.montant_verse_out, + self.droit_ouvert_base_out, self.montant_initial_base_out, + self.montant_initial_base_premier_enfant_out, + self.montant_initial_base_deuxieme_enfant_out, + self.montant_initial_base_troisieme_enfant_et_plus_out, + self.rapport_enfants_total_moyen_out, self.nombre_moyen_enfants_out, + self.nombre_total_enfants_out, + self.montant_avec_garde_alternee_base_out, self.montant_verse_base_out, + self.avait_enfant_a_charge_avant_1er_janvier_2012_out, + self.montant_initial_base_premier_enfant_mayotte_out, + self.montant_initial_base_deuxieme_enfant_mayotte_out, + self.montant_initial_base_troisieme_enfant_mayotte_out, + self.montant_initial_base_quatrieme_enfant_et_plus_mayotte_out, + self.droit_ouvert_forfaitaire_out, + self.montant_verse_forfaitaire_par_enfant_out, + self.montant_verse_forfaitaire_out, self.droit_ouvert_majoration_out, + self.montant_initial_metropole_majoration_out, + self.montant_initial_majoration_out, + self.montant_avec_garde_alternee_majoration_out, + self.montant_verse_majoration_out, self.droit_ouvert_complement_out, + self.montant_base_complement_pour_base_et_majoration_out, + self.complement_degressif_out, + self.montant_verse_complement_pour_base_et_majoration_out, + self.montant_verse_complement_pour_forfaitaire_out, + self.nombre_enfants_l521_1_out, self.age_minimum_alinea_1_l521_3_out, + self.nombre_enfants_alinea_2_l521_3_out, + self.est_enfant_le_plus_age_out, self.plafond_I_d521_3_out, + self.plafond_II_d521_3_out) class AllocationsFamilialesIn: - def __init__(self, personne_charge_effective_permanente_est_parent_in: Callable[[Unit], bool], personne_charge_effective_permanente_remplit_titre_I_in: Callable[[Unit], bool], ressources_menage_in: Callable[[Unit], Money], residence_in: Callable[[Unit], Collectivite], date_courante_in: Callable[[Unit], Date], enfants_a_charge_in: Callable[[Unit], (List[Enfant])], enfants_a_charge_droit_ouvert_prestation_familiale_in: Callable[[Unit], (List[Enfant])], prise_en_compte_in: Callable[[Unit], (Callable[[Enfant], PriseEnCompte])], versement_in: Callable[[Unit], (Callable[[Enfant], VersementAllocations])], montant_verse_in: Callable[[Unit], Money], droit_ouvert_base_in: Callable[[Unit], bool], montant_initial_base_in: Callable[[Unit], Money], montant_initial_base_premier_enfant_in: Callable[[Unit], Money], montant_initial_base_deuxieme_enfant_in: Callable[[Unit], Money], montant_initial_base_troisieme_enfant_et_plus_in: Callable[[Unit], Money], rapport_enfants_total_moyen_in: Callable[[Unit], Decimal], nombre_moyen_enfants_in: Callable[[Unit], Decimal], nombre_total_enfants_in: Callable[[Unit], Decimal], montant_avec_garde_alternee_base_in: Callable[[Unit], Money], montant_verse_base_in: Callable[[Unit], Money], avait_enfant_a_charge_avant_1er_janvier_2012_in: Callable[[Unit], bool], montant_initial_base_premier_enfant_mayotte_in: Callable[[Unit], Money], montant_initial_base_deuxieme_enfant_mayotte_in: Callable[[Unit], Money], montant_initial_base_troisieme_enfant_mayotte_in: Callable[[Unit], Money], montant_initial_base_quatrieme_enfant_et_plus_mayotte_in: Callable[[Unit], Money], droit_ouvert_forfaitaire_in: Callable[[Unit], (Callable[[Enfant], bool])], montant_verse_forfaitaire_par_enfant_in: Callable[[Unit], Money], montant_verse_forfaitaire_in: Callable[[Unit], Money], droit_ouvert_majoration_in: Callable[[Unit], (Callable[[Enfant], bool])], montant_initial_metropole_majoration_in: Callable[[Unit], (Callable[[Enfant], Money])], montant_initial_majoration_in: Callable[[Unit], (Callable[[Enfant], Money])], montant_avec_garde_alternee_majoration_in: Callable[[Unit], (Callable[[Enfant], Money])], montant_verse_majoration_in: Callable[[Unit], Money], droit_ouvert_complement_in: Callable[[Unit], bool], montant_base_complement_pour_base_et_majoration_in: Callable[[Unit], Money], complement_degressif_in: Callable[[Unit], (Callable[[Money], Money])], montant_verse_complement_pour_base_et_majoration_in: Callable[[Unit], Money], montant_verse_complement_pour_forfaitaire_in: Callable[[Unit], Money], nombre_enfants_l521_1_in: Callable[[Unit], Integer], age_minimum_alinea_1_l521_3_in: Callable[[Unit], (Callable[[Enfant], Integer])], nombre_enfants_alinea_2_l521_3_in: Callable[[Unit], Integer], est_enfant_le_plus_age_in: Callable[[Unit], (Callable[[Enfant], bool])], plafond_I_d521_3_in: Callable[[Unit], Money], plafond_II_d521_3_in: Callable[[Unit], Money]) -> None: - self.personne_charge_effective_permanente_est_parent_in = personne_charge_effective_permanente_est_parent_in - self.personne_charge_effective_permanente_remplit_titre_I_in = personne_charge_effective_permanente_remplit_titre_I_in - self.ressources_menage_in = ressources_menage_in - self.residence_in = residence_in - self.date_courante_in = date_courante_in - self.enfants_a_charge_in = enfants_a_charge_in - self.enfants_a_charge_droit_ouvert_prestation_familiale_in = enfants_a_charge_droit_ouvert_prestation_familiale_in - self.prise_en_compte_in = prise_en_compte_in - self.versement_in = versement_in - self.montant_verse_in = montant_verse_in - self.droit_ouvert_base_in = droit_ouvert_base_in - self.montant_initial_base_in = montant_initial_base_in - self.montant_initial_base_premier_enfant_in = montant_initial_base_premier_enfant_in - self.montant_initial_base_deuxieme_enfant_in = montant_initial_base_deuxieme_enfant_in - self.montant_initial_base_troisieme_enfant_et_plus_in = montant_initial_base_troisieme_enfant_et_plus_in - self.rapport_enfants_total_moyen_in = rapport_enfants_total_moyen_in - self.nombre_moyen_enfants_in = nombre_moyen_enfants_in - self.nombre_total_enfants_in = nombre_total_enfants_in - self.montant_avec_garde_alternee_base_in = montant_avec_garde_alternee_base_in - self.montant_verse_base_in = montant_verse_base_in - self.avait_enfant_a_charge_avant_1er_janvier_2012_in = avait_enfant_a_charge_avant_1er_janvier_2012_in - self.montant_initial_base_premier_enfant_mayotte_in = montant_initial_base_premier_enfant_mayotte_in - self.montant_initial_base_deuxieme_enfant_mayotte_in = montant_initial_base_deuxieme_enfant_mayotte_in - self.montant_initial_base_troisieme_enfant_mayotte_in = montant_initial_base_troisieme_enfant_mayotte_in - self.montant_initial_base_quatrieme_enfant_et_plus_mayotte_in = montant_initial_base_quatrieme_enfant_et_plus_mayotte_in - self.droit_ouvert_forfaitaire_in = droit_ouvert_forfaitaire_in - self.montant_verse_forfaitaire_par_enfant_in = montant_verse_forfaitaire_par_enfant_in - self.montant_verse_forfaitaire_in = montant_verse_forfaitaire_in - self.droit_ouvert_majoration_in = droit_ouvert_majoration_in - self.montant_initial_metropole_majoration_in = montant_initial_metropole_majoration_in - self.montant_initial_majoration_in = montant_initial_majoration_in - self.montant_avec_garde_alternee_majoration_in = montant_avec_garde_alternee_majoration_in - self.montant_verse_majoration_in = montant_verse_majoration_in - self.droit_ouvert_complement_in = droit_ouvert_complement_in - self.montant_base_complement_pour_base_et_majoration_in = montant_base_complement_pour_base_et_majoration_in - self.complement_degressif_in = complement_degressif_in - self.montant_verse_complement_pour_base_et_majoration_in = montant_verse_complement_pour_base_et_majoration_in - self.montant_verse_complement_pour_forfaitaire_in = montant_verse_complement_pour_forfaitaire_in - self.nombre_enfants_l521_1_in = nombre_enfants_l521_1_in - self.age_minimum_alinea_1_l521_3_in = age_minimum_alinea_1_l521_3_in - self.nombre_enfants_alinea_2_l521_3_in = nombre_enfants_alinea_2_l521_3_in - self.est_enfant_le_plus_age_in = est_enfant_le_plus_age_in - self.plafond_I_d521_3_in = plafond_I_d521_3_in - self.plafond_II_d521_3_in = plafond_II_d521_3_in - - def __eq__(self, other: object) -> bool: - if isinstance(other, AllocationsFamilialesIn): - return (self.personne_charge_effective_permanente_est_parent_in == other.personne_charge_effective_permanente_est_parent_in and - self.personne_charge_effective_permanente_remplit_titre_I_in == other.personne_charge_effective_permanente_remplit_titre_I_in and - self.ressources_menage_in == other.ressources_menage_in and - self.residence_in == other.residence_in and - self.date_courante_in == other.date_courante_in and - self.enfants_a_charge_in == other.enfants_a_charge_in and - self.enfants_a_charge_droit_ouvert_prestation_familiale_in == other.enfants_a_charge_droit_ouvert_prestation_familiale_in and - self.prise_en_compte_in == other.prise_en_compte_in and - self.versement_in == other.versement_in and - self.montant_verse_in == other.montant_verse_in and - self.droit_ouvert_base_in == other.droit_ouvert_base_in and - self.montant_initial_base_in == other.montant_initial_base_in and - self.montant_initial_base_premier_enfant_in == other.montant_initial_base_premier_enfant_in and - self.montant_initial_base_deuxieme_enfant_in == other.montant_initial_base_deuxieme_enfant_in and - self.montant_initial_base_troisieme_enfant_et_plus_in == other.montant_initial_base_troisieme_enfant_et_plus_in and - self.rapport_enfants_total_moyen_in == other.rapport_enfants_total_moyen_in and - self.nombre_moyen_enfants_in == other.nombre_moyen_enfants_in and - self.nombre_total_enfants_in == other.nombre_total_enfants_in and - self.montant_avec_garde_alternee_base_in == other.montant_avec_garde_alternee_base_in and - self.montant_verse_base_in == other.montant_verse_base_in and - self.avait_enfant_a_charge_avant_1er_janvier_2012_in == other.avait_enfant_a_charge_avant_1er_janvier_2012_in and - self.montant_initial_base_premier_enfant_mayotte_in == other.montant_initial_base_premier_enfant_mayotte_in and - self.montant_initial_base_deuxieme_enfant_mayotte_in == other.montant_initial_base_deuxieme_enfant_mayotte_in and - self.montant_initial_base_troisieme_enfant_mayotte_in == other.montant_initial_base_troisieme_enfant_mayotte_in and - self.montant_initial_base_quatrieme_enfant_et_plus_mayotte_in == other.montant_initial_base_quatrieme_enfant_et_plus_mayotte_in and - self.droit_ouvert_forfaitaire_in == other.droit_ouvert_forfaitaire_in and - self.montant_verse_forfaitaire_par_enfant_in == other.montant_verse_forfaitaire_par_enfant_in and - self.montant_verse_forfaitaire_in == other.montant_verse_forfaitaire_in and - self.droit_ouvert_majoration_in == other.droit_ouvert_majoration_in and - self.montant_initial_metropole_majoration_in == other.montant_initial_metropole_majoration_in and - self.montant_initial_majoration_in == other.montant_initial_majoration_in and - self.montant_avec_garde_alternee_majoration_in == other.montant_avec_garde_alternee_majoration_in and - self.montant_verse_majoration_in == other.montant_verse_majoration_in and - self.droit_ouvert_complement_in == other.droit_ouvert_complement_in and - self.montant_base_complement_pour_base_et_majoration_in == other.montant_base_complement_pour_base_et_majoration_in and - self.complement_degressif_in == other.complement_degressif_in and - self.montant_verse_complement_pour_base_et_majoration_in == other.montant_verse_complement_pour_base_et_majoration_in and - self.montant_verse_complement_pour_forfaitaire_in == other.montant_verse_complement_pour_forfaitaire_in and - self.nombre_enfants_l521_1_in == other.nombre_enfants_l521_1_in and - self.age_minimum_alinea_1_l521_3_in == other.age_minimum_alinea_1_l521_3_in and - self.nombre_enfants_alinea_2_l521_3_in == other.nombre_enfants_alinea_2_l521_3_in and - self.est_enfant_le_plus_age_in == other.est_enfant_le_plus_age_in and - self.plafond_I_d521_3_in == other.plafond_I_d521_3_in and - self.plafond_II_d521_3_in == other.plafond_II_d521_3_in) - else: - return False - - def __ne__(self, other: object) -> bool: - return not (self == other) - - def __str__(self) -> str: - return "AllocationsFamilialesIn(personne_charge_effective_permanente_est_parent_in={},personne_charge_effective_permanente_remplit_titre_I_in={},ressources_menage_in={},residence_in={},date_courante_in={},enfants_a_charge_in={},enfants_a_charge_droit_ouvert_prestation_familiale_in={},prise_en_compte_in={},versement_in={},montant_verse_in={},droit_ouvert_base_in={},montant_initial_base_in={},montant_initial_base_premier_enfant_in={},montant_initial_base_deuxieme_enfant_in={},montant_initial_base_troisieme_enfant_et_plus_in={},rapport_enfants_total_moyen_in={},nombre_moyen_enfants_in={},nombre_total_enfants_in={},montant_avec_garde_alternee_base_in={},montant_verse_base_in={},avait_enfant_a_charge_avant_1er_janvier_2012_in={},montant_initial_base_premier_enfant_mayotte_in={},montant_initial_base_deuxieme_enfant_mayotte_in={},montant_initial_base_troisieme_enfant_mayotte_in={},montant_initial_base_quatrieme_enfant_et_plus_mayotte_in={},droit_ouvert_forfaitaire_in={},montant_verse_forfaitaire_par_enfant_in={},montant_verse_forfaitaire_in={},droit_ouvert_majoration_in={},montant_initial_metropole_majoration_in={},montant_initial_majoration_in={},montant_avec_garde_alternee_majoration_in={},montant_verse_majoration_in={},droit_ouvert_complement_in={},montant_base_complement_pour_base_et_majoration_in={},complement_degressif_in={},montant_verse_complement_pour_base_et_majoration_in={},montant_verse_complement_pour_forfaitaire_in={},nombre_enfants_l521_1_in={},age_minimum_alinea_1_l521_3_in={},nombre_enfants_alinea_2_l521_3_in={},est_enfant_le_plus_age_in={},plafond_I_d521_3_in={},plafond_II_d521_3_in={})".format(self.personne_charge_effective_permanente_est_parent_in, - self.personne_charge_effective_permanente_remplit_titre_I_in, - self.ressources_menage_in, self.residence_in, self.date_courante_in, - self.enfants_a_charge_in, - self.enfants_a_charge_droit_ouvert_prestation_familiale_in, - self.prise_en_compte_in, self.versement_in, self.montant_verse_in, - self.droit_ouvert_base_in, self.montant_initial_base_in, - self.montant_initial_base_premier_enfant_in, - self.montant_initial_base_deuxieme_enfant_in, - self.montant_initial_base_troisieme_enfant_et_plus_in, - self.rapport_enfants_total_moyen_in, self.nombre_moyen_enfants_in, - self.nombre_total_enfants_in, self.montant_avec_garde_alternee_base_in, - self.montant_verse_base_in, - self.avait_enfant_a_charge_avant_1er_janvier_2012_in, - self.montant_initial_base_premier_enfant_mayotte_in, - self.montant_initial_base_deuxieme_enfant_mayotte_in, - self.montant_initial_base_troisieme_enfant_mayotte_in, - self.montant_initial_base_quatrieme_enfant_et_plus_mayotte_in, - self.droit_ouvert_forfaitaire_in, - self.montant_verse_forfaitaire_par_enfant_in, - self.montant_verse_forfaitaire_in, self.droit_ouvert_majoration_in, - self.montant_initial_metropole_majoration_in, - self.montant_initial_majoration_in, - self.montant_avec_garde_alternee_majoration_in, - self.montant_verse_majoration_in, self.droit_ouvert_complement_in, - self.montant_base_complement_pour_base_et_majoration_in, - self.complement_degressif_in, - self.montant_verse_complement_pour_base_et_majoration_in, - self.montant_verse_complement_pour_forfaitaire_in, - self.nombre_enfants_l521_1_in, self.age_minimum_alinea_1_l521_3_in, - self.nombre_enfants_alinea_2_l521_3_in, self.est_enfant_le_plus_age_in, - self.plafond_I_d521_3_in, self.plafond_II_d521_3_in) - + def __init__(self, personne_charge_effective_permanente_est_parent_in: Callable[[Unit], bool], personne_charge_effective_permanente_remplit_titre_I_in: Callable[[Unit], bool], ressources_menage_in: Callable[[Unit], Money], residence_in: Callable[[Unit], Collectivite], date_courante_in: Callable[[Unit], Date], enfants_a_charge_in: Callable[[Unit], (List[Enfant])], enfants_a_charge_droit_ouvert_prestation_familiale_in: Callable[[Unit], (List[Enfant])], prise_en_compte_in: Callable[[Unit], (Callable[[Enfant], PriseEnCompte])], versement_in: Callable[[Unit], (Callable[[Enfant], VersementAllocations])], montant_verse_in: Callable[[Unit], Money], droit_ouvert_base_in: Callable[[Unit], bool], montant_initial_base_in: Callable[[Unit], Money], montant_initial_base_premier_enfant_in: Callable[[Unit], Money], montant_initial_base_deuxieme_enfant_in: Callable[[Unit], Money], montant_initial_base_troisieme_enfant_et_plus_in: Callable[[Unit], Money], rapport_enfants_total_moyen_in: Callable[[Unit], Decimal], nombre_moyen_enfants_in: Callable[[Unit], Decimal], nombre_total_enfants_in: Callable[[Unit], Decimal], montant_avec_garde_alternee_base_in: Callable[[Unit], Money], montant_verse_base_in: Callable[[Unit], Money], avait_enfant_a_charge_avant_1er_janvier_2012_in: Callable[[Unit], bool], montant_initial_base_premier_enfant_mayotte_in: Callable[[Unit], Money], montant_initial_base_deuxieme_enfant_mayotte_in: Callable[[Unit], Money], montant_initial_base_troisieme_enfant_mayotte_in: Callable[[Unit], Money], montant_initial_base_quatrieme_enfant_et_plus_mayotte_in: Callable[[Unit], Money], droit_ouvert_forfaitaire_in: Callable[[Unit], (Callable[[Enfant], bool])], montant_verse_forfaitaire_par_enfant_in: Callable[[Unit], Money], montant_verse_forfaitaire_in: Callable[[Unit], Money], droit_ouvert_majoration_in: Callable[[Unit], (Callable[[Enfant], bool])], montant_initial_metropole_majoration_in: Callable[[Unit], (Callable[[Enfant], Money])], montant_initial_majoration_in: Callable[[Unit], (Callable[[Enfant], Money])], montant_avec_garde_alternee_majoration_in: Callable[[Unit], (Callable[[Enfant], Money])], montant_verse_majoration_in: Callable[[Unit], Money], droit_ouvert_complement_in: Callable[[Unit], bool], montant_base_complement_pour_base_et_majoration_in: Callable[[Unit], Money], complement_degressif_in: Callable[[Unit], (Callable[[Money], Money])], montant_verse_complement_pour_base_et_majoration_in: Callable[[Unit], Money], montant_verse_complement_pour_forfaitaire_in: Callable[[Unit], Money], nombre_enfants_l521_1_in: Callable[[Unit], Integer], age_minimum_alinea_1_l521_3_in: Callable[[Unit], (Callable[[Enfant], Integer])], nombre_enfants_alinea_2_l521_3_in: Callable[[Unit], Integer], est_enfant_le_plus_age_in: Callable[[Unit], (Callable[[Enfant], bool])], plafond_I_d521_3_in: Callable[[Unit], Money], plafond_II_d521_3_in: Callable[[Unit], Money]) -> None: + self.personne_charge_effective_permanente_est_parent_in = personne_charge_effective_permanente_est_parent_in + self.personne_charge_effective_permanente_remplit_titre_I_in = personne_charge_effective_permanente_remplit_titre_I_in + self.ressources_menage_in = ressources_menage_in + self.residence_in = residence_in + self.date_courante_in = date_courante_in + self.enfants_a_charge_in = enfants_a_charge_in + self.enfants_a_charge_droit_ouvert_prestation_familiale_in = enfants_a_charge_droit_ouvert_prestation_familiale_in + self.prise_en_compte_in = prise_en_compte_in + self.versement_in = versement_in + self.montant_verse_in = montant_verse_in + self.droit_ouvert_base_in = droit_ouvert_base_in + self.montant_initial_base_in = montant_initial_base_in + self.montant_initial_base_premier_enfant_in = montant_initial_base_premier_enfant_in + self.montant_initial_base_deuxieme_enfant_in = montant_initial_base_deuxieme_enfant_in + self.montant_initial_base_troisieme_enfant_et_plus_in = montant_initial_base_troisieme_enfant_et_plus_in + self.rapport_enfants_total_moyen_in = rapport_enfants_total_moyen_in + self.nombre_moyen_enfants_in = nombre_moyen_enfants_in + self.nombre_total_enfants_in = nombre_total_enfants_in + self.montant_avec_garde_alternee_base_in = montant_avec_garde_alternee_base_in + self.montant_verse_base_in = montant_verse_base_in + self.avait_enfant_a_charge_avant_1er_janvier_2012_in = avait_enfant_a_charge_avant_1er_janvier_2012_in + self.montant_initial_base_premier_enfant_mayotte_in = montant_initial_base_premier_enfant_mayotte_in + self.montant_initial_base_deuxieme_enfant_mayotte_in = montant_initial_base_deuxieme_enfant_mayotte_in + self.montant_initial_base_troisieme_enfant_mayotte_in = montant_initial_base_troisieme_enfant_mayotte_in + self.montant_initial_base_quatrieme_enfant_et_plus_mayotte_in = montant_initial_base_quatrieme_enfant_et_plus_mayotte_in + self.droit_ouvert_forfaitaire_in = droit_ouvert_forfaitaire_in + self.montant_verse_forfaitaire_par_enfant_in = montant_verse_forfaitaire_par_enfant_in + self.montant_verse_forfaitaire_in = montant_verse_forfaitaire_in + self.droit_ouvert_majoration_in = droit_ouvert_majoration_in + self.montant_initial_metropole_majoration_in = montant_initial_metropole_majoration_in + self.montant_initial_majoration_in = montant_initial_majoration_in + self.montant_avec_garde_alternee_majoration_in = montant_avec_garde_alternee_majoration_in + self.montant_verse_majoration_in = montant_verse_majoration_in + self.droit_ouvert_complement_in = droit_ouvert_complement_in + self.montant_base_complement_pour_base_et_majoration_in = montant_base_complement_pour_base_et_majoration_in + self.complement_degressif_in = complement_degressif_in + self.montant_verse_complement_pour_base_et_majoration_in = montant_verse_complement_pour_base_et_majoration_in + self.montant_verse_complement_pour_forfaitaire_in = montant_verse_complement_pour_forfaitaire_in + self.nombre_enfants_l521_1_in = nombre_enfants_l521_1_in + self.age_minimum_alinea_1_l521_3_in = age_minimum_alinea_1_l521_3_in + self.nombre_enfants_alinea_2_l521_3_in = nombre_enfants_alinea_2_l521_3_in + self.est_enfant_le_plus_age_in = est_enfant_le_plus_age_in + self.plafond_I_d521_3_in = plafond_I_d521_3_in + self.plafond_II_d521_3_in = plafond_II_d521_3_in + + def __eq__(self, other: object) -> bool: + if isinstance(other, AllocationsFamilialesIn): + return (self.personne_charge_effective_permanente_est_parent_in == other.personne_charge_effective_permanente_est_parent_in and + self.personne_charge_effective_permanente_remplit_titre_I_in == other.personne_charge_effective_permanente_remplit_titre_I_in and + self.ressources_menage_in == other.ressources_menage_in and + self.residence_in == other.residence_in and + self.date_courante_in == other.date_courante_in and + self.enfants_a_charge_in == other.enfants_a_charge_in and + self.enfants_a_charge_droit_ouvert_prestation_familiale_in == other.enfants_a_charge_droit_ouvert_prestation_familiale_in and + self.prise_en_compte_in == other.prise_en_compte_in and + self.versement_in == other.versement_in and + self.montant_verse_in == other.montant_verse_in and + self.droit_ouvert_base_in == other.droit_ouvert_base_in and + self.montant_initial_base_in == other.montant_initial_base_in and + self.montant_initial_base_premier_enfant_in == other.montant_initial_base_premier_enfant_in and + self.montant_initial_base_deuxieme_enfant_in == other.montant_initial_base_deuxieme_enfant_in and + self.montant_initial_base_troisieme_enfant_et_plus_in == other.montant_initial_base_troisieme_enfant_et_plus_in and + self.rapport_enfants_total_moyen_in == other.rapport_enfants_total_moyen_in and + self.nombre_moyen_enfants_in == other.nombre_moyen_enfants_in and + self.nombre_total_enfants_in == other.nombre_total_enfants_in and + self.montant_avec_garde_alternee_base_in == other.montant_avec_garde_alternee_base_in and + self.montant_verse_base_in == other.montant_verse_base_in and + self.avait_enfant_a_charge_avant_1er_janvier_2012_in == other.avait_enfant_a_charge_avant_1er_janvier_2012_in and + self.montant_initial_base_premier_enfant_mayotte_in == other.montant_initial_base_premier_enfant_mayotte_in and + self.montant_initial_base_deuxieme_enfant_mayotte_in == other.montant_initial_base_deuxieme_enfant_mayotte_in and + self.montant_initial_base_troisieme_enfant_mayotte_in == other.montant_initial_base_troisieme_enfant_mayotte_in and + self.montant_initial_base_quatrieme_enfant_et_plus_mayotte_in == other.montant_initial_base_quatrieme_enfant_et_plus_mayotte_in and + self.droit_ouvert_forfaitaire_in == other.droit_ouvert_forfaitaire_in and + self.montant_verse_forfaitaire_par_enfant_in == other.montant_verse_forfaitaire_par_enfant_in and + self.montant_verse_forfaitaire_in == other.montant_verse_forfaitaire_in and + self.droit_ouvert_majoration_in == other.droit_ouvert_majoration_in and + self.montant_initial_metropole_majoration_in == other.montant_initial_metropole_majoration_in and + self.montant_initial_majoration_in == other.montant_initial_majoration_in and + self.montant_avec_garde_alternee_majoration_in == other.montant_avec_garde_alternee_majoration_in and + self.montant_verse_majoration_in == other.montant_verse_majoration_in and + self.droit_ouvert_complement_in == other.droit_ouvert_complement_in and + self.montant_base_complement_pour_base_et_majoration_in == other.montant_base_complement_pour_base_et_majoration_in and + self.complement_degressif_in == other.complement_degressif_in and + self.montant_verse_complement_pour_base_et_majoration_in == other.montant_verse_complement_pour_base_et_majoration_in and + self.montant_verse_complement_pour_forfaitaire_in == other.montant_verse_complement_pour_forfaitaire_in and + self.nombre_enfants_l521_1_in == other.nombre_enfants_l521_1_in and + self.age_minimum_alinea_1_l521_3_in == other.age_minimum_alinea_1_l521_3_in and + self.nombre_enfants_alinea_2_l521_3_in == other.nombre_enfants_alinea_2_l521_3_in and + self.est_enfant_le_plus_age_in == other.est_enfant_le_plus_age_in and + self.plafond_I_d521_3_in == other.plafond_I_d521_3_in and + self.plafond_II_d521_3_in == other.plafond_II_d521_3_in) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "AllocationsFamilialesIn(personne_charge_effective_permanente_est_parent_in={},personne_charge_effective_permanente_remplit_titre_I_in={},ressources_menage_in={},residence_in={},date_courante_in={},enfants_a_charge_in={},enfants_a_charge_droit_ouvert_prestation_familiale_in={},prise_en_compte_in={},versement_in={},montant_verse_in={},droit_ouvert_base_in={},montant_initial_base_in={},montant_initial_base_premier_enfant_in={},montant_initial_base_deuxieme_enfant_in={},montant_initial_base_troisieme_enfant_et_plus_in={},rapport_enfants_total_moyen_in={},nombre_moyen_enfants_in={},nombre_total_enfants_in={},montant_avec_garde_alternee_base_in={},montant_verse_base_in={},avait_enfant_a_charge_avant_1er_janvier_2012_in={},montant_initial_base_premier_enfant_mayotte_in={},montant_initial_base_deuxieme_enfant_mayotte_in={},montant_initial_base_troisieme_enfant_mayotte_in={},montant_initial_base_quatrieme_enfant_et_plus_mayotte_in={},droit_ouvert_forfaitaire_in={},montant_verse_forfaitaire_par_enfant_in={},montant_verse_forfaitaire_in={},droit_ouvert_majoration_in={},montant_initial_metropole_majoration_in={},montant_initial_majoration_in={},montant_avec_garde_alternee_majoration_in={},montant_verse_majoration_in={},droit_ouvert_complement_in={},montant_base_complement_pour_base_et_majoration_in={},complement_degressif_in={},montant_verse_complement_pour_base_et_majoration_in={},montant_verse_complement_pour_forfaitaire_in={},nombre_enfants_l521_1_in={},age_minimum_alinea_1_l521_3_in={},nombre_enfants_alinea_2_l521_3_in={},est_enfant_le_plus_age_in={},plafond_I_d521_3_in={},plafond_II_d521_3_in={})".format(self.personne_charge_effective_permanente_est_parent_in, + self.personne_charge_effective_permanente_remplit_titre_I_in, + self.ressources_menage_in, self.residence_in, self.date_courante_in, + self.enfants_a_charge_in, + self.enfants_a_charge_droit_ouvert_prestation_familiale_in, + self.prise_en_compte_in, self.versement_in, self.montant_verse_in, + self.droit_ouvert_base_in, self.montant_initial_base_in, + self.montant_initial_base_premier_enfant_in, + self.montant_initial_base_deuxieme_enfant_in, + self.montant_initial_base_troisieme_enfant_et_plus_in, + self.rapport_enfants_total_moyen_in, self.nombre_moyen_enfants_in, + self.nombre_total_enfants_in, self.montant_avec_garde_alternee_base_in, + self.montant_verse_base_in, + self.avait_enfant_a_charge_avant_1er_janvier_2012_in, + self.montant_initial_base_premier_enfant_mayotte_in, + self.montant_initial_base_deuxieme_enfant_mayotte_in, + self.montant_initial_base_troisieme_enfant_mayotte_in, + self.montant_initial_base_quatrieme_enfant_et_plus_mayotte_in, + self.droit_ouvert_forfaitaire_in, + self.montant_verse_forfaitaire_par_enfant_in, + self.montant_verse_forfaitaire_in, self.droit_ouvert_majoration_in, + self.montant_initial_metropole_majoration_in, + self.montant_initial_majoration_in, + self.montant_avec_garde_alternee_majoration_in, + self.montant_verse_majoration_in, self.droit_ouvert_complement_in, + self.montant_base_complement_pour_base_et_majoration_in, + self.complement_degressif_in, + self.montant_verse_complement_pour_base_et_majoration_in, + self.montant_verse_complement_pour_forfaitaire_in, + self.nombre_enfants_l521_1_in, self.age_minimum_alinea_1_l521_3_in, + self.nombre_enfants_alinea_2_l521_3_in, self.est_enfant_le_plus_age_in, + self.plafond_I_d521_3_in, self.plafond_II_d521_3_in) class InterfaceAllocationsFamilialesOut: - def __init__(self, date_courante_out: Date, enfants_out: List[EnfantEntree], enfants_a_charge_out: List[Enfant], ressources_menage_out: Money, residence_out: Collectivite, montant_verse_out: Money, personne_charge_effective_permanente_est_parent_out: bool, personne_charge_effective_permanente_remplit_titre_I_out: bool, avait_enfant_a_charge_avant_1er_janvier_2012_out: bool) -> None: - self.date_courante_out = date_courante_out - self.enfants_out = enfants_out - self.enfants_a_charge_out = enfants_a_charge_out - self.ressources_menage_out = ressources_menage_out - self.residence_out = residence_out - self.montant_verse_out = montant_verse_out - self.personne_charge_effective_permanente_est_parent_out = personne_charge_effective_permanente_est_parent_out - self.personne_charge_effective_permanente_remplit_titre_I_out = personne_charge_effective_permanente_remplit_titre_I_out - self.avait_enfant_a_charge_avant_1er_janvier_2012_out = avait_enfant_a_charge_avant_1er_janvier_2012_out - - def __eq__(self, other: object) -> bool: - if isinstance(other, InterfaceAllocationsFamilialesOut): - return (self.date_courante_out == other.date_courante_out and - self.enfants_out == other.enfants_out and - self.enfants_a_charge_out == other.enfants_a_charge_out and - self.ressources_menage_out == other.ressources_menage_out and - self.residence_out == other.residence_out and - self.montant_verse_out == other.montant_verse_out and - self.personne_charge_effective_permanente_est_parent_out == other.personne_charge_effective_permanente_est_parent_out and - self.personne_charge_effective_permanente_remplit_titre_I_out == other.personne_charge_effective_permanente_remplit_titre_I_out and - self.avait_enfant_a_charge_avant_1er_janvier_2012_out == other.avait_enfant_a_charge_avant_1er_janvier_2012_out) - else: - return False - - def __ne__(self, other: object) -> bool: - return not (self == other) - - def __str__(self) -> str: - return "InterfaceAllocationsFamilialesOut(date_courante_out={},enfants_out={},enfants_a_charge_out={},ressources_menage_out={},residence_out={},montant_verse_out={},personne_charge_effective_permanente_est_parent_out={},personne_charge_effective_permanente_remplit_titre_I_out={},avait_enfant_a_charge_avant_1er_janvier_2012_out={})".format(self.date_courante_out, - self.enfants_out, self.enfants_a_charge_out, - self.ressources_menage_out, self.residence_out, self.montant_verse_out, - self.personne_charge_effective_permanente_est_parent_out, - self.personne_charge_effective_permanente_remplit_titre_I_out, - self.avait_enfant_a_charge_avant_1er_janvier_2012_out) - + def __init__(self, date_courante_out: Date, enfants_out: List[EnfantEntree], enfants_a_charge_out: List[Enfant], ressources_menage_out: Money, residence_out: Collectivite, montant_verse_out: Money, personne_charge_effective_permanente_est_parent_out: bool, personne_charge_effective_permanente_remplit_titre_I_out: bool, avait_enfant_a_charge_avant_1er_janvier_2012_out: bool) -> None: + self.date_courante_out = date_courante_out + self.enfants_out = enfants_out + self.enfants_a_charge_out = enfants_a_charge_out + self.ressources_menage_out = ressources_menage_out + self.residence_out = residence_out + self.montant_verse_out = montant_verse_out + self.personne_charge_effective_permanente_est_parent_out = personne_charge_effective_permanente_est_parent_out + self.personne_charge_effective_permanente_remplit_titre_I_out = personne_charge_effective_permanente_remplit_titre_I_out + self.avait_enfant_a_charge_avant_1er_janvier_2012_out = avait_enfant_a_charge_avant_1er_janvier_2012_out + + def __eq__(self, other: object) -> bool: + if isinstance(other, InterfaceAllocationsFamilialesOut): + return (self.date_courante_out == other.date_courante_out and + self.enfants_out == other.enfants_out and + self.enfants_a_charge_out == other.enfants_a_charge_out and + self.ressources_menage_out == other.ressources_menage_out and + self.residence_out == other.residence_out and + self.montant_verse_out == other.montant_verse_out and + self.personne_charge_effective_permanente_est_parent_out == other.personne_charge_effective_permanente_est_parent_out and + self.personne_charge_effective_permanente_remplit_titre_I_out == other.personne_charge_effective_permanente_remplit_titre_I_out and + self.avait_enfant_a_charge_avant_1er_janvier_2012_out == other.avait_enfant_a_charge_avant_1er_janvier_2012_out) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "InterfaceAllocationsFamilialesOut(date_courante_out={},enfants_out={},enfants_a_charge_out={},ressources_menage_out={},residence_out={},montant_verse_out={},personne_charge_effective_permanente_est_parent_out={},personne_charge_effective_permanente_remplit_titre_I_out={},avait_enfant_a_charge_avant_1er_janvier_2012_out={})".format(self.date_courante_out, + self.enfants_out, self.enfants_a_charge_out, + self.ressources_menage_out, self.residence_out, self.montant_verse_out, + self.personne_charge_effective_permanente_est_parent_out, + self.personne_charge_effective_permanente_remplit_titre_I_out, + self.avait_enfant_a_charge_avant_1er_janvier_2012_out) class InterfaceAllocationsFamilialesIn: - def __init__(self, date_courante_in: Callable[[Unit], Date], enfants_in: Callable[[Unit], (List[EnfantEntree])], enfants_a_charge_in: Callable[[Unit], (List[Enfant])], ressources_menage_in: Callable[[Unit], Money], residence_in: Callable[[Unit], Collectivite], montant_verse_in: Callable[[Unit], Money], personne_charge_effective_permanente_est_parent_in: Callable[[Unit], bool], personne_charge_effective_permanente_remplit_titre_I_in: Callable[[Unit], bool], avait_enfant_a_charge_avant_1er_janvier_2012_in: Callable[[Unit], bool]) -> None: - self.date_courante_in = date_courante_in - self.enfants_in = enfants_in - self.enfants_a_charge_in = enfants_a_charge_in - self.ressources_menage_in = ressources_menage_in - self.residence_in = residence_in - self.montant_verse_in = montant_verse_in - self.personne_charge_effective_permanente_est_parent_in = personne_charge_effective_permanente_est_parent_in - self.personne_charge_effective_permanente_remplit_titre_I_in = personne_charge_effective_permanente_remplit_titre_I_in - self.avait_enfant_a_charge_avant_1er_janvier_2012_in = avait_enfant_a_charge_avant_1er_janvier_2012_in - - def __eq__(self, other: object) -> bool: - if isinstance(other, InterfaceAllocationsFamilialesIn): - return (self.date_courante_in == other.date_courante_in and - self.enfants_in == other.enfants_in and - self.enfants_a_charge_in == other.enfants_a_charge_in and - self.ressources_menage_in == other.ressources_menage_in and - self.residence_in == other.residence_in and - self.montant_verse_in == other.montant_verse_in and - self.personne_charge_effective_permanente_est_parent_in == other.personne_charge_effective_permanente_est_parent_in and - self.personne_charge_effective_permanente_remplit_titre_I_in == other.personne_charge_effective_permanente_remplit_titre_I_in and - self.avait_enfant_a_charge_avant_1er_janvier_2012_in == other.avait_enfant_a_charge_avant_1er_janvier_2012_in) - else: - return False - - def __ne__(self, other: object) -> bool: - return not (self == other) - - def __str__(self) -> str: - return "InterfaceAllocationsFamilialesIn(date_courante_in={},enfants_in={},enfants_a_charge_in={},ressources_menage_in={},residence_in={},montant_verse_in={},personne_charge_effective_permanente_est_parent_in={},personne_charge_effective_permanente_remplit_titre_I_in={},avait_enfant_a_charge_avant_1er_janvier_2012_in={})".format(self.date_courante_in, - self.enfants_in, self.enfants_a_charge_in, self.ressources_menage_in, - self.residence_in, self.montant_verse_in, - self.personne_charge_effective_permanente_est_parent_in, - self.personne_charge_effective_permanente_remplit_titre_I_in, - self.avait_enfant_a_charge_avant_1er_janvier_2012_in) - - -def smic(smic_in_1: SmicIn): + def __init__(self, date_courante_in: Callable[[Unit], Date], enfants_in: Callable[[Unit], (List[EnfantEntree])], enfants_a_charge_in: Callable[[Unit], (List[Enfant])], ressources_menage_in: Callable[[Unit], Money], residence_in: Callable[[Unit], Collectivite], montant_verse_in: Callable[[Unit], Money], personne_charge_effective_permanente_est_parent_in: Callable[[Unit], bool], personne_charge_effective_permanente_remplit_titre_I_in: Callable[[Unit], bool], avait_enfant_a_charge_avant_1er_janvier_2012_in: Callable[[Unit], bool]) -> None: + self.date_courante_in = date_courante_in + self.enfants_in = enfants_in + self.enfants_a_charge_in = enfants_a_charge_in + self.ressources_menage_in = ressources_menage_in + self.residence_in = residence_in + self.montant_verse_in = montant_verse_in + self.personne_charge_effective_permanente_est_parent_in = personne_charge_effective_permanente_est_parent_in + self.personne_charge_effective_permanente_remplit_titre_I_in = personne_charge_effective_permanente_remplit_titre_I_in + self.avait_enfant_a_charge_avant_1er_janvier_2012_in = avait_enfant_a_charge_avant_1er_janvier_2012_in + + def __eq__(self, other: object) -> bool: + if isinstance(other, InterfaceAllocationsFamilialesIn): + return (self.date_courante_in == other.date_courante_in and + self.enfants_in == other.enfants_in and + self.enfants_a_charge_in == other.enfants_a_charge_in and + self.ressources_menage_in == other.ressources_menage_in and + self.residence_in == other.residence_in and + self.montant_verse_in == other.montant_verse_in and + self.personne_charge_effective_permanente_est_parent_in == other.personne_charge_effective_permanente_est_parent_in and + self.personne_charge_effective_permanente_remplit_titre_I_in == other.personne_charge_effective_permanente_remplit_titre_I_in and + self.avait_enfant_a_charge_avant_1er_janvier_2012_in == other.avait_enfant_a_charge_avant_1er_janvier_2012_in) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "InterfaceAllocationsFamilialesIn(date_courante_in={},enfants_in={},enfants_a_charge_in={},ressources_menage_in={},residence_in={},montant_verse_in={},personne_charge_effective_permanente_est_parent_in={},personne_charge_effective_permanente_remplit_titre_I_in={},avait_enfant_a_charge_avant_1er_janvier_2012_in={})".format(self.date_courante_in, + self.enfants_in, self.enfants_a_charge_in, self.ressources_menage_in, + self.residence_in, self.montant_verse_in, + self.personne_charge_effective_permanente_est_parent_in, + self.personne_charge_effective_permanente_remplit_titre_I_in, + self.avait_enfant_a_charge_avant_1er_janvier_2012_in) + + + +def smic(smic_in_1:SmicIn): date_courante_2 = smic_in_1.date_courante_in residence_3 = smic_in_1.residence_in brut_horaire_4 = smic_in_1.brut_horaire_in try: - local_var_6 = date_courante_2(Unit()) + try: + local_var_6 = date_courante_2(Unit()) + except EmptyError: + if log_decision_taken(SourcePosition(filename="", start_line=0, + start_column=1, end_line=0, end_column=1, + law_headings=[]), False): + raise EmptyError + else: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=41, start_column=12, end_line=41, end_column=25, - law_headings=["Prologue"])) + start_line=41, start_column=12, end_line=41, end_column=25, + law_headings=["Prologue"])) date_courante_5 = log_variable_definition(["Smic", "date_courante"], - local_var_6) + local_var_6) try: - local_var_8 = residence_3(Unit()) + try: + local_var_8 = residence_3(Unit()) + except EmptyError: + if log_decision_taken(SourcePosition(filename="", start_line=0, + start_column=1, end_line=0, end_column=1, + law_headings=[]), False): + raise EmptyError + else: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=42, start_column=12, end_line=42, end_column=21, - law_headings=["Prologue"])) + start_line=42, start_column=12, end_line=42, end_column=21, + law_headings=["Prologue"])) residence_7 = log_variable_definition(["Smic", "résidence"], - local_var_8) + local_var_8) try: try: local_var_10 = brut_horaire_4(Unit()) except EmptyError: - def local_var_21(_: Any): + def local_var_21(_:Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=219, start_column=5, - end_line=228, end_column=6, law_headings=["Article 1", - "Décret n° 2018-1173 du 19 décembre 2018 portant relèvement du salaire minimum de croissance", - "Montant du salaire minimum de croissance", - "Décrets divers"]), ((date_courante_5 >= - date_of_numbers(2019, 1, 1)) and ((date_courante_5 <= - date_of_numbers(2019, 12, 31)) and ((residence_7 == - Collectivite(Collectivite_Code.Metropole, Unit())) or - ((residence_7 == - Collectivite(Collectivite_Code.Guadeloupe, Unit())) or - ((residence_7 == Collectivite(Collectivite_Code.Guyane, - Unit())) or ((residence_7 == - Collectivite(Collectivite_Code.Martinique, Unit())) or - ((residence_7 == - Collectivite(Collectivite_Code.LaReunion, Unit())) or - ((residence_7 == - Collectivite(Collectivite_Code.SaintBarthelemy, - Unit())) or ((residence_7 == - Collectivite(Collectivite_Code.SaintMartin, Unit())) or - (residence_7 == - Collectivite(Collectivite_Code.SaintPierreEtMiquelon, - Unit())))))))))))): + start_line=219, start_column=5, + end_line=228, end_column=6, law_headings=["Article 1", + "Décret n° 2018-1173 du 19 décembre 2018 portant relèvement du salaire minimum de croissance", + "Montant du salaire minimum de croissance", + "Décrets divers"]), ((date_courante_5 >= + date_of_numbers(2019,1,1)) and ((date_courante_5 <= + date_of_numbers(2019,12,31)) and ((residence_7 == + Collectivite(Collectivite_Code.Metropole, Unit())) or + ((residence_7 == + Collectivite(Collectivite_Code.Guadeloupe, Unit())) or + ((residence_7 == Collectivite(Collectivite_Code.Guyane, + Unit())) or ((residence_7 == + Collectivite(Collectivite_Code.Martinique, Unit())) or + ((residence_7 == + Collectivite(Collectivite_Code.LaReunion, Unit())) or + ((residence_7 == + Collectivite(Collectivite_Code.SaintBarthelemy, + Unit())) or ((residence_7 == + Collectivite(Collectivite_Code.SaintMartin, Unit())) or + (residence_7 == + Collectivite(Collectivite_Code.SaintPierreEtMiquelon, + Unit())))))))))))): return money_of_cents_string("1003") else: raise EmptyError - - def local_var_19(_: Any): + def local_var_19(_:Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=237, start_column=5, - end_line=239, end_column=6, law_headings=["Article 1", - "Décret n° 2018-1173 du 19 décembre 2018 portant relèvement du salaire minimum de croissance", - "Montant du salaire minimum de croissance", - "Décrets divers"]), ((date_courante_5 >= - date_of_numbers(2019, 1, 1)) and ((date_courante_5 <= - date_of_numbers(2019, 12, 31)) and (residence_7 == - Collectivite(Collectivite_Code.Mayotte, - Unit()))))): + start_line=237, start_column=5, + end_line=239, end_column=6, law_headings=["Article 1", + "Décret n° 2018-1173 du 19 décembre 2018 portant relèvement du salaire minimum de croissance", + "Montant du salaire minimum de croissance", + "Décrets divers"]), ((date_courante_5 >= + date_of_numbers(2019,1,1)) and ((date_courante_5 <= + date_of_numbers(2019,12,31)) and (residence_7 == + Collectivite(Collectivite_Code.Mayotte, + Unit()))))): return money_of_cents_string("757") else: raise EmptyError - - def local_var_17(_: Any): + def local_var_17(_:Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=258, start_column=5, - end_line=267, end_column=6, law_headings=["Article 1", - "Décret n° 2019-1387 du 18 décembre 2019 portant relèvement du salaire minimum de croissance", - "Montant du salaire minimum de croissance", - "Décrets divers"]), ((date_courante_5 >= - date_of_numbers(2020, 1, 1)) and ((date_courante_5 <= - date_of_numbers(2020, 12, 31)) and ((residence_7 == - Collectivite(Collectivite_Code.Metropole, Unit())) or - ((residence_7 == - Collectivite(Collectivite_Code.Guadeloupe, Unit())) or - ((residence_7 == Collectivite(Collectivite_Code.Guyane, - Unit())) or ((residence_7 == - Collectivite(Collectivite_Code.Martinique, Unit())) or - ((residence_7 == - Collectivite(Collectivite_Code.LaReunion, Unit())) or - ((residence_7 == - Collectivite(Collectivite_Code.SaintBarthelemy, - Unit())) or ((residence_7 == - Collectivite(Collectivite_Code.SaintMartin, Unit())) or - (residence_7 == - Collectivite(Collectivite_Code.SaintPierreEtMiquelon, - Unit())))))))))))): + start_line=258, start_column=5, + end_line=267, end_column=6, law_headings=["Article 1", + "Décret n° 2019-1387 du 18 décembre 2019 portant relèvement du salaire minimum de croissance", + "Montant du salaire minimum de croissance", + "Décrets divers"]), ((date_courante_5 >= + date_of_numbers(2020,1,1)) and ((date_courante_5 <= + date_of_numbers(2020,12,31)) and ((residence_7 == + Collectivite(Collectivite_Code.Metropole, Unit())) or + ((residence_7 == + Collectivite(Collectivite_Code.Guadeloupe, Unit())) or + ((residence_7 == Collectivite(Collectivite_Code.Guyane, + Unit())) or ((residence_7 == + Collectivite(Collectivite_Code.Martinique, Unit())) or + ((residence_7 == + Collectivite(Collectivite_Code.LaReunion, Unit())) or + ((residence_7 == + Collectivite(Collectivite_Code.SaintBarthelemy, + Unit())) or ((residence_7 == + Collectivite(Collectivite_Code.SaintMartin, Unit())) or + (residence_7 == + Collectivite(Collectivite_Code.SaintPierreEtMiquelon, + Unit())))))))))))): return money_of_cents_string("1015") else: raise EmptyError - - def local_var_15(_: Any): + def local_var_15(_:Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=276, start_column=5, - end_line=278, end_column=6, law_headings=["Article 1", - "Décret n° 2019-1387 du 18 décembre 2019 portant relèvement du salaire minimum de croissance", - "Montant du salaire minimum de croissance", - "Décrets divers"]), ((date_courante_5 >= - date_of_numbers(2020, 1, 1)) and ((date_courante_5 <= - date_of_numbers(2020, 12, 31)) and (residence_7 == - Collectivite(Collectivite_Code.Mayotte, - Unit()))))): + start_line=276, start_column=5, + end_line=278, end_column=6, law_headings=["Article 1", + "Décret n° 2019-1387 du 18 décembre 2019 portant relèvement du salaire minimum de croissance", + "Montant du salaire minimum de croissance", + "Décrets divers"]), ((date_courante_5 >= + date_of_numbers(2020,1,1)) and ((date_courante_5 <= + date_of_numbers(2020,12,31)) and (residence_7 == + Collectivite(Collectivite_Code.Mayotte, + Unit()))))): return money_of_cents_string("766") else: raise EmptyError - - def local_var_13(_: Any): + def local_var_13(_:Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=297, start_column=5, - end_line=306, end_column=6, law_headings=["Article 1", - "Décret n° 2020-1598 du 16 décembre 2020 portant relèvement du salaire minimum de croissance", - "Montant du salaire minimum de croissance", - "Décrets divers"]), ((date_courante_5 >= - date_of_numbers(2021, 1, 1)) and ((date_courante_5 <= - date_of_numbers(2021, 12, 31)) and ((residence_7 == - Collectivite(Collectivite_Code.Metropole, Unit())) or - ((residence_7 == - Collectivite(Collectivite_Code.Guadeloupe, Unit())) or - ((residence_7 == Collectivite(Collectivite_Code.Guyane, - Unit())) or ((residence_7 == - Collectivite(Collectivite_Code.Martinique, Unit())) or - ((residence_7 == - Collectivite(Collectivite_Code.LaReunion, Unit())) or - ((residence_7 == - Collectivite(Collectivite_Code.SaintBarthelemy, - Unit())) or ((residence_7 == - Collectivite(Collectivite_Code.SaintMartin, Unit())) or - (residence_7 == - Collectivite(Collectivite_Code.SaintPierreEtMiquelon, - Unit())))))))))))): + start_line=297, start_column=5, + end_line=306, end_column=6, law_headings=["Article 1", + "Décret n° 2020-1598 du 16 décembre 2020 portant relèvement du salaire minimum de croissance", + "Montant du salaire minimum de croissance", + "Décrets divers"]), ((date_courante_5 >= + date_of_numbers(2021,1,1)) and ((date_courante_5 <= + date_of_numbers(2021,12,31)) and ((residence_7 == + Collectivite(Collectivite_Code.Metropole, Unit())) or + ((residence_7 == + Collectivite(Collectivite_Code.Guadeloupe, Unit())) or + ((residence_7 == Collectivite(Collectivite_Code.Guyane, + Unit())) or ((residence_7 == + Collectivite(Collectivite_Code.Martinique, Unit())) or + ((residence_7 == + Collectivite(Collectivite_Code.LaReunion, Unit())) or + ((residence_7 == + Collectivite(Collectivite_Code.SaintBarthelemy, + Unit())) or ((residence_7 == + Collectivite(Collectivite_Code.SaintMartin, Unit())) or + (residence_7 == + Collectivite(Collectivite_Code.SaintPierreEtMiquelon, + Unit())))))))))))): return money_of_cents_string("1025") else: raise EmptyError - - def local_var_11(_: Any): + def local_var_11(_:Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=315, start_column=5, - end_line=317, end_column=6, law_headings=["Article 1", - "Décret n° 2020-1598 du 16 décembre 2020 portant relèvement du salaire minimum de croissance", - "Montant du salaire minimum de croissance", - "Décrets divers"]), ((date_courante_5 >= - date_of_numbers(2021, 1, 1)) and ((date_courante_5 <= - date_of_numbers(2021, 12, 31)) and (residence_7 == - Collectivite(Collectivite_Code.Mayotte, - Unit()))))): + start_line=315, start_column=5, + end_line=317, end_column=6, law_headings=["Article 1", + "Décret n° 2020-1598 du 16 décembre 2020 portant relèvement du salaire minimum de croissance", + "Montant du salaire minimum de croissance", + "Décrets divers"]), ((date_courante_5 >= + date_of_numbers(2021,1,1)) and ((date_courante_5 <= + date_of_numbers(2021,12,31)) and (residence_7 == + Collectivite(Collectivite_Code.Mayotte, + Unit()))))): return money_of_cents_string("774") else: raise EmptyError - - def local_var_23(_: Any): + def local_var_23(_:Any): return log_decision_taken(SourcePosition(filename="", - start_line=0, start_column=1, end_line=0, end_column=1, - law_headings=[]), False) - - def local_var_25(_: Any): + start_line=0, start_column=1, end_line=0, end_column=1, + law_headings=[]), False) + def local_var_25(_:Any): raise EmptyError local_var_10 = handle_default([local_var_11, local_var_13, - local_var_15, local_var_17, local_var_19, local_var_21], - local_var_23, local_var_25) + local_var_15, local_var_17, local_var_19, local_var_21], + local_var_23, local_var_25) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=43, start_column=12, end_line=43, end_column=24, - law_headings=["Prologue"])) + start_line=43, start_column=12, end_line=43, end_column=24, + law_headings=["Prologue"])) brut_horaire_9 = log_variable_definition(["Smic", "brut_horaire"], - local_var_10) - return SmicOut(date_courante_out=date_courante_5, - residence_out=residence_7, brut_horaire_out=brut_horaire_9) - + local_var_10) + return SmicOut(date_courante_out = date_courante_5, + residence_out = residence_7, brut_horaire_out = brut_horaire_9) -def allocation_familiales_avril2008(allocation_familiales_avril2008_in_27: AllocationFamilialesAvril2008In): +def allocation_familiales_avril2008(allocation_familiales_avril2008_in_27:AllocationFamilialesAvril2008In): age_minimum_alinea_1_l521_3_28 = allocation_familiales_avril2008_in_27.age_minimum_alinea_1_l521_3_in try: try: local_var_30 = age_minimum_alinea_1_l521_3_28(Unit()) except EmptyError: - local_var_30 = integer_of_string("16") + try: + local_var_30 = integer_of_string("16") + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=81, start_column=12, end_line=81, end_column=39, - law_headings=["Prologue"])) + start_line=81, start_column=12, end_line=81, end_column=39, + law_headings=["Prologue"])) age_minimum_alinea_1_l521_3_29 = log_variable_definition(["AllocationFamilialesAvril2008", - "âge_minimum_alinéa_1_l521_3"], local_var_30) - return AllocationFamilialesAvril2008Out(age_minimum_alinea_1_l521_3_out=age_minimum_alinea_1_l521_3_29) - + "âge_minimum_alinéa_1_l521_3"], local_var_30) + return AllocationFamilialesAvril2008Out(age_minimum_alinea_1_l521_3_out = age_minimum_alinea_1_l521_3_29) -def enfant_le_plus_age(enfant_le_plus_age_in_31: EnfantLePlusAgeIn): +def enfant_le_plus_age(enfant_le_plus_age_in_31:EnfantLePlusAgeIn): enfants_32 = enfant_le_plus_age_in_31.enfants_in le_plus_age_33 = enfant_le_plus_age_in_31.le_plus_age_in try: - local_var_35 = enfants_32(Unit()) + try: + local_var_35 = enfants_32(Unit()) + except EmptyError: + if log_decision_taken(SourcePosition(filename="", start_line=0, + start_column=1, end_line=0, end_column=1, + law_headings=[]), False): + raise EmptyError + else: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=84, start_column=12, end_line=84, end_column=19, - law_headings=["Prologue"])) + start_line=84, start_column=12, end_line=84, end_column=19, + law_headings=["Prologue"])) enfants_34 = log_variable_definition(["EnfantLePlusÂgé", "enfants"], - local_var_35) + local_var_35) try: try: local_var_37 = le_plus_age_33(Unit()) except EmptyError: - def local_var_39(potentiel_plus_age_40: Any): - return potentiel_plus_age_40.age - predicate_38 = local_var_39 - - def local_var_41(acc_42: Any, item_43: Any): - if (predicate_38(acc_42) > + try: + def local_var_39(potentiel_plus_age_40:Any): + return potentiel_plus_age_40.age + predicate_38 = local_var_39 + def local_var_41(acc_42:Any, item_43:Any): + if (predicate_38(acc_42) > predicate_38(item_43)): - return acc_42 - else: - return item_43 - local_var_37 = list_fold_left(local_var_41, - Enfant(identifiant=- integer_of_string("1"), - obligation_scolaire=SituationObligationScolaire(SituationObligationScolaire_Code.Pendant, - Unit()), remuneration_mensuelle=money_of_cents_string("0"), - date_de_naissance=date_of_numbers( - 1900, 1, 1), - age=integer_of_string("0"), - prise_en_charge=PriseEnCharge(PriseEnCharge_Code.EffectiveEtPermanente, - Unit()), - a_deja_ouvert_droit_aux_allocations_familiales=False), - enfants_34) + return acc_42 + else: + return item_43 + local_var_37 = list_fold_left(local_var_41, + Enfant(identifiant = - integer_of_string("1"), + obligation_scolaire = SituationObligationScolaire(SituationObligationScolaire_Code.Pendant, + Unit()), + remuneration_mensuelle = money_of_cents_string("0"), + date_de_naissance = date_of_numbers(1900,1,1), + age = integer_of_string("0"), + prise_en_charge = PriseEnCharge(PriseEnCharge_Code.EffectiveEtPermanente, + Unit()), + a_deja_ouvert_droit_aux_allocations_familiales = False), + enfants_34) + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=85, start_column=12, end_line=85, end_column=23, - law_headings=["Prologue"])) + start_line=85, start_column=12, end_line=85, end_column=23, + law_headings=["Prologue"])) le_plus_age_36 = log_variable_definition(["EnfantLePlusÂgé", - "le_plus_âgé"], local_var_37) - return EnfantLePlusAgeOut(enfants_out=enfants_34, - le_plus_age_out=le_plus_age_36) - + "le_plus_âgé"], local_var_37) + return EnfantLePlusAgeOut(enfants_out = enfants_34, + le_plus_age_out = le_plus_age_36) -def prestations_familiales(prestations_familiales_in_44: PrestationsFamilialesIn): +def prestations_familiales(prestations_familiales_in_44:PrestationsFamilialesIn): droit_ouvert_45 = prestations_familiales_in_44.droit_ouvert_in conditions_hors_age_46 = prestations_familiales_in_44.conditions_hors_age_in plafond_l512_3_2_47 = prestations_familiales_in_44.plafond_l512_3_2_in @@ -1007,229 +1013,261 @@ def prestations_familiales(prestations_familiales_in_44: PrestationsFamilialesIn try: local_var_55 = age_l512_3_2_48(Unit()) except EmptyError: - local_var_55 = integer_of_string("20") + try: + local_var_55 = integer_of_string("20") + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=68, start_column=12, end_line=68, end_column=24, - law_headings=["Prologue"])) + start_line=68, start_column=12, end_line=68, end_column=24, + law_headings=["Prologue"])) age_l512_3_2_54 = log_variable_definition(["PrestationsFamiliales", - "âge_l512_3_2"], local_var_55) + "âge_l512_3_2"], local_var_55) try: - local_var_57 = date_courante_50(Unit()) + try: + local_var_57 = date_courante_50(Unit()) + except EmptyError: + if log_decision_taken(SourcePosition(filename="", start_line=0, + start_column=1, end_line=0, end_column=1, + law_headings=[]), False): + raise EmptyError + else: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=70, start_column=12, end_line=70, end_column=25, - law_headings=["Prologue"])) + start_line=70, start_column=12, end_line=70, end_column=25, + law_headings=["Prologue"])) date_courante_56 = log_variable_definition(["PrestationsFamiliales", - "date_courante"], local_var_57) + "date_courante"], local_var_57) try: - local_var_59 = prestation_courante_51(Unit()) + try: + local_var_59 = prestation_courante_51(Unit()) + except EmptyError: + if log_decision_taken(SourcePosition(filename="", start_line=0, + start_column=1, end_line=0, end_column=1, + law_headings=[]), False): + raise EmptyError + else: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=71, start_column=12, end_line=71, end_column=31, - law_headings=["Prologue"])) + start_line=71, start_column=12, end_line=71, end_column=31, + law_headings=["Prologue"])) prestation_courante_58 = log_variable_definition(["PrestationsFamiliales", - "prestation_courante"], local_var_59) + "prestation_courante"], local_var_59) try: - local_var_61 = residence_52(Unit()) + try: + local_var_61 = residence_52(Unit()) + except EmptyError: + if log_decision_taken(SourcePosition(filename="", start_line=0, + start_column=1, end_line=0, end_column=1, + law_headings=[]), False): + raise EmptyError + else: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=72, start_column=12, end_line=72, end_column=21, - law_headings=["Prologue"])) + start_line=72, start_column=12, end_line=72, end_column=21, + law_headings=["Prologue"])) residence_60 = log_variable_definition(["PrestationsFamiliales", - "résidence"], local_var_61) + "résidence"], local_var_61) try: try: local_var_63 = base_mensuelle_53(Unit()) except EmptyError: - def local_var_68(_: Any): + def local_var_68(_:Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=24, start_column=5, - end_line=25, end_column=34, - law_headings=["Instruction ministérielle N°DSS/SD2B/2019/65 du 25 mars 2019 relative à la revalorisation au 1er avril 2019 des prestations familiales servies en métropole", - "Montant de la base mensuelle des allocations familiales", - "Décrets divers"]), ((date_courante_56 >= - date_of_numbers(2019, 4, 1)) and (date_courante_56 < - date_of_numbers(2020, 4, 1)))): + start_line=24, start_column=5, + end_line=25, end_column=34, + law_headings=["Instruction ministérielle N°DSS/SD2B/2019/65 du 25 mars 2019 relative à la revalorisation au 1er avril 2019 des prestations familiales servies en métropole", + "Montant de la base mensuelle des allocations familiales", + "Décrets divers"]), ((date_courante_56 >= + date_of_numbers(2019,4,1)) and (date_courante_56 < + date_of_numbers(2020,4,1)))): return money_of_cents_string("41316") else: raise EmptyError - - def local_var_66(_: Any): + def local_var_66(_:Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=44, start_column=5, - end_line=45, end_column=34, - law_headings=["Instruction interministérielle no DSS/SD2B/2020/33 du 18 février 2020 relative à la revalorisation au 1er avril 2020 des prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à La Réunion, à Saint-Barthélemy, à Saint-Martin et dans le département de Mayotte", - "Montant de la base mensuelle des allocations familiales", - "Décrets divers"]), ((date_courante_56 >= - date_of_numbers(2020, 4, 1)) and (date_courante_56 < - date_of_numbers(2021, 4, 1)))): + start_line=44, start_column=5, + end_line=45, end_column=34, + law_headings=["Instruction interministérielle no DSS/SD2B/2020/33 du 18 février 2020 relative à la revalorisation au 1er avril 2020 des prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à La Réunion, à Saint-Barthélemy, à Saint-Martin et dans le département de Mayotte", + "Montant de la base mensuelle des allocations familiales", + "Décrets divers"]), ((date_courante_56 >= + date_of_numbers(2020,4,1)) and (date_courante_56 < + date_of_numbers(2021,4,1)))): return money_of_cents_string("41404") else: raise EmptyError - - def local_var_64(_: Any): + def local_var_64(_:Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=60, start_column=5, - end_line=61, end_column=34, - law_headings=["Instruction interministérielle n°DSS/2B/2021/65 du 19 mars 2021 relative à la revalorisation au 1er avril 2021 des prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et dans le département de Mayotte", - "Montant de la base mensuelle des allocations familiales", - "Décrets divers"]), ((date_courante_56 >= - date_of_numbers(2021, 4, 1)) and (date_courante_56 < - date_of_numbers(2022, 4, 1)))): + start_line=60, start_column=5, + end_line=61, end_column=34, + law_headings=["Instruction interministérielle n°DSS/2B/2021/65 du 19 mars 2021 relative à la revalorisation au 1er avril 2021 des prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et dans le département de Mayotte", + "Montant de la base mensuelle des allocations familiales", + "Décrets divers"]), ((date_courante_56 >= + date_of_numbers(2021,4,1)) and (date_courante_56 < + date_of_numbers(2022,4,1)))): return money_of_cents_string("41481") else: raise EmptyError - - def local_var_70(_: Any): + def local_var_70(_:Any): return log_decision_taken(SourcePosition(filename="", - start_line=0, start_column=1, end_line=0, end_column=1, - law_headings=[]), False) - - def local_var_72(_: Any): + start_line=0, start_column=1, end_line=0, end_column=1, + law_headings=[]), False) + def local_var_72(_:Any): raise EmptyError local_var_63 = handle_default([local_var_64, local_var_66, - local_var_68], local_var_70, local_var_72) + local_var_68], local_var_70, local_var_72) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=74, start_column=12, end_line=74, end_column=26, - law_headings=["Prologue"])) + start_line=74, start_column=12, end_line=74, end_column=26, + law_headings=["Prologue"])) base_mensuelle_62 = log_variable_definition(["PrestationsFamiliales", - "base_mensuelle"], local_var_63) - - def local_var_75(_: Unit): + "base_mensuelle"], local_var_63) + def local_var_75(_:Unit): + try: + local_var_77 = date_courante_56 + except EmptyError: + raise EmptyError return log_variable_definition(["PrestationsFamiliales", - "smic.date_courante"], date_courante_56) + "smic.date_courante"], local_var_77) smic_dot_date_courante_74 = local_var_75 - - def local_var_78(_: Unit): + def local_var_79(_:Unit): + try: + local_var_81 = residence_60 + except EmptyError: + raise EmptyError return log_variable_definition(["PrestationsFamiliales", - "smic.résidence"], residence_60) - smic_dot_residence_77 = local_var_78 - - def local_var_81(_: Unit): + "smic.résidence"], local_var_81) + smic_dot_residence_78 = local_var_79 + def local_var_83(_:Unit): raise EmptyError - result_80 = log_end_call(["PrestationsFamiliales", "smic", "Smic"], - log_begin_call(["PrestationsFamiliales", "smic", "Smic"], smic, - SmicIn(date_courante_in=smic_dot_date_courante_74, - residence_in=smic_dot_residence_77, - brut_horaire_in=local_var_81))) - smic_dot_date_courante_83 = result_80.date_courante_out - smic_dot_residence_84 = result_80.residence_out - smic_dot_brut_horaire_85 = result_80.brut_horaire_out + result_82 = log_end_call(["PrestationsFamiliales", "smic", "Smic"], + log_begin_call(["PrestationsFamiliales", "smic", "Smic"], smic, + SmicIn(date_courante_in = smic_dot_date_courante_74, + residence_in = smic_dot_residence_78, + brut_horaire_in = local_var_83))) + smic_dot_date_courante_85 = result_82.date_courante_out + smic_dot_residence_86 = result_82.residence_out + smic_dot_brut_horaire_87 = result_82.brut_horaire_out try: try: - local_var_87 = regime_outre_mer_l751_1_49(Unit()) + local_var_89 = regime_outre_mer_l751_1_49(Unit()) except EmptyError: try: if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=354, start_column=5, - end_line=359, end_column=30, - law_headings=["Article L751-1", - "Chapitre 1er : Généralités", - "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin", - "Livre 7 : Régimes divers - Dispositions diverses", - "Partie législative", - "Code de la sécurité sociale"]), ((residence_60 == - Collectivite(Collectivite_Code.Guadeloupe, Unit())) or - ((residence_60 == Collectivite(Collectivite_Code.Guyane, - Unit())) or ((residence_60 == - Collectivite(Collectivite_Code.Martinique, Unit())) or - ((residence_60 == - Collectivite(Collectivite_Code.LaReunion, Unit())) or - ((residence_60 == - Collectivite(Collectivite_Code.SaintBarthelemy, - Unit())) or (residence_60 == - Collectivite(Collectivite_Code.SaintMartin, - Unit())))))))): - local_var_87 = True + start_line=354, start_column=5, + end_line=359, end_column=30, + law_headings=["Article L751-1", + "Chapitre 1er : Généralités", + "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin", + "Livre 7 : Régimes divers - Dispositions diverses", + "Partie législative", + "Code de la sécurité sociale"]), ((residence_60 == + Collectivite(Collectivite_Code.Guadeloupe, Unit())) or + ((residence_60 == Collectivite(Collectivite_Code.Guyane, + Unit())) or ((residence_60 == + Collectivite(Collectivite_Code.Martinique, Unit())) or + ((residence_60 == + Collectivite(Collectivite_Code.LaReunion, Unit())) or + ((residence_60 == + Collectivite(Collectivite_Code.SaintBarthelemy, + Unit())) or (residence_60 == + Collectivite(Collectivite_Code.SaintMartin, + Unit())))))))): + local_var_89 = True else: raise EmptyError except EmptyError: - local_var_87 = False + local_var_89 = False except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=69, start_column=12, end_line=69, end_column=35, - law_headings=["Prologue"])) - regime_outre_mer_l751_1_86 = log_variable_definition(["PrestationsFamiliales", - "régime_outre_mer_l751_1"], local_var_87) + start_line=69, start_column=12, end_line=69, end_column=35, + law_headings=["Prologue"])) + regime_outre_mer_l751_1_88 = log_variable_definition(["PrestationsFamiliales", + "régime_outre_mer_l751_1"], local_var_89) try: try: - local_var_89 = plafond_l512_3_2_47(Unit()) + local_var_91 = plafond_l512_3_2_47(Unit()) except EmptyError: try: - if log_decision_taken(SourcePosition(filename="./securite_sociale_R.catala_fr", - start_line=216, start_column=18, - end_line=216, end_column=41, - law_headings=["Article R755-0-2", - "Chapitre 5 : Prestations familiales et prestations assimilées", - "Titre 5 : Départements d'outre-mer", - "Livre 7 : Régimes divers - Dispositions diverses", - "Partie réglementaire - Décrets en Conseil d'Etat", - "Code de la sécurité sociale"]), regime_outre_mer_l751_1_86): - local_var_89 = ((smic_dot_brut_horaire_85 * - decimal_of_string("0.55")) * - decimal_of_string("169.")) - else: - raise EmptyError + try: + if log_decision_taken(SourcePosition(filename="./securite_sociale_R.catala_fr", + start_line=216, start_column=18, + end_line=216, end_column=41, + law_headings=["Article R755-0-2", + "Chapitre 5 : Prestations familiales et prestations assimilées", + "Titre 5 : Départements d'outre-mer", + "Livre 7 : Régimes divers - Dispositions diverses", + "Partie réglementaire - Décrets en Conseil d'Etat", + "Code de la sécurité sociale"]), regime_outre_mer_l751_1_88): + local_var_91 = ((smic_dot_brut_horaire_87 * + decimal_of_string("0.55")) * + decimal_of_string("169.")) + else: + raise EmptyError + except EmptyError: + local_var_91 = ((smic_dot_brut_horaire_87 * + decimal_of_string("0.55")) * + decimal_of_string("169.")) except EmptyError: - local_var_89 = ((smic_dot_brut_horaire_85 * - decimal_of_string("0.55")) * decimal_of_string("169.")) + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=67, start_column=12, end_line=67, end_column=28, - law_headings=["Prologue"])) - plafond_l512_3_2_88 = log_variable_definition(["PrestationsFamiliales", - "plafond_l512_3_2"], local_var_89) + start_line=67, start_column=12, end_line=67, end_column=28, + law_headings=["Prologue"])) + plafond_l512_3_2_90 = log_variable_definition(["PrestationsFamiliales", + "plafond_l512_3_2"], local_var_91) try: try: - local_var_91 = conditions_hors_age_46(Unit()) + local_var_93 = conditions_hors_age_46(Unit()) except EmptyError: - def local_var_91(param_92: Enfant): + def local_var_93(param_94:Enfant): try: try: - match_arg_775 = param_92.obligation_scolaire - if match_arg_775.code == SituationObligationScolaire_Code.Avant: - _ = match_arg_775.value - local_var_97 = False - elif match_arg_775.code == SituationObligationScolaire_Code.Pendant: - _ = match_arg_775.value - local_var_97 = True - elif match_arg_775.code == SituationObligationScolaire_Code.Apres: - _ = match_arg_775.value - local_var_97 = False - match_arg_776 = param_92.obligation_scolaire - if match_arg_776.code == SituationObligationScolaire_Code.Avant: - _ = match_arg_776.value - local_var_101 = False - elif match_arg_776.code == SituationObligationScolaire_Code.Pendant: - _ = match_arg_776.value - local_var_101 = False - elif match_arg_776.code == SituationObligationScolaire_Code.Apres: - _ = match_arg_776.value - local_var_101 = True - match_arg_777 = param_92.obligation_scolaire - if match_arg_777.code == SituationObligationScolaire_Code.Avant: - _ = match_arg_777.value - local_var_93 = True - elif match_arg_777.code == SituationObligationScolaire_Code.Pendant: - _ = match_arg_777.value - local_var_93 = False - elif match_arg_777.code == SituationObligationScolaire_Code.Apres: - _ = match_arg_777.value - local_var_93 = False + match_arg_785 = param_94.obligation_scolaire + if match_arg_785.code == SituationObligationScolaire_Code.Avant: + _ = match_arg_785.value + local_var_99 = False + elif match_arg_785.code == SituationObligationScolaire_Code.Pendant: + _ = match_arg_785.value + local_var_99 = True + elif match_arg_785.code == SituationObligationScolaire_Code.Apres: + _ = match_arg_785.value + local_var_99 = False + match_arg_786 = param_94.obligation_scolaire + if match_arg_786.code == SituationObligationScolaire_Code.Avant: + _ = match_arg_786.value + local_var_103 = False + elif match_arg_786.code == SituationObligationScolaire_Code.Pendant: + _ = match_arg_786.value + local_var_103 = False + elif match_arg_786.code == SituationObligationScolaire_Code.Apres: + _ = match_arg_786.value + local_var_103 = True + match_arg_787 = param_94.obligation_scolaire + if match_arg_787.code == SituationObligationScolaire_Code.Avant: + _ = match_arg_787.value + local_var_95 = True + elif match_arg_787.code == SituationObligationScolaire_Code.Pendant: + _ = match_arg_787.value + local_var_95 = False + elif match_arg_787.code == SituationObligationScolaire_Code.Apres: + _ = match_arg_787.value + local_var_95 = False if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=68, start_column=5, - end_line=71, end_column=57, - law_headings=["Article L512-3", - "Chapitre 2 : Champ d'application", - "Titre 1 : Champ d'application - Généralités", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), (local_var_93 or - (local_var_97 or (local_var_101 and - (param_92.remuneration_mensuelle <= - plafond_l512_3_2_88))))): + start_line=68, start_column=5, + end_line=71, end_column=57, + law_headings=["Article L512-3", + "Chapitre 2 : Champ d'application", + "Titre 1 : Champ d'application - Généralités", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), (local_var_95 or + (local_var_99 or (local_var_103 and + (param_94.remuneration_mensuelle <= + plafond_l512_3_2_90))))): return True else: raise EmptyError @@ -1237,1015 +1275,1062 @@ def local_var_91(param_92: Enfant): return False except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=66, start_column=12, end_line=66, - end_column=31, law_headings=["Prologue"])) + start_line=66, start_column=12, end_line=66, + end_column=31, law_headings=["Prologue"])) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=66, start_column=12, end_line=66, end_column=31, - law_headings=["Prologue"])) - conditions_hors_age_90 = log_variable_definition(["PrestationsFamiliales", - "conditions_hors_âge"], local_var_91) + start_line=66, start_column=12, end_line=66, end_column=31, + law_headings=["Prologue"])) + conditions_hors_age_92 = log_variable_definition(["PrestationsFamiliales", + "conditions_hors_âge"], local_var_93) try: try: - local_var_106 = droit_ouvert_45(Unit()) + local_var_108 = droit_ouvert_45(Unit()) except EmptyError: - def local_var_106(param_107: Enfant): + def local_var_108(param_109:Enfant): try: - def local_var_114(_: Any): - match_arg_778 = param_107.obligation_scolaire - if match_arg_778.code == SituationObligationScolaire_Code.Avant: - _ = match_arg_778.value - local_var_120 = False - elif match_arg_778.code == SituationObligationScolaire_Code.Pendant: - _ = match_arg_778.value - local_var_120 = True - elif match_arg_778.code == SituationObligationScolaire_Code.Apres: - _ = match_arg_778.value - local_var_120 = False - match_arg_779 = param_107.obligation_scolaire - if match_arg_779.code == SituationObligationScolaire_Code.Avant: - _ = match_arg_779.value - local_var_116 = True - elif match_arg_779.code == SituationObligationScolaire_Code.Pendant: - _ = match_arg_779.value - local_var_116 = False - elif match_arg_779.code == SituationObligationScolaire_Code.Apres: - _ = match_arg_779.value - local_var_116 = False + def local_var_116(_:Any): + match_arg_788 = param_109.obligation_scolaire + if match_arg_788.code == SituationObligationScolaire_Code.Avant: + _ = match_arg_788.value + local_var_122 = False + elif match_arg_788.code == SituationObligationScolaire_Code.Pendant: + _ = match_arg_788.value + local_var_122 = True + elif match_arg_788.code == SituationObligationScolaire_Code.Apres: + _ = match_arg_788.value + local_var_122 = False + match_arg_789 = param_109.obligation_scolaire + if match_arg_789.code == SituationObligationScolaire_Code.Avant: + _ = match_arg_789.value + local_var_118 = True + elif match_arg_789.code == SituationObligationScolaire_Code.Pendant: + _ = match_arg_789.value + local_var_118 = False + elif match_arg_789.code == SituationObligationScolaire_Code.Apres: + _ = match_arg_789.value + local_var_118 = False if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=49, start_column=5, - end_line=50, end_column=50, - law_headings=["Article L512-3", - "Chapitre 2 : Champ d'application", - "Titre 1 : Champ d'application - Généralités", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), (local_var_116 or - local_var_120)): + start_line=49, start_column=5, + end_line=50, end_column=50, + law_headings=["Article L512-3", + "Chapitre 2 : Champ d'application", + "Titre 1 : Champ d'application - Généralités", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), (local_var_118 or + local_var_122)): return True else: raise EmptyError - - def local_var_108(_: Any): - match_arg_780 = param_107.obligation_scolaire - if match_arg_780.code == SituationObligationScolaire_Code.Avant: - _ = match_arg_780.value - local_var_110 = False - elif match_arg_780.code == SituationObligationScolaire_Code.Pendant: - _ = match_arg_780.value - local_var_110 = False - elif match_arg_780.code == SituationObligationScolaire_Code.Apres: - _ = match_arg_780.value - local_var_110 = True + def local_var_110(_:Any): + match_arg_790 = param_109.obligation_scolaire + if match_arg_790.code == SituationObligationScolaire_Code.Avant: + _ = match_arg_790.value + local_var_112 = False + elif match_arg_790.code == SituationObligationScolaire_Code.Pendant: + _ = match_arg_790.value + local_var_112 = False + elif match_arg_790.code == SituationObligationScolaire_Code.Apres: + _ = match_arg_790.value + local_var_112 = True if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=60, start_column=5, - end_line=62, end_column=32, - law_headings=["Article L512-3", - "Chapitre 2 : Champ d'application", - "Titre 1 : Champ d'application - Généralités", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), (local_var_110 and - ((param_107.remuneration_mensuelle <= - plafond_l512_3_2_88) and (param_107.age < - age_l512_3_2_54)))): + start_line=60, start_column=5, + end_line=62, end_column=32, + law_headings=["Article L512-3", + "Chapitre 2 : Champ d'application", + "Titre 1 : Champ d'application - Généralités", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), (local_var_112 and + ((param_109.remuneration_mensuelle <= + plafond_l512_3_2_90) and (param_109.age < + age_l512_3_2_54)))): return True else: raise EmptyError - - def local_var_124(_: Any): + def local_var_126(_:Any): return log_decision_taken(SourcePosition(filename="", - start_line=0, start_column=1, - end_line=0, end_column=1, law_headings=[]), True) - - def local_var_126(_: Any): + start_line=0, start_column=1, + end_line=0, end_column=1, law_headings=[]), True) + def local_var_128(_:Any): return False - return handle_default([local_var_108, local_var_114], - local_var_124, local_var_126) + return handle_default([local_var_110, local_var_116], + local_var_126, local_var_128) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=65, start_column=12, end_line=65, - end_column=24, law_headings=["Prologue"])) + start_line=65, start_column=12, end_line=65, + end_column=24, law_headings=["Prologue"])) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=65, start_column=12, end_line=65, end_column=24, - law_headings=["Prologue"])) - droit_ouvert_105 = log_variable_definition(["PrestationsFamiliales", - "droit_ouvert"], local_var_106) - return PrestationsFamilialesOut(droit_ouvert_out=droit_ouvert_105, - conditions_hors_age_out=conditions_hors_age_90, - plafond_l512_3_2_out=plafond_l512_3_2_88, - age_l512_3_2_out=age_l512_3_2_54, - regime_outre_mer_l751_1_out=regime_outre_mer_l751_1_86, - date_courante_out=date_courante_56, - prestation_courante_out=prestation_courante_58, - residence_out=residence_60, base_mensuelle_out=base_mensuelle_62) - - -def allocations_familiales(allocations_familiales_in_128: AllocationsFamilialesIn): - personne_charge_effective_permanente_est_parent_129 = allocations_familiales_in_128.personne_charge_effective_permanente_est_parent_in - personne_charge_effective_permanente_remplit_titre__i_130 = allocations_familiales_in_128.personne_charge_effective_permanente_remplit_titre_I_in - ressources_menage_131 = allocations_familiales_in_128.ressources_menage_in - residence_132 = allocations_familiales_in_128.residence_in - date_courante_133 = allocations_familiales_in_128.date_courante_in - enfants_a_charge_134 = allocations_familiales_in_128.enfants_a_charge_in - enfants_a_charge_droit_ouvert_prestation_familiale_135 = allocations_familiales_in_128.enfants_a_charge_droit_ouvert_prestation_familiale_in - prise_en_compte_136 = allocations_familiales_in_128.prise_en_compte_in - versement_137 = allocations_familiales_in_128.versement_in - montant_verse_138 = allocations_familiales_in_128.montant_verse_in - droit_ouvert_base_139 = allocations_familiales_in_128.droit_ouvert_base_in - montant_initial_base_140 = allocations_familiales_in_128.montant_initial_base_in - montant_initial_base_premier_enfant_141 = allocations_familiales_in_128.montant_initial_base_premier_enfant_in - montant_initial_base_deuxieme_enfant_142 = allocations_familiales_in_128.montant_initial_base_deuxieme_enfant_in - montant_initial_base_troisieme_enfant_et_plus_143 = allocations_familiales_in_128.montant_initial_base_troisieme_enfant_et_plus_in - rapport_enfants_total_moyen_144 = allocations_familiales_in_128.rapport_enfants_total_moyen_in - nombre_moyen_enfants_145 = allocations_familiales_in_128.nombre_moyen_enfants_in - nombre_total_enfants_146 = allocations_familiales_in_128.nombre_total_enfants_in - montant_avec_garde_alternee_base_147 = allocations_familiales_in_128.montant_avec_garde_alternee_base_in - montant_verse_base_148 = allocations_familiales_in_128.montant_verse_base_in - avait_enfant_a_charge_avant_1er_janvier_2012_149 = allocations_familiales_in_128.avait_enfant_a_charge_avant_1er_janvier_2012_in - montant_initial_base_premier_enfant_mayotte_150 = allocations_familiales_in_128.montant_initial_base_premier_enfant_mayotte_in - montant_initial_base_deuxieme_enfant_mayotte_151 = allocations_familiales_in_128.montant_initial_base_deuxieme_enfant_mayotte_in - montant_initial_base_troisieme_enfant_mayotte_152 = allocations_familiales_in_128.montant_initial_base_troisieme_enfant_mayotte_in - montant_initial_base_quatrieme_enfant_et_plus_mayotte_153 = allocations_familiales_in_128.montant_initial_base_quatrieme_enfant_et_plus_mayotte_in - droit_ouvert_forfaitaire_154 = allocations_familiales_in_128.droit_ouvert_forfaitaire_in - montant_verse_forfaitaire_par_enfant_155 = allocations_familiales_in_128.montant_verse_forfaitaire_par_enfant_in - montant_verse_forfaitaire_156 = allocations_familiales_in_128.montant_verse_forfaitaire_in - droit_ouvert_majoration_157 = allocations_familiales_in_128.droit_ouvert_majoration_in - montant_initial_metropole_majoration_158 = allocations_familiales_in_128.montant_initial_metropole_majoration_in - montant_initial_majoration_159 = allocations_familiales_in_128.montant_initial_majoration_in - montant_avec_garde_alternee_majoration_160 = allocations_familiales_in_128.montant_avec_garde_alternee_majoration_in - montant_verse_majoration_161 = allocations_familiales_in_128.montant_verse_majoration_in - droit_ouvert_complement_162 = allocations_familiales_in_128.droit_ouvert_complement_in - montant_base_complement_pour_base_et_majoration_163 = allocations_familiales_in_128.montant_base_complement_pour_base_et_majoration_in - complement_degressif_164 = allocations_familiales_in_128.complement_degressif_in - montant_verse_complement_pour_base_et_majoration_165 = allocations_familiales_in_128.montant_verse_complement_pour_base_et_majoration_in - montant_verse_complement_pour_forfaitaire_166 = allocations_familiales_in_128.montant_verse_complement_pour_forfaitaire_in - nombre_enfants_l521_1_167 = allocations_familiales_in_128.nombre_enfants_l521_1_in - age_minimum_alinea_1_l521_3_168 = allocations_familiales_in_128.age_minimum_alinea_1_l521_3_in - nombre_enfants_alinea_2_l521_3_169 = allocations_familiales_in_128.nombre_enfants_alinea_2_l521_3_in - est_enfant_le_plus_age_170 = allocations_familiales_in_128.est_enfant_le_plus_age_in - plafond__i_d521_3_171 = allocations_familiales_in_128.plafond_I_d521_3_in - plafond__i_i_d521_3_172 = allocations_familiales_in_128.plafond_II_d521_3_in + start_line=65, start_column=12, end_line=65, end_column=24, + law_headings=["Prologue"])) + droit_ouvert_107 = log_variable_definition(["PrestationsFamiliales", + "droit_ouvert"], local_var_108) + return PrestationsFamilialesOut(droit_ouvert_out = droit_ouvert_107, + conditions_hors_age_out = conditions_hors_age_92, + plafond_l512_3_2_out = plafond_l512_3_2_90, + age_l512_3_2_out = age_l512_3_2_54, + regime_outre_mer_l751_1_out = regime_outre_mer_l751_1_88, + date_courante_out = date_courante_56, + prestation_courante_out = prestation_courante_58, + residence_out = residence_60, base_mensuelle_out = base_mensuelle_62) + +def allocations_familiales(allocations_familiales_in_130:AllocationsFamilialesIn): + personne_charge_effective_permanente_est_parent_131 = allocations_familiales_in_130.personne_charge_effective_permanente_est_parent_in + personne_charge_effective_permanente_remplit_titre__i_132 = allocations_familiales_in_130.personne_charge_effective_permanente_remplit_titre_I_in + ressources_menage_133 = allocations_familiales_in_130.ressources_menage_in + residence_134 = allocations_familiales_in_130.residence_in + date_courante_135 = allocations_familiales_in_130.date_courante_in + enfants_a_charge_136 = allocations_familiales_in_130.enfants_a_charge_in + enfants_a_charge_droit_ouvert_prestation_familiale_137 = allocations_familiales_in_130.enfants_a_charge_droit_ouvert_prestation_familiale_in + prise_en_compte_138 = allocations_familiales_in_130.prise_en_compte_in + versement_139 = allocations_familiales_in_130.versement_in + montant_verse_140 = allocations_familiales_in_130.montant_verse_in + droit_ouvert_base_141 = allocations_familiales_in_130.droit_ouvert_base_in + montant_initial_base_142 = allocations_familiales_in_130.montant_initial_base_in + montant_initial_base_premier_enfant_143 = allocations_familiales_in_130.montant_initial_base_premier_enfant_in + montant_initial_base_deuxieme_enfant_144 = allocations_familiales_in_130.montant_initial_base_deuxieme_enfant_in + montant_initial_base_troisieme_enfant_et_plus_145 = allocations_familiales_in_130.montant_initial_base_troisieme_enfant_et_plus_in + rapport_enfants_total_moyen_146 = allocations_familiales_in_130.rapport_enfants_total_moyen_in + nombre_moyen_enfants_147 = allocations_familiales_in_130.nombre_moyen_enfants_in + nombre_total_enfants_148 = allocations_familiales_in_130.nombre_total_enfants_in + montant_avec_garde_alternee_base_149 = allocations_familiales_in_130.montant_avec_garde_alternee_base_in + montant_verse_base_150 = allocations_familiales_in_130.montant_verse_base_in + avait_enfant_a_charge_avant_1er_janvier_2012_151 = allocations_familiales_in_130.avait_enfant_a_charge_avant_1er_janvier_2012_in + montant_initial_base_premier_enfant_mayotte_152 = allocations_familiales_in_130.montant_initial_base_premier_enfant_mayotte_in + montant_initial_base_deuxieme_enfant_mayotte_153 = allocations_familiales_in_130.montant_initial_base_deuxieme_enfant_mayotte_in + montant_initial_base_troisieme_enfant_mayotte_154 = allocations_familiales_in_130.montant_initial_base_troisieme_enfant_mayotte_in + montant_initial_base_quatrieme_enfant_et_plus_mayotte_155 = allocations_familiales_in_130.montant_initial_base_quatrieme_enfant_et_plus_mayotte_in + droit_ouvert_forfaitaire_156 = allocations_familiales_in_130.droit_ouvert_forfaitaire_in + montant_verse_forfaitaire_par_enfant_157 = allocations_familiales_in_130.montant_verse_forfaitaire_par_enfant_in + montant_verse_forfaitaire_158 = allocations_familiales_in_130.montant_verse_forfaitaire_in + droit_ouvert_majoration_159 = allocations_familiales_in_130.droit_ouvert_majoration_in + montant_initial_metropole_majoration_160 = allocations_familiales_in_130.montant_initial_metropole_majoration_in + montant_initial_majoration_161 = allocations_familiales_in_130.montant_initial_majoration_in + montant_avec_garde_alternee_majoration_162 = allocations_familiales_in_130.montant_avec_garde_alternee_majoration_in + montant_verse_majoration_163 = allocations_familiales_in_130.montant_verse_majoration_in + droit_ouvert_complement_164 = allocations_familiales_in_130.droit_ouvert_complement_in + montant_base_complement_pour_base_et_majoration_165 = allocations_familiales_in_130.montant_base_complement_pour_base_et_majoration_in + complement_degressif_166 = allocations_familiales_in_130.complement_degressif_in + montant_verse_complement_pour_base_et_majoration_167 = allocations_familiales_in_130.montant_verse_complement_pour_base_et_majoration_in + montant_verse_complement_pour_forfaitaire_168 = allocations_familiales_in_130.montant_verse_complement_pour_forfaitaire_in + nombre_enfants_l521_1_169 = allocations_familiales_in_130.nombre_enfants_l521_1_in + age_minimum_alinea_1_l521_3_170 = allocations_familiales_in_130.age_minimum_alinea_1_l521_3_in + nombre_enfants_alinea_2_l521_3_171 = allocations_familiales_in_130.nombre_enfants_alinea_2_l521_3_in + est_enfant_le_plus_age_172 = allocations_familiales_in_130.est_enfant_le_plus_age_in + plafond__i_d521_3_173 = allocations_familiales_in_130.plafond_I_d521_3_in + plafond__i_i_d521_3_174 = allocations_familiales_in_130.plafond_II_d521_3_in try: try: - local_var_174 = personne_charge_effective_permanente_est_parent_129( - Unit()) + local_var_176 = personne_charge_effective_permanente_est_parent_131(Unit()) except EmptyError: - local_var_174 = False + if log_decision_taken(SourcePosition(filename="", start_line=0, + start_column=1, end_line=0, end_column=1, + law_headings=[]), True): + local_var_176 = False + else: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=90, start_column=12, end_line=90, end_column=59, - law_headings=["Prologue"])) - personne_charge_effective_permanente_est_parent_173 = log_variable_definition(["AllocationsFamiliales", - "personne_charge_effective_permanente_est_parent"], local_var_174) + start_line=90, start_column=12, end_line=90, end_column=59, + law_headings=["Prologue"])) + personne_charge_effective_permanente_est_parent_175 = log_variable_definition(["AllocationsFamiliales", + "personne_charge_effective_permanente_est_parent"], local_var_176) try: try: - local_var_176 = personne_charge_effective_permanente_remplit_titre__i_130( - Unit()) + local_var_178 = personne_charge_effective_permanente_remplit_titre__i_132(Unit()) except EmptyError: - local_var_176 = False + if log_decision_taken(SourcePosition(filename="", start_line=0, + start_column=1, end_line=0, end_column=1, + law_headings=[]), True): + local_var_178 = False + else: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=91, start_column=12, end_line=91, end_column=64, - law_headings=["Prologue"])) - personne_charge_effective_permanente_remplit_titre__i_175 = log_variable_definition(["AllocationsFamiliales", - "personne_charge_effective_permanente_remplit_titre_I"], - local_var_176) + start_line=91, start_column=12, end_line=91, end_column=64, + law_headings=["Prologue"])) + personne_charge_effective_permanente_remplit_titre__i_177 = log_variable_definition(["AllocationsFamiliales", + "personne_charge_effective_permanente_remplit_titre_I"], + local_var_178) try: - local_var_178 = ressources_menage_131(Unit()) + try: + local_var_180 = ressources_menage_133(Unit()) + except EmptyError: + if log_decision_taken(SourcePosition(filename="", start_line=0, + start_column=1, end_line=0, end_column=1, + law_headings=[]), False): + raise EmptyError + else: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=92, start_column=12, end_line=92, end_column=29, - law_headings=["Prologue"])) - ressources_menage_177 = log_variable_definition(["AllocationsFamiliales", - "ressources_ménage"], local_var_178) + start_line=92, start_column=12, end_line=92, end_column=29, + law_headings=["Prologue"])) + ressources_menage_179 = log_variable_definition(["AllocationsFamiliales", + "ressources_ménage"], local_var_180) try: - local_var_180 = residence_132(Unit()) + try: + local_var_182 = residence_134(Unit()) + except EmptyError: + if log_decision_taken(SourcePosition(filename="", start_line=0, + start_column=1, end_line=0, end_column=1, + law_headings=[]), False): + raise EmptyError + else: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=93, start_column=12, end_line=93, end_column=21, - law_headings=["Prologue"])) - residence_179 = log_variable_definition(["AllocationsFamiliales", - "résidence"], local_var_180) + start_line=93, start_column=12, end_line=93, end_column=21, + law_headings=["Prologue"])) + residence_181 = log_variable_definition(["AllocationsFamiliales", + "résidence"], local_var_182) try: - local_var_182 = date_courante_133(Unit()) + try: + local_var_184 = date_courante_135(Unit()) + except EmptyError: + if log_decision_taken(SourcePosition(filename="", start_line=0, + start_column=1, end_line=0, end_column=1, + law_headings=[]), False): + raise EmptyError + else: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=96, start_column=12, end_line=96, end_column=25, - law_headings=["Prologue"])) - date_courante_181 = log_variable_definition(["AllocationsFamiliales", - "date_courante"], local_var_182) + start_line=96, start_column=12, end_line=96, end_column=25, + law_headings=["Prologue"])) + date_courante_183 = log_variable_definition(["AllocationsFamiliales", + "date_courante"], local_var_184) try: - local_var_184 = enfants_a_charge_134(Unit()) + try: + local_var_186 = enfants_a_charge_136(Unit()) + except EmptyError: + if log_decision_taken(SourcePosition(filename="", start_line=0, + start_column=1, end_line=0, end_column=1, + law_headings=[]), False): + raise EmptyError + else: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=99, start_column=12, end_line=99, end_column=28, - law_headings=["Prologue"])) - enfants_a_charge_183 = log_variable_definition(["AllocationsFamiliales", - "enfants_à_charge"], local_var_184) + start_line=99, start_column=12, end_line=99, end_column=28, + law_headings=["Prologue"])) + enfants_a_charge_185 = log_variable_definition(["AllocationsFamiliales", + "enfants_à_charge"], local_var_186) try: try: - local_var_186 = prise_en_compte_136(Unit()) + local_var_188 = prise_en_compte_138(Unit()) except EmptyError: - def local_var_186(param_187: Enfant): + def local_var_188(param_189:Enfant): try: - def local_var_220(_: Any): - match_arg_781 = param_187.prise_en_charge - if match_arg_781.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: - _ = match_arg_781.value - local_var_222 = False - elif match_arg_781.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: - _ = match_arg_781.value - local_var_222 = False - elif match_arg_781.code == PriseEnCharge_Code.EffectiveEtPermanente: - _ = match_arg_781.value - local_var_222 = True - elif match_arg_781.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: - _ = match_arg_781.value - local_var_222 = False - elif match_arg_781.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: - _ = match_arg_781.value - local_var_222 = False + def local_var_222(_:Any): + match_arg_791 = param_189.prise_en_charge + if match_arg_791.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: + _ = match_arg_791.value + local_var_224 = False + elif match_arg_791.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: + _ = match_arg_791.value + local_var_224 = False + elif match_arg_791.code == PriseEnCharge_Code.EffectiveEtPermanente: + _ = match_arg_791.value + local_var_224 = True + elif match_arg_791.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: + _ = match_arg_791.value + local_var_224 = False + elif match_arg_791.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: + _ = match_arg_791.value + local_var_224 = False if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=184, start_column=5, - end_line=184, end_column=60, - law_headings=["Article L521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), local_var_222): + start_line=184, start_column=5, + end_line=184, end_column=60, + law_headings=["Article L521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), local_var_224): return PriseEnCompte(PriseEnCompte_Code.Complete, - Unit()) + Unit()) else: raise EmptyError - - def local_var_212(_: Any): - match_arg_782 = param_187.prise_en_charge - if match_arg_782.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: - _ = match_arg_782.value - local_var_214 = False - elif match_arg_782.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: - _ = match_arg_782.value - local_var_214 = True - elif match_arg_782.code == PriseEnCharge_Code.EffectiveEtPermanente: - _ = match_arg_782.value - local_var_214 = False - elif match_arg_782.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: - _ = match_arg_782.value - local_var_214 = False - elif match_arg_782.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: - _ = match_arg_782.value - local_var_214 = False + def local_var_214(_:Any): + match_arg_792 = param_189.prise_en_charge + if match_arg_792.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: + _ = match_arg_792.value + local_var_216 = False + elif match_arg_792.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: + _ = match_arg_792.value + local_var_216 = True + elif match_arg_792.code == PriseEnCharge_Code.EffectiveEtPermanente: + _ = match_arg_792.value + local_var_216 = False + elif match_arg_792.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: + _ = match_arg_792.value + local_var_216 = False + elif match_arg_792.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: + _ = match_arg_792.value + local_var_216 = False if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=204, start_column=5, - end_line=204, end_column=69, - law_headings=["Article L521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), local_var_214): + start_line=204, start_column=5, + end_line=204, end_column=69, + law_headings=["Article L521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), local_var_216): return PriseEnCompte(PriseEnCompte_Code.Complete, - Unit()) + Unit()) else: raise EmptyError - - def local_var_204(_: Any): - match_arg_783 = param_187.prise_en_charge - if match_arg_783.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: - _ = match_arg_783.value - local_var_206 = True - elif match_arg_783.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: - _ = match_arg_783.value - local_var_206 = False - elif match_arg_783.code == PriseEnCharge_Code.EffectiveEtPermanente: - _ = match_arg_783.value - local_var_206 = False - elif match_arg_783.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: - _ = match_arg_783.value - local_var_206 = False - elif match_arg_783.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: - _ = match_arg_783.value - local_var_206 = False + def local_var_206(_:Any): + match_arg_793 = param_189.prise_en_charge + if match_arg_793.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: + _ = match_arg_793.value + local_var_208 = True + elif match_arg_793.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: + _ = match_arg_793.value + local_var_208 = False + elif match_arg_793.code == PriseEnCharge_Code.EffectiveEtPermanente: + _ = match_arg_793.value + local_var_208 = False + elif match_arg_793.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: + _ = match_arg_793.value + local_var_208 = False + elif match_arg_793.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: + _ = match_arg_793.value + local_var_208 = False if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=214, start_column=5, - end_line=214, end_column=70, - law_headings=["Article L521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), local_var_206): + start_line=214, start_column=5, + end_line=214, end_column=70, + law_headings=["Article L521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), local_var_208): return PriseEnCompte(PriseEnCompte_Code.Partagee, - Unit()) + Unit()) else: raise EmptyError - - def local_var_196(_: Any): - match_arg_784 = param_187.prise_en_charge - if match_arg_784.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: - _ = match_arg_784.value - local_var_198 = False - elif match_arg_784.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: - _ = match_arg_784.value - local_var_198 = False - elif match_arg_784.code == PriseEnCharge_Code.EffectiveEtPermanente: - _ = match_arg_784.value - local_var_198 = False - elif match_arg_784.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: - _ = match_arg_784.value - local_var_198 = False - elif match_arg_784.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: - _ = match_arg_784.value - local_var_198 = True + def local_var_198(_:Any): + match_arg_794 = param_189.prise_en_charge + if match_arg_794.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: + _ = match_arg_794.value + local_var_200 = False + elif match_arg_794.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: + _ = match_arg_794.value + local_var_200 = False + elif match_arg_794.code == PriseEnCharge_Code.EffectiveEtPermanente: + _ = match_arg_794.value + local_var_200 = False + elif match_arg_794.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: + _ = match_arg_794.value + local_var_200 = False + elif match_arg_794.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: + _ = match_arg_794.value + local_var_200 = True if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=253, start_column=5, - end_line=254, end_column=56, - law_headings=["Article L521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), local_var_198): + start_line=253, start_column=5, + end_line=254, end_column=56, + law_headings=["Article L521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), local_var_200): return PriseEnCompte(PriseEnCompte_Code.Zero, - Unit()) + Unit()) else: raise EmptyError - - def local_var_188(_: Any): - match_arg_785 = param_187.prise_en_charge - if match_arg_785.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: - _ = match_arg_785.value - local_var_190 = False - elif match_arg_785.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: - _ = match_arg_785.value - local_var_190 = False - elif match_arg_785.code == PriseEnCharge_Code.EffectiveEtPermanente: - _ = match_arg_785.value - local_var_190 = False - elif match_arg_785.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: - _ = match_arg_785.value - local_var_190 = True - elif match_arg_785.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: - _ = match_arg_785.value - local_var_190 = False + def local_var_190(_:Any): + match_arg_795 = param_189.prise_en_charge + if match_arg_795.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: + _ = match_arg_795.value + local_var_192 = False + elif match_arg_795.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: + _ = match_arg_795.value + local_var_192 = False + elif match_arg_795.code == PriseEnCharge_Code.EffectiveEtPermanente: + _ = match_arg_795.value + local_var_192 = False + elif match_arg_795.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: + _ = match_arg_795.value + local_var_192 = True + elif match_arg_795.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: + _ = match_arg_795.value + local_var_192 = False if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=263, start_column=5, - end_line=264, end_column=48, - law_headings=["Article L521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), local_var_190): + start_line=263, start_column=5, + end_line=264, end_column=48, + law_headings=["Article L521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), local_var_192): return PriseEnCompte(PriseEnCompte_Code.Complete, - Unit()) + Unit()) else: raise EmptyError - - def local_var_228(_: Any): + def local_var_230(_:Any): return log_decision_taken(SourcePosition(filename="", - start_line=0, start_column=1, - end_line=0, end_column=1, - law_headings=[]), False) - - def local_var_230(_: Any): + start_line=0, start_column=1, + end_line=0, end_column=1, + law_headings=[]), False) + def local_var_232(_:Any): raise EmptyError - return handle_default([local_var_188, local_var_196, - local_var_204, local_var_212, local_var_220], - local_var_228, local_var_230) + return handle_default([local_var_190, local_var_198, + local_var_206, local_var_214, local_var_222], + local_var_230, local_var_232) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=102, start_column=12, end_line=102, - end_column=27, law_headings=["Prologue"])) + start_line=102, start_column=12, end_line=102, + end_column=27, law_headings=["Prologue"])) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=102, start_column=12, end_line=102, end_column=27, - law_headings=["Prologue"])) - prise_en_compte_185 = log_variable_definition(["AllocationsFamiliales", - "prise_en_compte"], local_var_186) + start_line=102, start_column=12, end_line=102, end_column=27, + law_headings=["Prologue"])) + prise_en_compte_187 = log_variable_definition(["AllocationsFamiliales", + "prise_en_compte"], local_var_188) try: try: - local_var_233 = versement_137(Unit()) + local_var_235 = versement_139(Unit()) except EmptyError: - def local_var_233(param_234: Enfant): + def local_var_235(param_236:Enfant): try: - def local_var_267(_: Any): - match_arg_786 = param_234.prise_en_charge - if match_arg_786.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: - _ = match_arg_786.value - local_var_269 = False - elif match_arg_786.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: - _ = match_arg_786.value - local_var_269 = False - elif match_arg_786.code == PriseEnCharge_Code.EffectiveEtPermanente: - _ = match_arg_786.value - local_var_269 = True - elif match_arg_786.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: - _ = match_arg_786.value - local_var_269 = False - elif match_arg_786.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: - _ = match_arg_786.value - local_var_269 = False + def local_var_269(_:Any): + match_arg_796 = param_236.prise_en_charge + if match_arg_796.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: + _ = match_arg_796.value + local_var_271 = False + elif match_arg_796.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: + _ = match_arg_796.value + local_var_271 = False + elif match_arg_796.code == PriseEnCharge_Code.EffectiveEtPermanente: + _ = match_arg_796.value + local_var_271 = True + elif match_arg_796.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: + _ = match_arg_796.value + local_var_271 = False + elif match_arg_796.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: + _ = match_arg_796.value + local_var_271 = False if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=188, start_column=5, - end_line=188, end_column=60, - law_headings=["Article L521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), local_var_269): + start_line=188, start_column=5, + end_line=188, end_column=60, + law_headings=["Article L521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), local_var_271): return VersementAllocations(VersementAllocations_Code.Normal, - Unit()) + Unit()) else: raise EmptyError - - def local_var_259(_: Any): - match_arg_787 = param_234.prise_en_charge - if match_arg_787.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: - _ = match_arg_787.value - local_var_261 = False - elif match_arg_787.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: - _ = match_arg_787.value - local_var_261 = True - elif match_arg_787.code == PriseEnCharge_Code.EffectiveEtPermanente: - _ = match_arg_787.value - local_var_261 = False - elif match_arg_787.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: - _ = match_arg_787.value - local_var_261 = False - elif match_arg_787.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: - _ = match_arg_787.value - local_var_261 = False + def local_var_261(_:Any): + match_arg_797 = param_236.prise_en_charge + if match_arg_797.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: + _ = match_arg_797.value + local_var_263 = False + elif match_arg_797.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: + _ = match_arg_797.value + local_var_263 = True + elif match_arg_797.code == PriseEnCharge_Code.EffectiveEtPermanente: + _ = match_arg_797.value + local_var_263 = False + elif match_arg_797.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: + _ = match_arg_797.value + local_var_263 = False + elif match_arg_797.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: + _ = match_arg_797.value + local_var_263 = False if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=208, start_column=5, - end_line=208, end_column=69, - law_headings=["Article L521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), local_var_261): + start_line=208, start_column=5, + end_line=208, end_column=69, + law_headings=["Article L521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), local_var_263): return VersementAllocations(VersementAllocations_Code.Normal, - Unit()) + Unit()) else: raise EmptyError - - def local_var_251(_: Any): - match_arg_788 = param_234.prise_en_charge - if match_arg_788.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: - _ = match_arg_788.value - local_var_253 = True - elif match_arg_788.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: - _ = match_arg_788.value - local_var_253 = False - elif match_arg_788.code == PriseEnCharge_Code.EffectiveEtPermanente: - _ = match_arg_788.value - local_var_253 = False - elif match_arg_788.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: - _ = match_arg_788.value - local_var_253 = False - elif match_arg_788.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: - _ = match_arg_788.value - local_var_253 = False + def local_var_253(_:Any): + match_arg_798 = param_236.prise_en_charge + if match_arg_798.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: + _ = match_arg_798.value + local_var_255 = True + elif match_arg_798.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: + _ = match_arg_798.value + local_var_255 = False + elif match_arg_798.code == PriseEnCharge_Code.EffectiveEtPermanente: + _ = match_arg_798.value + local_var_255 = False + elif match_arg_798.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: + _ = match_arg_798.value + local_var_255 = False + elif match_arg_798.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: + _ = match_arg_798.value + local_var_255 = False if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=218, start_column=5, - end_line=218, end_column=70, - law_headings=["Article L521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), local_var_253): + start_line=218, start_column=5, + end_line=218, end_column=70, + law_headings=["Article L521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), local_var_255): return VersementAllocations(VersementAllocations_Code.Normal, - Unit()) + Unit()) else: raise EmptyError - - def local_var_243(_: Any): - match_arg_789 = param_234.prise_en_charge - if match_arg_789.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: - _ = match_arg_789.value - local_var_245 = False - elif match_arg_789.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: - _ = match_arg_789.value - local_var_245 = False - elif match_arg_789.code == PriseEnCharge_Code.EffectiveEtPermanente: - _ = match_arg_789.value - local_var_245 = False - elif match_arg_789.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: - _ = match_arg_789.value - local_var_245 = False - elif match_arg_789.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: - _ = match_arg_789.value - local_var_245 = True + def local_var_245(_:Any): + match_arg_799 = param_236.prise_en_charge + if match_arg_799.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: + _ = match_arg_799.value + local_var_247 = False + elif match_arg_799.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: + _ = match_arg_799.value + local_var_247 = False + elif match_arg_799.code == PriseEnCharge_Code.EffectiveEtPermanente: + _ = match_arg_799.value + local_var_247 = False + elif match_arg_799.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: + _ = match_arg_799.value + local_var_247 = False + elif match_arg_799.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: + _ = match_arg_799.value + local_var_247 = True if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=258, start_column=5, - end_line=259, end_column=56, - law_headings=["Article L521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), local_var_245): + start_line=258, start_column=5, + end_line=259, end_column=56, + law_headings=["Article L521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), local_var_247): return VersementAllocations(VersementAllocations_Code.AllocationVerseeAuxServicesSociaux, - Unit()) + Unit()) else: raise EmptyError - - def local_var_235(_: Any): - match_arg_790 = param_234.prise_en_charge - if match_arg_790.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: - _ = match_arg_790.value - local_var_237 = False - elif match_arg_790.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: - _ = match_arg_790.value - local_var_237 = False - elif match_arg_790.code == PriseEnCharge_Code.EffectiveEtPermanente: - _ = match_arg_790.value - local_var_237 = False - elif match_arg_790.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: - _ = match_arg_790.value - local_var_237 = True - elif match_arg_790.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: - _ = match_arg_790.value - local_var_237 = False + def local_var_237(_:Any): + match_arg_800 = param_236.prise_en_charge + if match_arg_800.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: + _ = match_arg_800.value + local_var_239 = False + elif match_arg_800.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: + _ = match_arg_800.value + local_var_239 = False + elif match_arg_800.code == PriseEnCharge_Code.EffectiveEtPermanente: + _ = match_arg_800.value + local_var_239 = False + elif match_arg_800.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: + _ = match_arg_800.value + local_var_239 = True + elif match_arg_800.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: + _ = match_arg_800.value + local_var_239 = False if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=269, start_column=5, - end_line=270, end_column=48, - law_headings=["Article L521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), local_var_237): + start_line=269, start_column=5, + end_line=270, end_column=48, + law_headings=["Article L521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), local_var_239): return VersementAllocations(VersementAllocations_Code.Normal, - Unit()) + Unit()) else: raise EmptyError - - def local_var_275(_: Any): + def local_var_277(_:Any): return log_decision_taken(SourcePosition(filename="", - start_line=0, start_column=1, - end_line=0, end_column=1, - law_headings=[]), False) - - def local_var_277(_: Any): + start_line=0, start_column=1, + end_line=0, end_column=1, + law_headings=[]), False) + def local_var_279(_:Any): raise EmptyError - return handle_default([local_var_235, local_var_243, - local_var_251, local_var_259, local_var_267], - local_var_275, local_var_277) + return handle_default([local_var_237, local_var_245, + local_var_253, local_var_261, local_var_269], + local_var_277, local_var_279) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=103, start_column=12, end_line=103, - end_column=21, law_headings=["Prologue"])) + start_line=103, start_column=12, end_line=103, + end_column=21, law_headings=["Prologue"])) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=103, start_column=12, end_line=103, end_column=21, - law_headings=["Prologue"])) - versement_232 = log_variable_definition(["AllocationsFamiliales", - "versement"], local_var_233) + start_line=103, start_column=12, end_line=103, end_column=21, + law_headings=["Prologue"])) + versement_234 = log_variable_definition(["AllocationsFamiliales", + "versement"], local_var_235) try: try: - local_var_280 = avait_enfant_a_charge_avant_1er_janvier_2012_149( - Unit()) + local_var_282 = avait_enfant_a_charge_avant_1er_janvier_2012_151(Unit()) except EmptyError: - local_var_280 = False + if log_decision_taken(SourcePosition(filename="", start_line=0, + start_column=1, end_line=0, end_column=1, + law_headings=[]), True): + local_var_282 = False + else: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=120, start_column=12, end_line=120, end_column=56, - law_headings=["Prologue"])) - avait_enfant_a_charge_avant_1er_janvier_2012_279 = log_variable_definition(["AllocationsFamiliales", - "avait_enfant_à_charge_avant_1er_janvier_2012"], local_var_280) + start_line=120, start_column=12, end_line=120, end_column=56, + law_headings=["Prologue"])) + avait_enfant_a_charge_avant_1er_janvier_2012_281 = log_variable_definition(["AllocationsFamiliales", + "avait_enfant_à_charge_avant_1er_janvier_2012"], local_var_282) try: try: - local_var_282 = nombre_enfants_l521_1_167(Unit()) + local_var_284 = nombre_enfants_l521_1_169(Unit()) except EmptyError: - local_var_282 = integer_of_string("3") + try: + local_var_284 = integer_of_string("3") + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=151, start_column=12, end_line=151, end_column=33, - law_headings=["Prologue"])) - nombre_enfants_l521_1_281 = log_variable_definition(["AllocationsFamiliales", - "nombre_enfants_l521_1"], local_var_282) + start_line=151, start_column=12, end_line=151, end_column=33, + law_headings=["Prologue"])) + nombre_enfants_l521_1_283 = log_variable_definition(["AllocationsFamiliales", + "nombre_enfants_l521_1"], local_var_284) try: try: - local_var_284 = nombre_enfants_alinea_2_l521_3_169(Unit()) + local_var_286 = nombre_enfants_alinea_2_l521_3_171(Unit()) except EmptyError: - local_var_284 = integer_of_string("3") + try: + local_var_286 = integer_of_string("3") + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=153, start_column=12, end_line=153, end_column=42, - law_headings=["Prologue"])) - nombre_enfants_alinea_2_l521_3_283 = log_variable_definition(["AllocationsFamiliales", - "nombre_enfants_alinéa_2_l521_3"], local_var_284) - - def local_var_286(_: Unit): + start_line=153, start_column=12, end_line=153, end_column=42, + law_headings=["Prologue"])) + nombre_enfants_alinea_2_l521_3_285 = log_variable_definition(["AllocationsFamiliales", + "nombre_enfants_alinéa_2_l521_3"], local_var_286) + def local_var_288(_:Unit): raise EmptyError - result_285 = log_end_call(["AllocationsFamiliales", "version_avril_2008", - "AllocationFamilialesAvril2008"], - log_begin_call(["AllocationsFamiliales", "version_avril_2008", - "AllocationFamilialesAvril2008"], allocation_familiales_avril2008, - AllocationFamilialesAvril2008In(age_minimum_alinea_1_l521_3_in=local_var_286))) - version_avril_2008_dot_age_minimum_alinea_1_l521_3_288 = result_285.age_minimum_alinea_1_l521_3_out - - def local_var_290(_: Unit): + result_287 = log_end_call(["AllocationsFamiliales", "version_avril_2008", + "AllocationFamilialesAvril2008"], + log_begin_call(["AllocationsFamiliales", "version_avril_2008", + "AllocationFamilialesAvril2008"], allocation_familiales_avril2008, + AllocationFamilialesAvril2008In(age_minimum_alinea_1_l521_3_in = local_var_288))) + version_avril_2008_dot_age_minimum_alinea_1_l521_3_290 = result_287.age_minimum_alinea_1_l521_3_out + def local_var_292(_:Unit): + try: + local_var_294 = date_courante_183 + except EmptyError: + raise EmptyError return log_variable_definition(["AllocationsFamiliales", - "prestations_familiales.date_courante"], date_courante_181) - prestations_familiales_dot_date_courante_289 = local_var_290 - - def local_var_293(_: Unit): + "prestations_familiales.date_courante"], local_var_294) + prestations_familiales_dot_date_courante_291 = local_var_292 + def local_var_296(_:Unit): + try: + local_var_298 = ElementPrestationsFamiliales(ElementPrestationsFamiliales_Code.AllocationsFamiliales, + Unit()) + except EmptyError: + raise EmptyError return log_variable_definition(["AllocationsFamiliales", - "prestations_familiales.prestation_courante"], - ElementPrestationsFamiliales(ElementPrestationsFamiliales_Code.AllocationsFamiliales, - Unit())) - prestations_familiales_dot_prestation_courante_292 = local_var_293 - - def local_var_296(_: Unit): + "prestations_familiales.prestation_courante"], local_var_298) + prestations_familiales_dot_prestation_courante_295 = local_var_296 + def local_var_300(_:Unit): + try: + local_var_302 = residence_181 + except EmptyError: + raise EmptyError return log_variable_definition(["AllocationsFamiliales", - "prestations_familiales.résidence"], residence_179) - prestations_familiales_dot_residence_295 = local_var_296 - - def local_var_299(_: Unit): + "prestations_familiales.résidence"], local_var_302) + prestations_familiales_dot_residence_299 = local_var_300 + def local_var_304(_:Unit): raise EmptyError - - def local_var_301(_: Unit): + def local_var_306(_:Unit): raise EmptyError - - def local_var_303(_: Unit): + def local_var_308(_:Unit): raise EmptyError - - def local_var_305(_: Unit): + def local_var_310(_:Unit): raise EmptyError - - def local_var_307(_: Unit): + def local_var_312(_:Unit): raise EmptyError - - def local_var_309(_: Unit): + def local_var_314(_:Unit): raise EmptyError - result_298 = log_end_call(["AllocationsFamiliales", - "prestations_familiales", "PrestationsFamiliales"], - log_begin_call(["AllocationsFamiliales", "prestations_familiales", - "PrestationsFamiliales"], prestations_familiales, - PrestationsFamilialesIn(droit_ouvert_in=local_var_299, - conditions_hors_age_in=local_var_301, - plafond_l512_3_2_in=local_var_303, age_l512_3_2_in=local_var_305, - regime_outre_mer_l751_1_in=local_var_307, - date_courante_in=prestations_familiales_dot_date_courante_289, - prestation_courante_in=prestations_familiales_dot_prestation_courante_292, - residence_in=prestations_familiales_dot_residence_295, - base_mensuelle_in=local_var_309))) - prestations_familiales_dot_droit_ouvert_311 = result_298.droit_ouvert_out - prestations_familiales_dot_conditions_hors_age_312 = result_298.conditions_hors_age_out - prestations_familiales_dot_plafond_l512_3_2_313 = result_298.plafond_l512_3_2_out - prestations_familiales_dot_age_l512_3_2_314 = result_298.age_l512_3_2_out - prestations_familiales_dot_regime_outre_mer_l751_1_315 = result_298.regime_outre_mer_l751_1_out - prestations_familiales_dot_date_courante_316 = result_298.date_courante_out - prestations_familiales_dot_prestation_courante_317 = result_298.prestation_courante_out - prestations_familiales_dot_residence_318 = result_298.residence_out - prestations_familiales_dot_base_mensuelle_319 = result_298.base_mensuelle_out - - def local_var_321(_: Unit): + result_303 = log_end_call(["AllocationsFamiliales", + "prestations_familiales", "PrestationsFamiliales"], + log_begin_call(["AllocationsFamiliales", "prestations_familiales", + "PrestationsFamiliales"], prestations_familiales, + PrestationsFamilialesIn(droit_ouvert_in = local_var_304, + conditions_hors_age_in = local_var_306, + plafond_l512_3_2_in = local_var_308, age_l512_3_2_in = local_var_310, + regime_outre_mer_l751_1_in = local_var_312, + date_courante_in = prestations_familiales_dot_date_courante_291, + prestation_courante_in = prestations_familiales_dot_prestation_courante_295, + residence_in = prestations_familiales_dot_residence_299, + base_mensuelle_in = local_var_314))) + prestations_familiales_dot_droit_ouvert_316 = result_303.droit_ouvert_out + prestations_familiales_dot_conditions_hors_age_317 = result_303.conditions_hors_age_out + prestations_familiales_dot_plafond_l512_3_2_318 = result_303.plafond_l512_3_2_out + prestations_familiales_dot_age_l512_3_2_319 = result_303.age_l512_3_2_out + prestations_familiales_dot_regime_outre_mer_l751_1_320 = result_303.regime_outre_mer_l751_1_out + prestations_familiales_dot_date_courante_321 = result_303.date_courante_out + prestations_familiales_dot_prestation_courante_322 = result_303.prestation_courante_out + prestations_familiales_dot_residence_323 = result_303.residence_out + prestations_familiales_dot_base_mensuelle_324 = result_303.base_mensuelle_out + def local_var_326(_:Unit): + try: + local_var_328 = enfants_a_charge_185 + except EmptyError: + raise EmptyError return log_variable_definition(["AllocationsFamiliales", - "enfant_le_plus_âgé.enfants"], enfants_a_charge_183) - enfant_le_plus_age_dot_enfants_320 = local_var_321 - - def local_var_324(_: Unit): + "enfant_le_plus_âgé.enfants"], local_var_328) + enfant_le_plus_age_dot_enfants_325 = local_var_326 + def local_var_330(_:Unit): raise EmptyError - result_323 = log_end_call(["AllocationsFamiliales", - "enfant_le_plus_âgé", "EnfantLePlusÂgé"], - log_begin_call(["AllocationsFamiliales", "enfant_le_plus_âgé", - "EnfantLePlusÂgé"], enfant_le_plus_age, - EnfantLePlusAgeIn(enfants_in=enfant_le_plus_age_dot_enfants_320, - le_plus_age_in=local_var_324))) - enfant_le_plus_age_dot_enfants_326 = result_323.enfants_out - enfant_le_plus_age_dot_le_plus_age_327 = result_323.le_plus_age_out + result_329 = log_end_call(["AllocationsFamiliales", + "enfant_le_plus_âgé", "EnfantLePlusÂgé"], + log_begin_call(["AllocationsFamiliales", "enfant_le_plus_âgé", + "EnfantLePlusÂgé"], enfant_le_plus_age, + EnfantLePlusAgeIn(enfants_in = enfant_le_plus_age_dot_enfants_325, + le_plus_age_in = local_var_330))) + enfant_le_plus_age_dot_enfants_332 = result_329.enfants_out + enfant_le_plus_age_dot_le_plus_age_333 = result_329.le_plus_age_out try: try: - local_var_329 = age_minimum_alinea_1_l521_3_168(Unit()) + local_var_335 = age_minimum_alinea_1_l521_3_170(Unit()) except EmptyError: - def local_var_329(param_330: Enfant): + def local_var_335(param_336:Enfant): try: try: - if log_decision_taken(SourcePosition(filename="./securite_sociale_R.catala_fr", - start_line=83, start_column=19, - end_line=83, end_column=69, - law_headings=["Article R521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets en Conseil d'Etat", - "Code de la sécurité sociale"]), ((param_330.date_de_naissance + - duration_of_numbers(11, 0, 0)) <= - date_of_numbers(2008, 4, 30))): - return version_avril_2008_dot_age_minimum_alinea_1_l521_3_288 - else: - raise EmptyError + try: + if log_decision_taken(SourcePosition(filename="./securite_sociale_R.catala_fr", + start_line=83, start_column=19, + end_line=83, end_column=69, + law_headings=["Article R521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets en Conseil d'Etat", + "Code de la sécurité sociale"]), ((param_336.date_de_naissance + + duration_of_numbers(11,0,0)) <= + date_of_numbers(2008,4,30))): + return version_avril_2008_dot_age_minimum_alinea_1_l521_3_290 + else: + raise EmptyError + except EmptyError: + return integer_of_string("14") except EmptyError: - return integer_of_string("14") + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=152, start_column=12, end_line=152, - end_column=39, law_headings=["Prologue"])) + start_line=152, start_column=12, end_line=152, + end_column=39, law_headings=["Prologue"])) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=152, start_column=12, end_line=152, end_column=39, - law_headings=["Prologue"])) - age_minimum_alinea_1_l521_3_328 = log_variable_definition(["AllocationsFamiliales", - "âge_minimum_alinéa_1_l521_3"], local_var_329) + start_line=152, start_column=12, end_line=152, end_column=39, + law_headings=["Prologue"])) + age_minimum_alinea_1_l521_3_334 = log_variable_definition(["AllocationsFamiliales", + "âge_minimum_alinéa_1_l521_3"], local_var_335) try: try: - local_var_332 = enfants_a_charge_droit_ouvert_prestation_familiale_135( - Unit()) + local_var_338 = enfants_a_charge_droit_ouvert_prestation_familiale_137(Unit()) except EmptyError: - def local_var_333(enfant_334: Any): - return log_end_call(["PrestationsFamiliales", - "droit_ouvert"], - log_variable_definition(["PrestationsFamiliales", - "droit_ouvert", "output"], - log_begin_call(["PrestationsFamiliales", "droit_ouvert"], - prestations_familiales_dot_droit_ouvert_311, - log_variable_definition(["PrestationsFamiliales", - "droit_ouvert", "input"], enfant_334)))) - local_var_332 = list_filter(local_var_333, enfants_a_charge_183) + try: + def local_var_339(enfant_340:Any): + return log_end_call(["PrestationsFamiliales", + "droit_ouvert"], + log_variable_definition(["PrestationsFamiliales", + "droit_ouvert", "output"], + log_begin_call(["PrestationsFamiliales", + "droit_ouvert"], + prestations_familiales_dot_droit_ouvert_316, + log_variable_definition(["PrestationsFamiliales", + "droit_ouvert", "input"], enfant_340)))) + local_var_338 = list_filter(local_var_339, + enfants_a_charge_185) + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=100, start_column=12, end_line=100, end_column=62, - law_headings=["Prologue"])) - enfants_a_charge_droit_ouvert_prestation_familiale_331 = log_variable_definition(["AllocationsFamiliales", - "enfants_à_charge_droit_ouvert_prestation_familiale"], - local_var_332) + start_line=100, start_column=12, end_line=100, end_column=62, + law_headings=["Prologue"])) + enfants_a_charge_droit_ouvert_prestation_familiale_337 = log_variable_definition(["AllocationsFamiliales", + "enfants_à_charge_droit_ouvert_prestation_familiale"], + local_var_338) try: try: - local_var_336 = est_enfant_le_plus_age_170(Unit()) + local_var_342 = est_enfant_le_plus_age_172(Unit()) except EmptyError: - def local_var_336(param_337: Enfant): + def local_var_342(param_343:Enfant): try: - return (enfant_le_plus_age_dot_le_plus_age_327 == - param_337) + try: + return (enfant_le_plus_age_dot_le_plus_age_333 == + param_343) + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=154, start_column=12, end_line=154, - end_column=34, law_headings=["Prologue"])) + start_line=154, start_column=12, end_line=154, + end_column=34, law_headings=["Prologue"])) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=154, start_column=12, end_line=154, end_column=34, - law_headings=["Prologue"])) - est_enfant_le_plus_age_335 = log_variable_definition(["AllocationsFamiliales", - "est_enfant_le_plus_âgé"], local_var_336) + start_line=154, start_column=12, end_line=154, end_column=34, + law_headings=["Prologue"])) + est_enfant_le_plus_age_341 = log_variable_definition(["AllocationsFamiliales", + "est_enfant_le_plus_âgé"], local_var_342) try: try: - local_var_339 = plafond__i_i_d521_3_172(Unit()) + local_var_345 = plafond__i_i_d521_3_174(Unit()) except EmptyError: - def local_var_346(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=94, start_column=5, - end_line=94, end_column=69, - law_headings=["Circulaire interministérielle N° DSS/SD2B/2017/352 du 22 décembre 2017 relative à la revalorisation au 1er janvier 2018 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", - "Montant des plafonds de ressources", - "Décrets divers"]), ((date_courante_181 >= - date_of_numbers(2018, 1, 1)) and (date_courante_181 <= - date_of_numbers(2018, 12, 31)))): - return (money_of_cents_string("7877000") + + try: + def local_var_352(_:Any): + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=94, start_column=5, + end_line=94, end_column=69, + law_headings=["Circulaire interministérielle N° DSS/SD2B/2017/352 du 22 décembre 2017 relative à la revalorisation au 1er janvier 2018 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", + "Montant des plafonds de ressources", + "Décrets divers"]), ((date_courante_183 >= + date_of_numbers(2018,1,1)) and (date_courante_183 <= + date_of_numbers(2018,12,31)))): + return (money_of_cents_string("7877000") + (money_of_cents_string("562800") * - decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331)))) - else: - raise EmptyError - - def local_var_344(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=127, start_column=5, - end_line=127, end_column=69, - law_headings=["Instruction interministérielle n° DSS/SD2B/2018/279 du 17 décembre 2018 relative à la revalorisation au 1er janvier 2019 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", - "Montant des plafonds de ressources", - "Décrets divers"]), ((date_courante_181 >= - date_of_numbers(2019, 1, 1)) and (date_courante_181 <= - date_of_numbers(2019, 12, 31)))): - return (money_of_cents_string("7955800") + + decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337)))) + else: + raise EmptyError + def local_var_350(_:Any): + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=127, start_column=5, + end_line=127, end_column=69, + law_headings=["Instruction interministérielle n° DSS/SD2B/2018/279 du 17 décembre 2018 relative à la revalorisation au 1er janvier 2019 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", + "Montant des plafonds de ressources", + "Décrets divers"]), ((date_courante_183 >= + date_of_numbers(2019,1,1)) and (date_courante_183 <= + date_of_numbers(2019,12,31)))): + return (money_of_cents_string("7955800") + (money_of_cents_string("568400") * - decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331)))) - else: - raise EmptyError - - def local_var_342(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=160, start_column=5, - end_line=160, end_column=69, - law_headings=["Instruction interministerielle no DSS/SD2B/2019/261 du 18 décembre 2019 relative à la revalorisation au 1er janvier 2020 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à La Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", - "Montant des plafonds de ressources", - "Décrets divers"]), ((date_courante_181 >= - date_of_numbers(2020, 1, 1)) and (date_courante_181 <= - date_of_numbers(2020, 12, 31)))): - return (money_of_cents_string("8083100") + + decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337)))) + else: + raise EmptyError + def local_var_348(_:Any): + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=160, start_column=5, + end_line=160, end_column=69, + law_headings=["Instruction interministerielle no DSS/SD2B/2019/261 du 18 décembre 2019 relative à la revalorisation au 1er janvier 2020 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à La Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", + "Montant des plafonds de ressources", + "Décrets divers"]), ((date_courante_183 >= + date_of_numbers(2020,1,1)) and (date_courante_183 <= + date_of_numbers(2020,12,31)))): + return (money_of_cents_string("8083100") + (money_of_cents_string("577500") * - decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331)))) - else: - raise EmptyError - - def local_var_340(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=196, start_column=5, - end_line=196, end_column=69, law_headings=["Article 1", - "Arrêté du 14 décembre 2020 relatif au montant des plafonds de ressources de certaines prestations familiales et aux tranches du barème applicable au recouvrement des indus et à la saisie des prestations", - "Montant des plafonds de ressources", - "Décrets divers"]), ((date_courante_181 >= - date_of_numbers(2021, 1, 1)) and (date_courante_181 <= - date_of_numbers(2021, 12, 31)))): - return (money_of_cents_string("8155800") + + decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337)))) + else: + raise EmptyError + def local_var_346(_:Any): + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=196, start_column=5, + end_line=196, end_column=69, + law_headings=["Article 1", + "Arrêté du 14 décembre 2020 relatif au montant des plafonds de ressources de certaines prestations familiales et aux tranches du barème applicable au recouvrement des indus et à la saisie des prestations", + "Montant des plafonds de ressources", + "Décrets divers"]), ((date_courante_183 >= + date_of_numbers(2021,1,1)) and (date_courante_183 <= + date_of_numbers(2021,12,31)))): + return (money_of_cents_string("8155800") + (money_of_cents_string("582700") * - decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331)))) - else: - raise EmptyError - - def local_var_348(_: Any): - return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=308, start_column=14, - end_line=308, end_column=31, - law_headings=["Article D521-3", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), True) - - def local_var_350(_: Any): - return (money_of_cents_string("7830000") + + decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337)))) + else: + raise EmptyError + def local_var_354(_:Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=308, start_column=14, + end_line=308, end_column=31, + law_headings=["Article D521-3", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), True) + def local_var_356(_:Any): + return (money_of_cents_string("7830000") + (money_of_cents_string("559500") * - decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331)))) - local_var_339 = handle_default([local_var_340, local_var_342, - local_var_344, local_var_346], local_var_348, local_var_350) + decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337)))) + local_var_345 = handle_default([local_var_346, local_var_348, + local_var_350, local_var_352], local_var_354, + local_var_356) + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=156, start_column=12, end_line=156, end_column=29, - law_headings=["Prologue"])) - plafond__i_i_d521_3_338 = log_variable_definition(["AllocationsFamiliales", - "plafond_II_d521_3"], local_var_339) + start_line=156, start_column=12, end_line=156, end_column=29, + law_headings=["Prologue"])) + plafond__i_i_d521_3_344 = log_variable_definition(["AllocationsFamiliales", + "plafond_II_d521_3"], local_var_345) try: try: - local_var_353 = plafond__i_d521_3_171(Unit()) + local_var_359 = plafond__i_d521_3_173(Unit()) except EmptyError: - def local_var_360(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=87, start_column=5, - end_line=87, end_column=69, - law_headings=["Circulaire interministérielle N° DSS/SD2B/2017/352 du 22 décembre 2017 relative à la revalorisation au 1er janvier 2018 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", - "Montant des plafonds de ressources", - "Décrets divers"]), ((date_courante_181 >= - date_of_numbers(2018, 1, 1)) and (date_courante_181 <= - date_of_numbers(2018, 12, 31)))): - return (money_of_cents_string("5628600") + + try: + def local_var_366(_:Any): + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=87, start_column=5, + end_line=87, end_column=69, + law_headings=["Circulaire interministérielle N° DSS/SD2B/2017/352 du 22 décembre 2017 relative à la revalorisation au 1er janvier 2018 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", + "Montant des plafonds de ressources", + "Décrets divers"]), ((date_courante_183 >= + date_of_numbers(2018,1,1)) and (date_courante_183 <= + date_of_numbers(2018,12,31)))): + return (money_of_cents_string("5628600") + (money_of_cents_string("562800") * - decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331)))) - else: - raise EmptyError - - def local_var_358(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=120, start_column=5, - end_line=120, end_column=69, - law_headings=["Instruction interministérielle n° DSS/SD2B/2018/279 du 17 décembre 2018 relative à la revalorisation au 1er janvier 2019 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", - "Montant des plafonds de ressources", - "Décrets divers"]), ((date_courante_181 >= - date_of_numbers(2019, 1, 1)) and (date_courante_181 <= - date_of_numbers(2019, 12, 31)))): - return (money_of_cents_string("5684900") + + decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337)))) + else: + raise EmptyError + def local_var_364(_:Any): + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=120, start_column=5, + end_line=120, end_column=69, + law_headings=["Instruction interministérielle n° DSS/SD2B/2018/279 du 17 décembre 2018 relative à la revalorisation au 1er janvier 2019 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", + "Montant des plafonds de ressources", + "Décrets divers"]), ((date_courante_183 >= + date_of_numbers(2019,1,1)) and (date_courante_183 <= + date_of_numbers(2019,12,31)))): + return (money_of_cents_string("5684900") + (money_of_cents_string("568400") * - decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331)))) - else: - raise EmptyError - - def local_var_356(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=153, start_column=5, - end_line=153, end_column=69, - law_headings=["Instruction interministerielle no DSS/SD2B/2019/261 du 18 décembre 2019 relative à la revalorisation au 1er janvier 2020 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à La Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", - "Montant des plafonds de ressources", - "Décrets divers"]), ((date_courante_181 >= - date_of_numbers(2020, 1, 1)) and (date_courante_181 <= - date_of_numbers(2020, 12, 31)))): - return (money_of_cents_string("5775900") + + decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337)))) + else: + raise EmptyError + def local_var_362(_:Any): + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=153, start_column=5, + end_line=153, end_column=69, + law_headings=["Instruction interministerielle no DSS/SD2B/2019/261 du 18 décembre 2019 relative à la revalorisation au 1er janvier 2020 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à La Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", + "Montant des plafonds de ressources", + "Décrets divers"]), ((date_courante_183 >= + date_of_numbers(2020,1,1)) and (date_courante_183 <= + date_of_numbers(2020,12,31)))): + return (money_of_cents_string("5775900") + (money_of_cents_string("577500") * - decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331)))) - else: - raise EmptyError - - def local_var_354(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=180, start_column=5, - end_line=180, end_column=69, law_headings=["Article 1", - "Arrêté du 14 décembre 2020 relatif au montant des plafonds de ressources de certaines prestations familiales et aux tranches du barème applicable au recouvrement des indus et à la saisie des prestations", - "Montant des plafonds de ressources", - "Décrets divers"]), ((date_courante_181 >= - date_of_numbers(2021, 1, 1)) and (date_courante_181 <= - date_of_numbers(2021, 12, 31)))): - return (money_of_cents_string("5827900") + + decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337)))) + else: + raise EmptyError + def local_var_360(_:Any): + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=180, start_column=5, + end_line=180, end_column=69, + law_headings=["Article 1", + "Arrêté du 14 décembre 2020 relatif au montant des plafonds de ressources de certaines prestations familiales et aux tranches du barème applicable au recouvrement des indus et à la saisie des prestations", + "Montant des plafonds de ressources", + "Décrets divers"]), ((date_courante_183 >= + date_of_numbers(2021,1,1)) and (date_courante_183 <= + date_of_numbers(2021,12,31)))): + return (money_of_cents_string("5827900") + (money_of_cents_string("582700") * - decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331)))) - else: - raise EmptyError - - def local_var_362(_: Any): - return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=298, start_column=14, - end_line=298, end_column=30, - law_headings=["Article D521-3", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), True) - - def local_var_364(_: Any): - return (money_of_cents_string("5595000") + + decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337)))) + else: + raise EmptyError + def local_var_368(_:Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=298, start_column=14, + end_line=298, end_column=30, + law_headings=["Article D521-3", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), True) + def local_var_370(_:Any): + return (money_of_cents_string("5595000") + (money_of_cents_string("559500") * - decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331)))) - local_var_353 = handle_default([local_var_354, local_var_356, - local_var_358, local_var_360], local_var_362, local_var_364) + decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337)))) + local_var_359 = handle_default([local_var_360, local_var_362, + local_var_364, local_var_366], local_var_368, + local_var_370) + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=155, start_column=12, end_line=155, end_column=28, - law_headings=["Prologue"])) - plafond__i_d521_3_352 = log_variable_definition(["AllocationsFamiliales", - "plafond_I_d521_3"], local_var_353) + start_line=155, start_column=12, end_line=155, end_column=28, + law_headings=["Prologue"])) + plafond__i_d521_3_358 = log_variable_definition(["AllocationsFamiliales", + "plafond_I_d521_3"], local_var_359) try: try: - local_var_367 = droit_ouvert_complement_162(Unit()) + local_var_373 = droit_ouvert_complement_164(Unit()) except EmptyError: try: try: if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=426, start_column=5, - end_line=427, end_column=71, - law_headings=["Article L755-12", - "Chapitre 5 : Prestations familiales et prestations assimilées", - "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin", - "Livre 7 : Régimes divers - Dispositions diverses", - "Partie législative", - "Code de la sécurité sociale"]), (prestations_familiales_dot_regime_outre_mer_l751_1_315 and - (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) == - integer_of_string("1")))): - local_var_367 = False + start_line=426, start_column=5, + end_line=427, end_column=71, + law_headings=["Article L755-12", + "Chapitre 5 : Prestations familiales et prestations assimilées", + "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin", + "Livre 7 : Régimes divers - Dispositions diverses", + "Partie législative", + "Code de la sécurité sociale"]), (prestations_familiales_dot_regime_outre_mer_l751_1_320 and + (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) == + integer_of_string("1")))): + local_var_373 = False else: raise EmptyError except EmptyError: - local_var_367 = True + local_var_373 = True except EmptyError: - local_var_367 = False + local_var_373 = False except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=139, start_column=12, end_line=139, end_column=35, - law_headings=["Prologue"])) - droit_ouvert_complement_366 = log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_complément"], local_var_367) + start_line=139, start_column=12, end_line=139, end_column=35, + law_headings=["Prologue"])) + droit_ouvert_complement_372 = log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_complément"], local_var_373) try: try: - local_var_369 = droit_ouvert_forfaitaire_154(Unit()) + local_var_375 = droit_ouvert_forfaitaire_156(Unit()) except EmptyError: - def local_var_369(param_370: Enfant): + def local_var_375(param_376:Enfant): try: try: try: if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=420, start_column=6, - end_line=421, end_column=72, - law_headings=["Article L755-12", - "Chapitre 5 : Prestations familiales et prestations assimilées", - "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin", - "Livre 7 : Régimes divers - Dispositions diverses", - "Partie législative", - "Code de la sécurité sociale"]), (prestations_familiales_dot_regime_outre_mer_l751_1_315 and - (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) == - integer_of_string("1")))): + start_line=420, start_column=6, + end_line=421, end_column=72, + law_headings=["Article L755-12", + "Chapitre 5 : Prestations familiales et prestations assimilées", + "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin", + "Livre 7 : Régimes divers - Dispositions diverses", + "Partie législative", + "Code de la sécurité sociale"]), (prestations_familiales_dot_regime_outre_mer_l751_1_320 and + (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) == + integer_of_string("1")))): return False else: raise EmptyError except EmptyError: if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=119, start_column=5, - end_line=125, end_column=59, - law_headings=["Article L521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), ((list_length(enfants_a_charge_183) >= - nombre_enfants_alinea_2_l521_3_283) and - ((param_370.age == - prestations_familiales_dot_age_l512_3_2_314) and - (param_370.a_deja_ouvert_droit_aux_allocations_familiales and - log_end_call(["PrestationsFamiliales", - "conditions_hors_âge"], - log_variable_definition(["PrestationsFamiliales", - "conditions_hors_âge", "output"], - log_begin_call(["PrestationsFamiliales", - "conditions_hors_âge"], - prestations_familiales_dot_conditions_hors_age_312, - log_variable_definition(["PrestationsFamiliales", - "conditions_hors_âge", "input"], - param_370)))))))): + start_line=119, start_column=5, + end_line=125, end_column=59, + law_headings=["Article L521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), ((list_length(enfants_a_charge_185) >= + nombre_enfants_alinea_2_l521_3_285) and + ((param_376.age == + prestations_familiales_dot_age_l512_3_2_319) and + (param_376.a_deja_ouvert_droit_aux_allocations_familiales and + log_end_call(["PrestationsFamiliales", + "conditions_hors_âge"], + log_variable_definition(["PrestationsFamiliales", + "conditions_hors_âge", "output"], + log_begin_call(["PrestationsFamiliales", + "conditions_hors_âge"], + prestations_familiales_dot_conditions_hors_age_317, + log_variable_definition(["PrestationsFamiliales", + "conditions_hors_âge", "input"], + param_376)))))))): return True else: raise EmptyError @@ -2253,883 +2338,868 @@ def local_var_369(param_370: Enfant): return False except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=127, start_column=12, end_line=127, - end_column=36, law_headings=["Prologue"])) + start_line=127, start_column=12, end_line=127, + end_column=36, law_headings=["Prologue"])) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=127, start_column=12, end_line=127, end_column=36, - law_headings=["Prologue"])) - droit_ouvert_forfaitaire_368 = log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_forfaitaire"], local_var_369) + start_line=127, start_column=12, end_line=127, end_column=36, + law_headings=["Prologue"])) + droit_ouvert_forfaitaire_374 = log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_forfaitaire"], local_var_375) try: try: - local_var_372 = montant_initial_base_quatrieme_enfant_et_plus_mayotte_153( - Unit()) + local_var_378 = montant_initial_base_quatrieme_enfant_et_plus_mayotte_155(Unit()) except EmptyError: - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > + try: + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > integer_of_string("3")): - local_var_372 = ((prestations_familiales_dot_base_mensuelle_319 * - decimal_of_string("0.0463")) * - decimal_of_integer((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) - - integer_of_string("3")))) - else: - local_var_372 = money_of_cents_string("0") + local_var_378 = ((prestations_familiales_dot_base_mensuelle_324 * + decimal_of_string("0.0463")) * + decimal_of_integer((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) - + integer_of_string("3")))) + else: + local_var_378 = money_of_cents_string("0") + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=124, start_column=12, end_line=124, end_column=65, - law_headings=["Prologue"])) - montant_initial_base_quatrieme_enfant_et_plus_mayotte_371 = log_variable_definition(["AllocationsFamiliales", - "montant_initial_base_quatrième_enfant_et_plus_mayotte"], - local_var_372) + start_line=124, start_column=12, end_line=124, end_column=65, + law_headings=["Prologue"])) + montant_initial_base_quatrieme_enfant_et_plus_mayotte_377 = log_variable_definition(["AllocationsFamiliales", + "montant_initial_base_quatrième_enfant_et_plus_mayotte"], + local_var_378) try: try: - local_var_374 = montant_initial_base_troisieme_enfant_mayotte_152( - Unit()) + local_var_380 = montant_initial_base_troisieme_enfant_mayotte_154(Unit()) except EmptyError: - def local_var_393(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=584, start_column=5, - end_line=584, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_181 >= - date_of_numbers(2011, 1, 1)) and (date_courante_181 <= - date_of_numbers(2011, 12, 31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > + try: + def local_var_399(_:Any): + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=584, start_column=5, + end_line=584, end_column=69, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_183 >= + date_of_numbers(2011,1,1)) and (date_courante_183 <= + date_of_numbers(2011,12,31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > integer_of_string("2")): - return (prestations_familiales_dot_base_mensuelle_319 * + return (prestations_familiales_dot_base_mensuelle_324 * decimal_of_string("0.0463")) + else: + return money_of_cents_string("0") else: - return money_of_cents_string("0") - else: - raise EmptyError - - def local_var_391(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=591, start_column=5, - end_line=591, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_181 >= - date_of_numbers(2012, 1, 1)) and (date_courante_181 <= - date_of_numbers(2012, 12, 31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > + raise EmptyError + def local_var_397(_:Any): + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=591, start_column=5, + end_line=591, end_column=69, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_183 >= + date_of_numbers(2012,1,1)) and (date_courante_183 <= + date_of_numbers(2012,12,31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > integer_of_string("2")): - return (prestations_familiales_dot_base_mensuelle_319 * + return (prestations_familiales_dot_base_mensuelle_324 * decimal_of_string("0.0539")) + else: + return money_of_cents_string("0") else: - return money_of_cents_string("0") - else: - raise EmptyError - - def local_var_389(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=598, start_column=5, - end_line=598, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_181 >= - date_of_numbers(2013, 1, 1)) and (date_courante_181 <= - date_of_numbers(2013, 12, 31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > + raise EmptyError + def local_var_395(_:Any): + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=598, start_column=5, + end_line=598, end_column=69, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_183 >= + date_of_numbers(2013,1,1)) and (date_courante_183 <= + date_of_numbers(2013,12,31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > integer_of_string("2")): - return (prestations_familiales_dot_base_mensuelle_319 * + return (prestations_familiales_dot_base_mensuelle_324 * decimal_of_string("0.075")) + else: + return money_of_cents_string("0") else: - return money_of_cents_string("0") - else: - raise EmptyError - - def local_var_387(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=605, start_column=5, - end_line=605, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_181 >= - date_of_numbers(2014, 1, 1)) and (date_courante_181 <= - date_of_numbers(2014, 12, 31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > + raise EmptyError + def local_var_393(_:Any): + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=605, start_column=5, + end_line=605, end_column=69, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_183 >= + date_of_numbers(2014,1,1)) and (date_courante_183 <= + date_of_numbers(2014,12,31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > integer_of_string("2")): - return (prestations_familiales_dot_base_mensuelle_319 * + return (prestations_familiales_dot_base_mensuelle_324 * decimal_of_string("0.069")) + else: + return money_of_cents_string("0") else: - return money_of_cents_string("0") - else: - raise EmptyError - - def local_var_385(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=612, start_column=5, - end_line=612, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_181 >= - date_of_numbers(2015, 1, 1)) and (date_courante_181 <= - date_of_numbers(2015, 12, 31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > + raise EmptyError + def local_var_391(_:Any): + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=612, start_column=5, + end_line=612, end_column=69, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_183 >= + date_of_numbers(2015,1,1)) and (date_courante_183 <= + date_of_numbers(2015,12,31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > integer_of_string("2")): - return (prestations_familiales_dot_base_mensuelle_319 * + return (prestations_familiales_dot_base_mensuelle_324 * decimal_of_string("0.0766")) + else: + return money_of_cents_string("0") else: - return money_of_cents_string("0") - else: - raise EmptyError - - def local_var_383(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=619, start_column=5, - end_line=619, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_181 >= - date_of_numbers(2016, 1, 1)) and (date_courante_181 <= - date_of_numbers(2016, 12, 31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > + raise EmptyError + def local_var_389(_:Any): + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=619, start_column=5, + end_line=619, end_column=69, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_183 >= + date_of_numbers(2016,1,1)) and (date_courante_183 <= + date_of_numbers(2016,12,31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > integer_of_string("2")): - return (prestations_familiales_dot_base_mensuelle_319 * + return (prestations_familiales_dot_base_mensuelle_324 * decimal_of_string("0.0842")) + else: + return money_of_cents_string("0") else: - return money_of_cents_string("0") - else: - raise EmptyError - - def local_var_381(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=626, start_column=5, - end_line=626, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_181 >= - date_of_numbers(2017, 1, 1)) and (date_courante_181 <= - date_of_numbers(2017, 12, 31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > + raise EmptyError + def local_var_387(_:Any): + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=626, start_column=5, + end_line=626, end_column=69, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_183 >= + date_of_numbers(2017,1,1)) and (date_courante_183 <= + date_of_numbers(2017,12,31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > integer_of_string("2")): - return (prestations_familiales_dot_base_mensuelle_319 * + return (prestations_familiales_dot_base_mensuelle_324 * decimal_of_string("0.0918")) + else: + return money_of_cents_string("0") else: - return money_of_cents_string("0") - else: - raise EmptyError - - def local_var_379(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=633, start_column=5, - end_line=633, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_181 >= - date_of_numbers(2018, 1, 1)) and (date_courante_181 <= - date_of_numbers(2018, 12, 31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > + raise EmptyError + def local_var_385(_:Any): + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=633, start_column=5, + end_line=633, end_column=69, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_183 >= + date_of_numbers(2018,1,1)) and (date_courante_183 <= + date_of_numbers(2018,12,31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > integer_of_string("2")): - return (prestations_familiales_dot_base_mensuelle_319 * + return (prestations_familiales_dot_base_mensuelle_324 * decimal_of_string("0.1089")) + else: + return money_of_cents_string("0") else: - return money_of_cents_string("0") - else: - raise EmptyError - - def local_var_377(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=640, start_column=5, - end_line=640, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_181 >= - date_of_numbers(2019, 1, 1)) and (date_courante_181 <= - date_of_numbers(2019, 12, 31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > + raise EmptyError + def local_var_383(_:Any): + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=640, start_column=5, + end_line=640, end_column=69, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_183 >= + date_of_numbers(2019,1,1)) and (date_courante_183 <= + date_of_numbers(2019,12,31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > integer_of_string("2")): - return (prestations_familiales_dot_base_mensuelle_319 * + return (prestations_familiales_dot_base_mensuelle_324 * decimal_of_string("0.1259")) + else: + return money_of_cents_string("0") else: - return money_of_cents_string("0") - else: - raise EmptyError - - def local_var_375(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=647, start_column=5, - end_line=647, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_181 >= - date_of_numbers(2020, 1, 1)) and (date_courante_181 <= - date_of_numbers(2020, 12, 31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > + raise EmptyError + def local_var_381(_:Any): + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=647, start_column=5, + end_line=647, end_column=69, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_183 >= + date_of_numbers(2020,1,1)) and (date_courante_183 <= + date_of_numbers(2020,12,31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > integer_of_string("2")): - return (prestations_familiales_dot_base_mensuelle_319 * + return (prestations_familiales_dot_base_mensuelle_324 * decimal_of_string("0.143")) + else: + return money_of_cents_string("0") else: - return money_of_cents_string("0") - else: - raise EmptyError - - def local_var_395(_: Any): - return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=376, start_column=14, - end_line=376, end_column=59, law_headings=["Article 7", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), True) - - def local_var_397(_: Any): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > + raise EmptyError + def local_var_401(_:Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=376, start_column=14, + end_line=376, end_column=59, + law_headings=["Article 7", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), True) + def local_var_403(_:Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > integer_of_string("2")): - return (prestations_familiales_dot_base_mensuelle_319 * + return (prestations_familiales_dot_base_mensuelle_324 * decimal_of_string("0.16")) - else: - return money_of_cents_string("0") - local_var_374 = handle_default([local_var_375, local_var_377, - local_var_379, local_var_381, local_var_383, local_var_385, - local_var_387, local_var_389, local_var_391, local_var_393], - local_var_395, local_var_397) + else: + return money_of_cents_string("0") + local_var_380 = handle_default([local_var_381, local_var_383, + local_var_385, local_var_387, local_var_389, + local_var_391, local_var_393, local_var_395, + local_var_397, local_var_399], local_var_401, + local_var_403) + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=123, start_column=12, end_line=123, end_column=57, - law_headings=["Prologue"])) - montant_initial_base_troisieme_enfant_mayotte_373 = log_variable_definition(["AllocationsFamiliales", - "montant_initial_base_troisième_enfant_mayotte"], local_var_374) + start_line=123, start_column=12, end_line=123, end_column=57, + law_headings=["Prologue"])) + montant_initial_base_troisieme_enfant_mayotte_379 = log_variable_definition(["AllocationsFamiliales", + "montant_initial_base_troisième_enfant_mayotte"], local_var_380) try: try: - local_var_400 = montant_initial_base_deuxieme_enfant_mayotte_151( - Unit()) + local_var_406 = montant_initial_base_deuxieme_enfant_mayotte_153(Unit()) except EmptyError: - def local_var_419(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=513, start_column=5, - end_line=513, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_181 >= - date_of_numbers(2011, 1, 1)) and (date_courante_181 <= - date_of_numbers(2011, 12, 31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > + try: + def local_var_425(_:Any): + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=513, start_column=5, + end_line=513, end_column=69, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_183 >= + date_of_numbers(2011,1,1)) and (date_courante_183 <= + date_of_numbers(2011,12,31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_319 * + return (prestations_familiales_dot_base_mensuelle_324 * decimal_of_string("0.232")) + else: + return money_of_cents_string("0") else: - return money_of_cents_string("0") - else: - raise EmptyError - - def local_var_417(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=520, start_column=5, - end_line=520, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_181 >= - date_of_numbers(2012, 1, 1)) and (date_courante_181 <= - date_of_numbers(2012, 12, 31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > + raise EmptyError + def local_var_423(_:Any): + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=520, start_column=5, + end_line=520, end_column=69, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_183 >= + date_of_numbers(2012,1,1)) and (date_courante_183 <= + date_of_numbers(2012,12,31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_319 * + return (prestations_familiales_dot_base_mensuelle_324 * decimal_of_string("0.2379")) + else: + return money_of_cents_string("0") else: - return money_of_cents_string("0") - else: - raise EmptyError - - def local_var_415(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=527, start_column=5, - end_line=527, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_181 >= - date_of_numbers(2013, 1, 1)) and (date_courante_181 <= - date_of_numbers(2013, 12, 31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > + raise EmptyError + def local_var_421(_:Any): + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=527, start_column=5, + end_line=527, end_column=69, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_183 >= + date_of_numbers(2013,1,1)) and (date_courante_183 <= + date_of_numbers(2013,12,31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_319 * + return (prestations_familiales_dot_base_mensuelle_324 * decimal_of_string("0.2437")) + else: + return money_of_cents_string("0") else: - return money_of_cents_string("0") - else: - raise EmptyError - - def local_var_413(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=534, start_column=5, - end_line=534, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_181 >= - date_of_numbers(2014, 1, 1)) and (date_courante_181 <= - date_of_numbers(2014, 12, 31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > + raise EmptyError + def local_var_419(_:Any): + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=534, start_column=5, + end_line=534, end_column=69, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_183 >= + date_of_numbers(2014,1,1)) and (date_courante_183 <= + date_of_numbers(2014,12,31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_319 * + return (prestations_familiales_dot_base_mensuelle_324 * decimal_of_string("0.2496")) + else: + return money_of_cents_string("0") else: - return money_of_cents_string("0") - else: - raise EmptyError - - def local_var_411(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=541, start_column=5, - end_line=541, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_181 >= - date_of_numbers(2015, 1, 1)) and (date_courante_181 <= - date_of_numbers(2015, 12, 31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > + raise EmptyError + def local_var_417(_:Any): + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=541, start_column=5, + end_line=541, end_column=69, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_183 >= + date_of_numbers(2015,1,1)) and (date_courante_183 <= + date_of_numbers(2015,12,31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_319 * + return (prestations_familiales_dot_base_mensuelle_324 * decimal_of_string("0.2555")) + else: + return money_of_cents_string("0") else: - return money_of_cents_string("0") - else: - raise EmptyError - - def local_var_409(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=548, start_column=5, - end_line=548, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_181 >= - date_of_numbers(2016, 1, 1)) and (date_courante_181 <= - date_of_numbers(2016, 12, 31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > + raise EmptyError + def local_var_415(_:Any): + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=548, start_column=5, + end_line=548, end_column=69, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_183 >= + date_of_numbers(2016,1,1)) and (date_courante_183 <= + date_of_numbers(2016,12,31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_319 * + return (prestations_familiales_dot_base_mensuelle_324 * decimal_of_string("0.273")) + else: + return money_of_cents_string("0") else: - return money_of_cents_string("0") - else: - raise EmptyError - - def local_var_407(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=555, start_column=5, - end_line=555, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_181 >= - date_of_numbers(2017, 1, 1)) and (date_courante_181 <= - date_of_numbers(2017, 12, 31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > + raise EmptyError + def local_var_413(_:Any): + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=555, start_column=5, + end_line=555, end_column=69, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_183 >= + date_of_numbers(2017,1,1)) and (date_courante_183 <= + date_of_numbers(2017,12,31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_319 * + return (prestations_familiales_dot_base_mensuelle_324 * decimal_of_string("0.2672")) + else: + return money_of_cents_string("0") else: - return money_of_cents_string("0") - else: - raise EmptyError - - def local_var_405(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=562, start_column=5, - end_line=562, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_181 >= - date_of_numbers(2018, 1, 1)) and (date_courante_181 <= - date_of_numbers(2018, 12, 31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > + raise EmptyError + def local_var_411(_:Any): + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=562, start_column=5, + end_line=562, end_column=69, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_183 >= + date_of_numbers(2018,1,1)) and (date_courante_183 <= + date_of_numbers(2018,12,31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_319 * + return (prestations_familiales_dot_base_mensuelle_324 * decimal_of_string("0.284")) + else: + return money_of_cents_string("0") else: - return money_of_cents_string("0") - else: - raise EmptyError - - def local_var_403(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=569, start_column=5, - end_line=569, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_181 >= - date_of_numbers(2019, 1, 1)) and (date_courante_181 <= - date_of_numbers(2019, 12, 31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > + raise EmptyError + def local_var_409(_:Any): + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=569, start_column=5, + end_line=569, end_column=69, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_183 >= + date_of_numbers(2019,1,1)) and (date_courante_183 <= + date_of_numbers(2019,12,31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_319 * + return (prestations_familiales_dot_base_mensuelle_324 * decimal_of_string("0.2936")) + else: + return money_of_cents_string("0") else: - return money_of_cents_string("0") - else: - raise EmptyError - - def local_var_401(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=576, start_column=5, - end_line=576, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_181 >= - date_of_numbers(2020, 1, 1)) and (date_courante_181 <= - date_of_numbers(2020, 12, 31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > + raise EmptyError + def local_var_407(_:Any): + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=576, start_column=5, + end_line=576, end_column=69, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_183 >= + date_of_numbers(2020,1,1)) and (date_courante_183 <= + date_of_numbers(2020,12,31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_319 * + return (prestations_familiales_dot_base_mensuelle_324 * decimal_of_string("0.3068")) + else: + return money_of_cents_string("0") else: - return money_of_cents_string("0") - else: - raise EmptyError - - def local_var_421(_: Any): - return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=367, start_column=14, - end_line=367, end_column=58, law_headings=["Article 7", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), True) - - def local_var_423(_: Any): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > + raise EmptyError + def local_var_427(_:Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=367, start_column=14, + end_line=367, end_column=58, + law_headings=["Article 7", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), True) + def local_var_429(_:Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_319 * + return (prestations_familiales_dot_base_mensuelle_324 * decimal_of_string("0.32")) - else: - return money_of_cents_string("0") - local_var_400 = handle_default([local_var_401, local_var_403, - local_var_405, local_var_407, local_var_409, local_var_411, - local_var_413, local_var_415, local_var_417, local_var_419], - local_var_421, local_var_423) + else: + return money_of_cents_string("0") + local_var_406 = handle_default([local_var_407, local_var_409, + local_var_411, local_var_413, local_var_415, + local_var_417, local_var_419, local_var_421, + local_var_423, local_var_425], local_var_427, + local_var_429) + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=122, start_column=12, end_line=122, end_column=56, - law_headings=["Prologue"])) - montant_initial_base_deuxieme_enfant_mayotte_399 = log_variable_definition(["AllocationsFamiliales", - "montant_initial_base_deuxième_enfant_mayotte"], local_var_400) + start_line=122, start_column=12, end_line=122, end_column=56, + law_headings=["Prologue"])) + montant_initial_base_deuxieme_enfant_mayotte_405 = log_variable_definition(["AllocationsFamiliales", + "montant_initial_base_deuxième_enfant_mayotte"], local_var_406) try: try: - local_var_426 = montant_initial_base_premier_enfant_mayotte_150( - Unit()) + local_var_432 = montant_initial_base_premier_enfant_mayotte_152(Unit()) except EmptyError: - def local_var_447(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=425, start_column=5, - end_line=426, end_column=53, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_181 >= - date_of_numbers(2011, 1, 1)) and ((date_courante_181 <= - date_of_numbers(2011, 12, 31)) and - not avait_enfant_a_charge_avant_1er_janvier_2012_279))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > + try: + def local_var_453(_:Any): + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=425, start_column=5, + end_line=426, end_column=53, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_183 >= + date_of_numbers(2011,1,1)) and ((date_courante_183 <= + date_of_numbers(2011,12,31)) and + not avait_enfant_a_charge_avant_1er_janvier_2012_281))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > integer_of_string("0")): - return (prestations_familiales_dot_base_mensuelle_319 * + return (prestations_familiales_dot_base_mensuelle_324 * decimal_of_string("0.145")) + else: + return money_of_cents_string("0") else: - return money_of_cents_string("0") - else: - raise EmptyError - - def local_var_445(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=433, start_column=5, - end_line=434, end_column=53, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_181 >= - date_of_numbers(2012, 1, 1)) and ((date_courante_181 <= - date_of_numbers(2012, 12, 31)) and - not avait_enfant_a_charge_avant_1er_janvier_2012_279))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > + raise EmptyError + def local_var_451(_:Any): + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=433, start_column=5, + end_line=434, end_column=53, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_183 >= + date_of_numbers(2012,1,1)) and ((date_courante_183 <= + date_of_numbers(2012,12,31)) and + not avait_enfant_a_charge_avant_1er_janvier_2012_281))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > integer_of_string("0")): - return (prestations_familiales_dot_base_mensuelle_319 * + return (prestations_familiales_dot_base_mensuelle_324 * decimal_of_string("0.1393")) + else: + return money_of_cents_string("0") else: - return money_of_cents_string("0") - else: - raise EmptyError - - def local_var_443(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=441, start_column=5, - end_line=442, end_column=53, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_181 >= - date_of_numbers(2013, 1, 1)) and ((date_courante_181 <= - date_of_numbers(2013, 12, 31)) and - not avait_enfant_a_charge_avant_1er_janvier_2012_279))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > + raise EmptyError + def local_var_449(_:Any): + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=441, start_column=5, + end_line=442, end_column=53, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_183 >= + date_of_numbers(2013,1,1)) and ((date_courante_183 <= + date_of_numbers(2013,12,31)) and + not avait_enfant_a_charge_avant_1er_janvier_2012_281))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > integer_of_string("0")): - return (prestations_familiales_dot_base_mensuelle_319 * + return (prestations_familiales_dot_base_mensuelle_324 * decimal_of_string("0.1335")) + else: + return money_of_cents_string("0") else: - return money_of_cents_string("0") - else: - raise EmptyError - - def local_var_441(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=449, start_column=5, - end_line=450, end_column=53, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_181 >= - date_of_numbers(2014, 1, 1)) and ((date_courante_181 <= - date_of_numbers(2014, 12, 31)) and - not avait_enfant_a_charge_avant_1er_janvier_2012_279))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > + raise EmptyError + def local_var_447(_:Any): + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=449, start_column=5, + end_line=450, end_column=53, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_183 >= + date_of_numbers(2014,1,1)) and ((date_courante_183 <= + date_of_numbers(2014,12,31)) and + not avait_enfant_a_charge_avant_1er_janvier_2012_281))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > integer_of_string("0")): - return (prestations_familiales_dot_base_mensuelle_319 * + return (prestations_familiales_dot_base_mensuelle_324 * decimal_of_string("0.1278")) + else: + return money_of_cents_string("0") else: - return money_of_cents_string("0") - else: - raise EmptyError - - def local_var_439(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=457, start_column=5, - end_line=458, end_column=53, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_181 >= - date_of_numbers(2015, 1, 1)) and ((date_courante_181 <= - date_of_numbers(2015, 12, 31)) and - not avait_enfant_a_charge_avant_1er_janvier_2012_279))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > + raise EmptyError + def local_var_445(_:Any): + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=457, start_column=5, + end_line=458, end_column=53, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_183 >= + date_of_numbers(2015,1,1)) and ((date_courante_183 <= + date_of_numbers(2015,12,31)) and + not avait_enfant_a_charge_avant_1er_janvier_2012_281))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > integer_of_string("0")): - return (prestations_familiales_dot_base_mensuelle_319 * + return (prestations_familiales_dot_base_mensuelle_324 * decimal_of_string("0.122")) + else: + return money_of_cents_string("0") else: - return money_of_cents_string("0") - else: - raise EmptyError - - def local_var_437(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=465, start_column=5, - end_line=466, end_column=53, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_181 >= - date_of_numbers(2016, 1, 1)) and ((date_courante_181 <= - date_of_numbers(2016, 12, 31)) and - not avait_enfant_a_charge_avant_1er_janvier_2012_279))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > + raise EmptyError + def local_var_443(_:Any): + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=465, start_column=5, + end_line=466, end_column=53, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_183 >= + date_of_numbers(2016,1,1)) and ((date_courante_183 <= + date_of_numbers(2016,12,31)) and + not avait_enfant_a_charge_avant_1er_janvier_2012_281))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > integer_of_string("0")): - return (prestations_familiales_dot_base_mensuelle_319 * + return (prestations_familiales_dot_base_mensuelle_324 * decimal_of_string("0.1163")) + else: + return money_of_cents_string("0") else: - return money_of_cents_string("0") - else: - raise EmptyError - - def local_var_435(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=473, start_column=5, - end_line=474, end_column=53, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_181 >= - date_of_numbers(2017, 1, 1)) and ((date_courante_181 <= - date_of_numbers(2017, 12, 31)) and - not avait_enfant_a_charge_avant_1er_janvier_2012_279))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > + raise EmptyError + def local_var_441(_:Any): + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=473, start_column=5, + end_line=474, end_column=53, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_183 >= + date_of_numbers(2017,1,1)) and ((date_courante_183 <= + date_of_numbers(2017,12,31)) and + not avait_enfant_a_charge_avant_1er_janvier_2012_281))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > integer_of_string("0")): - return (prestations_familiales_dot_base_mensuelle_319 * + return (prestations_familiales_dot_base_mensuelle_324 * decimal_of_string("0.115")) + else: + return money_of_cents_string("0") else: - return money_of_cents_string("0") - else: - raise EmptyError - - def local_var_433(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=481, start_column=5, - end_line=482, end_column=53, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_181 >= - date_of_numbers(2018, 1, 1)) and ((date_courante_181 <= - date_of_numbers(2018, 12, 31)) and - not avait_enfant_a_charge_avant_1er_janvier_2012_279))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > + raise EmptyError + def local_var_439(_:Any): + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=481, start_column=5, + end_line=482, end_column=53, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_183 >= + date_of_numbers(2018,1,1)) and ((date_courante_183 <= + date_of_numbers(2018,12,31)) and + not avait_enfant_a_charge_avant_1er_janvier_2012_281))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > integer_of_string("0")): - return (prestations_familiales_dot_base_mensuelle_319 * + return (prestations_familiales_dot_base_mensuelle_324 * decimal_of_string("0.0976")) + else: + return money_of_cents_string("0") else: - return money_of_cents_string("0") - else: - raise EmptyError - - def local_var_431(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=489, start_column=5, - end_line=490, end_column=53, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_181 >= - date_of_numbers(2019, 1, 1)) and ((date_courante_181 <= - date_of_numbers(2019, 12, 31)) and - not avait_enfant_a_charge_avant_1er_janvier_2012_279))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > + raise EmptyError + def local_var_437(_:Any): + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=489, start_column=5, + end_line=490, end_column=53, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_183 >= + date_of_numbers(2019,1,1)) and ((date_courante_183 <= + date_of_numbers(2019,12,31)) and + not avait_enfant_a_charge_avant_1er_janvier_2012_281))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > integer_of_string("0")): - return (prestations_familiales_dot_base_mensuelle_319 * + return (prestations_familiales_dot_base_mensuelle_324 * decimal_of_string("0.0847")) + else: + return money_of_cents_string("0") else: - return money_of_cents_string("0") - else: - raise EmptyError - - def local_var_429(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=497, start_column=5, - end_line=498, end_column=53, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_181 >= - date_of_numbers(2020, 1, 1)) and ((date_courante_181 <= - date_of_numbers(2020, 12, 31)) and - not avait_enfant_a_charge_avant_1er_janvier_2012_279))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > + raise EmptyError + def local_var_435(_:Any): + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=497, start_column=5, + end_line=498, end_column=53, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_183 >= + date_of_numbers(2020,1,1)) and ((date_courante_183 <= + date_of_numbers(2020,12,31)) and + not avait_enfant_a_charge_avant_1er_janvier_2012_281))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > integer_of_string("0")): - return (prestations_familiales_dot_base_mensuelle_319 * + return (prestations_familiales_dot_base_mensuelle_324 * decimal_of_string("0.0717")) + else: + return money_of_cents_string("0") else: - return money_of_cents_string("0") - else: - raise EmptyError - - def local_var_427(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=505, start_column=5, - end_line=505, end_column=49, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), avait_enfant_a_charge_avant_1er_janvier_2012_279): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > + raise EmptyError + def local_var_433(_:Any): + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=505, start_column=5, + end_line=505, end_column=49, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), avait_enfant_a_charge_avant_1er_janvier_2012_281): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > integer_of_string("0")): - return money_of_cents_string("5728") + return money_of_cents_string("5728") + else: + return money_of_cents_string("0") else: - return money_of_cents_string("0") - else: - raise EmptyError - - def local_var_449(_: Any): - return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=358, start_column=14, - end_line=358, end_column=57, law_headings=["Article 7", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), True) - - def local_var_451(_: Any): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > + raise EmptyError + def local_var_455(_:Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=358, start_column=14, + end_line=358, end_column=57, + law_headings=["Article 7", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), True) + def local_var_457(_:Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > integer_of_string("0")): - return (prestations_familiales_dot_base_mensuelle_319 * + return (prestations_familiales_dot_base_mensuelle_324 * decimal_of_string("0.0588")) - else: - return money_of_cents_string("0") - local_var_426 = handle_default([local_var_427, local_var_429, - local_var_431, local_var_433, local_var_435, local_var_437, - local_var_439, local_var_441, local_var_443, local_var_445, - local_var_447], local_var_449, local_var_451) + else: + return money_of_cents_string("0") + local_var_432 = handle_default([local_var_433, local_var_435, + local_var_437, local_var_439, local_var_441, + local_var_443, local_var_445, local_var_447, + local_var_449, local_var_451, local_var_453], + local_var_455, local_var_457) + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=121, start_column=12, end_line=121, end_column=55, - law_headings=["Prologue"])) - montant_initial_base_premier_enfant_mayotte_425 = log_variable_definition(["AllocationsFamiliales", - "montant_initial_base_premier_enfant_mayotte"], local_var_426) + start_line=121, start_column=12, end_line=121, end_column=55, + law_headings=["Prologue"])) + montant_initial_base_premier_enfant_mayotte_431 = log_variable_definition(["AllocationsFamiliales", + "montant_initial_base_premier_enfant_mayotte"], local_var_432) try: try: - local_var_454 = nombre_total_enfants_146(Unit()) + local_var_460 = nombre_total_enfants_148(Unit()) except EmptyError: - local_var_454 = decimal_of_integer(list_length( - enfants_a_charge_droit_ouvert_prestation_familiale_331)) + try: + local_var_460 = decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337)) + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=115, start_column=12, end_line=115, end_column=32, - law_headings=["Prologue"])) - nombre_total_enfants_453 = log_variable_definition(["AllocationsFamiliales", - "nombre_total_enfants"], local_var_454) + start_line=115, start_column=12, end_line=115, end_column=32, + law_headings=["Prologue"])) + nombre_total_enfants_459 = log_variable_definition(["AllocationsFamiliales", + "nombre_total_enfants"], local_var_460) try: try: - local_var_456 = nombre_moyen_enfants_145(Unit()) + local_var_462 = nombre_moyen_enfants_147(Unit()) except EmptyError: - def local_var_457(acc_458: Decimal, enfant_459: Any): - match_arg_791 = log_end_call(["AllocationsFamiliales", - "prise_en_compte"], - log_variable_definition(["AllocationsFamiliales", - "prise_en_compte", "output"], - log_begin_call(["AllocationsFamiliales", "prise_en_compte"], - prise_en_compte_185, - log_variable_definition(["AllocationsFamiliales", - "prise_en_compte", "input"], - enfant_459)))) - if match_arg_791.code == PriseEnCompte_Code.Complete: - _ = match_arg_791.value - local_var_460 = decimal_of_string("1.") - elif match_arg_791.code == PriseEnCompte_Code.Partagee: - _ = match_arg_791.value - local_var_460 = decimal_of_string("0.5") - elif match_arg_791.code == PriseEnCompte_Code.Zero: - _ = match_arg_791.value - local_var_460 = decimal_of_string("0.") - return (acc_458 + local_var_460) - local_var_456 = list_fold_left(local_var_457, - decimal_of_string("0."), - enfants_a_charge_droit_ouvert_prestation_familiale_331) + try: + def local_var_463(acc_464:Decimal, enfant_465:Any): + match_arg_801 = log_end_call(["AllocationsFamiliales", + "prise_en_compte"], + log_variable_definition(["AllocationsFamiliales", + "prise_en_compte", "output"], + log_begin_call(["AllocationsFamiliales", + "prise_en_compte"], prise_en_compte_187, + log_variable_definition(["AllocationsFamiliales", + "prise_en_compte", "input"], + enfant_465)))) + if match_arg_801.code == PriseEnCompte_Code.Complete: + _ = match_arg_801.value + local_var_466 = decimal_of_string("1.") + elif match_arg_801.code == PriseEnCompte_Code.Partagee: + _ = match_arg_801.value + local_var_466 = decimal_of_string("0.5") + elif match_arg_801.code == PriseEnCompte_Code.Zero: + _ = match_arg_801.value + local_var_466 = decimal_of_string("0.") + return (acc_464 + local_var_466) + local_var_462 = list_fold_left(local_var_463, + decimal_of_string("0."), + enfants_a_charge_droit_ouvert_prestation_familiale_337) + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=114, start_column=12, end_line=114, end_column=32, - law_headings=["Prologue"])) - nombre_moyen_enfants_455 = log_variable_definition(["AllocationsFamiliales", - "nombre_moyen_enfants"], local_var_456) + start_line=114, start_column=12, end_line=114, end_column=32, + law_headings=["Prologue"])) + nombre_moyen_enfants_461 = log_variable_definition(["AllocationsFamiliales", + "nombre_moyen_enfants"], local_var_462) try: try: - local_var_465 = montant_initial_base_premier_enfant_141(Unit()) + local_var_471 = montant_initial_base_premier_enfant_143(Unit()) except EmptyError: try: - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=359, start_column=5, - end_line=360, end_column=71, - law_headings=["Article D755-5", - "Chapitre 5 : Prestations familiales et prestations assimilées", - "Titre 5 : Départements d'outre-mer", - "Livre 7 : Régimes divers - Dispositions diverses", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (prestations_familiales_dot_regime_outre_mer_l751_1_315 and - (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) == - integer_of_string("1")))): - local_var_465 = (prestations_familiales_dot_base_mensuelle_319 * - decimal_of_string("0.0588")) - else: - raise EmptyError + try: + if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=359, start_column=5, + end_line=360, end_column=71, + law_headings=["Article D755-5", + "Chapitre 5 : Prestations familiales et prestations assimilées", + "Titre 5 : Départements d'outre-mer", + "Livre 7 : Régimes divers - Dispositions diverses", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), (prestations_familiales_dot_regime_outre_mer_l751_1_320 and + (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) == + integer_of_string("1")))): + local_var_471 = (prestations_familiales_dot_base_mensuelle_324 * + decimal_of_string("0.0588")) + else: + raise EmptyError + except EmptyError: + local_var_471 = money_of_cents_string("0") except EmptyError: - local_var_465 = money_of_cents_string("0") + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=110, start_column=12, end_line=110, end_column=47, - law_headings=["Prologue"])) - montant_initial_base_premier_enfant_464 = log_variable_definition(["AllocationsFamiliales", - "montant_initial_base_premier_enfant"], local_var_465) + start_line=110, start_column=12, end_line=110, end_column=47, + law_headings=["Prologue"])) + montant_initial_base_premier_enfant_470 = log_variable_definition(["AllocationsFamiliales", + "montant_initial_base_premier_enfant"], local_var_471) try: try: - local_var_467 = droit_ouvert_base_139(Unit()) + local_var_473 = droit_ouvert_base_141(Unit()) except EmptyError: try: - def local_var_470(_: Any): + def local_var_476(_:Any): if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=406, start_column=5, - end_line=407, end_column=72, - law_headings=["Article L755-12", - "Chapitre 5 : Prestations familiales et prestations assimilées", - "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin", - "Livre 7 : Régimes divers - Dispositions diverses", - "Partie législative", - "Code de la sécurité sociale"]), (prestations_familiales_dot_regime_outre_mer_l751_1_315 and - (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) >= - integer_of_string("1")))): + start_line=406, start_column=5, + end_line=407, end_column=72, + law_headings=["Article L755-12", + "Chapitre 5 : Prestations familiales et prestations assimilées", + "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin", + "Livre 7 : Régimes divers - Dispositions diverses", + "Partie législative", + "Code de la sécurité sociale"]), (prestations_familiales_dot_regime_outre_mer_l751_1_320 and + (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) >= + integer_of_string("1")))): return True else: raise EmptyError - - def local_var_468(_: Any): + def local_var_474(_:Any): if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=344, start_column=5, - end_line=345, end_column=72, - law_headings=["Article 7", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((residence_179 == - Collectivite(Collectivite_Code.Mayotte, Unit())) and - (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) >= - integer_of_string("1")))): + start_line=344, start_column=5, + end_line=345, end_column=72, + law_headings=["Article 7", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((residence_181 == + Collectivite(Collectivite_Code.Mayotte, Unit())) and + (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) >= + integer_of_string("1")))): return True else: raise EmptyError - - def local_var_472(_: Any): + def local_var_478(_:Any): return log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=101, start_column=5, - end_line=101, end_column=70, - law_headings=["Article L521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) >= - integer_of_string("2"))) - - def local_var_474(_: Any): + start_line=101, start_column=5, + end_line=101, end_column=70, + law_headings=["Article L521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) >= + integer_of_string("2"))) + def local_var_480(_:Any): return True - local_var_467 = handle_default([local_var_468, - local_var_470], local_var_472, local_var_474) + local_var_473 = handle_default([local_var_474, + local_var_476], local_var_478, local_var_480) except EmptyError: - local_var_467 = False + local_var_473 = False except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=108, start_column=12, end_line=108, end_column=29, - law_headings=["Prologue"])) - droit_ouvert_base_466 = log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_base"], local_var_467) + start_line=108, start_column=12, end_line=108, end_column=29, + law_headings=["Prologue"])) + droit_ouvert_base_472 = log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_base"], local_var_473) try: try: - local_var_477 = droit_ouvert_majoration_157(Unit()) + local_var_483 = droit_ouvert_majoration_159(Unit()) except EmptyError: - def local_var_477(param_478: Enfant): + def local_var_483(param_484:Enfant): try: try: try: if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=313, start_column=5, - end_line=315, end_column=58, - law_headings=["Article L521-3", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), ((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) >= - nombre_enfants_alinea_2_l521_3_283) and - (param_478.age >= - log_end_call(["AllocationsFamiliales", - "âge_minimum_alinéa_1_l521_3"], - log_variable_definition(["AllocationsFamiliales", - "âge_minimum_alinéa_1_l521_3", "output"], - log_begin_call(["AllocationsFamiliales", - "âge_minimum_alinéa_1_l521_3"], - age_minimum_alinea_1_l521_3_328, - log_variable_definition(["AllocationsFamiliales", - "âge_minimum_alinéa_1_l521_3", "input"], - param_478))))))): + start_line=313, start_column=5, + end_line=315, end_column=58, + law_headings=["Article L521-3", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), ((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) >= + nombre_enfants_alinea_2_l521_3_285) and + (param_484.age >= + log_end_call(["AllocationsFamiliales", + "âge_minimum_alinéa_1_l521_3"], + log_variable_definition(["AllocationsFamiliales", + "âge_minimum_alinéa_1_l521_3", "output"], + log_begin_call(["AllocationsFamiliales", + "âge_minimum_alinéa_1_l521_3"], + age_minimum_alinea_1_l521_3_334, + log_variable_definition(["AllocationsFamiliales", + "âge_minimum_alinéa_1_l521_3", "input"], + param_484))))))): return True else: raise EmptyError except EmptyError: if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=299, start_column=5, - end_line=300, end_column=58, - law_headings=["Article L521-3", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), (not log_end_call(["AllocationsFamiliales", - "est_enfant_le_plus_âgé"], - log_variable_definition(["AllocationsFamiliales", - "est_enfant_le_plus_âgé", "output"], - log_begin_call(["AllocationsFamiliales", - "est_enfant_le_plus_âgé"], - est_enfant_le_plus_age_335, - log_variable_definition(["AllocationsFamiliales", - "est_enfant_le_plus_âgé", "input"], - param_478)))) and (param_478.age >= - log_end_call(["AllocationsFamiliales", - "âge_minimum_alinéa_1_l521_3"], - log_variable_definition(["AllocationsFamiliales", - "âge_minimum_alinéa_1_l521_3", "output"], - log_begin_call(["AllocationsFamiliales", - "âge_minimum_alinéa_1_l521_3"], - age_minimum_alinea_1_l521_3_328, - log_variable_definition(["AllocationsFamiliales", - "âge_minimum_alinéa_1_l521_3", "input"], - param_478))))))): + start_line=299, start_column=5, + end_line=300, end_column=58, + law_headings=["Article L521-3", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), (not log_end_call(["AllocationsFamiliales", + "est_enfant_le_plus_âgé"], + log_variable_definition(["AllocationsFamiliales", + "est_enfant_le_plus_âgé", "output"], + log_begin_call(["AllocationsFamiliales", + "est_enfant_le_plus_âgé"], + est_enfant_le_plus_age_341, + log_variable_definition(["AllocationsFamiliales", + "est_enfant_le_plus_âgé", "input"], + param_484)))) and (param_484.age >= + log_end_call(["AllocationsFamiliales", + "âge_minimum_alinéa_1_l521_3"], + log_variable_definition(["AllocationsFamiliales", + "âge_minimum_alinéa_1_l521_3", "output"], + log_begin_call(["AllocationsFamiliales", + "âge_minimum_alinéa_1_l521_3"], + age_minimum_alinea_1_l521_3_334, + log_variable_definition(["AllocationsFamiliales", + "âge_minimum_alinéa_1_l521_3", "input"], + param_484))))))): return True else: raise EmptyError @@ -3137,1324 +3207,1359 @@ def local_var_477(param_478: Enfant): return False except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=132, start_column=12, end_line=132, - end_column=35, law_headings=["Prologue"])) + start_line=132, start_column=12, end_line=132, + end_column=35, law_headings=["Prologue"])) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=132, start_column=12, end_line=132, end_column=35, - law_headings=["Prologue"])) - droit_ouvert_majoration_476 = log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration"], local_var_477) + start_line=132, start_column=12, end_line=132, end_column=35, + law_headings=["Prologue"])) + droit_ouvert_majoration_482 = log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_majoration"], local_var_483) try: try: - local_var_480 = complement_degressif_164(Unit()) + local_var_486 = complement_degressif_166(Unit()) except EmptyError: - def local_var_480(param_481: Money): + def local_var_486(param_487:Money): try: - def local_var_484(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=162, start_column=5, - end_line=163, end_column=68, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), ((ressources_menage_177 > - plafond__i_d521_3_352) and - (ressources_menage_177 <= - (plafond__i_d521_3_352 + (param_481 * - decimal_of_string("12.")))))): - return ((plafond__i_d521_3_352 + ((param_481 * - decimal_of_string("12.")) - - ressources_menage_177)) * + try: + def local_var_490(_:Any): + if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=162, start_column=5, + end_line=163, end_column=68, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), ((ressources_menage_179 > + plafond__i_d521_3_358) and + (ressources_menage_179 <= + (plafond__i_d521_3_358 + (param_487 * + decimal_of_string("12.")))))): + return ((plafond__i_d521_3_358 + + ((param_487 * decimal_of_string("12.")) - + ressources_menage_179)) * (decimal_of_string("1.") / - decimal_of_string("12."))) - else: - raise EmptyError - - def local_var_482(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=170, start_column=5, - end_line=171, end_column=68, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), ((ressources_menage_177 > - plafond__i_i_d521_3_338) and - (ressources_menage_177 <= - (plafond__i_i_d521_3_338 + (param_481 * - decimal_of_string("12.")))))): - return ((plafond__i_i_d521_3_338 + ((param_481 * - decimal_of_string("12.")) - - ressources_menage_177)) * + decimal_of_string("12."))) + else: + raise EmptyError + def local_var_488(_:Any): + if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=170, start_column=5, + end_line=171, end_column=68, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), ((ressources_menage_179 > + plafond__i_i_d521_3_344) and + (ressources_menage_179 <= + (plafond__i_i_d521_3_344 + (param_487 * + decimal_of_string("12.")))))): + return ((plafond__i_i_d521_3_344 + + ((param_487 * decimal_of_string("12.")) - + ressources_menage_179)) * (decimal_of_string("1.") / - decimal_of_string("12."))) - else: - raise EmptyError - - def local_var_486(_: Any): - return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=176, start_column=14, - end_line=176, end_column=34, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), True) - - def local_var_488(_: Any): - return money_of_cents_string("0") - return handle_default([local_var_482, local_var_484], - local_var_486, local_var_488) + decimal_of_string("12."))) + else: + raise EmptyError + def local_var_492(_:Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=176, start_column=14, + end_line=176, end_column=34, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), True) + def local_var_494(_:Any): + return money_of_cents_string("0") + return handle_default([local_var_488, local_var_490], + local_var_492, local_var_494) + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=141, start_column=12, end_line=141, - end_column=32, law_headings=["Prologue"])) + start_line=141, start_column=12, end_line=141, + end_column=32, law_headings=["Prologue"])) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=141, start_column=12, end_line=141, end_column=32, - law_headings=["Prologue"])) - complement_degressif_479 = log_variable_definition(["AllocationsFamiliales", - "complément_dégressif"], local_var_480) + start_line=141, start_column=12, end_line=141, end_column=32, + law_headings=["Prologue"])) + complement_degressif_485 = log_variable_definition(["AllocationsFamiliales", + "complément_dégressif"], local_var_486) try: try: - local_var_491 = montant_verse_forfaitaire_par_enfant_155(Unit()) + local_var_497 = montant_verse_forfaitaire_par_enfant_157(Unit()) except EmptyError: - def local_var_496(_: Any): + def local_var_502(_:Any): if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=215, start_column=5, - end_line=215, end_column=43, - law_headings=["Article D521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (ressources_menage_177 <= - plafond__i_d521_3_352)): - return (prestations_familiales_dot_base_mensuelle_319 * - decimal_of_string("0.20234")) + start_line=215, start_column=5, + end_line=215, end_column=43, + law_headings=["Article D521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), (ressources_menage_179 <= + plafond__i_d521_3_358)): + return (prestations_familiales_dot_base_mensuelle_324 * + decimal_of_string("0.20234")) else: raise EmptyError - - def local_var_494(_: Any): + def local_var_500(_:Any): if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=229, start_column=5, - end_line=230, end_column=46, - law_headings=["Article D521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), ((ressources_menage_177 > - plafond__i_d521_3_352) and (ressources_menage_177 <= - plafond__i_i_d521_3_338))): - return (prestations_familiales_dot_base_mensuelle_319 * - decimal_of_string("0.1117")) + start_line=229, start_column=5, + end_line=230, end_column=46, + law_headings=["Article D521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), ((ressources_menage_179 > + plafond__i_d521_3_358) and (ressources_menage_179 <= + plafond__i_i_d521_3_344))): + return (prestations_familiales_dot_base_mensuelle_324 * + decimal_of_string("0.1117")) else: raise EmptyError - - def local_var_492(_: Any): + def local_var_498(_:Any): if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=243, start_column=5, - end_line=243, end_column=43, - law_headings=["Article D521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (ressources_menage_177 > - plafond__i_i_d521_3_338)): - return (prestations_familiales_dot_base_mensuelle_319 * - decimal_of_string("0.0559")) + start_line=243, start_column=5, + end_line=243, end_column=43, + law_headings=["Article D521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), (ressources_menage_179 > + plafond__i_i_d521_3_344)): + return (prestations_familiales_dot_base_mensuelle_324 * + decimal_of_string("0.0559")) else: raise EmptyError - - def local_var_498(_: Any): + def local_var_504(_:Any): return log_decision_taken(SourcePosition(filename="", - start_line=0, start_column=1, end_line=0, end_column=1, - law_headings=[]), False) - - def local_var_500(_: Any): + start_line=0, start_column=1, end_line=0, end_column=1, + law_headings=[]), False) + def local_var_506(_:Any): raise EmptyError - local_var_491 = handle_default([local_var_492, local_var_494, - local_var_496], local_var_498, local_var_500) + local_var_497 = handle_default([local_var_498, local_var_500, + local_var_502], local_var_504, local_var_506) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=128, start_column=12, end_line=128, end_column=48, - law_headings=["Prologue"])) - montant_verse_forfaitaire_par_enfant_490 = log_variable_definition(["AllocationsFamiliales", - "montant_versé_forfaitaire_par_enfant"], local_var_491) + start_line=128, start_column=12, end_line=128, end_column=48, + law_headings=["Prologue"])) + montant_verse_forfaitaire_par_enfant_496 = log_variable_definition(["AllocationsFamiliales", + "montant_versé_forfaitaire_par_enfant"], local_var_497) try: try: - local_var_503 = montant_initial_base_troisieme_enfant_et_plus_143( - Unit()) + local_var_509 = montant_initial_base_troisieme_enfant_et_plus_145(Unit()) except EmptyError: - def local_var_508(_: Any): + def local_var_514(_:Any): if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=35, start_column=3, - end_line=35, end_column=41, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (ressources_menage_177 <= - plafond__i_d521_3_352)): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > - integer_of_string("2")): - return ((prestations_familiales_dot_base_mensuelle_319 * - decimal_of_string("0.41")) * - decimal_of_integer((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) - - integer_of_string("2")))) + start_line=35, start_column=3, + end_line=35, end_column=41, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), (ressources_menage_179 <= + plafond__i_d521_3_358)): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > + integer_of_string("2")): + return ((prestations_familiales_dot_base_mensuelle_324 * + decimal_of_string("0.41")) * + decimal_of_integer((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) - + integer_of_string("2")))) else: return money_of_cents_string("0") else: raise EmptyError - - def local_var_506(_: Any): + def local_var_512(_:Any): if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=74, start_column=3, - end_line=75, end_column=44, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), ((ressources_menage_177 > - plafond__i_d521_3_352) and (ressources_menage_177 <= - plafond__i_i_d521_3_338))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > - integer_of_string("2")): - return ((prestations_familiales_dot_base_mensuelle_319 * - decimal_of_string("0.205")) * - decimal_of_integer((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) - - integer_of_string("2")))) + start_line=74, start_column=3, + end_line=75, end_column=44, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), ((ressources_menage_179 > + plafond__i_d521_3_358) and (ressources_menage_179 <= + plafond__i_i_d521_3_344))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > + integer_of_string("2")): + return ((prestations_familiales_dot_base_mensuelle_324 * + decimal_of_string("0.205")) * + decimal_of_integer((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) - + integer_of_string("2")))) else: return money_of_cents_string("0") else: raise EmptyError - - def local_var_504(_: Any): + def local_var_510(_:Any): if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=113, start_column=3, - end_line=113, end_column=41, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (ressources_menage_177 > - plafond__i_i_d521_3_338)): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > - integer_of_string("2")): - return ((prestations_familiales_dot_base_mensuelle_319 * - decimal_of_string("0.1025")) * - decimal_of_integer((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) - - integer_of_string("2")))) + start_line=113, start_column=3, + end_line=113, end_column=41, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), (ressources_menage_179 > + plafond__i_i_d521_3_344)): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > + integer_of_string("2")): + return ((prestations_familiales_dot_base_mensuelle_324 * + decimal_of_string("0.1025")) * + decimal_of_integer((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) - + integer_of_string("2")))) else: return money_of_cents_string("0") else: raise EmptyError - - def local_var_510(_: Any): + def local_var_516(_:Any): return log_decision_taken(SourcePosition(filename="", - start_line=0, start_column=1, end_line=0, end_column=1, - law_headings=[]), False) - - def local_var_512(_: Any): + start_line=0, start_column=1, end_line=0, end_column=1, + law_headings=[]), False) + def local_var_518(_:Any): raise EmptyError - local_var_503 = handle_default([local_var_504, local_var_506, - local_var_508], local_var_510, local_var_512) + local_var_509 = handle_default([local_var_510, local_var_512, + local_var_514], local_var_516, local_var_518) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=112, start_column=12, end_line=112, end_column=57, - law_headings=["Prologue"])) - montant_initial_base_troisieme_enfant_et_plus_502 = log_variable_definition(["AllocationsFamiliales", - "montant_initial_base_troisième_enfant_et_plus"], local_var_503) + start_line=112, start_column=12, end_line=112, end_column=57, + law_headings=["Prologue"])) + montant_initial_base_troisieme_enfant_et_plus_508 = log_variable_definition(["AllocationsFamiliales", + "montant_initial_base_troisième_enfant_et_plus"], local_var_509) try: try: - local_var_515 = montant_initial_base_deuxieme_enfant_142(Unit()) + local_var_521 = montant_initial_base_deuxieme_enfant_144(Unit()) except EmptyError: - def local_var_520(_: Any): + def local_var_526(_:Any): if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=35, start_column=3, - end_line=35, end_column=41, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (ressources_menage_177 <= - plafond__i_d521_3_352)): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > - integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_319 * - decimal_of_string("0.32")) + start_line=35, start_column=3, + end_line=35, end_column=41, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), (ressources_menage_179 <= + plafond__i_d521_3_358)): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > + integer_of_string("1")): + return (prestations_familiales_dot_base_mensuelle_324 * + decimal_of_string("0.32")) else: return money_of_cents_string("0") else: raise EmptyError - - def local_var_518(_: Any): + def local_var_524(_:Any): if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=74, start_column=3, - end_line=75, end_column=44, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), ((ressources_menage_177 > - plafond__i_d521_3_352) and (ressources_menage_177 <= - plafond__i_i_d521_3_338))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > - integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_319 * - decimal_of_string("0.16")) + start_line=74, start_column=3, + end_line=75, end_column=44, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), ((ressources_menage_179 > + plafond__i_d521_3_358) and (ressources_menage_179 <= + plafond__i_i_d521_3_344))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > + integer_of_string("1")): + return (prestations_familiales_dot_base_mensuelle_324 * + decimal_of_string("0.16")) else: return money_of_cents_string("0") else: raise EmptyError - - def local_var_516(_: Any): + def local_var_522(_:Any): if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=113, start_column=3, - end_line=113, end_column=41, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (ressources_menage_177 > - plafond__i_i_d521_3_338)): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) > - integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_319 * - decimal_of_string("0.08")) + start_line=113, start_column=3, + end_line=113, end_column=41, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), (ressources_menage_179 > + plafond__i_i_d521_3_344)): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > + integer_of_string("1")): + return (prestations_familiales_dot_base_mensuelle_324 * + decimal_of_string("0.08")) else: return money_of_cents_string("0") else: raise EmptyError - - def local_var_522(_: Any): + def local_var_528(_:Any): return log_decision_taken(SourcePosition(filename="", - start_line=0, start_column=1, end_line=0, end_column=1, - law_headings=[]), False) - - def local_var_524(_: Any): + start_line=0, start_column=1, end_line=0, end_column=1, + law_headings=[]), False) + def local_var_530(_:Any): raise EmptyError - local_var_515 = handle_default([local_var_516, local_var_518, - local_var_520], local_var_522, local_var_524) + local_var_521 = handle_default([local_var_522, local_var_524, + local_var_526], local_var_528, local_var_530) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=111, start_column=12, end_line=111, end_column=48, - law_headings=["Prologue"])) - montant_initial_base_deuxieme_enfant_514 = log_variable_definition(["AllocationsFamiliales", - "montant_initial_base_deuxième_enfant"], local_var_515) + start_line=111, start_column=12, end_line=111, end_column=48, + law_headings=["Prologue"])) + montant_initial_base_deuxieme_enfant_520 = log_variable_definition(["AllocationsFamiliales", + "montant_initial_base_deuxième_enfant"], local_var_521) try: try: - local_var_527 = rapport_enfants_total_moyen_144(Unit()) + local_var_533 = rapport_enfants_total_moyen_146(Unit()) except EmptyError: - if (nombre_total_enfants_453 == + try: + if (nombre_total_enfants_459 == decimal_of_string("0.")): - local_var_527 = decimal_of_string("0.") - else: - local_var_527 = (nombre_moyen_enfants_455 / - nombre_total_enfants_453) + local_var_533 = decimal_of_string("0.") + else: + local_var_533 = (nombre_moyen_enfants_461 / + nombre_total_enfants_459) + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=113, start_column=12, end_line=113, end_column=39, - law_headings=["Prologue"])) - rapport_enfants_total_moyen_526 = log_variable_definition(["AllocationsFamiliales", - "rapport_enfants_total_moyen"], local_var_527) + start_line=113, start_column=12, end_line=113, end_column=39, + law_headings=["Prologue"])) + rapport_enfants_total_moyen_532 = log_variable_definition(["AllocationsFamiliales", + "rapport_enfants_total_moyen"], local_var_533) try: try: - local_var_529 = montant_initial_metropole_majoration_158(Unit()) + local_var_535 = montant_initial_metropole_majoration_160(Unit()) except EmptyError: - def local_var_529(param_530: Enfant): + def local_var_535(param_536:Enfant): try: - def local_var_537(_: Any): + def local_var_543(_:Any): if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=55, start_column=3, - end_line=55, end_column=41, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), ((ressources_menage_177 <= - plafond__i_d521_3_352) and - log_end_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "output"], - log_begin_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - droit_ouvert_majoration_476, - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "input"], - param_530)))))): - return (prestations_familiales_dot_base_mensuelle_319 * - decimal_of_string("0.16")) + start_line=55, start_column=3, + end_line=55, end_column=41, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), ((ressources_menage_179 <= + plafond__i_d521_3_358) and + log_end_call(["AllocationsFamiliales", + "droit_ouvert_majoration"], + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_majoration", "output"], + log_begin_call(["AllocationsFamiliales", + "droit_ouvert_majoration"], + droit_ouvert_majoration_482, + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_majoration", "input"], + param_536)))))): + return (prestations_familiales_dot_base_mensuelle_324 * + decimal_of_string("0.16")) else: raise EmptyError - - def local_var_535(_: Any): + def local_var_541(_:Any): if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=95, start_column=3, - end_line=96, end_column=44, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (((ressources_menage_177 > - plafond__i_d521_3_352) and - (ressources_menage_177 <= - plafond__i_i_d521_3_338)) and - log_end_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "output"], - log_begin_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - droit_ouvert_majoration_476, - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "input"], - param_530)))))): - return (prestations_familiales_dot_base_mensuelle_319 * - decimal_of_string("0.08")) + start_line=95, start_column=3, + end_line=96, end_column=44, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), (((ressources_menage_179 > + plafond__i_d521_3_358) and + (ressources_menage_179 <= + plafond__i_i_d521_3_344)) and + log_end_call(["AllocationsFamiliales", + "droit_ouvert_majoration"], + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_majoration", "output"], + log_begin_call(["AllocationsFamiliales", + "droit_ouvert_majoration"], + droit_ouvert_majoration_482, + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_majoration", "input"], + param_536)))))): + return (prestations_familiales_dot_base_mensuelle_324 * + decimal_of_string("0.08")) else: raise EmptyError - - def local_var_533(_: Any): + def local_var_539(_:Any): if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=132, start_column=3, - end_line=132, end_column=41, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), ((ressources_menage_177 > - plafond__i_i_d521_3_338) and - log_end_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "output"], - log_begin_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - droit_ouvert_majoration_476, - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "input"], - param_530)))))): - return (prestations_familiales_dot_base_mensuelle_319 * - decimal_of_string("0.04")) + start_line=132, start_column=3, + end_line=132, end_column=41, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), ((ressources_menage_179 > + plafond__i_i_d521_3_344) and + log_end_call(["AllocationsFamiliales", + "droit_ouvert_majoration"], + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_majoration", "output"], + log_begin_call(["AllocationsFamiliales", + "droit_ouvert_majoration"], + droit_ouvert_majoration_482, + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_majoration", "input"], + param_536)))))): + return (prestations_familiales_dot_base_mensuelle_324 * + decimal_of_string("0.04")) else: raise EmptyError - - def local_var_531(_: Any): + def local_var_537(_:Any): if log_decision_taken(SourcePosition(filename="./epilogue.catala_fr", - start_line=27, start_column=5, - end_line=27, end_column=44, - law_headings=["Règles diverses", "Épilogue", - "Décrets divers"]), not log_end_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "output"], - log_begin_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - droit_ouvert_majoration_476, - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "input"], - param_530))))): + start_line=27, start_column=5, + end_line=27, end_column=44, + law_headings=["Règles diverses", "Épilogue", + "Décrets divers"]), not log_end_call(["AllocationsFamiliales", + "droit_ouvert_majoration"], + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_majoration", "output"], + log_begin_call(["AllocationsFamiliales", + "droit_ouvert_majoration"], + droit_ouvert_majoration_482, + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_majoration", "input"], + param_536))))): return money_of_cents_string("0") else: raise EmptyError - - def local_var_539(_: Any): + def local_var_545(_:Any): return log_decision_taken(SourcePosition(filename="", - start_line=0, start_column=1, - end_line=0, end_column=1, - law_headings=[]), False) - - def local_var_541(_: Any): + start_line=0, start_column=1, + end_line=0, end_column=1, + law_headings=[]), False) + def local_var_547(_:Any): raise EmptyError - return handle_default([local_var_531, local_var_533, - local_var_535, local_var_537], local_var_539, - local_var_541) + return handle_default([local_var_537, local_var_539, + local_var_541, local_var_543], local_var_545, + local_var_547) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=133, start_column=12, end_line=133, - end_column=48, law_headings=["Prologue"])) + start_line=133, start_column=12, end_line=133, + end_column=48, law_headings=["Prologue"])) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=133, start_column=12, end_line=133, end_column=48, - law_headings=["Prologue"])) - montant_initial_metropole_majoration_528 = log_variable_definition(["AllocationsFamiliales", - "montant_initial_métropole_majoration"], local_var_529) + start_line=133, start_column=12, end_line=133, end_column=48, + law_headings=["Prologue"])) + montant_initial_metropole_majoration_534 = log_variable_definition(["AllocationsFamiliales", + "montant_initial_métropole_majoration"], local_var_535) try: try: - local_var_544 = montant_verse_forfaitaire_156(Unit()) + local_var_550 = montant_verse_forfaitaire_158(Unit()) except EmptyError: - def local_var_545(acc_546: Integer, enfant_547: Any): - if log_end_call(["AllocationsFamiliales", - "droit_ouvert_forfaitaire"], - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_forfaitaire", "output"], - log_begin_call(["AllocationsFamiliales", - "droit_ouvert_forfaitaire"], - droit_ouvert_forfaitaire_368, - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_forfaitaire", "input"], - enfant_547)))): - return (acc_546 + integer_of_string("1")) - else: - return acc_546 - local_var_544 = (montant_verse_forfaitaire_par_enfant_490 * - decimal_of_integer(list_fold_left(local_var_545, - integer_of_string("0"), enfants_a_charge_183))) + try: + def local_var_551(acc_552:Integer, enfant_553:Any): + if log_end_call(["AllocationsFamiliales", + "droit_ouvert_forfaitaire"], + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_forfaitaire", "output"], + log_begin_call(["AllocationsFamiliales", + "droit_ouvert_forfaitaire"], + droit_ouvert_forfaitaire_374, + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_forfaitaire", "input"], + enfant_553)))): + return (acc_552 + integer_of_string("1")) + else: + return acc_552 + local_var_550 = (montant_verse_forfaitaire_par_enfant_496 * + decimal_of_integer(list_fold_left(local_var_551, + integer_of_string("0"), enfants_a_charge_185))) + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=129, start_column=12, end_line=129, end_column=37, - law_headings=["Prologue"])) - montant_verse_forfaitaire_543 = log_variable_definition(["AllocationsFamiliales", - "montant_versé_forfaitaire"], local_var_544) + start_line=129, start_column=12, end_line=129, end_column=37, + law_headings=["Prologue"])) + montant_verse_forfaitaire_549 = log_variable_definition(["AllocationsFamiliales", + "montant_versé_forfaitaire"], local_var_550) try: try: - local_var_549 = montant_initial_base_140(Unit()) + local_var_555 = montant_initial_base_142(Unit()) except EmptyError: - def local_var_552(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=350, start_column=5, - end_line=351, end_column=69, - law_headings=["Article D755-5", - "Chapitre 5 : Prestations familiales et prestations assimilées", - "Titre 5 : Départements d'outre-mer", - "Livre 7 : Régimes divers - Dispositions diverses", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (prestations_familiales_dot_regime_outre_mer_l751_1_315 and - (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) == - integer_of_string("1")))): - return montant_initial_base_premier_enfant_464 - else: - raise EmptyError - - def local_var_550(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=335, start_column=5, - end_line=335, end_column=24, law_headings=["Article 7", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), (residence_179 == - Collectivite(Collectivite_Code.Mayotte, - Unit()))): - return (montant_initial_base_premier_enfant_mayotte_425 + - (montant_initial_base_deuxieme_enfant_mayotte_399 + - (montant_initial_base_troisieme_enfant_mayotte_373 + - montant_initial_base_quatrieme_enfant_et_plus_mayotte_371))) - else: - raise EmptyError - - def local_var_554(_: Any): - return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=18, start_column=14, - end_line=18, end_column=34, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), True) - - def local_var_556(_: Any): - return (montant_initial_base_deuxieme_enfant_514 + - montant_initial_base_troisieme_enfant_et_plus_502) - local_var_549 = handle_default([local_var_550, local_var_552], - local_var_554, local_var_556) + try: + def local_var_558(_:Any): + if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=350, start_column=5, + end_line=351, end_column=69, + law_headings=["Article D755-5", + "Chapitre 5 : Prestations familiales et prestations assimilées", + "Titre 5 : Départements d'outre-mer", + "Livre 7 : Régimes divers - Dispositions diverses", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), (prestations_familiales_dot_regime_outre_mer_l751_1_320 and + (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) == + integer_of_string("1")))): + return montant_initial_base_premier_enfant_470 + else: + raise EmptyError + def local_var_556(_:Any): + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=335, start_column=5, + end_line=335, end_column=24, + law_headings=["Article 7", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), (residence_181 == + Collectivite(Collectivite_Code.Mayotte, + Unit()))): + return (montant_initial_base_premier_enfant_mayotte_431 + + (montant_initial_base_deuxieme_enfant_mayotte_405 + + (montant_initial_base_troisieme_enfant_mayotte_379 + + montant_initial_base_quatrieme_enfant_et_plus_mayotte_377))) + else: + raise EmptyError + def local_var_560(_:Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=18, start_column=14, + end_line=18, end_column=34, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), True) + def local_var_562(_:Any): + return (montant_initial_base_deuxieme_enfant_520 + + montant_initial_base_troisieme_enfant_et_plus_508) + local_var_555 = handle_default([local_var_556, + local_var_558], local_var_560, local_var_562) + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=109, start_column=12, end_line=109, end_column=32, - law_headings=["Prologue"])) - montant_initial_base_548 = log_variable_definition(["AllocationsFamiliales", - "montant_initial_base"], local_var_549) + start_line=109, start_column=12, end_line=109, end_column=32, + law_headings=["Prologue"])) + montant_initial_base_554 = log_variable_definition(["AllocationsFamiliales", + "montant_initial_base"], local_var_555) try: try: - local_var_559 = montant_initial_majoration_159(Unit()) + local_var_565 = montant_initial_majoration_161(Unit()) except EmptyError: - def local_var_559(param_560: Enfant): + def local_var_565(param_566:Enfant): try: - def local_var_563(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=373, start_column=5, - end_line=376, end_column=42, - law_headings=["Article D755-5", - "Chapitre 5 : Prestations familiales et prestations assimilées", - "Titre 5 : Départements d'outre-mer", - "Livre 7 : Régimes divers - Dispositions diverses", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (log_end_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "output"], - log_begin_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - droit_ouvert_majoration_476, - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "input"], - param_560)))) and - (prestations_familiales_dot_regime_outre_mer_l751_1_315 and - ((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) == - integer_of_string("1")) and ((param_560.age >= - integer_of_string("11")) and (param_560.age < - integer_of_string("16"))))))): - return (prestations_familiales_dot_base_mensuelle_319 * + try: + def local_var_569(_:Any): + if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=373, start_column=5, + end_line=376, end_column=42, + law_headings=["Article D755-5", + "Chapitre 5 : Prestations familiales et prestations assimilées", + "Titre 5 : Départements d'outre-mer", + "Livre 7 : Régimes divers - Dispositions diverses", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), (log_end_call(["AllocationsFamiliales", + "droit_ouvert_majoration"], + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_majoration", "output"], + log_begin_call(["AllocationsFamiliales", + "droit_ouvert_majoration"], + droit_ouvert_majoration_482, + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_majoration", "input"], + param_566)))) and + (prestations_familiales_dot_regime_outre_mer_l751_1_320 and + ((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) == + integer_of_string("1")) and + ((param_566.age >= + integer_of_string("11")) and (param_566.age < + integer_of_string("16"))))))): + return (prestations_familiales_dot_base_mensuelle_324 * decimal_of_string("0.0369")) - else: - raise EmptyError - - def local_var_561(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=382, start_column=5, - end_line=385, end_column=23, - law_headings=["Article D755-5", - "Chapitre 5 : Prestations familiales et prestations assimilées", - "Titre 5 : Départements d'outre-mer", - "Livre 7 : Régimes divers - Dispositions diverses", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (log_end_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "output"], - log_begin_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - droit_ouvert_majoration_476, - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "input"], - param_560)))) and - (prestations_familiales_dot_regime_outre_mer_l751_1_315 and - ((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_331) == - integer_of_string("1")) and (param_560.age >= - integer_of_string("16")))))): - return (prestations_familiales_dot_base_mensuelle_319 * + else: + raise EmptyError + def local_var_567(_:Any): + if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=382, start_column=5, + end_line=385, end_column=23, + law_headings=["Article D755-5", + "Chapitre 5 : Prestations familiales et prestations assimilées", + "Titre 5 : Départements d'outre-mer", + "Livre 7 : Régimes divers - Dispositions diverses", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), (log_end_call(["AllocationsFamiliales", + "droit_ouvert_majoration"], + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_majoration", "output"], + log_begin_call(["AllocationsFamiliales", + "droit_ouvert_majoration"], + droit_ouvert_majoration_482, + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_majoration", "input"], + param_566)))) and + (prestations_familiales_dot_regime_outre_mer_l751_1_320 and + ((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) == + integer_of_string("1")) and (param_566.age >= + integer_of_string("16")))))): + return (prestations_familiales_dot_base_mensuelle_324 * decimal_of_string("0.0567")) - else: - raise EmptyError - - def local_var_565(_: Any): - return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=22, start_column=14, - end_line=22, end_column=40, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), True) - - def local_var_567(_: Any): - return log_end_call(["AllocationsFamiliales", - "montant_initial_métropole_majoration"], - log_variable_definition(["AllocationsFamiliales", - "montant_initial_métropole_majoration", - "output"], - log_begin_call(["AllocationsFamiliales", - "montant_initial_métropole_majoration"], - montant_initial_metropole_majoration_528, - log_variable_definition(["AllocationsFamiliales", - "montant_initial_métropole_majoration", - "input"], param_560)))) - return handle_default([local_var_561, local_var_563], - local_var_565, local_var_567) + else: + raise EmptyError + def local_var_571(_:Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=22, start_column=14, + end_line=22, end_column=40, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), True) + def local_var_573(_:Any): + return log_end_call(["AllocationsFamiliales", + "montant_initial_métropole_majoration"], + log_variable_definition(["AllocationsFamiliales", + "montant_initial_métropole_majoration", + "output"], + log_begin_call(["AllocationsFamiliales", + "montant_initial_métropole_majoration"], + montant_initial_metropole_majoration_534, + log_variable_definition(["AllocationsFamiliales", + "montant_initial_métropole_majoration", + "input"], param_566)))) + return handle_default([local_var_567, local_var_569], + local_var_571, local_var_573) + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=134, start_column=12, end_line=134, - end_column=38, law_headings=["Prologue"])) + start_line=134, start_column=12, end_line=134, + end_column=38, law_headings=["Prologue"])) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=134, start_column=12, end_line=134, end_column=38, - law_headings=["Prologue"])) - montant_initial_majoration_558 = log_variable_definition(["AllocationsFamiliales", - "montant_initial_majoration"], local_var_559) + start_line=134, start_column=12, end_line=134, end_column=38, + law_headings=["Prologue"])) + montant_initial_majoration_564 = log_variable_definition(["AllocationsFamiliales", + "montant_initial_majoration"], local_var_565) try: try: - local_var_570 = montant_verse_complement_pour_forfaitaire_166( - Unit()) + local_var_576 = montant_verse_complement_pour_forfaitaire_168(Unit()) except EmptyError: - def local_var_573(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=262, start_column=5, - end_line=264, end_column=42, - law_headings=["Article D521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), ((ressources_menage_177 > - plafond__i_d521_3_352) and (ressources_menage_177 <= - (plafond__i_d521_3_352 + (montant_verse_forfaitaire_543 * - decimal_of_string("12.")))))): - return ((plafond__i_d521_3_352 + - ((montant_verse_forfaitaire_543 * - decimal_of_string("12.")) - ressources_menage_177)) * - (decimal_of_string("1.") / decimal_of_string("12."))) - else: - raise EmptyError - - def local_var_571(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=272, start_column=5, - end_line=274, end_column=41, - law_headings=["Article D521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), ((ressources_menage_177 > - plafond__i_i_d521_3_338) and (ressources_menage_177 <= - (plafond__i_i_d521_3_338 + - (montant_verse_forfaitaire_543 * - decimal_of_string("12.")))))): - return ((plafond__i_i_d521_3_338 + - ((montant_verse_forfaitaire_543 * - decimal_of_string("12.")) - ressources_menage_177)) * - (decimal_of_string("1.") / decimal_of_string("12."))) - else: - raise EmptyError - - def local_var_575(_: Any): - return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=280, start_column=14, - end_line=280, end_column=55, - law_headings=["Article D521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), True) - - def local_var_577(_: Any): - return money_of_cents_string("0") - local_var_570 = handle_default([local_var_571, local_var_573], - local_var_575, local_var_577) + try: + def local_var_579(_:Any): + if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=262, start_column=5, + end_line=264, end_column=42, + law_headings=["Article D521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), ((ressources_menage_179 > + plafond__i_d521_3_358) and (ressources_menage_179 <= + (plafond__i_d521_3_358 + + (montant_verse_forfaitaire_549 * + decimal_of_string("12.")))))): + return ((plafond__i_d521_3_358 + + ((montant_verse_forfaitaire_549 * + decimal_of_string("12.")) - + ressources_menage_179)) * + (decimal_of_string("1.") / + decimal_of_string("12."))) + else: + raise EmptyError + def local_var_577(_:Any): + if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=272, start_column=5, + end_line=274, end_column=41, + law_headings=["Article D521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), ((ressources_menage_179 > + plafond__i_i_d521_3_344) and + (ressources_menage_179 <= (plafond__i_i_d521_3_344 + + (montant_verse_forfaitaire_549 * + decimal_of_string("12.")))))): + return ((plafond__i_i_d521_3_344 + + ((montant_verse_forfaitaire_549 * + decimal_of_string("12.")) - + ressources_menage_179)) * + (decimal_of_string("1.") / + decimal_of_string("12."))) + else: + raise EmptyError + def local_var_581(_:Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=280, start_column=14, + end_line=280, end_column=55, + law_headings=["Article D521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), True) + def local_var_583(_:Any): + return money_of_cents_string("0") + local_var_576 = handle_default([local_var_577, + local_var_579], local_var_581, local_var_583) + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=143, start_column=12, end_line=143, end_column=53, - law_headings=["Prologue"])) - montant_verse_complement_pour_forfaitaire_569 = log_variable_definition(["AllocationsFamiliales", - "montant_versé_complément_pour_forfaitaire"], local_var_570) + start_line=143, start_column=12, end_line=143, end_column=53, + law_headings=["Prologue"])) + montant_verse_complement_pour_forfaitaire_575 = log_variable_definition(["AllocationsFamiliales", + "montant_versé_complément_pour_forfaitaire"], local_var_576) try: try: - local_var_580 = montant_avec_garde_alternee_base_147(Unit()) + local_var_586 = montant_avec_garde_alternee_base_149(Unit()) except EmptyError: - local_var_580 = (montant_initial_base_548 * - rapport_enfants_total_moyen_526) + try: + local_var_586 = (montant_initial_base_554 * + rapport_enfants_total_moyen_532) + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=116, start_column=12, end_line=116, end_column=44, - law_headings=["Prologue"])) - montant_avec_garde_alternee_base_579 = log_variable_definition(["AllocationsFamiliales", - "montant_avec_garde_alternée_base"], local_var_580) + start_line=116, start_column=12, end_line=116, end_column=44, + law_headings=["Prologue"])) + montant_avec_garde_alternee_base_585 = log_variable_definition(["AllocationsFamiliales", + "montant_avec_garde_alternée_base"], local_var_586) try: try: - local_var_582 = montant_avec_garde_alternee_majoration_160(Unit()) + local_var_588 = montant_avec_garde_alternee_majoration_162(Unit()) except EmptyError: - def local_var_582(param_583: Enfant): + def local_var_588(param_589:Enfant): try: - match_arg_792 = log_end_call(["AllocationsFamiliales", - "prise_en_compte"], - log_variable_definition(["AllocationsFamiliales", - "prise_en_compte", "output"], - log_begin_call(["AllocationsFamiliales", - "prise_en_compte"], prise_en_compte_185, - log_variable_definition(["AllocationsFamiliales", - "prise_en_compte", "input"], - param_583)))) - if match_arg_792.code == PriseEnCompte_Code.Complete: - _ = match_arg_792.value - local_var_584 = decimal_of_string("1.") - elif match_arg_792.code == PriseEnCompte_Code.Partagee: - _ = match_arg_792.value - local_var_584 = decimal_of_string("0.5") - elif match_arg_792.code == PriseEnCompte_Code.Zero: - _ = match_arg_792.value - local_var_584 = decimal_of_string("0.") - return (log_end_call(["AllocationsFamiliales", - "montant_initial_majoration"], - log_variable_definition(["AllocationsFamiliales", - "montant_initial_majoration", "output"], - log_begin_call(["AllocationsFamiliales", - "montant_initial_majoration"], - montant_initial_majoration_558, - log_variable_definition(["AllocationsFamiliales", - "montant_initial_majoration", "input"], - param_583)))) * local_var_584) + try: + match_arg_802 = log_end_call(["AllocationsFamiliales", + "prise_en_compte"], + log_variable_definition(["AllocationsFamiliales", + "prise_en_compte", "output"], + log_begin_call(["AllocationsFamiliales", + "prise_en_compte"], prise_en_compte_187, + log_variable_definition(["AllocationsFamiliales", + "prise_en_compte", "input"], + param_589)))) + if match_arg_802.code == PriseEnCompte_Code.Complete: + _ = match_arg_802.value + local_var_590 = decimal_of_string("1.") + elif match_arg_802.code == PriseEnCompte_Code.Partagee: + _ = match_arg_802.value + local_var_590 = decimal_of_string("0.5") + elif match_arg_802.code == PriseEnCompte_Code.Zero: + _ = match_arg_802.value + local_var_590 = decimal_of_string("0.") + return (log_end_call(["AllocationsFamiliales", + "montant_initial_majoration"], + log_variable_definition(["AllocationsFamiliales", + "montant_initial_majoration", "output"], + log_begin_call(["AllocationsFamiliales", + "montant_initial_majoration"], + montant_initial_majoration_564, + log_variable_definition(["AllocationsFamiliales", + "montant_initial_majoration", "input"], + param_589)))) * local_var_590) + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=135, start_column=12, end_line=135, - end_column=50, law_headings=["Prologue"])) + start_line=135, start_column=12, end_line=135, + end_column=50, law_headings=["Prologue"])) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=135, start_column=12, end_line=135, end_column=50, - law_headings=["Prologue"])) - montant_avec_garde_alternee_majoration_581 = log_variable_definition(["AllocationsFamiliales", - "montant_avec_garde_alternée_majoration"], local_var_582) + start_line=135, start_column=12, end_line=135, end_column=50, + law_headings=["Prologue"])) + montant_avec_garde_alternee_majoration_587 = log_variable_definition(["AllocationsFamiliales", + "montant_avec_garde_alternée_majoration"], local_var_588) try: try: - local_var_589 = montant_verse_base_148(Unit()) + local_var_595 = montant_verse_base_150(Unit()) except EmptyError: - if droit_ouvert_base_466: - local_var_589 = montant_avec_garde_alternee_base_579 - else: - local_var_589 = money_of_cents_string("0") + try: + if droit_ouvert_base_472: + local_var_595 = montant_avec_garde_alternee_base_585 + else: + local_var_595 = money_of_cents_string("0") + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=117, start_column=12, end_line=117, end_column=30, - law_headings=["Prologue"])) - montant_verse_base_588 = log_variable_definition(["AllocationsFamiliales", - "montant_versé_base"], local_var_589) + start_line=117, start_column=12, end_line=117, end_column=30, + law_headings=["Prologue"])) + montant_verse_base_594 = log_variable_definition(["AllocationsFamiliales", + "montant_versé_base"], local_var_595) try: try: - local_var_591 = montant_verse_majoration_161(Unit()) + local_var_597 = montant_verse_majoration_163(Unit()) except EmptyError: - if droit_ouvert_base_466: - def local_var_592(acc_593: Money, enfant_594: Any): - return (acc_593 + log_end_call(["AllocationsFamiliales", - "montant_avec_garde_alternée_majoration"], - log_variable_definition(["AllocationsFamiliales", - "montant_avec_garde_alternée_majoration", "output"], - log_begin_call(["AllocationsFamiliales", - "montant_avec_garde_alternée_majoration"], - montant_avec_garde_alternee_majoration_581, - log_variable_definition(["AllocationsFamiliales", - "montant_avec_garde_alternée_majoration", "input"], - enfant_594))))) - local_var_591 = list_fold_left(local_var_592, - money_of_cents_string("0"), enfants_a_charge_183) - else: - local_var_591 = money_of_cents_string("0") + try: + if droit_ouvert_base_472: + def local_var_598(acc_599:Money, enfant_600:Any): + return (acc_599 + + log_end_call(["AllocationsFamiliales", + "montant_avec_garde_alternée_majoration"], + log_variable_definition(["AllocationsFamiliales", + "montant_avec_garde_alternée_majoration", + "output"], + log_begin_call(["AllocationsFamiliales", + "montant_avec_garde_alternée_majoration"], + montant_avec_garde_alternee_majoration_587, + log_variable_definition(["AllocationsFamiliales", + "montant_avec_garde_alternée_majoration", + "input"], enfant_600))))) + local_var_597 = list_fold_left(local_var_598, + money_of_cents_string("0"), enfants_a_charge_185) + else: + local_var_597 = money_of_cents_string("0") + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=136, start_column=12, end_line=136, end_column=36, - law_headings=["Prologue"])) - montant_verse_majoration_590 = log_variable_definition(["AllocationsFamiliales", - "montant_versé_majoration"], local_var_591) + start_line=136, start_column=12, end_line=136, end_column=36, + law_headings=["Prologue"])) + montant_verse_majoration_596 = log_variable_definition(["AllocationsFamiliales", + "montant_versé_majoration"], local_var_597) try: try: - local_var_596 = montant_base_complement_pour_base_et_majoration_163( - Unit()) + local_var_602 = montant_base_complement_pour_base_et_majoration_165(Unit()) except EmptyError: - local_var_596 = (montant_verse_base_588 + - montant_verse_majoration_590) + try: + local_var_602 = (montant_verse_base_594 + + montant_verse_majoration_596) + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=140, start_column=12, end_line=140, end_column=59, - law_headings=["Prologue"])) - montant_base_complement_pour_base_et_majoration_595 = log_variable_definition(["AllocationsFamiliales", - "montant_base_complément_pour_base_et_majoration"], local_var_596) + start_line=140, start_column=12, end_line=140, end_column=59, + law_headings=["Prologue"])) + montant_base_complement_pour_base_et_majoration_601 = log_variable_definition(["AllocationsFamiliales", + "montant_base_complément_pour_base_et_majoration"], local_var_602) try: try: - local_var_598 = montant_verse_complement_pour_base_et_majoration_165( - Unit()) + local_var_604 = montant_verse_complement_pour_base_et_majoration_167(Unit()) except EmptyError: - if droit_ouvert_complement_366: - local_var_598 = log_end_call(["AllocationsFamiliales", - "complément_dégressif"], - log_variable_definition(["AllocationsFamiliales", - "complément_dégressif", "output"], - log_begin_call(["AllocationsFamiliales", - "complément_dégressif"], complement_degressif_479, - log_variable_definition(["AllocationsFamiliales", - "complément_dégressif", "input"], - montant_base_complement_pour_base_et_majoration_595)))) - else: - local_var_598 = money_of_cents_string("0") + try: + if droit_ouvert_complement_372: + local_var_604 = log_end_call(["AllocationsFamiliales", + "complément_dégressif"], + log_variable_definition(["AllocationsFamiliales", + "complément_dégressif", "output"], + log_begin_call(["AllocationsFamiliales", + "complément_dégressif"], complement_degressif_485, + log_variable_definition(["AllocationsFamiliales", + "complément_dégressif", "input"], + montant_base_complement_pour_base_et_majoration_601)))) + else: + local_var_604 = money_of_cents_string("0") + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=142, start_column=12, end_line=142, end_column=60, - law_headings=["Prologue"])) - montant_verse_complement_pour_base_et_majoration_597 = log_variable_definition(["AllocationsFamiliales", - "montant_versé_complément_pour_base_et_majoration"], local_var_598) + start_line=142, start_column=12, end_line=142, end_column=60, + law_headings=["Prologue"])) + montant_verse_complement_pour_base_et_majoration_603 = log_variable_definition(["AllocationsFamiliales", + "montant_versé_complément_pour_base_et_majoration"], local_var_604) try: try: - local_var_600 = montant_verse_138(Unit()) + local_var_606 = montant_verse_140(Unit()) except EmptyError: - if droit_ouvert_base_466: - local_var_600 = (montant_verse_base_588 + - (montant_verse_majoration_590 + - (montant_verse_forfaitaire_543 + - (montant_verse_complement_pour_base_et_majoration_597 + - montant_verse_complement_pour_forfaitaire_569)))) - else: - local_var_600 = money_of_cents_string("0") + try: + if droit_ouvert_base_472: + local_var_606 = (montant_verse_base_594 + + (montant_verse_majoration_596 + + (montant_verse_forfaitaire_549 + + (montant_verse_complement_pour_base_et_majoration_603 + + montant_verse_complement_pour_forfaitaire_575)))) + else: + local_var_606 = money_of_cents_string("0") + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=105, start_column=12, end_line=105, end_column=25, - law_headings=["Prologue"])) - montant_verse_599 = log_variable_definition(["AllocationsFamiliales", - "montant_versé"], local_var_600) - assert (personne_charge_effective_permanente_est_parent_173 or - (not personne_charge_effective_permanente_est_parent_173 and - personne_charge_effective_permanente_remplit_titre__i_175)) - return AllocationsFamilialesOut(personne_charge_effective_permanente_est_parent_out=personne_charge_effective_permanente_est_parent_173, - personne_charge_effective_permanente_remplit_titre_I_out=personne_charge_effective_permanente_remplit_titre__i_175, - ressources_menage_out=ressources_menage_177, - residence_out=residence_179, date_courante_out=date_courante_181, - enfants_a_charge_out=enfants_a_charge_183, - enfants_a_charge_droit_ouvert_prestation_familiale_out=enfants_a_charge_droit_ouvert_prestation_familiale_331, - prise_en_compte_out=prise_en_compte_185, - versement_out=versement_232, montant_verse_out=montant_verse_599, - droit_ouvert_base_out=droit_ouvert_base_466, - montant_initial_base_out=montant_initial_base_548, - montant_initial_base_premier_enfant_out=montant_initial_base_premier_enfant_464, - montant_initial_base_deuxieme_enfant_out=montant_initial_base_deuxieme_enfant_514, - montant_initial_base_troisieme_enfant_et_plus_out=montant_initial_base_troisieme_enfant_et_plus_502, - rapport_enfants_total_moyen_out=rapport_enfants_total_moyen_526, - nombre_moyen_enfants_out=nombre_moyen_enfants_455, - nombre_total_enfants_out=nombre_total_enfants_453, - montant_avec_garde_alternee_base_out=montant_avec_garde_alternee_base_579, - montant_verse_base_out=montant_verse_base_588, - avait_enfant_a_charge_avant_1er_janvier_2012_out=avait_enfant_a_charge_avant_1er_janvier_2012_279, - montant_initial_base_premier_enfant_mayotte_out=montant_initial_base_premier_enfant_mayotte_425, - montant_initial_base_deuxieme_enfant_mayotte_out=montant_initial_base_deuxieme_enfant_mayotte_399, - montant_initial_base_troisieme_enfant_mayotte_out=montant_initial_base_troisieme_enfant_mayotte_373, - montant_initial_base_quatrieme_enfant_et_plus_mayotte_out=montant_initial_base_quatrieme_enfant_et_plus_mayotte_371, - droit_ouvert_forfaitaire_out=droit_ouvert_forfaitaire_368, - montant_verse_forfaitaire_par_enfant_out=montant_verse_forfaitaire_par_enfant_490, - montant_verse_forfaitaire_out=montant_verse_forfaitaire_543, - droit_ouvert_majoration_out=droit_ouvert_majoration_476, - montant_initial_metropole_majoration_out=montant_initial_metropole_majoration_528, - montant_initial_majoration_out=montant_initial_majoration_558, - montant_avec_garde_alternee_majoration_out=montant_avec_garde_alternee_majoration_581, - montant_verse_majoration_out=montant_verse_majoration_590, - droit_ouvert_complement_out=droit_ouvert_complement_366, - montant_base_complement_pour_base_et_majoration_out=montant_base_complement_pour_base_et_majoration_595, - complement_degressif_out=complement_degressif_479, - montant_verse_complement_pour_base_et_majoration_out=montant_verse_complement_pour_base_et_majoration_597, - montant_verse_complement_pour_forfaitaire_out=montant_verse_complement_pour_forfaitaire_569, - nombre_enfants_l521_1_out=nombre_enfants_l521_1_281, - age_minimum_alinea_1_l521_3_out=age_minimum_alinea_1_l521_3_328, - nombre_enfants_alinea_2_l521_3_out=nombre_enfants_alinea_2_l521_3_283, - est_enfant_le_plus_age_out=est_enfant_le_plus_age_335, - plafond_I_d521_3_out=plafond__i_d521_3_352, - plafond_II_d521_3_out=plafond__i_i_d521_3_338) - - -def interface_allocations_familiales(interface_allocations_familiales_in_601: InterfaceAllocationsFamilialesIn): - date_courante_602 = interface_allocations_familiales_in_601.date_courante_in - enfants_603 = interface_allocations_familiales_in_601.enfants_in - enfants_a_charge_604 = interface_allocations_familiales_in_601.enfants_a_charge_in - ressources_menage_605 = interface_allocations_familiales_in_601.ressources_menage_in - residence_606 = interface_allocations_familiales_in_601.residence_in - montant_verse_607 = interface_allocations_familiales_in_601.montant_verse_in - personne_charge_effective_permanente_est_parent_608 = interface_allocations_familiales_in_601.personne_charge_effective_permanente_est_parent_in - personne_charge_effective_permanente_remplit_titre__i_609 = interface_allocations_familiales_in_601.personne_charge_effective_permanente_remplit_titre_I_in - avait_enfant_a_charge_avant_1er_janvier_2012_610 = interface_allocations_familiales_in_601.avait_enfant_a_charge_avant_1er_janvier_2012_in + start_line=105, start_column=12, end_line=105, end_column=25, + law_headings=["Prologue"])) + montant_verse_605 = log_variable_definition(["AllocationsFamiliales", + "montant_versé"], local_var_606) + assert (personne_charge_effective_permanente_est_parent_175 or + (not personne_charge_effective_permanente_est_parent_175 and + personne_charge_effective_permanente_remplit_titre__i_177)) + return AllocationsFamilialesOut(personne_charge_effective_permanente_est_parent_out = personne_charge_effective_permanente_est_parent_175, + personne_charge_effective_permanente_remplit_titre_I_out = personne_charge_effective_permanente_remplit_titre__i_177, + ressources_menage_out = ressources_menage_179, + residence_out = residence_181, date_courante_out = date_courante_183, + enfants_a_charge_out = enfants_a_charge_185, + enfants_a_charge_droit_ouvert_prestation_familiale_out = enfants_a_charge_droit_ouvert_prestation_familiale_337, + prise_en_compte_out = prise_en_compte_187, + versement_out = versement_234, montant_verse_out = montant_verse_605, + droit_ouvert_base_out = droit_ouvert_base_472, + montant_initial_base_out = montant_initial_base_554, + montant_initial_base_premier_enfant_out = montant_initial_base_premier_enfant_470, + montant_initial_base_deuxieme_enfant_out = montant_initial_base_deuxieme_enfant_520, + montant_initial_base_troisieme_enfant_et_plus_out = montant_initial_base_troisieme_enfant_et_plus_508, + rapport_enfants_total_moyen_out = rapport_enfants_total_moyen_532, + nombre_moyen_enfants_out = nombre_moyen_enfants_461, + nombre_total_enfants_out = nombre_total_enfants_459, + montant_avec_garde_alternee_base_out = montant_avec_garde_alternee_base_585, + montant_verse_base_out = montant_verse_base_594, + avait_enfant_a_charge_avant_1er_janvier_2012_out = avait_enfant_a_charge_avant_1er_janvier_2012_281, + montant_initial_base_premier_enfant_mayotte_out = montant_initial_base_premier_enfant_mayotte_431, + montant_initial_base_deuxieme_enfant_mayotte_out = montant_initial_base_deuxieme_enfant_mayotte_405, + montant_initial_base_troisieme_enfant_mayotte_out = montant_initial_base_troisieme_enfant_mayotte_379, + montant_initial_base_quatrieme_enfant_et_plus_mayotte_out = montant_initial_base_quatrieme_enfant_et_plus_mayotte_377, + droit_ouvert_forfaitaire_out = droit_ouvert_forfaitaire_374, + montant_verse_forfaitaire_par_enfant_out = montant_verse_forfaitaire_par_enfant_496, + montant_verse_forfaitaire_out = montant_verse_forfaitaire_549, + droit_ouvert_majoration_out = droit_ouvert_majoration_482, + montant_initial_metropole_majoration_out = montant_initial_metropole_majoration_534, + montant_initial_majoration_out = montant_initial_majoration_564, + montant_avec_garde_alternee_majoration_out = montant_avec_garde_alternee_majoration_587, + montant_verse_majoration_out = montant_verse_majoration_596, + droit_ouvert_complement_out = droit_ouvert_complement_372, + montant_base_complement_pour_base_et_majoration_out = montant_base_complement_pour_base_et_majoration_601, + complement_degressif_out = complement_degressif_485, + montant_verse_complement_pour_base_et_majoration_out = montant_verse_complement_pour_base_et_majoration_603, + montant_verse_complement_pour_forfaitaire_out = montant_verse_complement_pour_forfaitaire_575, + nombre_enfants_l521_1_out = nombre_enfants_l521_1_283, + age_minimum_alinea_1_l521_3_out = age_minimum_alinea_1_l521_3_334, + nombre_enfants_alinea_2_l521_3_out = nombre_enfants_alinea_2_l521_3_285, + est_enfant_le_plus_age_out = est_enfant_le_plus_age_341, + plafond_I_d521_3_out = plafond__i_d521_3_358, + plafond_II_d521_3_out = plafond__i_i_d521_3_344) + +def interface_allocations_familiales(interface_allocations_familiales_in_607:InterfaceAllocationsFamilialesIn): + date_courante_608 = interface_allocations_familiales_in_607.date_courante_in + enfants_609 = interface_allocations_familiales_in_607.enfants_in + enfants_a_charge_610 = interface_allocations_familiales_in_607.enfants_a_charge_in + ressources_menage_611 = interface_allocations_familiales_in_607.ressources_menage_in + residence_612 = interface_allocations_familiales_in_607.residence_in + montant_verse_613 = interface_allocations_familiales_in_607.montant_verse_in + personne_charge_effective_permanente_est_parent_614 = interface_allocations_familiales_in_607.personne_charge_effective_permanente_est_parent_in + personne_charge_effective_permanente_remplit_titre__i_615 = interface_allocations_familiales_in_607.personne_charge_effective_permanente_remplit_titre_I_in + avait_enfant_a_charge_avant_1er_janvier_2012_616 = interface_allocations_familiales_in_607.avait_enfant_a_charge_avant_1er_janvier_2012_in try: - local_var_612 = date_courante_602(Unit()) + try: + local_var_618 = date_courante_608(Unit()) + except EmptyError: + if log_decision_taken(SourcePosition(filename="", start_line=0, + start_column=1, end_line=0, end_column=1, + law_headings=[]), False): + raise EmptyError + else: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./epilogue.catala_fr", - start_line=72, start_column=12, end_line=72, end_column=25, - law_headings=["Interface du programme", "Épilogue", - "Décrets divers"])) - date_courante_611 = log_variable_definition(["InterfaceAllocationsFamiliales", - "date_courante"], local_var_612) + start_line=72, start_column=12, end_line=72, end_column=25, + law_headings=["Interface du programme", "Épilogue", + "Décrets divers"])) + date_courante_617 = log_variable_definition(["InterfaceAllocationsFamiliales", + "date_courante"], local_var_618) try: - local_var_614 = enfants_603(Unit()) + try: + local_var_620 = enfants_609(Unit()) + except EmptyError: + if log_decision_taken(SourcePosition(filename="", start_line=0, + start_column=1, end_line=0, end_column=1, + law_headings=[]), False): + raise EmptyError + else: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./epilogue.catala_fr", - start_line=73, start_column=12, end_line=73, end_column=19, - law_headings=["Interface du programme", "Épilogue", - "Décrets divers"])) - enfants_613 = log_variable_definition(["InterfaceAllocationsFamiliales", - "enfants"], local_var_614) + start_line=73, start_column=12, end_line=73, end_column=19, + law_headings=["Interface du programme", "Épilogue", + "Décrets divers"])) + enfants_619 = log_variable_definition(["InterfaceAllocationsFamiliales", + "enfants"], local_var_620) try: - local_var_616 = ressources_menage_605(Unit()) + try: + local_var_622 = ressources_menage_611(Unit()) + except EmptyError: + if log_decision_taken(SourcePosition(filename="", start_line=0, + start_column=1, end_line=0, end_column=1, + law_headings=[]), False): + raise EmptyError + else: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./epilogue.catala_fr", - start_line=76, start_column=12, end_line=76, end_column=29, - law_headings=["Interface du programme", "Épilogue", - "Décrets divers"])) - ressources_menage_615 = log_variable_definition(["InterfaceAllocationsFamiliales", - "ressources_ménage"], local_var_616) + start_line=76, start_column=12, end_line=76, end_column=29, + law_headings=["Interface du programme", "Épilogue", + "Décrets divers"])) + ressources_menage_621 = log_variable_definition(["InterfaceAllocationsFamiliales", + "ressources_ménage"], local_var_622) try: - local_var_618 = residence_606(Unit()) + try: + local_var_624 = residence_612(Unit()) + except EmptyError: + if log_decision_taken(SourcePosition(filename="", start_line=0, + start_column=1, end_line=0, end_column=1, + law_headings=[]), False): + raise EmptyError + else: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./epilogue.catala_fr", - start_line=77, start_column=12, end_line=77, end_column=21, - law_headings=["Interface du programme", "Épilogue", - "Décrets divers"])) - residence_617 = log_variable_definition(["InterfaceAllocationsFamiliales", - "résidence"], local_var_618) + start_line=77, start_column=12, end_line=77, end_column=21, + law_headings=["Interface du programme", "Épilogue", + "Décrets divers"])) + residence_623 = log_variable_definition(["InterfaceAllocationsFamiliales", + "résidence"], local_var_624) try: try: - local_var_620 = personne_charge_effective_permanente_est_parent_608( - Unit()) + local_var_626 = personne_charge_effective_permanente_est_parent_614(Unit()) except EmptyError: - local_var_620 = False + if log_decision_taken(SourcePosition(filename="", start_line=0, + start_column=1, end_line=0, end_column=1, + law_headings=[]), True): + local_var_626 = False + else: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./epilogue.catala_fr", - start_line=79, start_column=12, end_line=79, end_column=59, - law_headings=["Interface du programme", "Épilogue", - "Décrets divers"])) - personne_charge_effective_permanente_est_parent_619 = log_variable_definition(["InterfaceAllocationsFamiliales", - "personne_charge_effective_permanente_est_parent"], local_var_620) + start_line=79, start_column=12, end_line=79, end_column=59, + law_headings=["Interface du programme", "Épilogue", + "Décrets divers"])) + personne_charge_effective_permanente_est_parent_625 = log_variable_definition(["InterfaceAllocationsFamiliales", + "personne_charge_effective_permanente_est_parent"], local_var_626) try: try: - local_var_622 = personne_charge_effective_permanente_remplit_titre__i_609( - Unit()) + local_var_628 = personne_charge_effective_permanente_remplit_titre__i_615(Unit()) except EmptyError: - local_var_622 = False + if log_decision_taken(SourcePosition(filename="", start_line=0, + start_column=1, end_line=0, end_column=1, + law_headings=[]), True): + local_var_628 = False + else: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./epilogue.catala_fr", - start_line=80, start_column=12, end_line=80, end_column=64, - law_headings=["Interface du programme", "Épilogue", - "Décrets divers"])) - personne_charge_effective_permanente_remplit_titre__i_621 = log_variable_definition(["InterfaceAllocationsFamiliales", - "personne_charge_effective_permanente_remplit_titre_I"], - local_var_622) + start_line=80, start_column=12, end_line=80, end_column=64, + law_headings=["Interface du programme", "Épilogue", + "Décrets divers"])) + personne_charge_effective_permanente_remplit_titre__i_627 = log_variable_definition(["InterfaceAllocationsFamiliales", + "personne_charge_effective_permanente_remplit_titre_I"], + local_var_628) try: try: - local_var_624 = avait_enfant_a_charge_avant_1er_janvier_2012_610( - Unit()) + local_var_630 = avait_enfant_a_charge_avant_1er_janvier_2012_616(Unit()) except EmptyError: - local_var_624 = False + if log_decision_taken(SourcePosition(filename="", start_line=0, + start_column=1, end_line=0, end_column=1, + law_headings=[]), True): + local_var_630 = False + else: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./epilogue.catala_fr", - start_line=81, start_column=12, end_line=81, end_column=56, - law_headings=["Interface du programme", "Épilogue", - "Décrets divers"])) - avait_enfant_a_charge_avant_1er_janvier_2012_623 = log_variable_definition(["InterfaceAllocationsFamiliales", - "avait_enfant_à_charge_avant_1er_janvier_2012"], local_var_624) + start_line=81, start_column=12, end_line=81, end_column=56, + law_headings=["Interface du programme", "Épilogue", + "Décrets divers"])) + avait_enfant_a_charge_avant_1er_janvier_2012_629 = log_variable_definition(["InterfaceAllocationsFamiliales", + "avait_enfant_à_charge_avant_1er_janvier_2012"], local_var_630) try: try: - local_var_626 = enfants_a_charge_604(Unit()) + local_var_632 = enfants_a_charge_610(Unit()) except EmptyError: - def local_var_627(enfant_628: Any): - if ((enfant_628.d_date_de_naissance + - duration_of_numbers(3, 0, 0)) >= - date_courante_611): - local_var_629 = SituationObligationScolaire(SituationObligationScolaire_Code.Avant, - Unit()) - else: - if ((enfant_628.d_date_de_naissance + - duration_of_numbers(16, 0, 0)) >= - date_courante_611): - local_var_629 = SituationObligationScolaire(SituationObligationScolaire_Code.Pendant, - Unit()) + try: + def local_var_633(enfant_634:Any): + if ((enfant_634.d_date_de_naissance + + duration_of_numbers(3,0,0)) >= + date_courante_617): + local_var_635 = SituationObligationScolaire(SituationObligationScolaire_Code.Avant, + Unit()) else: - local_var_629 = SituationObligationScolaire(SituationObligationScolaire_Code.Apres, - Unit()) - return Enfant(identifiant=enfant_628.d_identifiant, - obligation_scolaire=local_var_629, - remuneration_mensuelle=enfant_628.d_remuneration_mensuelle, - date_de_naissance=enfant_628.d_date_de_naissance, - age=year_of_date((date_of_numbers(0, 1, 1) + - (date_courante_611 - enfant_628.d_date_de_naissance))), - prise_en_charge=enfant_628.d_prise_en_charge, - a_deja_ouvert_droit_aux_allocations_familiales=enfant_628.d_a_deja_ouvert_droit_aux_allocations_familiales) - local_var_626 = list_map(local_var_627, enfants_613) + if ((enfant_634.d_date_de_naissance + + duration_of_numbers(16,0,0)) >= + date_courante_617): + local_var_635 = SituationObligationScolaire(SituationObligationScolaire_Code.Pendant, + Unit()) + else: + local_var_635 = SituationObligationScolaire(SituationObligationScolaire_Code.Apres, + Unit()) + return Enfant(identifiant = enfant_634.d_identifiant, + obligation_scolaire = local_var_635, + remuneration_mensuelle = enfant_634.d_remuneration_mensuelle, + date_de_naissance = enfant_634.d_date_de_naissance, + age = year_of_date((date_of_numbers(0,1,1) + + (date_courante_617 - + enfant_634.d_date_de_naissance))), + prise_en_charge = enfant_634.d_prise_en_charge, + a_deja_ouvert_droit_aux_allocations_familiales = enfant_634.d_a_deja_ouvert_droit_aux_allocations_familiales) + local_var_632 = list_map(local_var_633, enfants_619) + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./epilogue.catala_fr", - start_line=74, start_column=12, end_line=74, end_column=28, - law_headings=["Interface du programme", "Épilogue", - "Décrets divers"])) - enfants_a_charge_625 = log_variable_definition(["InterfaceAllocationsFamiliales", - "enfants_à_charge"], local_var_626) - - def local_var_631(_: Unit): + start_line=74, start_column=12, end_line=74, end_column=28, + law_headings=["Interface du programme", "Épilogue", + "Décrets divers"])) + enfants_a_charge_631 = log_variable_definition(["InterfaceAllocationsFamiliales", + "enfants_à_charge"], local_var_632) + def local_var_637(_:Unit): try: if log_decision_taken(SourcePosition(filename="./epilogue.catala_fr", - start_line=90, start_column=20, end_line=90, end_column=67, - law_headings=["Interface du programme", "Épilogue", - "Décrets divers"]), personne_charge_effective_permanente_est_parent_619): - local_var_633 = True + start_line=90, start_column=20, end_line=90, end_column=67, + law_headings=["Interface du programme", "Épilogue", + "Décrets divers"]), personne_charge_effective_permanente_est_parent_625): + local_var_639 = True else: raise EmptyError except EmptyError: - local_var_633 = False + local_var_639 = False return log_variable_definition(["InterfaceAllocationsFamiliales", - "allocations_familiales.personne_charge_effective_permanente_est_parent"], - local_var_633) - allocations_familiales_dot_personne_charge_effective_permanente_est_parent_630 = local_var_631 - - def local_var_635(_: Unit): + "allocations_familiales.personne_charge_effective_permanente_est_parent"], + local_var_639) + allocations_familiales_dot_personne_charge_effective_permanente_est_parent_636 = local_var_637 + def local_var_641(_:Unit): try: if log_decision_taken(SourcePosition(filename="./epilogue.catala_fr", - start_line=93, start_column=20, end_line=93, end_column=72, - law_headings=["Interface du programme", "Épilogue", - "Décrets divers"]), personne_charge_effective_permanente_remplit_titre__i_621): - local_var_637 = True + start_line=93, start_column=20, end_line=93, end_column=72, + law_headings=["Interface du programme", "Épilogue", + "Décrets divers"]), personne_charge_effective_permanente_remplit_titre__i_627): + local_var_643 = True else: raise EmptyError except EmptyError: - local_var_637 = False + local_var_643 = False return log_variable_definition(["InterfaceAllocationsFamiliales", - "allocations_familiales.personne_charge_effective_permanente_remplit_titre_I"], - local_var_637) - allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i_634 = local_var_635 - - def local_var_639(_: Unit): + "allocations_familiales.personne_charge_effective_permanente_remplit_titre_I"], + local_var_643) + allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i_640 = local_var_641 + def local_var_645(_:Unit): + try: + local_var_647 = ressources_menage_621 + except EmptyError: + raise EmptyError return log_variable_definition(["InterfaceAllocationsFamiliales", - "allocations_familiales.ressources_ménage"], - ressources_menage_615) - allocations_familiales_dot_ressources_menage_638 = local_var_639 - - def local_var_642(_: Unit): + "allocations_familiales.ressources_ménage"], local_var_647) + allocations_familiales_dot_ressources_menage_644 = local_var_645 + def local_var_649(_:Unit): + try: + local_var_651 = residence_623 + except EmptyError: + raise EmptyError return log_variable_definition(["InterfaceAllocationsFamiliales", - "allocations_familiales.résidence"], residence_617) - allocations_familiales_dot_residence_641 = local_var_642 - - def local_var_645(_: Unit): + "allocations_familiales.résidence"], local_var_651) + allocations_familiales_dot_residence_648 = local_var_649 + def local_var_653(_:Unit): + try: + local_var_655 = date_courante_617 + except EmptyError: + raise EmptyError return log_variable_definition(["InterfaceAllocationsFamiliales", - "allocations_familiales.date_courante"], date_courante_611) - allocations_familiales_dot_date_courante_644 = local_var_645 - - def local_var_648(_: Unit): + "allocations_familiales.date_courante"], local_var_655) + allocations_familiales_dot_date_courante_652 = local_var_653 + def local_var_657(_:Unit): + try: + local_var_659 = enfants_a_charge_631 + except EmptyError: + raise EmptyError return log_variable_definition(["InterfaceAllocationsFamiliales", - "allocations_familiales.enfants_à_charge"], - enfants_a_charge_625) - allocations_familiales_dot_enfants_a_charge_647 = local_var_648 - - def local_var_651(_: Unit): + "allocations_familiales.enfants_à_charge"], local_var_659) + allocations_familiales_dot_enfants_a_charge_656 = local_var_657 + def local_var_661(_:Unit): try: if log_decision_taken(SourcePosition(filename="./epilogue.catala_fr", - start_line=96, start_column=20, end_line=96, end_column=64, - law_headings=["Interface du programme", "Épilogue", - "Décrets divers"]), avait_enfant_a_charge_avant_1er_janvier_2012_623): - local_var_653 = True + start_line=96, start_column=20, end_line=96, end_column=64, + law_headings=["Interface du programme", "Épilogue", + "Décrets divers"]), avait_enfant_a_charge_avant_1er_janvier_2012_629): + local_var_663 = True else: raise EmptyError except EmptyError: - local_var_653 = False + local_var_663 = False return log_variable_definition(["InterfaceAllocationsFamiliales", - "allocations_familiales.avait_enfant_à_charge_avant_1er_janvier_2012"], - local_var_653) - allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012_650 = local_var_651 - - def local_var_655(_: Unit): + "allocations_familiales.avait_enfant_à_charge_avant_1er_janvier_2012"], + local_var_663) + allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012_660 = local_var_661 + def local_var_665(_:Unit): raise EmptyError - - def local_var_657(_: Unit): + def local_var_667(_:Unit): raise EmptyError - - def local_var_659(_: Unit): + def local_var_669(_:Unit): raise EmptyError - - def local_var_661(_: Unit): + def local_var_671(_:Unit): raise EmptyError - - def local_var_663(_: Unit): + def local_var_673(_:Unit): raise EmptyError - - def local_var_665(_: Unit): + def local_var_675(_:Unit): raise EmptyError - - def local_var_667(_: Unit): + def local_var_677(_:Unit): raise EmptyError - - def local_var_669(_: Unit): + def local_var_679(_:Unit): raise EmptyError - - def local_var_671(_: Unit): + def local_var_681(_:Unit): raise EmptyError - - def local_var_673(_: Unit): + def local_var_683(_:Unit): raise EmptyError - - def local_var_675(_: Unit): + def local_var_685(_:Unit): raise EmptyError - - def local_var_677(_: Unit): + def local_var_687(_:Unit): raise EmptyError - - def local_var_679(_: Unit): + def local_var_689(_:Unit): raise EmptyError - - def local_var_681(_: Unit): + def local_var_691(_:Unit): raise EmptyError - - def local_var_683(_: Unit): + def local_var_693(_:Unit): raise EmptyError - - def local_var_685(_: Unit): + def local_var_695(_:Unit): raise EmptyError - - def local_var_687(_: Unit): + def local_var_697(_:Unit): raise EmptyError - - def local_var_689(_: Unit): + def local_var_699(_:Unit): raise EmptyError - - def local_var_691(_: Unit): + def local_var_701(_:Unit): raise EmptyError - - def local_var_693(_: Unit): + def local_var_703(_:Unit): raise EmptyError - - def local_var_695(_: Unit): + def local_var_705(_:Unit): raise EmptyError - - def local_var_697(_: Unit): + def local_var_707(_:Unit): raise EmptyError - - def local_var_699(_: Unit): + def local_var_709(_:Unit): raise EmptyError - - def local_var_701(_: Unit): + def local_var_711(_:Unit): raise EmptyError - - def local_var_703(_: Unit): + def local_var_713(_:Unit): raise EmptyError - - def local_var_705(_: Unit): + def local_var_715(_:Unit): raise EmptyError - - def local_var_707(_: Unit): + def local_var_717(_:Unit): raise EmptyError - - def local_var_709(_: Unit): + def local_var_719(_:Unit): raise EmptyError - - def local_var_711(_: Unit): + def local_var_721(_:Unit): raise EmptyError - - def local_var_713(_: Unit): + def local_var_723(_:Unit): raise EmptyError - - def local_var_715(_: Unit): + def local_var_725(_:Unit): raise EmptyError - - def local_var_717(_: Unit): + def local_var_727(_:Unit): raise EmptyError - - def local_var_719(_: Unit): + def local_var_729(_:Unit): raise EmptyError - - def local_var_721(_: Unit): + def local_var_731(_:Unit): raise EmptyError - - def local_var_723(_: Unit): + def local_var_733(_:Unit): raise EmptyError - - def local_var_725(_: Unit): + def local_var_735(_:Unit): raise EmptyError - - def local_var_727(_: Unit): + def local_var_737(_:Unit): raise EmptyError - result_654 = log_end_call(["InterfaceAllocationsFamiliales", - "allocations_familiales", "AllocationsFamiliales"], - log_begin_call(["InterfaceAllocationsFamiliales", - "allocations_familiales", "AllocationsFamiliales"], - allocations_familiales, - AllocationsFamilialesIn(personne_charge_effective_permanente_est_parent_in=allocations_familiales_dot_personne_charge_effective_permanente_est_parent_630, - personne_charge_effective_permanente_remplit_titre_I_in=allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i_634, - ressources_menage_in=allocations_familiales_dot_ressources_menage_638, - residence_in=allocations_familiales_dot_residence_641, - date_courante_in=allocations_familiales_dot_date_courante_644, - enfants_a_charge_in=allocations_familiales_dot_enfants_a_charge_647, - enfants_a_charge_droit_ouvert_prestation_familiale_in=local_var_655, - prise_en_compte_in=local_var_657, versement_in=local_var_659, - montant_verse_in=local_var_661, - droit_ouvert_base_in=local_var_663, - montant_initial_base_in=local_var_665, - montant_initial_base_premier_enfant_in=local_var_667, - montant_initial_base_deuxieme_enfant_in=local_var_669, - montant_initial_base_troisieme_enfant_et_plus_in=local_var_671, - rapport_enfants_total_moyen_in=local_var_673, - nombre_moyen_enfants_in=local_var_675, - nombre_total_enfants_in=local_var_677, - montant_avec_garde_alternee_base_in=local_var_679, - montant_verse_base_in=local_var_681, - avait_enfant_a_charge_avant_1er_janvier_2012_in=allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012_650, - montant_initial_base_premier_enfant_mayotte_in=local_var_683, - montant_initial_base_deuxieme_enfant_mayotte_in=local_var_685, - montant_initial_base_troisieme_enfant_mayotte_in=local_var_687, - montant_initial_base_quatrieme_enfant_et_plus_mayotte_in=local_var_689, - droit_ouvert_forfaitaire_in=local_var_691, - montant_verse_forfaitaire_par_enfant_in=local_var_693, - montant_verse_forfaitaire_in=local_var_695, - droit_ouvert_majoration_in=local_var_697, - montant_initial_metropole_majoration_in=local_var_699, - montant_initial_majoration_in=local_var_701, - montant_avec_garde_alternee_majoration_in=local_var_703, - montant_verse_majoration_in=local_var_705, - droit_ouvert_complement_in=local_var_707, - montant_base_complement_pour_base_et_majoration_in=local_var_709, - complement_degressif_in=local_var_711, - montant_verse_complement_pour_base_et_majoration_in=local_var_713, - montant_verse_complement_pour_forfaitaire_in=local_var_715, - nombre_enfants_l521_1_in=local_var_717, - age_minimum_alinea_1_l521_3_in=local_var_719, - nombre_enfants_alinea_2_l521_3_in=local_var_721, - est_enfant_le_plus_age_in=local_var_723, - plafond_I_d521_3_in=local_var_725, - plafond_II_d521_3_in=local_var_727))) - allocations_familiales_dot_personne_charge_effective_permanente_est_parent_729 = result_654.personne_charge_effective_permanente_est_parent_out - allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i_730 = result_654.personne_charge_effective_permanente_remplit_titre_I_out - allocations_familiales_dot_ressources_menage_731 = result_654.ressources_menage_out - allocations_familiales_dot_residence_732 = result_654.residence_out - allocations_familiales_dot_date_courante_733 = result_654.date_courante_out - allocations_familiales_dot_enfants_a_charge_734 = result_654.enfants_a_charge_out - allocations_familiales_dot_enfants_a_charge_droit_ouvert_prestation_familiale_735 = result_654.enfants_a_charge_droit_ouvert_prestation_familiale_out - allocations_familiales_dot_prise_en_compte_736 = result_654.prise_en_compte_out - allocations_familiales_dot_versement_737 = result_654.versement_out - allocations_familiales_dot_montant_verse_738 = result_654.montant_verse_out - allocations_familiales_dot_droit_ouvert_base_739 = result_654.droit_ouvert_base_out - allocations_familiales_dot_montant_initial_base_740 = result_654.montant_initial_base_out - allocations_familiales_dot_montant_initial_base_premier_enfant_741 = result_654.montant_initial_base_premier_enfant_out - allocations_familiales_dot_montant_initial_base_deuxieme_enfant_742 = result_654.montant_initial_base_deuxieme_enfant_out - allocations_familiales_dot_montant_initial_base_troisieme_enfant_et_plus_743 = result_654.montant_initial_base_troisieme_enfant_et_plus_out - allocations_familiales_dot_rapport_enfants_total_moyen_744 = result_654.rapport_enfants_total_moyen_out - allocations_familiales_dot_nombre_moyen_enfants_745 = result_654.nombre_moyen_enfants_out - allocations_familiales_dot_nombre_total_enfants_746 = result_654.nombre_total_enfants_out - allocations_familiales_dot_montant_avec_garde_alternee_base_747 = result_654.montant_avec_garde_alternee_base_out - allocations_familiales_dot_montant_verse_base_748 = result_654.montant_verse_base_out - allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012_749 = result_654.avait_enfant_a_charge_avant_1er_janvier_2012_out - allocations_familiales_dot_montant_initial_base_premier_enfant_mayotte_750 = result_654.montant_initial_base_premier_enfant_mayotte_out - allocations_familiales_dot_montant_initial_base_deuxieme_enfant_mayotte_751 = result_654.montant_initial_base_deuxieme_enfant_mayotte_out - allocations_familiales_dot_montant_initial_base_troisieme_enfant_mayotte_752 = result_654.montant_initial_base_troisieme_enfant_mayotte_out - allocations_familiales_dot_montant_initial_base_quatrieme_enfant_et_plus_mayotte_753 = result_654.montant_initial_base_quatrieme_enfant_et_plus_mayotte_out - allocations_familiales_dot_droit_ouvert_forfaitaire_754 = result_654.droit_ouvert_forfaitaire_out - allocations_familiales_dot_montant_verse_forfaitaire_par_enfant_755 = result_654.montant_verse_forfaitaire_par_enfant_out - allocations_familiales_dot_montant_verse_forfaitaire_756 = result_654.montant_verse_forfaitaire_out - allocations_familiales_dot_droit_ouvert_majoration_757 = result_654.droit_ouvert_majoration_out - allocations_familiales_dot_montant_initial_metropole_majoration_758 = result_654.montant_initial_metropole_majoration_out - allocations_familiales_dot_montant_initial_majoration_759 = result_654.montant_initial_majoration_out - allocations_familiales_dot_montant_avec_garde_alternee_majoration_760 = result_654.montant_avec_garde_alternee_majoration_out - allocations_familiales_dot_montant_verse_majoration_761 = result_654.montant_verse_majoration_out - allocations_familiales_dot_droit_ouvert_complement_762 = result_654.droit_ouvert_complement_out - allocations_familiales_dot_montant_base_complement_pour_base_et_majoration_763 = result_654.montant_base_complement_pour_base_et_majoration_out - allocations_familiales_dot_complement_degressif_764 = result_654.complement_degressif_out - allocations_familiales_dot_montant_verse_complement_pour_base_et_majoration_765 = result_654.montant_verse_complement_pour_base_et_majoration_out - allocations_familiales_dot_montant_verse_complement_pour_forfaitaire_766 = result_654.montant_verse_complement_pour_forfaitaire_out - allocations_familiales_dot_nombre_enfants_l521_1_767 = result_654.nombre_enfants_l521_1_out - allocations_familiales_dot_age_minimum_alinea_1_l521_3_768 = result_654.age_minimum_alinea_1_l521_3_out - allocations_familiales_dot_nombre_enfants_alinea_2_l521_3_769 = result_654.nombre_enfants_alinea_2_l521_3_out - allocations_familiales_dot_est_enfant_le_plus_age_770 = result_654.est_enfant_le_plus_age_out - allocations_familiales_dot_plafond__i_d521_3_771 = result_654.plafond_I_d521_3_out - allocations_familiales_dot_plafond__i_i_d521_3_772 = result_654.plafond_II_d521_3_out + result_664 = log_end_call(["InterfaceAllocationsFamiliales", + "allocations_familiales", "AllocationsFamiliales"], + log_begin_call(["InterfaceAllocationsFamiliales", + "allocations_familiales", "AllocationsFamiliales"], + allocations_familiales, + AllocationsFamilialesIn(personne_charge_effective_permanente_est_parent_in = allocations_familiales_dot_personne_charge_effective_permanente_est_parent_636, + personne_charge_effective_permanente_remplit_titre_I_in = allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i_640, + ressources_menage_in = allocations_familiales_dot_ressources_menage_644, + residence_in = allocations_familiales_dot_residence_648, + date_courante_in = allocations_familiales_dot_date_courante_652, + enfants_a_charge_in = allocations_familiales_dot_enfants_a_charge_656, + enfants_a_charge_droit_ouvert_prestation_familiale_in = local_var_665, + prise_en_compte_in = local_var_667, versement_in = local_var_669, + montant_verse_in = local_var_671, + droit_ouvert_base_in = local_var_673, + montant_initial_base_in = local_var_675, + montant_initial_base_premier_enfant_in = local_var_677, + montant_initial_base_deuxieme_enfant_in = local_var_679, + montant_initial_base_troisieme_enfant_et_plus_in = local_var_681, + rapport_enfants_total_moyen_in = local_var_683, + nombre_moyen_enfants_in = local_var_685, + nombre_total_enfants_in = local_var_687, + montant_avec_garde_alternee_base_in = local_var_689, + montant_verse_base_in = local_var_691, + avait_enfant_a_charge_avant_1er_janvier_2012_in = allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012_660, + montant_initial_base_premier_enfant_mayotte_in = local_var_693, + montant_initial_base_deuxieme_enfant_mayotte_in = local_var_695, + montant_initial_base_troisieme_enfant_mayotte_in = local_var_697, + montant_initial_base_quatrieme_enfant_et_plus_mayotte_in = local_var_699, + droit_ouvert_forfaitaire_in = local_var_701, + montant_verse_forfaitaire_par_enfant_in = local_var_703, + montant_verse_forfaitaire_in = local_var_705, + droit_ouvert_majoration_in = local_var_707, + montant_initial_metropole_majoration_in = local_var_709, + montant_initial_majoration_in = local_var_711, + montant_avec_garde_alternee_majoration_in = local_var_713, + montant_verse_majoration_in = local_var_715, + droit_ouvert_complement_in = local_var_717, + montant_base_complement_pour_base_et_majoration_in = local_var_719, + complement_degressif_in = local_var_721, + montant_verse_complement_pour_base_et_majoration_in = local_var_723, + montant_verse_complement_pour_forfaitaire_in = local_var_725, + nombre_enfants_l521_1_in = local_var_727, + age_minimum_alinea_1_l521_3_in = local_var_729, + nombre_enfants_alinea_2_l521_3_in = local_var_731, + est_enfant_le_plus_age_in = local_var_733, + plafond_I_d521_3_in = local_var_735, + plafond_II_d521_3_in = local_var_737))) + allocations_familiales_dot_personne_charge_effective_permanente_est_parent_739 = result_664.personne_charge_effective_permanente_est_parent_out + allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i_740 = result_664.personne_charge_effective_permanente_remplit_titre_I_out + allocations_familiales_dot_ressources_menage_741 = result_664.ressources_menage_out + allocations_familiales_dot_residence_742 = result_664.residence_out + allocations_familiales_dot_date_courante_743 = result_664.date_courante_out + allocations_familiales_dot_enfants_a_charge_744 = result_664.enfants_a_charge_out + allocations_familiales_dot_enfants_a_charge_droit_ouvert_prestation_familiale_745 = result_664.enfants_a_charge_droit_ouvert_prestation_familiale_out + allocations_familiales_dot_prise_en_compte_746 = result_664.prise_en_compte_out + allocations_familiales_dot_versement_747 = result_664.versement_out + allocations_familiales_dot_montant_verse_748 = result_664.montant_verse_out + allocations_familiales_dot_droit_ouvert_base_749 = result_664.droit_ouvert_base_out + allocations_familiales_dot_montant_initial_base_750 = result_664.montant_initial_base_out + allocations_familiales_dot_montant_initial_base_premier_enfant_751 = result_664.montant_initial_base_premier_enfant_out + allocations_familiales_dot_montant_initial_base_deuxieme_enfant_752 = result_664.montant_initial_base_deuxieme_enfant_out + allocations_familiales_dot_montant_initial_base_troisieme_enfant_et_plus_753 = result_664.montant_initial_base_troisieme_enfant_et_plus_out + allocations_familiales_dot_rapport_enfants_total_moyen_754 = result_664.rapport_enfants_total_moyen_out + allocations_familiales_dot_nombre_moyen_enfants_755 = result_664.nombre_moyen_enfants_out + allocations_familiales_dot_nombre_total_enfants_756 = result_664.nombre_total_enfants_out + allocations_familiales_dot_montant_avec_garde_alternee_base_757 = result_664.montant_avec_garde_alternee_base_out + allocations_familiales_dot_montant_verse_base_758 = result_664.montant_verse_base_out + allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012_759 = result_664.avait_enfant_a_charge_avant_1er_janvier_2012_out + allocations_familiales_dot_montant_initial_base_premier_enfant_mayotte_760 = result_664.montant_initial_base_premier_enfant_mayotte_out + allocations_familiales_dot_montant_initial_base_deuxieme_enfant_mayotte_761 = result_664.montant_initial_base_deuxieme_enfant_mayotte_out + allocations_familiales_dot_montant_initial_base_troisieme_enfant_mayotte_762 = result_664.montant_initial_base_troisieme_enfant_mayotte_out + allocations_familiales_dot_montant_initial_base_quatrieme_enfant_et_plus_mayotte_763 = result_664.montant_initial_base_quatrieme_enfant_et_plus_mayotte_out + allocations_familiales_dot_droit_ouvert_forfaitaire_764 = result_664.droit_ouvert_forfaitaire_out + allocations_familiales_dot_montant_verse_forfaitaire_par_enfant_765 = result_664.montant_verse_forfaitaire_par_enfant_out + allocations_familiales_dot_montant_verse_forfaitaire_766 = result_664.montant_verse_forfaitaire_out + allocations_familiales_dot_droit_ouvert_majoration_767 = result_664.droit_ouvert_majoration_out + allocations_familiales_dot_montant_initial_metropole_majoration_768 = result_664.montant_initial_metropole_majoration_out + allocations_familiales_dot_montant_initial_majoration_769 = result_664.montant_initial_majoration_out + allocations_familiales_dot_montant_avec_garde_alternee_majoration_770 = result_664.montant_avec_garde_alternee_majoration_out + allocations_familiales_dot_montant_verse_majoration_771 = result_664.montant_verse_majoration_out + allocations_familiales_dot_droit_ouvert_complement_772 = result_664.droit_ouvert_complement_out + allocations_familiales_dot_montant_base_complement_pour_base_et_majoration_773 = result_664.montant_base_complement_pour_base_et_majoration_out + allocations_familiales_dot_complement_degressif_774 = result_664.complement_degressif_out + allocations_familiales_dot_montant_verse_complement_pour_base_et_majoration_775 = result_664.montant_verse_complement_pour_base_et_majoration_out + allocations_familiales_dot_montant_verse_complement_pour_forfaitaire_776 = result_664.montant_verse_complement_pour_forfaitaire_out + allocations_familiales_dot_nombre_enfants_l521_1_777 = result_664.nombre_enfants_l521_1_out + allocations_familiales_dot_age_minimum_alinea_1_l521_3_778 = result_664.age_minimum_alinea_1_l521_3_out + allocations_familiales_dot_nombre_enfants_alinea_2_l521_3_779 = result_664.nombre_enfants_alinea_2_l521_3_out + allocations_familiales_dot_est_enfant_le_plus_age_780 = result_664.est_enfant_le_plus_age_out + allocations_familiales_dot_plafond__i_d521_3_781 = result_664.plafond_I_d521_3_out + allocations_familiales_dot_plafond__i_i_d521_3_782 = result_664.plafond_II_d521_3_out try: try: - local_var_774 = montant_verse_607(Unit()) + local_var_784 = montant_verse_613(Unit()) except EmptyError: - local_var_774 = allocations_familiales_dot_montant_verse_738 + try: + local_var_784 = allocations_familiales_dot_montant_verse_748 + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./epilogue.catala_fr", - start_line=78, start_column=12, end_line=78, end_column=25, - law_headings=["Interface du programme", "Épilogue", - "Décrets divers"])) - montant_verse_773 = log_variable_definition(["InterfaceAllocationsFamiliales", - "montant_versé"], local_var_774) - return InterfaceAllocationsFamilialesOut(date_courante_out=date_courante_611, - enfants_out=enfants_613, - enfants_a_charge_out=enfants_a_charge_625, - ressources_menage_out=ressources_menage_615, - residence_out=residence_617, montant_verse_out=montant_verse_773, - personne_charge_effective_permanente_est_parent_out=personne_charge_effective_permanente_est_parent_619, - personne_charge_effective_permanente_remplit_titre_I_out=personne_charge_effective_permanente_remplit_titre__i_621, - avait_enfant_a_charge_avant_1er_janvier_2012_out=avait_enfant_a_charge_avant_1er_janvier_2012_623) + start_line=78, start_column=12, end_line=78, end_column=25, + law_headings=["Interface du programme", "Épilogue", + "Décrets divers"])) + montant_verse_783 = log_variable_definition(["InterfaceAllocationsFamiliales", + "montant_versé"], local_var_784) + return InterfaceAllocationsFamilialesOut(date_courante_out = date_courante_617, + enfants_out = enfants_619, + enfants_a_charge_out = enfants_a_charge_631, + ressources_menage_out = ressources_menage_621, + residence_out = residence_623, montant_verse_out = montant_verse_783, + personne_charge_effective_permanente_est_parent_out = personne_charge_effective_permanente_est_parent_625, + personne_charge_effective_permanente_remplit_titre_I_out = personne_charge_effective_permanente_remplit_titre__i_627, + avait_enfant_a_charge_avant_1er_janvier_2012_out = avait_enfant_a_charge_avant_1er_janvier_2012_629) \ No newline at end of file From 604fbbf2bf04c944148824e3648b197b47e1738e Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Tue, 30 Nov 2021 16:52:33 +0100 Subject: [PATCH 020/102] Stub of changing signature --- compiler/lcalc/compile_without_exceptions.ml | 6 +++--- compiler/lcalc/optimizations.ml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index 1b1c8876d..dffef8be3 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -77,12 +77,12 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl let x = A.Var.make ("e1", pos) in let tau = (D.TAny, pos) in - let e2 = - let+ e1 = Bindlib.box (A.EVar (x, pos)) in + let new_e new_e1_var = + let+ e1 = Bindlib.box (A.EVar (new_e1_var, pos)) in same_pos @@ A.ETupleAccess ((e1, pos), i, s, ts) in - A.make_letopt_in x tau e1 e2 + A.make_letopt_in tau e1 e2 | D.EInj (e1, i, en, ts) -> let e1 = translate_expr ctx e1 in let pos = Pos.get_position (Bindlib.unbox e1) in diff --git a/compiler/lcalc/optimizations.ml b/compiler/lcalc/optimizations.ml index 640d46688..e06ba4a65 100644 --- a/compiler/lcalc/optimizations.ml +++ b/compiler/lcalc/optimizations.ml @@ -22,7 +22,7 @@ let transform (t : 'a -> expr Pos.marked -> expr Pos.marked Bindlib.box) (ctx : (e : expr Pos.marked) : expr Pos.marked Bindlib.box = (* calls [t ctx] on every direct childs of [e], then rebuild an abstract syntax tree modified. Used in other transformations. *) - let default_mark e' = Pos.mark (Pos.get_position e) e' in + let default_mark e' = Pos.same_pos_as e' e in match Pos.unmark e with | EVar (v, pos) -> let+ v = Bindlib.box_var v in From 76f5e6115c39363a8adddf70fb0fa863ff6d2daf Mon Sep 17 00:00:00 2001 From: Alain Date: Tue, 30 Nov 2021 18:05:30 +0100 Subject: [PATCH 021/102] changing signature -- cont --- compiler/lcalc/ast.ml | 15 +++ compiler/lcalc/ast.mli | 7 + compiler/lcalc/compile_without_exceptions.ml | 132 +++++++++---------- 3 files changed, 88 insertions(+), 66 deletions(-) diff --git a/compiler/lcalc/ast.ml b/compiler/lcalc/ast.ml index b543d7f63..71aa02b39 100644 --- a/compiler/lcalc/ast.ml +++ b/compiler/lcalc/ast.ml @@ -122,6 +122,21 @@ let make_letopt_in (x : Var.t) (tau : D.typ Pos.marked) (e1 : expr Pos.marked Bi (make_abs (Array.of_list [ x ]) (make_none pos) pos [ tau ] pos) (make_abs (Array.of_list [ x ]) e2 pos [ tau ] pos) + +let make_bindopt + (pos: Pos.t) + (tau: D.typ Pos.marked) + (e1: expr Pos.marked Bindlib.box) + (e2: expr Bindlib.var -> expr Pos.marked Bindlib.box) +: expr Pos.marked Bindlib.box = + + let x = Var.make ("unit", pos) in + let v = Var.make ("v", pos) in + + make_matchopt e1 + (make_abs (Array.of_list [x]) (make_none pos) (pos) [D.TLit D.TUnit, pos] pos) + (make_abs (Array.of_list [v]) (e2 v) pos [tau] pos) + let handle_default = Var.make ("handle_default", Pos.no_pos) type binder = (expr, expr Pos.marked) Bindlib.binder diff --git a/compiler/lcalc/ast.mli b/compiler/lcalc/ast.mli index 7e4037e8d..eddd0b196 100644 --- a/compiler/lcalc/ast.mli +++ b/compiler/lcalc/ast.mli @@ -117,6 +117,13 @@ val make_matchopt : expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box +val make_bindopt : + Pos.t -> + Dcalc.Ast.typ Pos.marked -> + expr Pos.marked Bindlib.box -> + (expr Bindlib.var -> expr Pos.marked Bindlib.box) -> + expr Pos.marked Bindlib.box + val handle_default : Var.t type binder = (expr, expr Pos.marked) Bindlib.binder diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index dffef8be3..7a1da28c6 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -72,101 +72,99 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl | D.ETupleAccess (e1, i, s, ts) -> let e1 = translate_expr ctx e1 in - (* e1 : [|'a|] array option *) let pos = Pos.get_position (Bindlib.unbox e1) in - let x = A.Var.make ("e1", pos) in let tau = (D.TAny, pos) in let new_e new_e1_var = - let+ e1 = Bindlib.box (A.EVar (new_e1_var, pos)) in - same_pos @@ A.ETupleAccess ((e1, pos), i, s, ts) + let+ new_e1 = Bindlib.box (A.EVar (new_e1_var, pos)) in + same_pos @@ A.ETupleAccess ((new_e1, pos), i, s, ts) in - A.make_letopt_in tau e1 e2 + A.make_bindopt pos tau e1 new_e + | D.EInj (e1, i, en, ts) -> let e1 = translate_expr ctx e1 in let pos = Pos.get_position (Bindlib.unbox e1) in - let x = A.Var.make ("e1", pos) in - let tau = (D.TAny, pos) in - let e2 = - let+ e1 = Bindlib.box (A.EVar (x, pos)) in - same_pos @@ A.EInj ((e1, pos), i, en, ts) + let new_e new_e1_var = + let+ new_e1 = Bindlib.box (A.EVar (new_e1_var, pos)) in + same_pos @@ A.EInj ((new_e1, pos), i, en, ts) in - A.make_letopt_in x tau e1 e2 - | D.EMatch (e1, cases, en) -> - let e1 = translate_expr ctx e1 in - let pos = Pos.get_position (Bindlib.unbox e1) in - let x = A.Var.make ("e1", pos) in - - let tau = (D.TAny, pos) in - - let e2 = - let+ e1 = Bindlib.box (A.EVar (x, pos)) - and+ cases = - cases - |> List.map (fun (e', _pos) -> - match e' with - | D.EAbs ((binder, pos_binder), ts) -> - let vars, body = Bindlib.unmbind binder in - let ctx, lc_vars = - Array.fold_right - (fun var (ctx, lc_vars) -> - let lc_var = A.Var.make (Bindlib.name_of var, pos_binder) in - let lc_var_expr = A.make_var (lc_var, pos_binder) in - (D.VarMap.add var lc_var_expr ctx, lc_var :: lc_vars)) - vars (ctx, []) - in - let lc_vars = Array.of_list lc_vars in - let new_body = translate_expr ctx body in - let+ new_binder = Bindlib.bind_mvar lc_vars new_body in - same_pos @@ A.EAbs ((new_binder, pos_binder), List.map translate_typ ts) - | _ -> assert false) - |> Bindlib.box_list - in + A.make_bindopt pos tau e1 new_e + | D.EMatch (e1, cases, en) -> + let e1 = translate_expr ctx e1 in + let pos = Pos.get_position (Bindlib.unbox e1) in + let tau = (D.TAny, pos) in + + let new_e new_e1_var = + let+ new_e1 = Bindlib.box (A.EVar (new_e1_var, pos)) + and+ cases = + cases + |> List.map (fun (e', _pos) -> + match e' with + | D.EAbs ((binder, pos_binder), ts) -> + let vars, body = Bindlib.unmbind binder in + let ctx, lc_vars = + Array.fold_right + (fun var (ctx, lc_vars) -> + let lc_var = A.Var.make (Bindlib.name_of var, pos_binder) in + let lc_var_expr = A.make_var (lc_var, pos_binder) in + (D.VarMap.add var lc_var_expr ctx, lc_var :: lc_vars)) + vars (ctx, []) + in + let lc_vars = Array.of_list lc_vars in + let new_body = translate_expr ctx body in + let+ new_binder = Bindlib.bind_mvar lc_vars new_body in + same_pos @@ A.EAbs ((new_binder, pos_binder), List.map translate_typ ts) + | _ -> assert false) + |> Bindlib.box_list + in assert (List.for_all (fun (x, _) -> match x with A.EAbs _ -> true | _ -> false) cases); - same_pos @@ A.EMatch ((e1, pos), cases, en) + + same_pos @@ A.EMatch ((new_e1, pos), cases, en) in - A.make_letopt_in x tau e1 e2 + A.make_bindopt pos tau e1 new_e + | D.EArray es -> let+ es = es |> List.map (translate_expr ctx) |> Bindlib.box_list in - same_pos @@ A.make_some' (same_pos @@ A.EArray es) + | D.ELit l -> Bindlib.box @@ same_pos @@ translate_lit l | D.EOp op -> Bindlib.box @@ same_pos @@ A.make_some' (same_pos @@ A.EOp op) | D.EIfThenElse (e1, e2, e3) -> let e1 = translate_expr ctx e1 in let pos = Pos.get_position (Bindlib.unbox e1) in - let x = A.Var.make ("e1", pos) in - - (* we can say staticly what is the type of tau here. *) let tau = (D.TAny, pos) in - let e2 = - let+ e1 = Bindlib.box (A.EVar (x, pos)) + + + let new_e e1_new_var = + let+ e1_new = Bindlib.box (A.EVar (e1_new_var, pos)) and+ e2 = translate_expr ctx e2 and+ e3 = translate_expr ctx e3 in - same_pos @@ A.EIfThenElse ((e1, pos), e2, e3) + same_pos @@ A.EIfThenElse ((e1_new, pos), e2, e3) in - A.make_letopt_in x tau e1 e2 + A.make_bindopt pos tau e1 new_e + | D.EAssert e1 -> (* don't know the semantic of EAssert. *) (* Bindlib.box_apply (fun e1 -> Pos.same_pos_as (A.EAssert e1) e) (translate_expr ctx e1) *) let e1 = translate_expr ctx e1 in let pos = Pos.get_position (Bindlib.unbox e1) in - let x = A.Var.make ("e1", pos) in let tau = (D.TAny, pos) in - let e2 = let+ e1 = Bindlib.box (A.EVar (x, pos)) in + let new_e e1_new_var = + let+ e1_new = Bindlib.box (A.EVar (e1_new_var, pos)) in + same_pos @@ A.EAssert (e1_new, pos) + in - same_pos @@ A.EAssert (e1, pos) in + A.make_bindopt pos tau e1 new_e - A.make_letopt_in x tau e1 e2 | D.ErrorOnEmpty arg -> let pos = Pos.get_position arg in let x = A.Var.make ("e1", pos) in @@ -192,19 +190,21 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl let+ args = Bindlib.box_list (List.map (translate_expr ctx) args) in same_pos @@ A.EApp ((A.EOp op, pos), args) | D.EApp (e1, args) -> - let e1 = translate_expr ctx e1 in - let pos = Pos.get_position (Bindlib.unbox e1) in - let x = A.Var.make ("e1", pos) in - - let tau = (D.TAny, pos) in - - let e2 = - let+ e1 = Bindlib.box (A.EVar (x, pos)) - and+ args = Bindlib.box_list (List.map (translate_expr ctx) args) in - same_pos @@ A.EApp ((e1, pos), args) + let e1 = translate_expr ctx e1 in + let pos = Pos.get_position (Bindlib.unbox e1) in + let tau = (D.TAny, pos) in + + let new_e new_e1_var = + let+ new_e1 = Bindlib.box (A.EVar (new_e1_var, pos)) + and+ args = args + |> List.map (translate_expr ctx) + |> Bindlib.box_list in + same_pos @@ A.EApp ((new_e1, pos), args) + in + + A.make_bindopt pos tau e1 new_e - A.make_letopt_in x tau e1 e2 | D.EAbs ((binder, pos_binder), ts) -> let vars, body = Bindlib.unmbind binder in let ctx, lc_vars = From fd8ff75079b0cb4dc4d7980ee068beea3dd71c4a Mon Sep 17 00:00:00 2001 From: Alain Date: Wed, 1 Dec 2021 10:12:00 +0100 Subject: [PATCH 022/102] renamed transform -> visitor_map --- compiler/lcalc/optimizations.ml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/compiler/lcalc/optimizations.ml b/compiler/lcalc/optimizations.ml index e06ba4a65..b3709f141 100644 --- a/compiler/lcalc/optimizations.ml +++ b/compiler/lcalc/optimizations.ml @@ -18,7 +18,7 @@ let ( let+ ) x f = Bindlib.box_apply f x let ( and+ ) x y = Bindlib.box_pair x y -let transform (t : 'a -> expr Pos.marked -> expr Pos.marked Bindlib.box) (ctx : 'a) +let visitor_map (t : 'a -> expr Pos.marked -> expr Pos.marked Bindlib.box) (ctx : 'a) (e : expr Pos.marked) : expr Pos.marked Bindlib.box = (* calls [t ctx] on every direct childs of [e], then rebuild an abstract syntax tree modified. Used in other transformations. *) @@ -65,9 +65,9 @@ let rec iota_expr (_ : unit) (e : expr Pos.marked) : expr Pos.marked Bindlib.box let default_mark e' = Pos.mark (Pos.get_position e) e' in match Pos.unmark e with | EMatch ((EInj (e1, i, n', _ts), _), cases, n) when Dcalc.Ast.EnumName.compare n n' = 0 -> - let+ e1 = transform iota_expr () e1 and+ case = transform iota_expr () (List.nth cases i) in + let+ e1 = visitor_map iota_expr () e1 and+ case = visitor_map iota_expr () (List.nth cases i) in default_mark @@ EApp (case, [ e1 ]) - | _ -> transform iota_expr () e + | _ -> visitor_map iota_expr () e let iota_optimizations (p : program) : program = { p with scopes = List.map (fun (var, e) -> (var, Bindlib.unbox (iota_expr () e))) p.scopes } @@ -77,14 +77,14 @@ let rec peephole_expr (_ : unit) (e : expr Pos.marked) : expr Pos.marked Bindlib match Pos.unmark e with | EIfThenElse (e1, e2, e3) -> ( - let+ e1 = transform peephole_expr () e1 - and+ e2 = transform peephole_expr () e2 - and+ e3 = transform peephole_expr () e3 in + let+ e1 = visitor_map peephole_expr () e1 + and+ e2 = visitor_map peephole_expr () e2 + and+ e3 = visitor_map peephole_expr () e3 in match Pos.unmark e1 with | ELit (LBool true) | EApp ((EOp (Unop (Log _)), _), [ (ELit (LBool true), _) ]) -> e2 | ELit (LBool false) | EApp ((EOp (Unop (Log _)), _), [ (ELit (LBool false), _) ]) -> e3 | _ -> default_mark @@ EIfThenElse (e1, e2, e3)) - | _ -> transform peephole_expr () e + | _ -> visitor_map peephole_expr () e let peephole_optimizations (p : program) : program = { p with scopes = List.map (fun (var, e) -> (var, Bindlib.unbox (peephole_expr () e))) p.scopes } From be166eb479b0f8d316793d3e7e4b4976b8807e4b Mon Sep 17 00:00:00 2001 From: Alain Date: Wed, 1 Dec 2021 10:12:22 +0100 Subject: [PATCH 023/102] add lazy implementation of handle_default_opt in runtime --- compiler/runtime.ml | 19 +++++++++++++++++++ compiler/runtime.mli | 3 +++ 2 files changed, 22 insertions(+) diff --git a/compiler/runtime.ml b/compiler/runtime.ml index 7dfc0f14f..fd898a723 100644 --- a/compiler/runtime.ml +++ b/compiler/runtime.ml @@ -215,6 +215,25 @@ let handle_default : 'a. (unit -> 'a) array -> (unit -> bool) -> (unit -> 'a) -> in match except with Some x -> x | None -> if just () then cons () else raise EmptyError +let handle_default_opt: 'a. 'a eoption array -> (unit -> bool eoption) -> (unit -> 'a eoption) -> 'a eoption = + fun exceptions just cons -> + let except = + Array.fold_left + (fun acc except -> + match acc, except with + | ENone _, _ -> except + | ESome _, ENone _ -> acc + | ESome _, ESome _ -> raise ConflictError) + (ENone ()) exceptions + in + match except with + | ESome _ -> except + | ENone _ -> begin + match just () with + | ESome b -> if b then cons () else ENone () + | ENone _ -> ENone () + end + let no_input : unit -> 'a = fun _ -> raise EmptyError let ( *$ ) (i1 : money) (i2 : decimal) : money = diff --git a/compiler/runtime.mli b/compiler/runtime.mli index 8cc832a34..beffe79ce 100644 --- a/compiler/runtime.mli +++ b/compiler/runtime.mli @@ -175,6 +175,9 @@ val handle_default : (unit -> 'a) array -> (unit -> bool) -> (unit -> 'a) -> 'a (** @raise EmptyError @raise ConflictError *) +val handle_default_opt: 'a eoption array -> (unit -> bool eoption) -> (unit -> 'a eoption) -> 'a eoption +(** @raise ConflictError *) + val no_input : unit -> 'a (**{1 Operators} *) From 5f868374289ceb943f19b008fcf11d390ba6c155 Mon Sep 17 00:00:00 2001 From: Alain Date: Wed, 1 Dec 2021 11:17:16 +0100 Subject: [PATCH 024/102] correct use of bindlib in the translation --- compiler/lcalc/compile_without_exceptions.ml | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index 7a1da28c6..d1a8e2dd0 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -76,7 +76,7 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl let tau = (D.TAny, pos) in let new_e new_e1_var = - let+ new_e1 = Bindlib.box (A.EVar (new_e1_var, pos)) in + let+ new_e1 = Bindlib.box_var new_e1_var in same_pos @@ A.ETupleAccess ((new_e1, pos), i, s, ts) in @@ -88,7 +88,7 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl let tau = (D.TAny, pos) in let new_e new_e1_var = - let+ new_e1 = Bindlib.box (A.EVar (new_e1_var, pos)) in + let+ new_e1 = Bindlib.box_var new_e1_var in same_pos @@ A.EInj ((new_e1, pos), i, en, ts) in @@ -100,7 +100,7 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl let tau = (D.TAny, pos) in let new_e new_e1_var = - let+ new_e1 = Bindlib.box (A.EVar (new_e1_var, pos)) + let+ new_e1 = Bindlib.box_var new_e1_var and+ cases = cases |> List.map (fun (e', _pos) -> @@ -142,8 +142,8 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl - let new_e e1_new_var = - let+ e1_new = Bindlib.box (A.EVar (e1_new_var, pos)) + let new_e new_e1_var = + let+ e1_new = Bindlib.box_var new_e1_var and+ e2 = translate_expr ctx e2 and+ e3 = translate_expr ctx e3 in same_pos @@ A.EIfThenElse ((e1_new, pos), e2, e3) @@ -158,8 +158,8 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl let pos = Pos.get_position (Bindlib.unbox e1) in let tau = (D.TAny, pos) in - let new_e e1_new_var = - let+ e1_new = Bindlib.box (A.EVar (e1_new_var, pos)) in + let new_e new_e1_var = + let+ e1_new = Bindlib.box_var new_e1_var in same_pos @@ A.EAssert (e1_new, pos) in @@ -186,16 +186,13 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl in A.make_matchopt e1 e2 e3 - | D.EApp ((D.EOp op, pos), args) -> - let+ args = Bindlib.box_list (List.map (translate_expr ctx) args) in - same_pos @@ A.EApp ((A.EOp op, pos), args) | D.EApp (e1, args) -> let e1 = translate_expr ctx e1 in let pos = Pos.get_position (Bindlib.unbox e1) in let tau = (D.TAny, pos) in let new_e new_e1_var = - let+ new_e1 = Bindlib.box (A.EVar (new_e1_var, pos)) + let+ new_e1 = Bindlib.box_var new_e1_var and+ args = args |> List.map (translate_expr ctx) |> Bindlib.box_list From 3f8bc482f37cfb885a86930ebfab35f44c6799aa Mon Sep 17 00:00:00 2001 From: Alain Date: Wed, 1 Dec 2021 15:42:01 +0100 Subject: [PATCH 025/102] add refine iota transformation in lcalc --- compiler/lcalc/optimizations.ml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/compiler/lcalc/optimizations.ml b/compiler/lcalc/optimizations.ml index b3709f141..09b9db5bf 100644 --- a/compiler/lcalc/optimizations.ml +++ b/compiler/lcalc/optimizations.ml @@ -18,8 +18,10 @@ let ( let+ ) x f = Bindlib.box_apply f x let ( and+ ) x y = Bindlib.box_pair x y -let visitor_map (t : 'a -> expr Pos.marked -> expr Pos.marked Bindlib.box) (ctx : 'a) - (e : expr Pos.marked) : expr Pos.marked Bindlib.box = +let visitor_map + (t : 'a -> expr Pos.marked -> expr Pos.marked Bindlib.box) + (ctx : 'a) + (e : expr Pos.marked) : expr Pos.marked Bindlib.box = (* calls [t ctx] on every direct childs of [e], then rebuild an abstract syntax tree modified. Used in other transformations. *) let default_mark e' = Pos.same_pos_as e' e in @@ -67,6 +69,19 @@ let rec iota_expr (_ : unit) (e : expr Pos.marked) : expr Pos.marked Bindlib.box | EMatch ((EInj (e1, i, n', _ts), _), cases, n) when Dcalc.Ast.EnumName.compare n n' = 0 -> let+ e1 = visitor_map iota_expr () e1 and+ case = visitor_map iota_expr () (List.nth cases i) in default_mark @@ EApp (case, [ e1 ]) + + | EMatch (e', cases, n) when begin + cases + |> List.mapi (fun i (case, _pos) -> + match case with + | EInj (_ei, i', n', _ts') -> + i = i' && (* n = n' *) (Dcalc.Ast.EnumName.compare n n' = 0) + | _ -> false + ) + |> List.for_all Fun.id + end -> + visitor_map iota_expr () e' + | _ -> visitor_map iota_expr () e let iota_optimizations (p : program) : program = From 86fa2ea7faa5052706802863e4e6c0aad514c5a7 Mon Sep 17 00:00:00 2001 From: Alain Date: Wed, 1 Dec 2021 15:42:37 +0100 Subject: [PATCH 026/102] correct bindlib utilization (cont) --- compiler/lcalc/compile_without_exceptions.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index d1a8e2dd0..510dc6670 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -175,7 +175,7 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl let e3 = A.make_abs (Array.of_list [ x ]) - (Bindlib.box @@ same_pos @@ A.EVar (x, pos)) + (let+ v = Bindlib.box_var x in (v, pos)) pos [ tau ] pos and e1 = arg and e2 = From 0dfac8210e72826b6bcdeff2e0433f80b297c16d Mon Sep 17 00:00:00 2001 From: Alain Date: Wed, 1 Dec 2021 15:43:19 +0100 Subject: [PATCH 027/102] fix invariant correction within ErrorOnEmpty --- compiler/lcalc/compile_without_exceptions.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index 510dc6670..176b6b225 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -185,7 +185,7 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl pos [ tau ] pos in - A.make_matchopt e1 e2 e3 + A.make_some @@ A.make_matchopt e1 e2 e3 | D.EApp (e1, args) -> let e1 = translate_expr ctx e1 in let pos = Pos.get_position (Bindlib.unbox e1) in From ac7df6cdd778fba2d01a6484e81190299cfa9a41 Mon Sep 17 00:00:00 2001 From: Alain Date: Wed, 1 Dec 2021 15:48:18 +0100 Subject: [PATCH 028/102] add: implementation of generic operator without the need of rewriting each one add: error when using an operator not in the right place when using --avoid_empty --- compiler/lcalc/compile_without_exceptions.ml | 37 +++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index 176b6b225..9a4287096 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -134,7 +134,42 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl same_pos @@ A.make_some' (same_pos @@ A.EArray es) | D.ELit l -> Bindlib.box @@ same_pos @@ translate_lit l - | D.EOp op -> Bindlib.box @@ same_pos @@ A.make_some' (same_pos @@ A.EOp op) + | D.EOp _op -> + Errors.raise_spanned_error "Internal error: generic operator are not yet supported." (Pos.get_position e) + | D.EApp((D.EOp op, pos), args) -> + + begin + let xs = List.mapi (fun i arg -> A.Var.make (Printf.sprintf "x_%d" i, Pos.get_position arg)) args in + + + let dummy = A.Var.make ("unit", pos) in + + let e' final = args + |> List.map (translate_expr ctx) + |> List.combine xs + |> List.fold_left (fun acc (x, arg) -> + A.make_matchopt + arg + (A.make_abs (Array.of_list [dummy]) (A.make_none pos) (pos) [D.TLit D.TUnit, pos] pos) + (A.make_abs (Array.of_list [x]) acc pos [D.TAny, pos] pos) + ) final + in + + let new_e = + let+ args_var = xs + |> List.map (fun x -> Bindlib.box_var x) + |> Bindlib.box_list + in + + let args_var = args_var + |> List.combine args + |> List.map (fun (arg, x) -> Pos.same_pos_as x arg) + in + same_pos @@ A.make_some' @@ same_pos @@ A.EApp ((A.EOp op, pos), args_var) + in + + e' new_e + end | D.EIfThenElse (e1, e2, e3) -> let e1 = translate_expr ctx e1 in let pos = Pos.get_position (Bindlib.unbox e1) in From 959203e59599cf4dae56fd5cd15a9a7087f0b4f3 Mon Sep 17 00:00:00 2001 From: Alain Date: Wed, 1 Dec 2021 15:48:58 +0100 Subject: [PATCH 029/102] add: error message when unary operator log is left somewhere it shouldn't --- compiler/lcalc/to_ocaml.ml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/compiler/lcalc/to_ocaml.ml b/compiler/lcalc/to_ocaml.ml index 07090c33a..35a685e21 100644 --- a/compiler/lcalc/to_ocaml.ml +++ b/compiler/lcalc/to_ocaml.ml @@ -89,9 +89,8 @@ let format_unop (fmt : Format.formatter) (op : Dcalc.Ast.unop Pos.marked) : unit | Minus k -> Format.fprintf fmt "~-%a" format_op_kind k | Not -> Format.fprintf fmt "%s" "not" | Log (_entry, _infos) -> - (* Errors.raise_spanned_error "Internal error: a log operator has not been caught by the - expression match" (Pos.get_position op) *) - Format.fprintf fmt "Fun.id" + Errors.raise_spanned_error "Internal error: a log operator has not been caught by the + expression match" (Pos.get_position op) | Length -> Format.fprintf fmt "%s" "array_length" | IntToRat -> Format.fprintf fmt "%s" "decimal_of_integer" | GetDay -> Format.fprintf fmt "%s" "day_of_month_of_date" From 52aae25b9594bc95373e74fce9ea587b1e74f0e4 Mon Sep 17 00:00:00 2001 From: Alain Date: Wed, 1 Dec 2021 15:53:17 +0100 Subject: [PATCH 030/102] bump version --- .nix/no-web.patch | 2 +- default.nix | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.nix/no-web.patch b/.nix/no-web.patch index ad9a67c26..25fcfcdda 100644 --- a/.nix/no-web.patch +++ b/.nix/no-web.patch @@ -14,7 +14,7 @@ index 31d5289..0000000 - (language : Js.js_string Js.t) (trace : bool) = - driver - (Contents (Js.to_string contents)) -- false false false "Interpret" +- false false false false "Interpret" - (Some (Js.to_string language)) - None trace false - (Some (Js.to_string scope)) diff --git a/default.nix b/default.nix index b133a81e7..8ba3c1270 100644 --- a/default.nix +++ b/default.nix @@ -23,9 +23,9 @@ buildDunePackage rec { pname = "catala"; - version = "0.3.0"; + version = "0.5.0"; - minimumOCamlVersion = "4.08"; + minimumOCamlVersion = "4.11"; src = ./.; @@ -54,7 +54,7 @@ buildDunePackage rec { ] ++ (if isNull menhirLib then [ ] else [ menhirLib ]); doCheck = true; - # patches = [ ./.nix/no-web.patch ]; + patches = [ ./.nix/no-web.patch ]; meta = with lib; { homepage = "https://catala-lang.org"; From 177a2149aceb5b06cf1164a26484f4d1e8cf5f60 Mon Sep 17 00:00:00 2001 From: Alain Date: Tue, 7 Dec 2021 16:03:15 +0100 Subject: [PATCH 031/102] handle_opt --- compiler/lcalc/ast.ml | 2 ++ compiler/lcalc/ast.mli | 2 ++ 2 files changed, 4 insertions(+) diff --git a/compiler/lcalc/ast.ml b/compiler/lcalc/ast.ml index 71aa02b39..75abf8cab 100644 --- a/compiler/lcalc/ast.ml +++ b/compiler/lcalc/ast.ml @@ -139,6 +139,8 @@ let make_bindopt let handle_default = Var.make ("handle_default", Pos.no_pos) +let handle_default_opt = Var.make ("handle_default_opt", Pos.no_pos) + type binder = (expr, expr Pos.marked) Bindlib.binder type program = { decl_ctx : D.decl_ctx; scopes : (Var.t * expr Pos.marked) list } diff --git a/compiler/lcalc/ast.mli b/compiler/lcalc/ast.mli index eddd0b196..696a95ecb 100644 --- a/compiler/lcalc/ast.mli +++ b/compiler/lcalc/ast.mli @@ -126,6 +126,8 @@ val make_bindopt : val handle_default : Var.t +val handle_default_opt : Var.t + type binder = (expr, expr Pos.marked) Bindlib.binder type program = { decl_ctx : Dcalc.Ast.decl_ctx; scopes : (Var.t * expr Pos.marked) list } From df545e5761b7f3973046bba5afb155b00cbc9bc4 Mon Sep 17 00:00:00 2001 From: Alain Date: Tue, 7 Dec 2021 18:56:10 +0100 Subject: [PATCH 032/102] add translate_binder refactor make_bindopt refactor make_matchopt added make_bindmopt remove _{i}_ printing in to_ocaml add correct printing of handle_default_opt add two-step translation correct context for new variables --- compiler/lcalc/ast.ml | 65 +++-- compiler/lcalc/ast.mli | 16 +- compiler/lcalc/compile_without_exceptions.ml | 242 +++++++++++-------- compiler/lcalc/to_ocaml.ml | 4 +- 4 files changed, 194 insertions(+), 133 deletions(-) diff --git a/compiler/lcalc/ast.ml b/compiler/lcalc/ast.ml index 75abf8cab..e9083bc20 100644 --- a/compiler/lcalc/ast.ml +++ b/compiler/lcalc/ast.ml @@ -113,29 +113,54 @@ let make_matchopt (e : expr Pos.marked Bindlib.box) (e_none : expr Pos.marked Bi mark @@ EMatch (e, [ e_none; e_some ], option_enum) -let make_letopt_in (x : Var.t) (tau : D.typ Pos.marked) (e1 : expr Pos.marked Bindlib.box) - (e2 : expr Pos.marked Bindlib.box) : expr Pos.marked Bindlib.box = - (* let%opt x: tau = e1 in e2 == matchopt e1 with | None -> None | Some x -> e2 *) - let pos = Pos.get_position (Bindlib.unbox e2) in - - make_matchopt e1 - (make_abs (Array.of_list [ x ]) (make_none pos) pos [ tau ] pos) - (make_abs (Array.of_list [ x ]) e2 pos [ tau ] pos) + let make_matchopt' + (pos: Pos.t) + (tau: D.typ Pos.marked) + (arg: expr Pos.marked Bindlib.box) + (e_none: expr Pos.marked Bindlib.box) + (e_some: expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box) + : expr Pos.marked Bindlib.box = + + let x = Var.make ("unit", pos) in + let v = Var.make ("v", pos) in + + make_matchopt arg + (make_abs (Array.of_list [x]) (e_none) (pos) [D.TLit D.TUnit, pos] pos) + (make_abs (Array.of_list [v]) (e_some (let+ v = Bindlib.box_var v in (v, pos))) pos [tau] pos) let make_bindopt - (pos: Pos.t) - (tau: D.typ Pos.marked) - (e1: expr Pos.marked Bindlib.box) - (e2: expr Bindlib.var -> expr Pos.marked Bindlib.box) -: expr Pos.marked Bindlib.box = - - let x = Var.make ("unit", pos) in - let v = Var.make ("v", pos) in - - make_matchopt e1 - (make_abs (Array.of_list [x]) (make_none pos) (pos) [D.TLit D.TUnit, pos] pos) - (make_abs (Array.of_list [v]) (e2 v) pos [tau] pos) + (pos: Pos.t) + (tau: D.typ Pos.marked) + (e1: expr Pos.marked Bindlib.box) + (e2: expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box) + : expr Pos.marked Bindlib.box = + + make_matchopt' pos tau e1 (make_none pos) e2 + + +let make_bindmopt + (pos: Pos.t) + (taus: D.typ Pos.marked list) + (e1s: expr Pos.marked Bindlib.box list) + (e2s: expr Pos.marked Bindlib.box list -> expr Pos.marked Bindlib.box) + : expr Pos.marked Bindlib.box = + + let dummy = Var.make ("unit", pos) in + let vs = List.mapi (fun i _ -> Var.make (Format.sprintf "v_%i" i, pos)) e1s in + + let e1' final = List.combine (List.combine vs taus) e1s + |> List.fold_left (fun acc ((x, tau), arg) -> + make_matchopt arg + (make_abs (Array.of_list [dummy]) (make_none pos) pos [D.TLit D.TUnit, pos] pos) + (make_abs (Array.of_list [x]) acc pos [tau] pos) + ) final + in + + e1' (make_some (e2s (List.map (fun v -> let+ v = Bindlib.box_var v in (v, pos)) vs))) + + + let handle_default = Var.make ("handle_default", Pos.no_pos) diff --git a/compiler/lcalc/ast.mli b/compiler/lcalc/ast.mli index 696a95ecb..04fd9aa0b 100644 --- a/compiler/lcalc/ast.mli +++ b/compiler/lcalc/ast.mli @@ -90,13 +90,6 @@ val make_let_in : expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box -val make_letopt_in : - Var.t -> - Dcalc.Ast.typ Pos.marked -> - expr Pos.marked Bindlib.box -> - expr Pos.marked Bindlib.box -> - expr Pos.marked Bindlib.box - val option_enum : Dcalc.Ast.EnumName.t val none_constr : Dcalc.Ast.EnumConstructor.t @@ -121,7 +114,14 @@ val make_bindopt : Pos.t -> Dcalc.Ast.typ Pos.marked -> expr Pos.marked Bindlib.box -> - (expr Bindlib.var -> expr Pos.marked Bindlib.box) -> + (expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box) -> + expr Pos.marked Bindlib.box + +val make_bindmopt: + (Pos.t) -> + (Dcalc.Ast.typ Pos.marked list) -> + (expr Pos.marked Bindlib.box list) -> + (expr Pos.marked Bindlib.box list -> expr Pos.marked Bindlib.box) -> expr Pos.marked Bindlib.box val handle_default : Var.t diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index 9a4287096..ff2c0bf7a 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -16,7 +16,10 @@ open Utils module D = Dcalc.Ast module A = Ast -type ctx = A.expr Pos.marked Bindlib.box D.VarMap.t +type ctx = { + env: A.expr Pos.marked Bindlib.box D.VarMap.t; + env_pure: bool D.VarMap.t; (* true if it is pure (without opt) *) +} let translate_lit (l : D.lit) : A.expr = let build lit = @@ -40,6 +43,9 @@ let thunk_expr (e : A.expr Pos.marked Bindlib.box) (pos : Pos.t) : A.expr Pos.ma let dummy_var = A.Var.make ("_", pos) in A.make_abs [| dummy_var |] e pos [ (D.TAny, pos) ] pos + +(* let translate_binder (ctx: ctx) = assert false *) + let rec translate_default (ctx : ctx) (exceptions : D.expr Pos.marked list) (just : D.expr Pos.marked) (cons : D.expr Pos.marked) (pos_default : Pos.t) : A.expr Pos.marked Bindlib.box = @@ -62,10 +68,35 @@ and translate_typ (t : D.typ Pos.marked) : D.typ Pos.marked = (* Hack: If the type is D.TAny, it means for the compiler to not put any type annotation.*) Pos.same_pos_as D.TAny t +and translate_binder (ctx: ctx) ((binder, pos_binder): (D.expr, D.expr Pos.marked) Bindlib.mbinder Pos.marked): (A.expr, A.expr Pos.marked) Bindlib.mbinder Pos.marked Bindlib.box = + + let vars, body = Bindlib.unmbind binder in + let ctx, lc_vars = + Array.fold_right + (fun var (ctx, lc_vars) -> + let lc_var = A.Var.make (Bindlib.name_of var, pos_binder) in + let lc_var_expr = A.make_var (lc_var, pos_binder) in + let new_ctx = { + env=D.VarMap.add var lc_var_expr ctx.env; + env_pure=D.VarMap.add var false ctx.env_pure; + } in + (new_ctx, lc_var :: lc_vars)) + vars (ctx, []) + in + let lc_vars = Array.of_list lc_vars in + let new_body = translate_expr ctx body in + let+ binder = Bindlib.bind_mvar lc_vars new_body in + (binder, pos_binder) + and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindlib.box = let same_pos e' = Pos.same_pos_as e' e in match Pos.unmark e with - | D.EVar v -> D.VarMap.find (Pos.unmark v) ctx + | D.EVar v -> + (if D.VarMap.find (Pos.unmark v) ctx.env_pure then + A.make_some + else + Fun.id) + (D.VarMap.find (Pos.unmark v) ctx.env) | D.ETuple (args, s) -> let+ args = Bindlib.box_list (List.map (translate_expr ctx) args) in Pos.same_pos_as (A.ETuple (args, s)) e @@ -75,9 +106,9 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl let pos = Pos.get_position (Bindlib.unbox e1) in let tau = (D.TAny, pos) in - let new_e new_e1_var = - let+ new_e1 = Bindlib.box_var new_e1_var in - same_pos @@ A.ETupleAccess ((new_e1, pos), i, s, ts) + let new_e new_e1 = + let+ new_e1 = new_e1 in + same_pos @@ A.ETupleAccess (new_e1, i, s, ts) in A.make_bindopt pos tau e1 new_e @@ -87,9 +118,9 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl let pos = Pos.get_position (Bindlib.unbox e1) in let tau = (D.TAny, pos) in - let new_e new_e1_var = - let+ new_e1 = Bindlib.box_var new_e1_var in - same_pos @@ A.EInj ((new_e1, pos), i, en, ts) + let new_e new_e1 = + let+ new_e1 = new_e1 in + same_pos @@ A.EInj (new_e1, i, en, ts) in A.make_bindopt pos tau e1 new_e @@ -99,32 +130,22 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl let pos = Pos.get_position (Bindlib.unbox e1) in let tau = (D.TAny, pos) in - let new_e new_e1_var = - let+ new_e1 = Bindlib.box_var new_e1_var + let new_e new_e1 = + let+ new_e1 = new_e1 and+ cases = cases |> List.map (fun (e', _pos) -> - match e' with - | D.EAbs ((binder, pos_binder), ts) -> - let vars, body = Bindlib.unmbind binder in - let ctx, lc_vars = - Array.fold_right - (fun var (ctx, lc_vars) -> - let lc_var = A.Var.make (Bindlib.name_of var, pos_binder) in - let lc_var_expr = A.make_var (lc_var, pos_binder) in - (D.VarMap.add var lc_var_expr ctx, lc_var :: lc_vars)) - vars (ctx, []) - in - let lc_vars = Array.of_list lc_vars in - let new_body = translate_expr ctx body in - let+ new_binder = Bindlib.bind_mvar lc_vars new_body in - same_pos @@ A.EAbs ((new_binder, pos_binder), List.map translate_typ ts) - | _ -> assert false) + match e' with + | D.EAbs (binder, ts) -> + let+ new_binder = translate_binder ctx binder in + same_pos @@ A.EAbs (new_binder, List.map translate_typ ts) + | _ -> Errors.raise_spanned_error "Internal error: an error occured during the translation of a amtch." (Pos.get_position e)) |> Bindlib.box_list in - assert (List.for_all (fun (x, _) -> match x with A.EAbs _ -> true | _ -> false) cases); + if (List.for_all (fun (x, _) -> match x with A.EAbs _ -> true | _ -> false) cases) then + Errors.raise_spanned_error "Internal error: an error occured during the translation of a match." (Pos.get_position e); - same_pos @@ A.EMatch ((new_e1, pos), cases, en) + same_pos @@ A.EMatch (new_e1, cases, en) in A.make_bindopt pos tau e1 new_e @@ -135,41 +156,40 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl | D.ELit l -> Bindlib.box @@ same_pos @@ translate_lit l | D.EOp _op -> - Errors.raise_spanned_error "Internal error: generic operator are not yet supported." (Pos.get_position e) + Errors.raise_spanned_error "Internal error: partial application of generic operator are not yet supported when using --avoid_exception." (Pos.get_position e) | D.EApp((D.EOp op, pos), args) -> - begin - let xs = List.mapi (fun i arg -> A.Var.make (Printf.sprintf "x_%d" i, Pos.get_position arg)) args in - - - let dummy = A.Var.make ("unit", pos) in - - let e' final = args - |> List.map (translate_expr ctx) - |> List.combine xs - |> List.fold_left (fun acc (x, arg) -> - A.make_matchopt - arg - (A.make_abs (Array.of_list [dummy]) (A.make_none pos) (pos) [D.TLit D.TUnit, pos] pos) - (A.make_abs (Array.of_list [x]) acc pos [D.TAny, pos] pos) - ) final - in - - let new_e = - let+ args_var = xs - |> List.map (fun x -> Bindlib.box_var x) - |> Bindlib.box_list + let xs = List.mapi (fun i arg -> A.Var.make (Printf.sprintf "x_%d" i, Pos.get_position arg)) args in + + let dummy = A.Var.make ("unit", pos) in + + let e' final = args + |> List.map (translate_expr ctx) + |> List.combine xs + |> List.fold_left (fun acc (x, arg) -> + A.make_matchopt + arg + (A.make_abs (Array.of_list [dummy]) (A.make_none pos) (pos) [D.TLit D.TUnit, pos] pos) + (A.make_abs (Array.of_list [x]) acc pos [D.TAny, pos] pos) + ) final in - let args_var = args_var - |> List.combine args - |> List.map (fun (arg, x) -> Pos.same_pos_as x arg) + let new_e = + let+ args_var = xs + |> List.map (fun x -> Bindlib.box_var x) + |> Bindlib.box_list + in + + let args_var = args_var + |> List.combine args + |> List.map (fun (arg, x) -> Pos.same_pos_as x arg) + in + same_pos @@ A.make_some' @@ same_pos @@ A.EApp ((A.EOp op, pos), args_var) in - same_pos @@ A.make_some' @@ same_pos @@ A.EApp ((A.EOp op, pos), args_var) - in - e' new_e + e' new_e end + | D.EIfThenElse (e1, e2, e3) -> let e1 = translate_expr ctx e1 in let pos = Pos.get_position (Bindlib.unbox e1) in @@ -177,11 +197,11 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl - let new_e new_e1_var = - let+ e1_new = Bindlib.box_var new_e1_var + let new_e new_e1 = + let+ e1_new = new_e1 and+ e2 = translate_expr ctx e2 and+ e3 = translate_expr ctx e3 in - same_pos @@ A.EIfThenElse ((e1_new, pos), e2, e3) + same_pos @@ A.EIfThenElse (e1_new, e2, e3) in A.make_bindopt pos tau e1 new_e @@ -193,70 +213,84 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl let pos = Pos.get_position (Bindlib.unbox e1) in let tau = (D.TAny, pos) in - let new_e new_e1_var = - let+ e1_new = Bindlib.box_var new_e1_var in - same_pos @@ A.EAssert (e1_new, pos) + let new_e new_e1 = + let+ e1_new = new_e1 in + same_pos @@ A.EAssert e1_new in A.make_bindopt pos tau e1 new_e - | D.ErrorOnEmpty arg -> - let pos = Pos.get_position arg in - let x = A.Var.make ("e1", pos) in - let arg = translate_expr ctx arg in - - let tau = (D.TAny, pos) in - - let e3 = - A.make_abs - (Array.of_list [ x ]) - (let+ v = Bindlib.box_var x in (v, pos)) - pos [ tau ] pos - and e1 = arg - and e2 = - A.make_abs - (Array.of_list [ x ]) - (Bindlib.box @@ same_pos @@ A.ERaise A.NoValueProvided) - pos [ tau ] pos - in - - A.make_some @@ A.make_matchopt e1 e2 e3 - | D.EApp (e1, args) -> + | D.EApp (e1, args) -> let e1 = translate_expr ctx e1 in let pos = Pos.get_position (Bindlib.unbox e1) in let tau = (D.TAny, pos) in - let new_e new_e1_var = - let+ new_e1 = Bindlib.box_var new_e1_var + let new_e new_e1 = + let+ new_e1 = new_e1 and+ args = args |> List.map (translate_expr ctx) |> Bindlib.box_list in - same_pos @@ A.EApp ((new_e1, pos), args) + same_pos @@ A.EApp (new_e1, args) in A.make_bindopt pos tau e1 new_e - | D.EAbs ((binder, pos_binder), ts) -> - let vars, body = Bindlib.unmbind binder in - let ctx, lc_vars = - Array.fold_right - (fun var (ctx, lc_vars) -> - let lc_var = A.Var.make (Bindlib.name_of var, pos_binder) in - let lc_var_expr = A.make_var (lc_var, pos_binder) in - (D.VarMap.add var lc_var_expr ctx, lc_var :: lc_vars)) - vars (ctx, []) - in - let lc_vars = Array.of_list lc_vars in - let new_body = translate_expr ctx body in - let+ new_binder = Bindlib.bind_mvar lc_vars new_body in + | D.EAbs (binder, ts) -> + let+ new_binder = translate_binder ctx binder in same_pos - @@ A.make_some' (same_pos @@ A.EAbs ((new_binder, pos_binder), List.map translate_typ ts)) + @@ A.make_some' (same_pos @@ A.EAbs (new_binder, List.map translate_typ ts)) | D.EDefault (exceptions, just, cons) -> translate_default ctx exceptions just cons (Pos.get_position e) + | D.ErrorOnEmpty _ -> assert false (* todo: error message *) + +let translate_expr_toplevel (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindlib.box = + + let same_pos e' = Pos.same_pos_as e' e in + match Pos.unmark e with + | D.ErrorOnEmpty arg -> + let pos = Pos.get_position arg in + let x = A.Var.make ("result", pos) in + let arg = translate_expr ctx arg in + + let tau = (D.TAny, pos) in + + let e3 = + A.make_abs + (Array.of_list [ x ]) + (let+ v = Bindlib.box_var x in (v, pos)) + pos [ tau ] pos + and e1 = arg + and e2 = + A.make_abs + (Array.of_list [ x ]) + (Bindlib.box @@ same_pos @@ A.ERaise A.NoValueProvided) + pos [ tau ] pos + in + + A.make_matchopt e1 e2 e3 + + | _ -> + (match Pos.unmark e with + | D.EVar _ -> Printf.printf "EVar\n" + | D.ETuple _ -> Printf.printf "ETuple\n" + | D.ETupleAccess _ -> Printf.printf "ETupleAccess\n" + | D.EInj _ -> Printf.printf "EInj\n" + | D.EMatch _ -> Printf.printf "EMatch\n" + | D.EArray _ -> Printf.printf "EArray\n" + | D.ELit _ -> Printf.printf "ELit\n" + | D.EAbs _ -> Printf.printf "EAbs\n" + | D.EApp _ -> Printf.printf "EApp\n" + | D.EAssert _ -> Printf.printf "EAssert\n" + | D.EOp _ -> Printf.printf "EOp\n" + | D.EIfThenElse _ -> Printf.printf "EIfThenElse\n" + | D.ErrorOnEmpty _ -> Printf.printf "ErrorOnEmpty\n" + | D.EDefault _ -> Printf.printf "EDefault\n"); + assert false (* todo: error message*) + let translate_program (prgm : D.program) : A.program = - { +{ scopes = (let acc, _ = List.fold_left @@ -265,7 +299,9 @@ let translate_program (prgm : D.program) : A.program = let new_acc = ( new_n, Bindlib.unbox - (translate_expr (D.VarMap.map (fun v -> A.make_var (v, Pos.no_pos)) ctx) e) ) + (translate_expr_toplevel { + env=D.VarMap.map (fun v -> A.make_var (v, Pos.no_pos)) ctx; + env_pure=D.VarMap.map (fun _ -> true) ctx } e) ) :: acc in let new_ctx = D.VarMap.add n new_n ctx in diff --git a/compiler/lcalc/to_ocaml.ml b/compiler/lcalc/to_ocaml.ml index 35a685e21..07da473d2 100644 --- a/compiler/lcalc/to_ocaml.ml +++ b/compiler/lcalc/to_ocaml.ml @@ -169,13 +169,13 @@ let rec format_typ (fmt : Format.formatter) (typ : Dcalc.Ast.typ Pos.marked) : u let format_var (fmt : Format.formatter) (v : Var.t) : unit = let lowercase_name = - to_lowercase (to_ascii (Bindlib.name_of v) ^ "_" ^ string_of_int (Bindlib.uid_of v)) + to_lowercase (to_ascii (Bindlib.name_of v) (* ^ "_" ^ string_of_int (Bindlib.uid_of v) *)) in let lowercase_name = Re.Pcre.substitute ~rex:(Re.Pcre.regexp "\\.") ~subst:(fun _ -> "_dot_") lowercase_name in let lowercase_name = avoid_keywords (to_ascii lowercase_name) in - if lowercase_name = "handle_default" || Dcalc.Print.begins_with_uppercase (Bindlib.name_of v) then + if List.mem lowercase_name ["handle_default"; "handle_default_opt"] || Dcalc.Print.begins_with_uppercase (Bindlib.name_of v) then Format.fprintf fmt "%s" lowercase_name else if lowercase_name = "_" then Format.fprintf fmt "%s" lowercase_name else Format.fprintf fmt "%s_" lowercase_name From 9c76b34afc997ac08c2ebf1490e3a01d8777c43e Mon Sep 17 00:00:00 2001 From: Alain Date: Wed, 8 Dec 2021 12:58:21 +0100 Subject: [PATCH 033/102] removed assert false --- compiler/lcalc/compile_without_exceptions.ml | 42 ++++++++++---------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index ff2c0bf7a..f9fb0de9f 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -43,9 +43,6 @@ let thunk_expr (e : A.expr Pos.marked Bindlib.box) (pos : Pos.t) : A.expr Pos.ma let dummy_var = A.Var.make ("_", pos) in A.make_abs [| dummy_var |] e pos [ (D.TAny, pos) ] pos - -(* let translate_binder (ctx: ctx) = assert false *) - let rec translate_default (ctx : ctx) (exceptions : D.expr Pos.marked list) (just : D.expr Pos.marked) (cons : D.expr Pos.marked) (pos_default : Pos.t) : A.expr Pos.marked Bindlib.box = @@ -243,7 +240,9 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl | D.EDefault (exceptions, just, cons) -> translate_default ctx exceptions just cons (Pos.get_position e) - | D.ErrorOnEmpty _ -> assert false (* todo: error message *) + | D.ErrorOnEmpty _ -> + + Errors.raise_spanned_error "Internal error: Error on empty found in incorrect place when compiling using the --avoid_exception option." (Pos.get_position e) let translate_expr_toplevel (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindlib.box = @@ -271,24 +270,23 @@ let translate_expr_toplevel (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.mar A.make_matchopt e1 e2 e3 - | _ -> - (match Pos.unmark e with - | D.EVar _ -> Printf.printf "EVar\n" - | D.ETuple _ -> Printf.printf "ETuple\n" - | D.ETupleAccess _ -> Printf.printf "ETupleAccess\n" - | D.EInj _ -> Printf.printf "EInj\n" - | D.EMatch _ -> Printf.printf "EMatch\n" - | D.EArray _ -> Printf.printf "EArray\n" - | D.ELit _ -> Printf.printf "ELit\n" - | D.EAbs _ -> Printf.printf "EAbs\n" - | D.EApp _ -> Printf.printf "EApp\n" - | D.EAssert _ -> Printf.printf "EAssert\n" - | D.EOp _ -> Printf.printf "EOp\n" - | D.EIfThenElse _ -> Printf.printf "EIfThenElse\n" - | D.ErrorOnEmpty _ -> Printf.printf "ErrorOnEmpty\n" - | D.EDefault _ -> Printf.printf "EDefault\n"); - assert false (* todo: error message*) - + | _ -> + let s = (match Pos.unmark e with + | D.EVar _ -> Printf.sprintf "EVar" + | D.ETuple _ -> Printf.sprintf "ETuple" + | D.ETupleAccess _ -> Printf.sprintf "ETupleAccess" + | D.EInj _ -> Printf.sprintf "EInj" + | D.EMatch _ -> Printf.sprintf "EMatch" + | D.EArray _ -> Printf.sprintf "EArray" + | D.ELit _ -> Printf.sprintf "ELit" + | D.EAbs _ -> Printf.sprintf "EAbs" + | D.EApp _ -> Printf.sprintf "EApp" + | D.EAssert _ -> Printf.sprintf "EAssert" + | D.EOp _ -> Printf.sprintf "EOp" + | D.EIfThenElse _ -> Printf.sprintf "EIfThenElse" + | D.ErrorOnEmpty _ -> Printf.sprintf "ErrorOnEmpty" + | D.EDefault _ -> Printf.sprintf "EDefault") in + Errors.raise_spanned_error (Printf.sprintf "Internal error: Found %s different to Error on empty at the toplevel when compiling using the --avoid_exception option." s) (Pos.get_position e) let translate_program (prgm : D.program) : A.program = { scopes = From 65ad229373901cd29ddb82dfb45af20f9a13ae52 Mon Sep 17 00:00:00 2001 From: Alain Date: Wed, 15 Dec 2021 09:23:03 +0100 Subject: [PATCH 034/102] scope_let translation 2/6 --- compiler/lcalc/compile_without_exceptions.ml | 120 +++++++++++++------ 1 file changed, 81 insertions(+), 39 deletions(-) diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index f9fb0de9f..aac4a8d44 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -244,52 +244,94 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl Errors.raise_spanned_error "Internal error: Error on empty found in incorrect place when compiling using the --avoid_exception option." (Pos.get_position e) -let translate_expr_toplevel (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindlib.box = - let same_pos e' = Pos.same_pos_as e' e in - match Pos.unmark e with - | D.ErrorOnEmpty arg -> - let pos = Pos.get_position arg in - let x = A.Var.make ("result", pos) in - let arg = translate_expr ctx arg in +let translate_scope_let (ctx: ctx) (s: D.scope_let) : A.expr Bindlib.box = + + let { + scope_let_var; + scope_let_kind; + scope_let_typ; + scope_let_expr; + } = s in + + (* I need to match on the expression. *) + let expr' : A.expr Bindlib.box = + let+ expr = scope_let_expr in + match scope_let_kind, scope_let_typ, expr with + | ScopeVarDefinition, typ, D.ErrorOnEmpty arg -> + (* ~> match [| arg |] with None -> raise NoValueProvided | Some x -> x *) + let pos = Pos.get_position arg in + let x = A.Var.make ("result", pos) in + let arg = translate_expr ctx arg in + + let tau = (D.TAny, pos) in + + let e3 = + A.make_abs + (Array.of_list [ x ]) + (let+ v = Bindlib.box_var x in (v, pos)) + pos [ tau ] pos + and e1 = arg + and e2 = + A.make_abs + (Array.of_list [ x ]) + (Bindlib.box @@ same_pos @@ A.ERaise A.NoValueProvided) + pos [ tau ] pos + in + + A.make_matchopt e1 e2 e3 + + | Assertion, typ, expr -> + let pos = Pos.get_position arg in + let x = A.Var.make ("result", pos) in + let arg = translate_expr ctx expr in + + let tau = (D.TAny, pos) in + + let e3 = + A.make_abs + (Array.of_list [ x ]) + (let+ v = Bindlib.box_var x in (v, pos)) + pos [ tau ] pos + and e1 = arg + and e2 = + A.make_abs + (Array.of_list [ x ]) + (Bindlib.box @@ same_pos @@ A.ERaise A.NoValueProvided) + pos [ tau ] pos + in + + A.make_matchopt e1 e2 e3 + + | SubScopeVarDefinition, typ, expr -> + assert false + + | DestructuringInputStruct, typ, expr -> + assert false + + | DestructuringSubScopeResults, typ, expr -> + assert false + + | CallingSubScope, typ, expr -> + assert false + + + + + | kind, typ, expr -> + Errors.raise_spanned_error (Printf.sprintf "Internal error: Found %s different to Error on empty at the toplevel when compiling using the --avoid_exception option." s) (Pos.get_position e) + in + + expr' + +let translate_scope_body (ctx: ctx) (s: D.scope_body): A.expr = assert false - let tau = (D.TAny, pos) in - let e3 = - A.make_abs - (Array.of_list [ x ]) - (let+ v = Bindlib.box_var x in (v, pos)) - pos [ tau ] pos - and e1 = arg - and e2 = - A.make_abs - (Array.of_list [ x ]) - (Bindlib.box @@ same_pos @@ A.ERaise A.NoValueProvided) - pos [ tau ] pos - in - A.make_matchopt e1 e2 e3 - - | _ -> - let s = (match Pos.unmark e with - | D.EVar _ -> Printf.sprintf "EVar" - | D.ETuple _ -> Printf.sprintf "ETuple" - | D.ETupleAccess _ -> Printf.sprintf "ETupleAccess" - | D.EInj _ -> Printf.sprintf "EInj" - | D.EMatch _ -> Printf.sprintf "EMatch" - | D.EArray _ -> Printf.sprintf "EArray" - | D.ELit _ -> Printf.sprintf "ELit" - | D.EAbs _ -> Printf.sprintf "EAbs" - | D.EApp _ -> Printf.sprintf "EApp" - | D.EAssert _ -> Printf.sprintf "EAssert" - | D.EOp _ -> Printf.sprintf "EOp" - | D.EIfThenElse _ -> Printf.sprintf "EIfThenElse" - | D.ErrorOnEmpty _ -> Printf.sprintf "ErrorOnEmpty" - | D.EDefault _ -> Printf.sprintf "EDefault") in - Errors.raise_spanned_error (Printf.sprintf "Internal error: Found %s different to Error on empty at the toplevel when compiling using the --avoid_exception option." s) (Pos.get_position e) let translate_program (prgm : D.program) : A.program = { scopes = + (* todo: réécrire *) (let acc, _ = List.fold_left (fun ((acc, ctx) : 'a * A.Var.t D.VarMap.t) (_, n, e) -> From 0d1363b2f657d4d04c3dc6eefca44d0e40528020 Mon Sep 17 00:00:00 2001 From: Alain Date: Wed, 15 Dec 2021 15:43:11 +0100 Subject: [PATCH 035/102] wip --- compiler/lcalc/compile_without_exceptions.ml | 163 +++++++++++++------ 1 file changed, 115 insertions(+), 48 deletions(-) diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index aac4a8d44..3cdb6e709 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -16,10 +16,8 @@ open Utils module D = Dcalc.Ast module A = Ast -type ctx = { - env: A.expr Pos.marked Bindlib.box D.VarMap.t; - env_pure: bool D.VarMap.t; (* true if it is pure (without opt) *) -} +type info = {boxed_expr: A.expr Pos.marked Bindlib.box; var: A.expr Bindlib.var; is_pure: bool} +type ctx = info D.VarMap.t let translate_lit (l : D.lit) : A.expr = let build lit = @@ -70,14 +68,11 @@ and translate_binder (ctx: ctx) ((binder, pos_binder): (D.expr, D.expr Pos.marke let vars, body = Bindlib.unmbind binder in let ctx, lc_vars = Array.fold_right - (fun var (ctx, lc_vars) -> + begin fun var (ctx, lc_vars) -> let lc_var = A.Var.make (Bindlib.name_of var, pos_binder) in let lc_var_expr = A.make_var (lc_var, pos_binder) in - let new_ctx = { - env=D.VarMap.add var lc_var_expr ctx.env; - env_pure=D.VarMap.add var false ctx.env_pure; - } in - (new_ctx, lc_var :: lc_vars)) + let new_ctx = D.VarMap.add var {boxed_expr=lc_var_expr; is_pure= false; var= lc_var} ctx in + (new_ctx, lc_var :: lc_vars) end vars (ctx, []) in let lc_vars = Array.of_list lc_vars in @@ -89,11 +84,13 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl let same_pos e' = Pos.same_pos_as e' e in match Pos.unmark e with | D.EVar v -> - (if D.VarMap.find (Pos.unmark v) ctx.env_pure then + + let info = D.VarMap.find (Pos.unmark v) ctx in + (if info.is_pure then A.make_some else Fun.id) - (D.VarMap.find (Pos.unmark v) ctx.env) + info.boxed_expr | D.ETuple (args, s) -> let+ args = Bindlib.box_list (List.map (translate_expr ctx) args) in Pos.same_pos_as (A.ETuple (args, s)) e @@ -245,20 +242,20 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl Errors.raise_spanned_error "Internal error: Error on empty found in incorrect place when compiling using the --avoid_exception option." (Pos.get_position e) -let translate_scope_let (ctx: ctx) (s: D.scope_let) : A.expr Bindlib.box = +let translate_scope_let (ctx: ctx) (s: D.scope_let) : ctx * A.expr Bindlib.box = - let { - scope_let_var; - scope_let_kind; - scope_let_typ; - scope_let_expr; - } = s in + match s with { + D.scope_let_var = var; + D.scope_let_kind = kind; + D.scope_let_typ = typ; + D.scope_let_expr = expr; + } -> (* I need to match on the expression. *) let expr' : A.expr Bindlib.box = - let+ expr = scope_let_expr in - match scope_let_kind, scope_let_typ, expr with - | ScopeVarDefinition, typ, D.ErrorOnEmpty arg -> + let+ expr = expr in + match kind, typ, expr with + | ScopeVarDefinition, typ, (D.ErrorOnEmpty arg, pos) -> begin (* ~> match [| arg |] with None -> raise NoValueProvided | Some x -> x *) let pos = Pos.get_position arg in let x = A.Var.make ("result", pos) in @@ -280,8 +277,8 @@ let translate_scope_let (ctx: ctx) (s: D.scope_let) : A.expr Bindlib.box = in A.make_matchopt e1 e2 e3 - - | Assertion, typ, expr -> + end + | Assertion, typ, expr -> begin let pos = Pos.get_position arg in let x = A.Var.make ("result", pos) in let arg = translate_expr ctx expr in @@ -302,9 +299,22 @@ let translate_scope_let (ctx: ctx) (s: D.scope_let) : A.expr Bindlib.box = in A.make_matchopt e1 e2 e3 + end + | SubScopeVarDefinition, typ, (D.EAbs ((binder, pos), tau), pos) -> + begin + let v, body = Bindlib.unbind binder in + + let _ = 1 +. 2.0 in + let body' = + let+ body = body in + translate_expr ctx body + in + + (* there is no need to add the binded var to the context since we know it is thunked *) - | SubScopeVarDefinition, typ, expr -> - assert false + + A.make_abs (Array.of_list [v] body') body' [D.TAny, pos] pos + end | DestructuringInputStruct, typ, expr -> assert false @@ -322,33 +332,90 @@ let translate_scope_let (ctx: ctx) (s: D.scope_let) : A.expr Bindlib.box = Errors.raise_spanned_error (Printf.sprintf "Internal error: Found %s different to Error on empty at the toplevel when compiling using the --avoid_exception option." s) (Pos.get_position e) in - expr' + (expr', ctx) -let translate_scope_body (ctx: ctx) (s: D.scope_body): A.expr = assert false +let void = assert false +(* let translate_scope_expr (ctx : decl_ctx) (body : scope_body) (pos_scope : Pos.t) = + let body_expr = + List.fold_right + (fun scope_let acc -> + make_let_in + (Pos.unmark scope_let.scope_let_var) + scope_let.scope_let_typ scope_let.scope_let_expr acc + (Pos.get_position scope_let.scope_let_var)) + body.scope_body_lets body.scope_body_result + in + make_abs + (Array.of_list [ body.scope_body_arg ]) + body_expr pos_scope + [ + ( TTuple + ( List.map snd (StructMap.find body.scope_body_input_struct ctx.ctx_structs), + Some body.scope_body_input_struct ), + pos_scope ); + ] + pos_scope *) + +let translate_scope_body (ctx: ctx) (s: D.scope_body): A.expr Pos.marked Bindlib.box = +match s with { + D.scope_body_lets=lets; + D.scope_body_result=result; + D.scope_body_arg=arg; + D.scope_body_input_struct=input_struct; + D.scope_body_output_struct=output_struct; +} -> begin + (* first we add to the input the ctx *) + let ctx = add_pure ctx arg in + + (* then, we compute the lets bindings and modification to the ctx *) + (* todo: once we update to ocaml 4.11, use fold_left_map instead of fold_left + List.rev *) + let ctx, acc = ListLabels.fold_left lets + ~init:(ctx, []) + ~f:begin fun (ctx, acc) (s: D.scope_let) -> + let ctx, e = translate_scope_let ctx s in + (ctx, (s.scope_let_var, D.TAny, e)::acc) + end + in + let acc = List.rev acc in + + (* we now have the context for the final transformation: the result *) + (* todo: alaid, result is boxed and hence incompatible with translate_expr... *) + let result = translate_expr ctx (Bindlib.unbox result) in + + (* finally, we can recombine everything using nested let ... = ... in *) + let body = + ListLabels.fold_left acc + ~init:result + ~f:(fun (body: (A.expr * Pos.t) Bindlib.box) (v, tau, e) -> + A.make_let_in (D.VarMap.find v ctx).var tau e body + ) + in + void +end let translate_program (prgm : D.program) : A.program = -{ - scopes = - (* todo: réécrire *) - (let acc, _ = - List.fold_left - (fun ((acc, ctx) : 'a * A.Var.t D.VarMap.t) (_, n, e) -> - let new_n = A.Var.make (Bindlib.name_of n, Pos.no_pos) in - let new_acc = - ( new_n, - Bindlib.unbox - (translate_expr_toplevel { - env=D.VarMap.map (fun v -> A.make_var (v, Pos.no_pos)) ctx; - env_pure=D.VarMap.map (fun _ -> true) ctx } e) ) - :: acc - in - let new_ctx = D.VarMap.add n new_n ctx in - (new_acc, new_ctx)) - ([], D.VarMap.empty) prgm.scopes - in - List.rev acc); + let new_scopes = (prgm.scopes : (D.ScopeName.t * D.expr Bindlib.var * D.scope_body) list) + |> ListLabels.fold_left + ~init:([], D.VarMap.empty) + ~f:begin fun (acc, ctx) (_, n, e) -> + let new_n = A.Var.make (Bindlib.name_of n, Pos.no_pos) in + let env: ctx = { + env=D.VarMap.map (fun v -> A.make_var (v, Pos.no_pos)) ctx; + env_pure=D.VarMap.map (fun _ -> true) ctx + } in + let new_e = translate_scope_body env e in + let new_acc = (new_n, Bindlib.unbox new_e) :: acc in + let new_ctx = D.VarMap.add n new_n ctx in + + (new_acc, new_ctx) + end + |> fst + |> List.rev + in + { + scopes = new_scopes; decl_ctx = { ctx_enums = prgm.decl_ctx.ctx_enums |> D.EnumMap.add A.option_enum A.option_enum_config; From 3a09b39bf5b2c6820ae362e8d889073f7d3c6311 Mon Sep 17 00:00:00 2001 From: Alain Date: Thu, 16 Dec 2021 16:59:25 +0100 Subject: [PATCH 036/102] wip --- compiler/lcalc/compile_without_exceptions.ml | 147 ++++++++++--------- 1 file changed, 80 insertions(+), 67 deletions(-) diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index 3cdb6e709..7637de8cb 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -16,7 +16,7 @@ open Utils module D = Dcalc.Ast module A = Ast -type info = {boxed_expr: A.expr Pos.marked Bindlib.box; var: A.expr Bindlib.var; is_pure: bool} +type info = {expr: A.expr Pos.marked Bindlib.box; var: A.expr Bindlib.var; is_pure: bool} type ctx = info D.VarMap.t let translate_lit (l : D.lit) : A.expr = @@ -41,6 +41,12 @@ let thunk_expr (e : A.expr Pos.marked Bindlib.box) (pos : Pos.t) : A.expr Pos.ma let dummy_var = A.Var.make ("_", pos) in A.make_abs [| dummy_var |] e pos [ (D.TAny, pos) ] pos + +let add_var pos var is_pure ctx = + let new_var = A.Var.make (Bindlib.name_of var, pos) in + let expr = A.make_var (new_var, pos) in + D.VarMap.add var {expr; var=new_var; is_pure} ctx + let rec translate_default (ctx : ctx) (exceptions : D.expr Pos.marked list) (just : D.expr Pos.marked) (cons : D.expr Pos.marked) (pos_default : Pos.t) : A.expr Pos.marked Bindlib.box = @@ -71,7 +77,7 @@ and translate_binder (ctx: ctx) ((binder, pos_binder): (D.expr, D.expr Pos.marke begin fun var (ctx, lc_vars) -> let lc_var = A.Var.make (Bindlib.name_of var, pos_binder) in let lc_var_expr = A.make_var (lc_var, pos_binder) in - let new_ctx = D.VarMap.add var {boxed_expr=lc_var_expr; is_pure= false; var= lc_var} ctx in + let new_ctx = D.VarMap.add var {expr=lc_var_expr; is_pure= false; var= lc_var} ctx in (new_ctx, lc_var :: lc_vars) end vars (ctx, []) in @@ -86,11 +92,11 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl | D.EVar v -> let info = D.VarMap.find (Pos.unmark v) ctx in - (if info.is_pure then - A.make_some + if info.is_pure then + A.make_some info.expr else - Fun.id) - info.boxed_expr + info.expr + | D.ETuple (args, s) -> let+ args = Bindlib.box_list (List.map (translate_expr ctx) args) in Pos.same_pos_as (A.ETuple (args, s)) e @@ -242,20 +248,22 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl Errors.raise_spanned_error "Internal error: Error on empty found in incorrect place when compiling using the --avoid_exception option." (Pos.get_position e) -let translate_scope_let (ctx: ctx) (s: D.scope_let) : ctx * A.expr Bindlib.box = +let translate_scope_let (ctx: ctx) (s: D.scope_let) : ctx * A.expr Pos.marked Bindlib.box = match s with { D.scope_let_var = var; D.scope_let_kind = kind; D.scope_let_typ = typ; D.scope_let_expr = expr; - } -> + } -> begin (* I need to match on the expression. *) - let expr' : A.expr Bindlib.box = - let+ expr = expr in + let expr' : A.expr Pos.marked Bindlib.box = + let expr = Bindlib.unbox expr in + + let same_pos e' = Pos.same_pos_as e' expr in match kind, typ, expr with - | ScopeVarDefinition, typ, (D.ErrorOnEmpty arg, pos) -> begin + | ScopeVarDefinition, _typ, (D.ErrorOnEmpty arg, _pos) -> begin (* ~> match [| arg |] with None -> raise NoValueProvided | Some x -> x *) let pos = Pos.get_position arg in let x = A.Var.make ("result", pos) in @@ -278,8 +286,8 @@ let translate_scope_let (ctx: ctx) (s: D.scope_let) : ctx * A.expr Bindlib.box = A.make_matchopt e1 e2 e3 end - | Assertion, typ, expr -> begin - let pos = Pos.get_position arg in + | Assertion, _typ, expr -> begin + let pos = Pos.get_position expr in let x = A.Var.make ("result", pos) in let arg = translate_expr ctx expr in @@ -300,78 +308,73 @@ let translate_scope_let (ctx: ctx) (s: D.scope_let) : ctx * A.expr Bindlib.box = A.make_matchopt e1 e2 e3 end - | SubScopeVarDefinition, typ, (D.EAbs ((binder, pos), tau), pos) -> + | SubScopeVarDefinition, _typ, (D.EAbs ((binder, pos_binder), _tau), pos) -> begin - let v, body = Bindlib.unbind binder in + let vs, body = Bindlib.unmbind binder in - let _ = 1 +. 2.0 in - let body' = - let+ body = body in - translate_expr ctx body - in - - (* there is no need to add the binded var to the context since we know it is thunked *) + let vs' = Array.map (fun v -> (D.VarMap.find v ctx).var) vs in + let body' = translate_expr ctx body in - A.make_abs (Array.of_list [v] body') body' [D.TAny, pos] pos + (* there is no need to add the binded var to the context since we know it is thunked *) + A.make_abs vs' body' pos_binder [D.TAny, pos_binder] pos end - | DestructuringInputStruct, typ, expr -> - assert false + | DestructuringInputStruct, _typ, expr -> + translate_expr ctx expr - | DestructuringSubScopeResults, typ, expr -> - assert false + | DestructuringSubScopeResults, _typ, expr -> + translate_expr ctx expr - | CallingSubScope, typ, expr -> - assert false + | CallingSubScope, _typ, expr -> + translate_expr ctx expr - | kind, typ, expr -> - Errors.raise_spanned_error (Printf.sprintf "Internal error: Found %s different to Error on empty at the toplevel when compiling using the --avoid_exception option." s) (Pos.get_position e) + | kind, _typ, _expr -> + + let kind_s = match kind with + | ScopeVarDefinition -> "ScopeVarDefinition" + | Assertion -> "Assertion" + | SubScopeVarDefinition -> "SubScopeVarDefinition" + | DestructuringInputStruct -> "DestructuringInputStruct" + | DestructuringSubScopeResults -> "DestructuringSubScopeResults" + | CallingSubScope -> "CallingSubScope" in + + Errors.raise_spanned_error (Printf.sprintf "Internal error: Found %s different to Error on empty at the toplevel when compiling using the --avoid_exception option." kind_s) (Pos.get_position expr) in - (expr', ctx) + let is_pure = match kind with + | ScopeVarDefinition -> true + | Assertion -> true + | SubScopeVarDefinition -> true + | DestructuringInputStruct -> true + | DestructuringSubScopeResults -> true + | CallingSubScope -> false + in -let void = assert false + let ctx' = add_var (snd var) (fst var) is_pure ctx in -(* let translate_scope_expr (ctx : decl_ctx) (body : scope_body) (pos_scope : Pos.t) = - let body_expr = - List.fold_right - (fun scope_let acc -> - make_let_in - (Pos.unmark scope_let.scope_let_var) - scope_let.scope_let_typ scope_let.scope_let_expr acc - (Pos.get_position scope_let.scope_let_var)) - body.scope_body_lets body.scope_body_result - in - make_abs - (Array.of_list [ body.scope_body_arg ]) - body_expr pos_scope - [ - ( TTuple - ( List.map snd (StructMap.find body.scope_body_input_struct ctx.ctx_structs), - Some body.scope_body_input_struct ), - pos_scope ); - ] - pos_scope *) + (ctx', expr') + + end let translate_scope_body (ctx: ctx) (s: D.scope_body): A.expr Pos.marked Bindlib.box = match s with { D.scope_body_lets=lets; D.scope_body_result=result; D.scope_body_arg=arg; - D.scope_body_input_struct=input_struct; - D.scope_body_output_struct=output_struct; + _ } -> begin + (* first we add to the input the ctx *) - let ctx = add_pure ctx arg in + let ctx1 = add_var Pos.no_pos arg true ctx in (* then, we compute the lets bindings and modification to the ctx *) (* todo: once we update to ocaml 4.11, use fold_left_map instead of fold_left + List.rev *) - let ctx, acc = ListLabels.fold_left lets - ~init:(ctx, []) + let ctx2, acc = ListLabels.fold_left lets + ~init:(ctx1, []) ~f:begin fun (ctx, acc) (s: D.scope_let) -> let ctx, e = translate_scope_let ctx s in (ctx, (s.scope_let_var, D.TAny, e)::acc) @@ -381,17 +384,21 @@ match s with { (* we now have the context for the final transformation: the result *) (* todo: alaid, result is boxed and hence incompatible with translate_expr... *) - let result = translate_expr ctx (Bindlib.unbox result) in + let result = translate_expr ctx2 (Bindlib.unbox result) in (* finally, we can recombine everything using nested let ... = ... in *) let body = ListLabels.fold_left acc ~init:result - ~f:(fun (body: (A.expr * Pos.t) Bindlib.box) (v, tau, e) -> - A.make_let_in (D.VarMap.find v ctx).var tau e body + ~f:(fun (body: (A.expr * Pos.t) Bindlib.box) ((v, pos), tau, e) -> + A.make_let_in (D.VarMap.find v ctx).var (tau, pos) e body ) in - void + + + (* we finnally rebuild the binder *) + + A.make_abs (Array.of_list [(D.VarMap.find arg ctx1).var]) body Pos.no_pos [D.TAny, Pos.no_pos] Pos.no_pos end @@ -400,12 +407,16 @@ let translate_program (prgm : D.program) : A.program = |> ListLabels.fold_left ~init:([], D.VarMap.empty) ~f:begin fun (acc, ctx) (_, n, e) -> - let new_n = A.Var.make (Bindlib.name_of n, Pos.no_pos) in - let env: ctx = { - env=D.VarMap.map (fun v -> A.make_var (v, Pos.no_pos)) ctx; - env_pure=D.VarMap.map (fun _ -> true) ctx - } in + + let env: ctx = D.VarMap.map (fun v -> + let new_var = A.Var.make (Bindlib.name_of v, Pos.no_pos) in + let expr = A.make_var (new_var, Pos.no_pos) in + {expr; var=new_var; is_pure=true} + ) ctx in + + let new_n = (D.VarMap.find n env).var in let new_e = translate_scope_body env e in + let new_acc = (new_n, Bindlib.unbox new_e) :: acc in let new_ctx = D.VarMap.add n new_n ctx in @@ -422,3 +433,5 @@ let translate_program (prgm : D.program) : A.program = ctx_structs = prgm.decl_ctx.ctx_structs; }; } + + From 63ff6cfbb3d401a79c7f2eb24b3e908a5ca46808 Mon Sep 17 00:00:00 2001 From: Alain Date: Thu, 16 Dec 2021 19:16:57 +0100 Subject: [PATCH 037/102] wip (compiling but can't compile catala program without internal errors) instrumentation of Dcalc.expr to show internals representation --- compiler/dcalc/ast.ml | 30 ++++--- compiler/dcalc/ast.mli | 1 + compiler/dcalc/dune | 2 +- compiler/lcalc/compile_without_exceptions.ml | 88 ++++++++++++++------ compiler/utils/dune | 3 +- compiler/utils/pos.ml | 4 +- compiler/utils/pos.mli | 2 + default.nix | 3 + 8 files changed, 93 insertions(+), 40 deletions(-) diff --git a/compiler/dcalc/ast.ml b/compiler/dcalc/ast.ml index 92abd3528..fa970e32a 100644 --- a/compiler/dcalc/ast.ml +++ b/compiler/dcalc/ast.ml @@ -33,6 +33,7 @@ module EnumConstructor : Uid.Id with type info = Uid.MarkedString.info = module EnumMap : Map.S with type key = EnumName.t = Map.Make (EnumName) type typ_lit = TBool | TUnit | TInt | TRat | TMoney | TDate | TDuration +[@@ deriving show] type struct_name = StructName.t @@ -40,11 +41,12 @@ type enum_name = EnumName.t type typ = | TLit of typ_lit - | TTuple of typ Pos.marked list * struct_name option - | TEnum of typ Pos.marked list * enum_name + | TTuple of typ Pos.marked list * (struct_name [@opaque]) option + | TEnum of typ Pos.marked list * (enum_name [@opaque]) | TArrow of typ Pos.marked * typ Pos.marked | TArray of typ Pos.marked | TAny +[@@ deriving show] type date = Runtime.date @@ -66,9 +68,12 @@ type lit = | LDate of date | LDuration of duration + type op_kind = KInt | KRat | KMoney | KDate | KDuration +[@@ deriving show] type ternop = Fold +[@@ deriving show] type binop = | And @@ -87,36 +92,41 @@ type binop = | Map | Concat | Filter +[@@ deriving show] type log_entry = VarDef of typ | BeginCall | EndCall | PosRecordIfTrueBool +[@@ deriving show] type unop = | Not | Minus of op_kind - | Log of log_entry * (Utils.Uid.MarkedString.info list[@opaque]) + | Log of log_entry * (Utils.Uid.MarkedString.info list [@opaque]) | Length | IntToRat | GetDay | GetMonth | GetYear +[@@ deriving show] type operator = Ternop of ternop | Binop of binop | Unop of unop +[@@ deriving show] type expr = - | EVar of (expr Bindlib.var[@opaque]) Pos.marked - | ETuple of expr Pos.marked list * struct_name option - | ETupleAccess of expr Pos.marked * int * struct_name option * typ Pos.marked list - | EInj of expr Pos.marked * int * enum_name * typ Pos.marked list - | EMatch of expr Pos.marked * expr Pos.marked list * enum_name + | EVar of (expr Bindlib.var [@opaque]) Pos.marked + | ETuple of expr Pos.marked list * (struct_name [@opaque]) option + | ETupleAccess of expr Pos.marked * int * (struct_name [@opaque]) option * typ Pos.marked list + | EInj of expr Pos.marked * int * (enum_name [@opaque]) * typ Pos.marked list + | EMatch of expr Pos.marked * expr Pos.marked list * (enum_name [@opaque]) | EArray of expr Pos.marked list - | ELit of lit - | EAbs of (expr, expr Pos.marked) Bindlib.mbinder Pos.marked * typ Pos.marked list + | ELit of (lit [@opaque]) + | EAbs of ((expr, expr Pos.marked) Bindlib.mbinder [@opaque]) Pos.marked * typ Pos.marked list | EApp of expr Pos.marked * expr Pos.marked list | EAssert of expr Pos.marked | EOp of operator | EDefault of expr Pos.marked list * expr Pos.marked * expr Pos.marked | EIfThenElse of expr Pos.marked * expr Pos.marked * expr Pos.marked | ErrorOnEmpty of expr Pos.marked +[@@ deriving show] type struct_ctx = (StructFieldName.t * typ Pos.marked) list StructMap.t diff --git a/compiler/dcalc/ast.mli b/compiler/dcalc/ast.mli index 5ec563d42..b5f4ddfd4 100644 --- a/compiler/dcalc/ast.mli +++ b/compiler/dcalc/ast.mli @@ -124,6 +124,7 @@ type expr = | EDefault of expr Pos.marked list * expr Pos.marked * expr Pos.marked | EIfThenElse of expr Pos.marked * expr Pos.marked * expr Pos.marked | ErrorOnEmpty of expr Pos.marked +[@@deriving show] type struct_ctx = (StructFieldName.t * typ Pos.marked) list StructMap.t diff --git a/compiler/dcalc/dune b/compiler/dcalc/dune index e450c5702..0402e8f09 100644 --- a/compiler/dcalc/dune +++ b/compiler/dcalc/dune @@ -3,7 +3,7 @@ (public_name catala.dcalc) (libraries bindlib unionFind utils re camomile runtime) (preprocess - (pps visitors.ppx))) + (pps visitors.ppx ppx_deriving.show))) (documentation (package catala) diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index 7637de8cb..e60b93d55 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -248,6 +248,44 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl Errors.raise_spanned_error "Internal error: Error on empty found in incorrect place when compiling using the --avoid_exception option." (Pos.get_position e) +let rec translate_scope_vardefinition ctx expr: A.expr Pos.marked Bindlib.box = + match expr with + + | D.ErrorOnEmpty arg, pos_expr -> + begin + (* ~> match [| arg |] with None -> raise NoValueProvided | Some x -> x *) + let pos_arg = Pos.get_position arg in + let x = A.Var.make ("result", pos_arg) in + let arg = translate_expr ctx arg in + + let tau = (D.TAny, pos_arg) in + + let e3 = + A.make_abs + (Array.of_list [ x ]) + (let+ v = Bindlib.box_var x in (v, pos_arg)) + pos_arg [ tau ] pos_arg + and e1 = arg + and e2 = + A.make_abs + (Array.of_list [ x ]) + (Bindlib.box @@ (A.ERaise A.NoValueProvided, pos_expr)) + pos_arg [ tau ] pos_arg + in + + A.make_matchopt e1 e2 e3 + end + + | D.EApp((D.EOp (D.Unop (D.Log (le, l))), pos_log), [e']), pos -> + + let+ e' = translate_scope_vardefinition ctx e' in + A.EApp((A.EOp (D.Unop (D.Log (le, l))), pos_log), [e']), pos + + | (expr, pos) -> + + Errors.raise_spanned_error (Printf.sprintf "Internal error: Found unexpected expression when compiling an expression using the --avoid_exception option. ''Full'' term: %s" (D.show_expr expr)) pos + + let translate_scope_let (ctx: ctx) (s: D.scope_let) : ctx * A.expr Pos.marked Bindlib.box = match s with { @@ -263,29 +301,8 @@ let translate_scope_let (ctx: ctx) (s: D.scope_let) : ctx * A.expr Pos.marked Bi let same_pos e' = Pos.same_pos_as e' expr in match kind, typ, expr with - | ScopeVarDefinition, _typ, (D.ErrorOnEmpty arg, _pos) -> begin - (* ~> match [| arg |] with None -> raise NoValueProvided | Some x -> x *) - let pos = Pos.get_position arg in - let x = A.Var.make ("result", pos) in - let arg = translate_expr ctx arg in - - let tau = (D.TAny, pos) in - - let e3 = - A.make_abs - (Array.of_list [ x ]) - (let+ v = Bindlib.box_var x in (v, pos)) - pos [ tau ] pos - and e1 = arg - and e2 = - A.make_abs - (Array.of_list [ x ]) - (Bindlib.box @@ same_pos @@ A.ERaise A.NoValueProvided) - pos [ tau ] pos - in - - A.make_matchopt e1 e2 e3 - end + | ScopeVarDefinition, _typ, expr -> + translate_scope_vardefinition ctx expr | Assertion, _typ, expr -> begin let pos = Pos.get_position expr in let x = A.Var.make ("result", pos) in @@ -332,7 +349,7 @@ let translate_scope_let (ctx: ctx) (s: D.scope_let) : ctx * A.expr Pos.marked Bi - | kind, _typ, _expr -> + | kind, _typ, (expr, pos) -> let kind_s = match kind with | ScopeVarDefinition -> "ScopeVarDefinition" @@ -341,8 +358,25 @@ let translate_scope_let (ctx: ctx) (s: D.scope_let) : ctx * A.expr Pos.marked Bi | DestructuringInputStruct -> "DestructuringInputStruct" | DestructuringSubScopeResults -> "DestructuringSubScopeResults" | CallingSubScope -> "CallingSubScope" in + + let expr_s = match expr with + | EVar _ -> "EVar" + | ETuple _ -> "ETuple" + | ETupleAccess _ -> "ETupleAccess" + | EInj _ -> "EInj" + | EMatch _ -> "EMatch" + | EArray _ -> "EArray" + | ELit _ -> "ELit" + | EAbs _ -> "EAbs" + | EApp _ -> "EApp" + | EAssert _ -> "EAssert" + | EOp _ -> "EOp" + | EDefault _ -> "EDefault" + | EIfThenElse _ -> "EIfThenElse" + | ErrorOnEmpty _ -> "ErrorOnEmpty" + in - Errors.raise_spanned_error (Printf.sprintf "Internal error: Found %s different to Error on empty at the toplevel when compiling using the --avoid_exception option." kind_s) (Pos.get_position expr) + Errors.raise_spanned_error (Printf.sprintf "Internal error: Found unexpected %s when compiling an expression containing %s using the --avoid_exception option. ''Full'' term: %s" kind_s expr_s (D.show_expr expr)) pos in let is_pure = match kind with @@ -391,7 +425,7 @@ match s with { ListLabels.fold_left acc ~init:result ~f:(fun (body: (A.expr * Pos.t) Bindlib.box) ((v, pos), tau, e) -> - A.make_let_in (D.VarMap.find v ctx).var (tau, pos) e body + A.make_let_in (D.VarMap.find v ctx2).var (tau, pos) e body ) in @@ -414,7 +448,7 @@ let translate_program (prgm : D.program) : A.program = {expr; var=new_var; is_pure=true} ) ctx in - let new_n = (D.VarMap.find n env).var in + let new_n = A.Var.make (Bindlib.name_of n, Pos.no_pos) in let new_e = translate_scope_body env e in let new_acc = (new_n, Bindlib.unbox new_e) :: acc in diff --git a/compiler/utils/dune b/compiler/utils/dune index 2d1789a00..10ebee56f 100644 --- a/compiler/utils/dune +++ b/compiler/utils/dune @@ -1,7 +1,8 @@ (library (name utils) (public_name catala.utils) - (libraries cmdliner ANSITerminal re)) + (libraries cmdliner ANSITerminal re) + (preprocess (pps ppx_deriving.show))) (documentation (package catala) diff --git a/compiler/utils/pos.ml b/compiler/utils/pos.ml index f45a98d3f..d7d96823d 100644 --- a/compiler/utils/pos.ml +++ b/compiler/utils/pos.ml @@ -12,7 +12,8 @@ or implied. See the License for the specific language governing permissions and limitations under the License. *) -type t = { code_pos : Lexing.position * Lexing.position; law_pos : string list } +type t = { code_pos : Lexing.position * Lexing.position [@opaque]; law_pos : string list } +[@@deriving show] let from_lpos (p : Lexing.position * Lexing.position) : t = { code_pos = p; law_pos = [] } @@ -168,6 +169,7 @@ let retrieve_loc_text (pos : t) : string = with Sys_error _ -> "Location:" ^ to_string pos type 'a marked = 'a * t +[@@deriving show] let no_pos : t = let zero_pos = diff --git a/compiler/utils/pos.mli b/compiler/utils/pos.mli index b1f3d519f..6864c788e 100644 --- a/compiler/utils/pos.mli +++ b/compiler/utils/pos.mli @@ -15,6 +15,7 @@ (** Source code position *) type t +[@@deriving show] (** A position in the source code is a file, as well as begin and end location of the form col:line *) (** Custom visitor for the [Pos.marked] type *) @@ -59,6 +60,7 @@ val retrieve_loc_text : t -> string (**{2 AST markings}*) type 'a marked = 'a * t +[@@deriving show] (** Everything related to the source code should keep its position stored, to improve error messages *) val no_pos : t diff --git a/default.nix b/default.nix index 8ba3c1270..72fbc4774 100644 --- a/default.nix +++ b/default.nix @@ -18,6 +18,7 @@ , js_of_ocaml-ppx , camomile , cppo +, ppx_deriving , menhirLib ? null #for nixos-unstable compatibility. }: @@ -49,6 +50,8 @@ buildDunePackage rec { camomile cppo + ppx_deriving + unionfind bindlib ] ++ (if isNull menhirLib then [ ] else [ menhirLib ]); From c3268cc13c29b919fff775d424e9c4768f9febab Mon Sep 17 00:00:00 2001 From: Alain Date: Thu, 16 Dec 2021 19:48:14 +0100 Subject: [PATCH 038/102] more mistakes removed --- compiler/lcalc/compile_without_exceptions.ml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index e60b93d55..655d20b01 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -329,6 +329,15 @@ let translate_scope_let (ctx: ctx) (s: D.scope_let) : ctx * A.expr Pos.marked Bi begin let vs, body = Bindlib.unmbind binder in + (* we need to add them to the context momentally *) + + let ctx = ArrayLabels.fold_left vs + ~init:ctx + ~f:(fun ctx (v: D.expr Bindlib.var) -> + add_var pos_binder v false ctx + ) + in + let vs' = Array.map (fun v -> (D.VarMap.find v ctx).var) vs in let body' = translate_expr ctx body in From 84cd6ddc61966ca4aae6483d40143249c515084f Mon Sep 17 00:00:00 2001 From: Alain Date: Fri, 17 Dec 2021 15:27:34 +0100 Subject: [PATCH 039/102] error on empty everywhere --- compiler/lcalc/compile_without_exceptions.ml | 30 ++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index 655d20b01..531dd09cb 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -243,9 +243,35 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl | D.EDefault (exceptions, just, cons) -> translate_default ctx exceptions just cons (Pos.get_position e) - | D.ErrorOnEmpty _ -> + | D.ErrorOnEmpty arg -> - Errors.raise_spanned_error "Internal error: Error on empty found in incorrect place when compiling using the --avoid_exception option." (Pos.get_position e) + (* we need to be carefull on this one *) + + begin + (* ~> match [| arg |] with None -> raise NoValueProvided | Some x -> x *) + let pos_arg = Pos.get_position arg in + let x = A.Var.make ("result", pos_arg) in + let arg = translate_expr ctx arg in + + let tau = (D.TAny, pos_arg) in + + let e3 = + A.make_abs + (Array.of_list [ x ]) + (let+ v = Bindlib.box_var x in (v, pos_arg)) + pos_arg [ tau ] pos_arg + and e1 = arg + and e2 = + A.make_abs + (Array.of_list [ x ]) + (Bindlib.box @@ (A.ERaise A.NoValueProvided, Pos.get_position e)) + pos_arg [ tau ] pos_arg + in + + A.make_some @@ A.make_matchopt e1 e2 e3 + end + + (* Errors.raise_spanned_error "Internal error: Error on empty found in incorrect place when compiling using the --avoid_exception option." (Pos.get_position e) *) let rec translate_scope_vardefinition ctx expr: A.expr Pos.marked Bindlib.box = From 2d267471da17489d7d02bc09af25ea2757730bc9 Mon Sep 17 00:00:00 2001 From: Alain Date: Fri, 17 Dec 2021 15:32:20 +0100 Subject: [PATCH 040/102] tentative beta reduction --- compiler/lcalc/optimizations.ml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/compiler/lcalc/optimizations.ml b/compiler/lcalc/optimizations.ml index 09b9db5bf..b8a04266b 100644 --- a/compiler/lcalc/optimizations.ml +++ b/compiler/lcalc/optimizations.ml @@ -84,9 +84,28 @@ let rec iota_expr (_ : unit) (e : expr Pos.marked) : expr Pos.marked Bindlib.box | _ -> visitor_map iota_expr () e + +let rec beta_expr (_: unit) (e: expr Pos.marked): expr Pos.marked Bindlib.box = + let default_mark e' = Pos.same_pos_as e' e in + match Pos.unmark e with + | EApp (e1, args) -> + let+ e1 = visitor_map beta_expr () e1 + and+ args = List.map (visitor_map beta_expr ()) args |> Bindlib.box_list in + begin match Pos.unmark e1 with + | EAbs ((binder, _pos_binder), _ts) -> + let _ : (_, _) Bindlib.mbinder = binder in + Bindlib.msubst binder (List.map fst args |> Array.of_list) + | _ -> + default_mark @@ EApp (e1, args) + end + | _ -> visitor_map beta_expr () e + let iota_optimizations (p : program) : program = { p with scopes = List.map (fun (var, e) -> (var, Bindlib.unbox (iota_expr () e))) p.scopes } +let _beta_optimizations (p: program): program = + { p with scopes = List.map (fun (var, e) -> (var, Bindlib.unbox (beta_expr () e))) p.scopes } + let rec peephole_expr (_ : unit) (e : expr Pos.marked) : expr Pos.marked Bindlib.box = let default_mark e' = Pos.mark (Pos.get_position e) e' in @@ -104,4 +123,7 @@ let rec peephole_expr (_ : unit) (e : expr Pos.marked) : expr Pos.marked Bindlib let peephole_optimizations (p : program) : program = { p with scopes = List.map (fun (var, e) -> (var, Bindlib.unbox (peephole_expr () e))) p.scopes } -let optimize_program (p : program) : program = p |> iota_optimizations |> peephole_optimizations +let optimize_program (p : program) : program = + p + |> iota_optimizations + |> peephole_optimizations From 1bfb891aa1a2fa01ed971feac57fa07226a371e2 Mon Sep 17 00:00:00 2001 From: Alain Date: Tue, 25 Jan 2022 13:55:17 +0100 Subject: [PATCH 041/102] printing dcalc and lcalc ast --- compiler/dcalc/ast.mli | 7 ++++++- compiler/lcalc/ast.ml | 26 +++++++++++++++++++------- compiler/lcalc/ast.mli | 6 ++++-- 3 files changed, 29 insertions(+), 10 deletions(-) diff --git a/compiler/dcalc/ast.mli b/compiler/dcalc/ast.mli index b5f4ddfd4..b96ec56cd 100644 --- a/compiler/dcalc/ast.mli +++ b/compiler/dcalc/ast.mli @@ -33,6 +33,7 @@ module EnumMap : Map.S with type key = EnumName.t (** {1 Abstract syntax tree} *) type typ_lit = TBool | TUnit | TInt | TRat | TMoney | TDate | TDuration +[@@deriving show] type typ = | TLit of typ_lit @@ -41,6 +42,7 @@ type typ = | TArrow of typ Pos.marked * typ Pos.marked | TArray of typ Pos.marked | TAny +[@@deriving show] type date = Runtime.date @@ -102,6 +104,9 @@ type unop = | GetYear type operator = Ternop of ternop | Binop of binop | Unop of unop +[@@deriving show] + + (** The expressions use the {{:https://lepigre.fr/ocaml-bindlib/} Bindlib} library, based on higher-order abstract syntax*) @@ -117,7 +122,7 @@ type expr = (** The [MarkedString.info] is the former enum case name *) | EArray of expr Pos.marked list | ELit of lit - | EAbs of (expr, expr Pos.marked) Bindlib.mbinder Pos.marked * typ Pos.marked list + | EAbs of ((expr, expr Pos.marked) Bindlib.mbinder [@opaque]) Pos.marked * typ Pos.marked list | EApp of expr Pos.marked * expr Pos.marked list | EAssert of expr Pos.marked | EOp of operator diff --git a/compiler/lcalc/ast.ml b/compiler/lcalc/ast.ml index e9083bc20..8eb5636ee 100644 --- a/compiler/lcalc/ast.ml +++ b/compiler/lcalc/ast.ml @@ -25,26 +25,38 @@ type lit = | LDuration of Runtime.duration type except = ConflictError | EmptyError | NoValueProvided | Crash +[@@deriving show] + + +let bla = fun _ b fmt x -> + let xs, body = Bindlib.unmbind x in + let xs = xs + |> Array.to_list + |> List.map (fun x -> (Bindlib.name_of x ^ "_" ^ (string_of_int @@ Bindlib.uid_of x))) + |> String.concat ", " + in + Format.fprintf fmt "Binder(%a, %a)" Format.pp_print_string xs b body type expr = - | EVar of expr Bindlib.var Pos.marked - | ETuple of expr Pos.marked list * D.StructName.t option + | EVar of (expr Bindlib.var [@polyprinter fun _ fmt x -> Format.fprintf fmt "%s_%d" (Bindlib.name_of x) (Bindlib.uid_of x)]) Pos.marked + | ETuple of expr Pos.marked list * (D.StructName.t [@opaque]) option (** The [MarkedString.info] is the former struct field name*) - | ETupleAccess of expr Pos.marked * int * D.StructName.t option * D.typ Pos.marked list + | ETupleAccess of expr Pos.marked * int * (D.StructName.t [@opaque]) option * D.typ Pos.marked list (** The [MarkedString.info] is the former struct field name *) - | EInj of expr Pos.marked * int * D.EnumName.t * D.typ Pos.marked list + | EInj of expr Pos.marked * int * (D.EnumName.t [@opaque]) * D.typ Pos.marked list (** The [MarkedString.info] is the former enum case name *) - | EMatch of expr Pos.marked * expr Pos.marked list * D.EnumName.t + | EMatch of expr Pos.marked * expr Pos.marked list * (D.EnumName.t [@opaque]) (** The [MarkedString.info] is the former enum case name *) | EArray of expr Pos.marked list - | ELit of lit - | EAbs of (expr, expr Pos.marked) Bindlib.mbinder Pos.marked * D.typ Pos.marked list + | ELit of (lit [@opaque]) + | EAbs of ((expr, expr Pos.marked) Bindlib.mbinder [@polyprinter bla]) Pos.marked * D.typ Pos.marked list | EApp of expr Pos.marked * expr Pos.marked list | EAssert of expr Pos.marked | EOp of D.operator | EIfThenElse of expr Pos.marked * expr Pos.marked * expr Pos.marked | ERaise of except | ECatch of expr Pos.marked * except * expr Pos.marked +[@@deriving show] module Var = struct type t = expr Bindlib.var diff --git a/compiler/lcalc/ast.mli b/compiler/lcalc/ast.mli index 04fd9aa0b..9c6e233af 100644 --- a/compiler/lcalc/ast.mli +++ b/compiler/lcalc/ast.mli @@ -31,6 +31,7 @@ type lit = | LDuration of Runtime.duration type except = ConflictError | EmptyError | NoValueProvided | Crash +[@@deriving show] type expr = | EVar of expr Bindlib.var Pos.marked @@ -44,14 +45,15 @@ type expr = | EMatch of expr Pos.marked * expr Pos.marked list * Dcalc.Ast.EnumName.t (** The [MarkedString.info] is the former enum case name *) | EArray of expr Pos.marked list - | ELit of lit - | EAbs of (expr, expr Pos.marked) Bindlib.mbinder Pos.marked * Dcalc.Ast.typ Pos.marked list + | ELit of (lit [@opaque]) + | EAbs of ((expr, expr Pos.marked) Bindlib.mbinder [@opaque]) Pos.marked * Dcalc.Ast.typ Pos.marked list | EApp of expr Pos.marked * expr Pos.marked list | EAssert of expr Pos.marked | EOp of Dcalc.Ast.operator | EIfThenElse of expr Pos.marked * expr Pos.marked * expr Pos.marked | ERaise of except | ECatch of expr Pos.marked * except * expr Pos.marked +[@@deriving show] (** {1 Variable helpers} *) From 33d9d03dea43a3bb6fff9e86b9c1b69f7bc37ed0 Mon Sep 17 00:00:00 2001 From: Alain Date: Fri, 28 Jan 2022 09:28:02 +0100 Subject: [PATCH 042/102] advancing --- compiler/lcalc/compile_without_exceptions2.ml | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 compiler/lcalc/compile_without_exceptions2.ml diff --git a/compiler/lcalc/compile_without_exceptions2.ml b/compiler/lcalc/compile_without_exceptions2.ml new file mode 100644 index 000000000..3226f48e0 --- /dev/null +++ b/compiler/lcalc/compile_without_exceptions2.ml @@ -0,0 +1,57 @@ + +open Utils +module D = Dcalc.Ast +module A = Ast + +(** information about the variables *) +type info = { + expr: A.expr Pos.marked Bindlib.box; + var: A.expr Bindlib.var; + is_pure: bool +} + +(** information context about variables in the current scope *) +type ctx = info D.VarMap.t + +type cuts = D.expr Pos.marked D.VarMap.t + + + +(** translate an expression, assuming there is absolutely no issues with options until it finds a eventual issue. *) +let translate_expr_and_cut + (ctx : ctx) + (e : D.expr Pos.marked) + (acc: cuts) +: A.expr Pos.marked Bindlib.box * cuts = + + let current_pos = Pos.get_position e in + match Pos.unmark e with + | D.EVar v -> + (* TODO: check error *) + let info = D.VarMap.find (Pos.unmark v) ctx in + if not (info.is_pure) then + Errors.raise_spanned_error + "Internal error: an unpure variable was found in a pure environement" + current_pos + else + info.expr + + (* Implicit application *) + | D.ETuple (args, s) -> + assert false + | D.ETupleAccess (e1, i, s, ts) -> + assert false + | D.EInj (e1, i, en, ts) -> + assert false + | D.EMatch (e1, cases, en) -> + assert false + | D.EArray es -> + assert false + | D.EIfThenElse (e1, e2, e3) -> + assert false + | D.EAssert e1 -> + assert false + | _ -> assert false + +and translate_expr_monad (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindlib.box = + assert false \ No newline at end of file From fcf6fecf71c41446132c53cb8533bdd8642fa504 Mon Sep 17 00:00:00 2001 From: Alain Date: Fri, 28 Jan 2022 11:07:29 +0100 Subject: [PATCH 043/102] implementation of a few cases in the translation without exceptions --- compiler/lcalc/ast.ml | 31 +++- compiler/lcalc/ast.mli | 12 ++ compiler/lcalc/compile_without_exceptions2.ml | 137 ++++++++++++++---- 3 files changed, 142 insertions(+), 38 deletions(-) diff --git a/compiler/lcalc/ast.ml b/compiler/lcalc/ast.ml index 8eb5636ee..c8740af92 100644 --- a/compiler/lcalc/ast.ml +++ b/compiler/lcalc/ast.ml @@ -125,13 +125,13 @@ let make_matchopt (e : expr Pos.marked Bindlib.box) (e_none : expr Pos.marked Bi mark @@ EMatch (e, [ e_none; e_some ], option_enum) - let make_matchopt' - (pos: Pos.t) - (tau: D.typ Pos.marked) - (arg: expr Pos.marked Bindlib.box) - (e_none: expr Pos.marked Bindlib.box) - (e_some: expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box) - : expr Pos.marked Bindlib.box = +let make_matchopt' + (pos: Pos.t) + (tau: D.typ Pos.marked) + (arg: expr Pos.marked Bindlib.box) + (e_none: expr Pos.marked Bindlib.box) + (e_some: expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box) +: expr Pos.marked Bindlib.box = let x = Var.make ("unit", pos) in let v = Var.make ("v", pos) in @@ -139,6 +139,23 @@ let make_matchopt (e : expr Pos.marked Bindlib.box) (e_none : expr Pos.marked Bi make_matchopt arg (make_abs (Array.of_list [x]) (e_none) (pos) [D.TLit D.TUnit, pos] pos) (make_abs (Array.of_list [v]) (e_some (let+ v = Bindlib.box_var v in (v, pos))) pos [tau] pos) +;; + +let make_matchopt'' + (pos: Pos.t) + (v: Var.t) + (tau: D.typ Pos.marked) + (arg: expr Pos.marked Bindlib.box) + (e_none: expr Pos.marked Bindlib.box) + (e_some: expr Pos.marked Bindlib.box) + : expr Pos.marked Bindlib.box = + + (* todo: replace this "unit" variable by the [()] pattern *) + let x = Var.make ("unit", pos) in + + make_matchopt arg + (make_abs (Array.of_list [x]) e_none pos [D.TLit D.TUnit, pos] pos) + (make_abs (Array.of_list [v]) e_some pos [tau] pos) let make_bindopt diff --git a/compiler/lcalc/ast.mli b/compiler/lcalc/ast.mli index 9c6e233af..87f49c473 100644 --- a/compiler/lcalc/ast.mli +++ b/compiler/lcalc/ast.mli @@ -112,6 +112,18 @@ val make_matchopt : expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box +(** [e' = make_matchopt'' pos v e e_none e_some] + Builds the term corresponding to [match e with | None -> fun () -> e_none |Some -> fun v -> e_some]. + *) +val make_matchopt'': + Pos.t -> + Var.t -> + Dcalc.Ast.typ Pos.marked -> + expr Pos.marked Bindlib.box -> + expr Pos.marked Bindlib.box -> + expr Pos.marked Bindlib.box -> + expr Pos.marked Bindlib.box + val make_bindopt : Pos.t -> Dcalc.Ast.typ Pos.marked -> diff --git a/compiler/lcalc/compile_without_exceptions2.ml b/compiler/lcalc/compile_without_exceptions2.ml index 3226f48e0..3db27132d 100644 --- a/compiler/lcalc/compile_without_exceptions2.ml +++ b/compiler/lcalc/compile_without_exceptions2.ml @@ -13,45 +13,120 @@ type info = { (** information context about variables in the current scope *) type ctx = info D.VarMap.t -type cuts = D.expr Pos.marked D.VarMap.t +type cuts = D.expr Pos.marked A.VarMap.t +let translate_lit (l : D.lit) (pos: Pos.t): A.lit = + match l with + | D.LBool l -> (A.LBool l) + | D.LInt i -> (A.LInt i) + | D.LRat r -> (A.LRat r) + | D.LMoney m -> (A.LMoney m) + | D.LUnit -> A.LUnit + | D.LDate d -> (A.LDate d) + | D.LDuration d -> (A.LDuration d) + | D.LEmptyError -> Errors.raise_spanned_error "Internal Error: An empty error was found in a place that shouldn't be possible." pos -(** translate an expression, assuming there is absolutely no issues with options until it finds a eventual issue. *) -let translate_expr_and_cut - (ctx : ctx) - (e : D.expr Pos.marked) - (acc: cuts) -: A.expr Pos.marked Bindlib.box * cuts = - let current_pos = Pos.get_position e in +(** [c = merge_maps cs] + Compute the disjoint union of multiple maps. Raises an internal error if there is two identicals keys in differnts parts. *) +let disjoint_union_maps (pos: Pos.t) (cs: 'a A.VarMap.t list): 'a A.VarMap.t = + let disjoint_union = A.VarMap.union (fun _ _ _ -> Errors.raise_spanned_error "Internal Error: Two supposed to be disjoints maps have one shared key." pos) in + + List.fold_left disjoint_union A.VarMap.empty cs + +(** [e' = translate_and_cut ctx e ] + Translate the Dcalc expression e into an expression in Lcalc, given we translate each cuts correctly. It ensures the equivalence between the execution of e and the execution of e' are equivalent in an environement where each variable v, where (v, e_v) is in cuts, has the non-empty value in e_v. *) +let rec translate_and_cut (ctx: ctx) (e: D.expr Pos.marked) + : A.expr Pos.marked Bindlib.box * cuts = + let pos = Pos.get_position e in match Pos.unmark e with + + (* empty-producing/using terms *) | D.EVar v -> - (* TODO: check error *) - let info = D.VarMap.find (Pos.unmark v) ctx in - if not (info.is_pure) then - Errors.raise_spanned_error - "Internal error: an unpure variable was found in a pure environement" - current_pos + + (* todo: for now, we requires there is unpure variables. This can change if the said variable are always present in the tree as thunked. *) + let v, pos_v = v in + if not (D.VarMap.find v ctx).is_pure then + let v' = A.Var.make ((Bindlib.name_of v), pos_v) in + (A.make_var (v', pos), A.VarMap.singleton v' e) else - info.expr + (D.VarMap.find v ctx).expr, A.VarMap.empty + | D.EDefault (_exceptions, _just, _cons) -> + let v' = A.Var.make ("default_term", pos) in + (A.make_var (v', pos), A.VarMap.singleton v' e) + | D.ELit D.LEmptyError -> + let v' = A.Var.make ("empty_litteral", pos) in + (A.make_var (v', pos), A.VarMap.singleton v' e) + | D.EAssert e -> + (* as discuted, if the value in an assertion is empty, an error should the raised. This beavior is different from the ICFP paper. *) + let v' = A.Var.make ("assertion_value", pos) in + (A.make_var (v', pos), A.VarMap.singleton v' e) - (* Implicit application *) - | D.ETuple (args, s) -> - assert false - | D.ETupleAccess (e1, i, s, ts) -> - assert false - | D.EInj (e1, i, en, ts) -> - assert false - | D.EMatch (e1, cases, en) -> - assert false - | D.EArray es -> - assert false + (* pure terms *) + | D.ELit l -> + (Bindlib.box (A.ELit (translate_lit l pos), pos), A.VarMap.empty) + | D.EIfThenElse (e1, e2, e3) -> - assert false - | D.EAssert e1 -> - assert false + let e1', c1 = translate_and_cut ctx e1 in + let e2', c2 = translate_and_cut ctx e2 in + let e3', c3 = translate_and_cut ctx e3 in + + let e' = Bindlib.box_apply3 ( + fun e1' e2' e3' -> (A.EIfThenElse(e1', e2', e3'), pos)) e1' e2' e3' + in + + (*(* equivalent code : *) + let e' = + let+ e1' = e1' and+ e2' = e2' and+ e3' = e3' in + (A.EIfThenElse (e1', e2', e3'), pos) + in + *) + + (e', disjoint_union_maps pos [c1; c2; c3]) + + + + | _ -> assert false -and translate_expr_monad (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindlib.box = - assert false \ No newline at end of file +let rec translate_expr (ctx: ctx) (e: D.expr Pos.marked) + : (A.expr Pos.marked Bindlib.box) = + let e', cs = translate_and_cut ctx e in + let cs = A.VarMap.bindings cs in + + let pos = Pos.get_position e in + (* build the cuts *) + ListLabels.fold_left cs ~init:e' + ~f:(fun acc (v, (c, pos_c)) -> + + let c': A.expr Pos.marked Bindlib.box = match c with + (* Here we have to handle only the cases appearing in cuts, as defined the [translate_and_cut] function. *) + | D.EVar v -> Bindlib.box_var v + | D.EDefault (excep, just, cons) -> + let excep' = List.map (translate_expr ctx) excep in + let just' = translate_expr ctx just in + let cons' = translate_expr ctx cons in + (* TODO: [ + match process_expr {{ except' }} with + | Some -> fun v -> v + | None -> (fun () -> match {{ just' }} with + | Some -> (fun v -> if v then {{ cons' }} else None) + | None -> (fun () -> None) + ) + ] *) + assert false + | D.ELit D.LEmptyError -> + A.make_none pos_c + | _ -> Errors.raise_spanned_error "Internal Error: An term was found in a position where it should not be" pos_c + in + + (* [ + match {{ c' }} with + | None -> None + | Some {{ v }} -> {{ acc }} + end + ] *) + A.make_matchopt'' pos v (D.TAny, pos) c' (A.make_none pos) acc + ) + From 90a63ebeadd32e5d2b134caec9fba34aa37b41da Mon Sep 17 00:00:00 2001 From: Alain Date: Tue, 1 Feb 2022 17:49:00 +0100 Subject: [PATCH 044/102] finished implementation of translation_expr + some documentation --- compiler/lcalc/compile_without_exceptions2.ml | 155 ++++++++++++++++-- 1 file changed, 139 insertions(+), 16 deletions(-) diff --git a/compiler/lcalc/compile_without_exceptions2.ml b/compiler/lcalc/compile_without_exceptions2.ml index 3db27132d..fd99c0b0d 100644 --- a/compiler/lcalc/compile_without_exceptions2.ml +++ b/compiler/lcalc/compile_without_exceptions2.ml @@ -3,6 +3,14 @@ open Utils module D = Dcalc.Ast module A = Ast + +(** + The main idea around this pass is to compile Dcalc to Lcalc without using [raise EmptyError] nor [try _ with EmptyError -> _]. To do so, we use the same technique as in rust or erlang to handle this kind of exceptions. Each [raise EmptyError] will be translated as [None] and each [try e1 with EmtpyError -> e2] as [match e1 with | None -> e2 | Some x -> x]. + + When doing this naively, this requires to add matches and Some constructor everywhere. We apply here an other technique where we generate what we call `cuts`. Cuts are expression whom could minimally [raise EmptyError]. +*) + + (** information about the variables *) type info = { expr: A.expr Pos.marked Bindlib.box; @@ -11,7 +19,7 @@ type info = { } (** information context about variables in the current scope *) -type ctx = info D.VarMap.t +type ctx = info D.VarMap.t type cuts = D.expr Pos.marked A.VarMap.t @@ -58,11 +66,16 @@ let rec translate_and_cut (ctx: ctx) (e: D.expr Pos.marked) | D.ELit D.LEmptyError -> let v' = A.Var.make ("empty_litteral", pos) in (A.make_var (v', pos), A.VarMap.singleton v' e) - | D.EAssert e -> + | D.EAssert _ -> (* as discuted, if the value in an assertion is empty, an error should the raised. This beavior is different from the ICFP paper. *) - let v' = A.Var.make ("assertion_value", pos) in + let v' = A.Var.make ("assertion_value", pos) in (A.make_var (v', pos), A.VarMap.singleton v' e) + | ErrorOnEmpty _ -> + let v' = A.Var.make ("error_on_empty_value", pos) in + (A.make_var (v', pos), A.VarMap.singleton v' e) + + (* pure terms *) | D.ELit l -> (Bindlib.box (A.ELit (translate_lit l pos), pos), A.VarMap.empty) @@ -85,39 +98,149 @@ let rec translate_and_cut (ctx: ctx) (e: D.expr Pos.marked) (e', disjoint_union_maps pos [c1; c2; c3]) + | EAbs ((binder, pos_binder), ts) -> + let vars, body = Bindlib.unmbind binder in + let ctx, lc_vars = ArrayLabels.fold_right vars ~init:(ctx, []) + ~f:(fun var (ctx, lc_vars) -> + let lc_var = A.Var.make (Bindlib.name_of var, pos_binder) in + let lc_var_expr = A.make_var (lc_var, pos_binder) in + (* we suppose the invariant that when applying a function, its arguments cannot be of the type "option". + + The code should behave correctly in the opposite direction if we put here an is_pure=false. *) + (D.VarMap.add var {var=lc_var; expr=lc_var_expr; is_pure=true} ctx, lc_var :: lc_vars)) + in + let lc_vars = Array.of_list lc_vars in + + (* here we take the guess that if we cannot build the closure because one of the variable is empty, then we cannot build the function. *) + let new_body, cuts = translate_and_cut ctx body in + let new_binder = Bindlib.bind_mvar lc_vars new_body in + + + (Bindlib.box_apply + (fun new_binder -> A.EAbs ((new_binder, pos_binder), ts), pos) + new_binder, cuts) + | EApp (e1, args) -> + (* general case is simple *) + let e1', c1 = translate_and_cut ctx e1 in + let args', c_args = args + |> List.map (translate_and_cut ctx) + |> List.split + in + + let cuts = disjoint_union_maps pos (c1::c_args) in + let e' = Bindlib.box_apply2 (fun e1' args' -> A.EApp (e1', args'), pos) + e1' (Bindlib.box_list args') + in + (e', cuts) + + | ETuple (args, s) -> + let args', c_args = args + |> List.map (translate_and_cut ctx) + |> List.split + in + + let cuts = disjoint_union_maps pos c_args in + (Bindlib.box_apply (fun args' -> A.ETuple (args', s), pos) (Bindlib.box_list args'), cuts) + | ETupleAccess (e1, i, s, ts) -> + let e1', cuts = translate_and_cut ctx e1 in + let e1' = Bindlib.box_apply + (fun e1' -> A.ETupleAccess (e1', i, s, ts), pos) + e1' + in + (e1', cuts) + | EInj (e1, i, en, ts) -> + let e1', cuts = translate_and_cut ctx e1 in + let e1' = Bindlib.box_apply + (fun e1' -> A.EInj (e1', i, en, ts), pos) + e1' + in + (e1', cuts) + | EMatch (e1, cases, en) -> + let e1', c1 = translate_and_cut ctx e1 in + let cases', c_cases = cases + |> List.map (translate_and_cut ctx) + |> List.split + in + + let cuts = disjoint_union_maps pos (c1::c_cases) in + let e' = Bindlib.box_apply2 (fun e1' cases' -> A.EMatch (e1', cases', en), pos) + e1' (Bindlib.box_list cases') + in + (e', cuts) + | EArray es -> + let es', cuts = es + |> List.map (translate_and_cut ctx) + |> List.split + in + (Bindlib.box_apply (fun es' -> (A.EArray es', pos)) (Bindlib.box_list es'), disjoint_union_maps pos cuts) - | _ -> assert false + | EOp op -> (Bindlib.box (A.EOp op, pos), A.VarMap.empty) + let rec translate_expr (ctx: ctx) (e: D.expr Pos.marked) : (A.expr Pos.marked Bindlib.box) = let e', cs = translate_and_cut ctx e in let cs = A.VarMap.bindings cs in - let pos = Pos.get_position e in + let _pos = Pos.get_position e in (* build the cuts *) ListLabels.fold_left cs ~init:e' ~f:(fun acc (v, (c, pos_c)) -> let c': A.expr Pos.marked Bindlib.box = match c with (* Here we have to handle only the cases appearing in cuts, as defined the [translate_and_cut] function. *) - | D.EVar v -> Bindlib.box_var v + | D.EVar v -> (D.VarMap.find (Pos.unmark v) ctx).expr | D.EDefault (excep, just, cons) -> let excep' = List.map (translate_expr ctx) excep in let just' = translate_expr ctx just in let cons' = translate_expr ctx cons in - (* TODO: [ - match process_expr {{ except' }} with - | Some -> fun v -> v - | None -> (fun () -> match {{ just' }} with - | Some -> (fun v -> if v then {{ cons' }} else None) - | None -> (fun () -> None) - ) - ] *) - assert false + (* calls handle_option. *) + A.make_app + (A.make_var (A.handle_default_opt, pos_c)) + [(Bindlib.box_apply (fun excep' -> (A.EArray excep', pos_c)) (Bindlib.box_list excep')); + just'; + cons' + ] + pos_c + | D.ELit D.LEmptyError -> A.make_none pos_c + + | ErrorOnEmpty arg -> + (* [ + match arg with + | None -> raise NoValueProvided + | Some v -> {{ v }} + ] *) + + let unit = A.Var.make ("unit", pos_c) in + let x = A.Var.make ("assertion_argument", pos_c) in + + let arg' = translate_expr ctx arg in + + A.make_matchopt arg' + (A.make_abs [| unit |] (Bindlib.box (A.ERaise A.NoValueProvided, pos_c)) pos_c [D.TAny, pos_c] pos_c) + (A.make_abs [| x |] ((A.make_var (x, pos_c))) pos_c [D.TAny, pos_c] pos_c) + + + | D.EAssert arg -> + let arg' = translate_expr ctx arg in + + (* [ + match arg with + | None -> raise NoValueProvided + | Some v -> assert {{ v }} + ] *) + + let unit = A.Var.make ("unit", pos_c) in + let x = A.Var.make ("assertion_argument", pos_c) in + + A.make_matchopt arg' + (A.make_abs [| unit |] (Bindlib.box (A.ERaise A.NoValueProvided, pos_c)) pos_c [D.TAny, pos_c] pos_c) + (A.make_abs [| x |] (Bindlib.box_apply (fun arg -> A.EAssert arg, pos_c) (A.make_var (x, pos_c))) pos_c [D.TAny, pos_c] pos_c) + | _ -> Errors.raise_spanned_error "Internal Error: An term was found in a position where it should not be" pos_c in @@ -127,6 +250,6 @@ let rec translate_expr (ctx: ctx) (e: D.expr Pos.marked) | Some {{ v }} -> {{ acc }} end ] *) - A.make_matchopt'' pos v (D.TAny, pos) c' (A.make_none pos) acc + A.make_matchopt'' pos_c v (D.TAny, pos_c) c' (A.make_none pos_c) acc ) From 0a612bfe7d0d272bbd5747eea978434851bf7cd0 Mon Sep 17 00:00:00 2001 From: Alain Date: Wed, 2 Feb 2022 12:01:05 +0100 Subject: [PATCH 045/102] translate_scope_let --- compiler/lcalc/compile_without_exceptions2.ml | 119 +++++++++++++++++- 1 file changed, 118 insertions(+), 1 deletion(-) diff --git a/compiler/lcalc/compile_without_exceptions2.ml b/compiler/lcalc/compile_without_exceptions2.ml index fd99c0b0d..6af98ac04 100644 --- a/compiler/lcalc/compile_without_exceptions2.ml +++ b/compiler/lcalc/compile_without_exceptions2.ml @@ -177,7 +177,7 @@ let rec translate_and_cut (ctx: ctx) (e: D.expr Pos.marked) (Bindlib.box_apply (fun es' -> (A.EArray es', pos)) (Bindlib.box_list es'), disjoint_union_maps pos cuts) | EOp op -> (Bindlib.box (A.EOp op, pos), A.VarMap.empty) - +;; let rec translate_expr (ctx: ctx) (e: D.expr Pos.marked) : (A.expr Pos.marked Bindlib.box) = @@ -252,4 +252,121 @@ let rec translate_expr (ctx: ctx) (e: D.expr Pos.marked) ] *) A.make_matchopt'' pos_c v (D.TAny, pos_c) c' (A.make_none pos_c) acc ) +;; + +let add_var pos var is_pure ctx = + let new_var = A.Var.make (Bindlib.name_of var, pos) in + let expr = A.make_var (new_var, pos) in + D.VarMap.add var { expr; var = new_var; is_pure } ctx +;; + +let translate_scope_let (ctx: ctx) (s: D.scope_let): ctx * A.expr Pos.marked Bindlib.box = + match s with + | { + D.scope_let_var = (var, pos); + D.scope_let_typ = _typ; + D.scope_let_expr = expr; + D.scope_let_kind = DestructuringInputStruct (** [let x = input.field]*) + } -> + (add_var pos var false ctx, translate_expr ctx (Bindlib.unbox expr)) + | { + D.scope_let_var = (var, pos); + D.scope_let_typ = _typ; + D.scope_let_expr = expr; + D.scope_let_kind = ScopeVarDefinition (** [let x = error_on_empty e]*) + } -> (add_var pos var true ctx, translate_expr ctx (Bindlib.unbox expr)) + | { + D.scope_let_var = (var, pos); + D.scope_let_typ = _typ; + D.scope_let_expr = expr; + D.scope_let_kind = SubScopeVarDefinition (** [let s.x = fun _ -> e] *) + } -> (add_var pos var true ctx, translate_expr ctx (Bindlib.unbox expr)) + | { + D.scope_let_var = (var, pos); + D.scope_let_typ = _typ; + D.scope_let_expr = expr; + D.scope_let_kind = CallingSubScope (** [let result = s ({ x = s.x; y = s.x; ...}) ]*) + } -> (add_var pos var true ctx, translate_expr ctx (Bindlib.unbox expr)) + | { + D.scope_let_var = (var, pos); + D.scope_let_typ = _typ; + D.scope_let_expr = expr; + D.scope_let_kind = DestructuringSubScopeResults (** [let s.x = result.x ]**) + } -> (add_var pos var true ctx, translate_expr ctx (Bindlib.unbox expr)) + | { + D.scope_let_var = (var, pos); + D.scope_let_typ = _typ; + D.scope_let_expr = expr; + D.scope_let_kind = Assertion (** [let _ = assert e]*) + } -> (add_var pos var true ctx, translate_expr ctx (Bindlib.unbox expr)) + +let translate_scope_body + (_scope_pos: Pos.t) + (_decl_ctx: D.decl_ctx) + (ctx: ctx) + (body: D.scope_body): A.expr Pos.marked Bindlib.box = + match body with + { + scope_body_lets=lets; + scope_body_result=result; + scope_body_arg=arg; + scope_body_input_struct=_input_struct; + scope_body_output_struct=_output_struct; + } -> + (* first we add to the input the ctx *) + let ctx1 = add_var Pos.no_pos arg true ctx in + + (* then, we compute the lets bindings and modification to the ctx *) + (* todo: once we update to ocaml 4.11, use fold_left_map instead of fold_left + List.rev *) + let ctx2, acc = + ListLabels.fold_left lets + ~init:(ctx1, []) + ~f:(fun (ctx, acc) (s : D.scope_let) -> + let ctx, e = translate_scope_let ctx s in + (ctx, (s.scope_let_var, D.TAny, e) :: acc)) + in + let acc = List.rev acc in + + (* we now have the context for the final transformation: the result *) + (* todo: alaid, result is boxed and hence incompatible with translate_expr... *) + let result = translate_expr ctx2 (Bindlib.unbox result) in + + (* finally, we can recombine everything using nested let ... = ... in *) + let body = + ListLabels.fold_left acc ~init:result + ~f:(fun (body : (A.expr * Pos.t) Bindlib.box) ((v, pos), tau, e) -> + A.make_let_in (D.VarMap.find v ctx2).var (tau, pos) e body) + in + + (* we finnally rebuild the binder *) + A.make_abs + (Array.of_list [ (D.VarMap.find arg ctx1).var ]) + body Pos.no_pos [ (D.TAny, Pos.no_pos) ] Pos.no_pos + + + + + +let translate_program (prgm: D.program) : A.program = + + (* modify *) + let decl_ctx = prgm.decl_ctx in + + let scopes = prgm.scopes + |> ListLabels.fold_left ~init:([], D.VarMap.empty) + ~f:(fun ((acc, ctx) : _ * info D.VarMap.t) (scope_name, n, scope_body) -> + let new_ctx = add_var Pos.no_pos n true ctx in + let new_n = D.VarMap.find n new_ctx in + + let scope_pos = Pos.get_position (D.ScopeName.get_info scope_name) in + + let new_acc = (new_n, Bindlib.unbox (translate_scope_body scope_pos decl_ctx ctx scope_body)) :: acc in + + (new_acc, new_ctx) + ) + |> fst + |> List.rev + |> List.map (fun (info, e) -> (info.var, e)) + in + {scopes; decl_ctx} \ No newline at end of file From 717915bc868ced5ffb32522689124b2a9c3887a8 Mon Sep 17 00:00:00 2001 From: Alain Date: Wed, 2 Feb 2022 12:10:47 +0100 Subject: [PATCH 046/102] more documentation --- compiler/lcalc/compile_without_exceptions2.ml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/compiler/lcalc/compile_without_exceptions2.ml b/compiler/lcalc/compile_without_exceptions2.ml index 6af98ac04..1b2b906f9 100644 --- a/compiler/lcalc/compile_without_exceptions2.ml +++ b/compiler/lcalc/compile_without_exceptions2.ml @@ -7,11 +7,17 @@ module A = Ast (** The main idea around this pass is to compile Dcalc to Lcalc without using [raise EmptyError] nor [try _ with EmptyError -> _]. To do so, we use the same technique as in rust or erlang to handle this kind of exceptions. Each [raise EmptyError] will be translated as [None] and each [try e1 with EmtpyError -> e2] as [match e1 with | None -> e2 | Some x -> x]. - When doing this naively, this requires to add matches and Some constructor everywhere. We apply here an other technique where we generate what we call `cuts`. Cuts are expression whom could minimally [raise EmptyError]. + When doing this naively, this requires to add matches and Some constructor everywhere. We apply here an other technique where we generate what we call `cuts`. Cuts are expression whom could minimally [raise EmptyError]. For instance [let x = * 3 in x + 1], the sub-expression [] can produce an empty error. So we make a cut with a new variable [y] linked to the Dcalc expression [], and we return as the translated expression [let x = y * 3 in x + 1]. + + The compilation of expressions is found in the functions [translate_and_cut ctx e] and [translate_expr ctx e]. Every option-generating expresion when calling [translate_and_cut] will be cutted and later handled by the [translate_expr] function. Every other cases is found in the translate_and_cut function. *) +(** cuts *) +type cuts = D.expr Pos.marked A.VarMap.t + -(** information about the variables *) +(** + information about the Dcalc variable : what is the corresponding LCalc variable; an expression build correctly using Bindlib, and a boolean indicating whenever the variable should be matched (false) or not (true). *) type info = { expr: A.expr Pos.marked Bindlib.box; var: A.expr Bindlib.var; @@ -21,7 +27,8 @@ type info = { (** information context about variables in the current scope *) type ctx = info D.VarMap.t -type cuts = D.expr Pos.marked A.VarMap.t + + let translate_lit (l : D.lit) (pos: Pos.t): A.lit = @@ -36,7 +43,7 @@ let translate_lit (l : D.lit) (pos: Pos.t): A.lit = | D.LEmptyError -> Errors.raise_spanned_error "Internal Error: An empty error was found in a place that shouldn't be possible." pos -(** [c = merge_maps cs] +(** [c = disjoint_union_maps cs] Compute the disjoint union of multiple maps. Raises an internal error if there is two identicals keys in differnts parts. *) let disjoint_union_maps (pos: Pos.t) (cs: 'a A.VarMap.t list): 'a A.VarMap.t = let disjoint_union = A.VarMap.union (fun _ _ _ -> Errors.raise_spanned_error "Internal Error: Two supposed to be disjoints maps have one shared key." pos) in From 3c5bc4f67e72df95f6f72787f850064f743216ee Mon Sep 17 00:00:00 2001 From: Alain Date: Wed, 2 Feb 2022 12:12:15 +0100 Subject: [PATCH 047/102] before removing the old file --- compiler/lcalc/compile_without_exceptions.ml | 538 +++++++++---------- 1 file changed, 249 insertions(+), 289 deletions(-) diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index 531dd09cb..c17d37524 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -16,8 +16,9 @@ open Utils module D = Dcalc.Ast module A = Ast -type info = {expr: A.expr Pos.marked Bindlib.box; var: A.expr Bindlib.var; is_pure: bool} -type ctx = info D.VarMap.t +type info = { expr : A.expr Pos.marked Bindlib.box; var : A.expr Bindlib.var; is_pure : bool } + +type ctx = info D.VarMap.t let translate_lit (l : D.lit) : A.expr = let build lit = @@ -41,11 +42,10 @@ let thunk_expr (e : A.expr Pos.marked Bindlib.box) (pos : Pos.t) : A.expr Pos.ma let dummy_var = A.Var.make ("_", pos) in A.make_abs [| dummy_var |] e pos [ (D.TAny, pos) ] pos - let add_var pos var is_pure ctx = let new_var = A.Var.make (Bindlib.name_of var, pos) in let expr = A.make_var (new_var, pos) in - D.VarMap.add var {expr; var=new_var; is_pure} ctx + D.VarMap.add var { expr; var = new_var; is_pure } ctx let rec translate_default (ctx : ctx) (exceptions : D.expr Pos.marked list) (just : D.expr Pos.marked) (cons : D.expr Pos.marked) (pos_default : Pos.t) : @@ -69,16 +69,19 @@ and translate_typ (t : D.typ Pos.marked) : D.typ Pos.marked = (* Hack: If the type is D.TAny, it means for the compiler to not put any type annotation.*) Pos.same_pos_as D.TAny t -and translate_binder (ctx: ctx) ((binder, pos_binder): (D.expr, D.expr Pos.marked) Bindlib.mbinder Pos.marked): (A.expr, A.expr Pos.marked) Bindlib.mbinder Pos.marked Bindlib.box = - +and translate_binder (ctx : ctx) + ((binder, pos_binder) : (D.expr, D.expr Pos.marked) Bindlib.mbinder Pos.marked) : + (A.expr, A.expr Pos.marked) Bindlib.mbinder Pos.marked Bindlib.box = let vars, body = Bindlib.unmbind binder in let ctx, lc_vars = Array.fold_right - begin fun var (ctx, lc_vars) -> + begin + fun var (ctx, lc_vars) -> let lc_var = A.Var.make (Bindlib.name_of var, pos_binder) in let lc_var_expr = A.make_var (lc_var, pos_binder) in - let new_ctx = D.VarMap.add var {expr=lc_var_expr; is_pure= false; var= lc_var} ctx in - (new_ctx, lc_var :: lc_vars) end + let new_ctx = D.VarMap.add var { expr = lc_var_expr; is_pure = false; var = lc_var } ctx in + (new_ctx, lc_var :: lc_vars) + end vars (ctx, []) in let lc_vars = Array.of_list lc_vars in @@ -90,13 +93,8 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl let same_pos e' = Pos.same_pos_as e' e in match Pos.unmark e with | D.EVar v -> - - let info = D.VarMap.find (Pos.unmark v) ctx in - if info.is_pure then - A.make_some info.expr - else - info.expr - + let info = D.VarMap.find (Pos.unmark v) ctx in + if info.is_pure then A.make_some info.expr else info.expr | D.ETuple (args, s) -> let+ args = Bindlib.box_list (List.map (translate_expr ctx) args) in Pos.same_pos_as (A.ETuple (args, s)) e @@ -112,7 +110,6 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl in A.make_bindopt pos tau e1 new_e - | D.EInj (e1, i, en, ts) -> let e1 = translate_expr ctx e1 in let pos = Pos.get_position (Bindlib.unbox e1) in @@ -124,88 +121,86 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl in A.make_bindopt pos tau e1 new_e - | D.EMatch (e1, cases, en) -> - let e1 = translate_expr ctx e1 in - let pos = Pos.get_position (Bindlib.unbox e1) in - let tau = (D.TAny, pos) in - - let new_e new_e1 = - let+ new_e1 = new_e1 - and+ cases = - cases - |> List.map (fun (e', _pos) -> - match e' with - | D.EAbs (binder, ts) -> - let+ new_binder = translate_binder ctx binder in - same_pos @@ A.EAbs (new_binder, List.map translate_typ ts) - | _ -> Errors.raise_spanned_error "Internal error: an error occured during the translation of a amtch." (Pos.get_position e)) - |> Bindlib.box_list - in - if (List.for_all (fun (x, _) -> match x with A.EAbs _ -> true | _ -> false) cases) then - Errors.raise_spanned_error "Internal error: an error occured during the translation of a match." (Pos.get_position e); + let e1 = translate_expr ctx e1 in + let pos = Pos.get_position (Bindlib.unbox e1) in + let tau = (D.TAny, pos) in + + let new_e new_e1 = + let+ new_e1 = new_e1 + and+ cases = + cases + |> List.map (fun (e', _pos) -> + match e' with + | D.EAbs (binder, ts) -> + let+ new_binder = translate_binder ctx binder in + same_pos @@ A.EAbs (new_binder, List.map translate_typ ts) + | _ -> + Errors.raise_spanned_error + "Internal error: an error occured during the translation of a amtch." + (Pos.get_position e)) + |> Bindlib.box_list + in + if List.for_all (fun (x, _) -> match x with A.EAbs _ -> true | _ -> false) cases then + Errors.raise_spanned_error + "Internal error: an error occured during the translation of a match." + (Pos.get_position e); same_pos @@ A.EMatch (new_e1, cases, en) in A.make_bindopt pos tau e1 new_e - | D.EArray es -> let+ es = es |> List.map (translate_expr ctx) |> Bindlib.box_list in same_pos @@ A.make_some' (same_pos @@ A.EArray es) - | D.ELit l -> Bindlib.box @@ same_pos @@ translate_lit l | D.EOp _op -> - Errors.raise_spanned_error "Internal error: partial application of generic operator are not yet supported when using --avoid_exception." (Pos.get_position e) - | D.EApp((D.EOp op, pos), args) -> - begin - let xs = List.mapi (fun i arg -> A.Var.make (Printf.sprintf "x_%d" i, Pos.get_position arg)) args in + Errors.raise_spanned_error + "Internal error: partial application of generic operator are not yet supported when using \ + --avoid_exception." + (Pos.get_position e) + | D.EApp ((D.EOp op, pos), args) -> + let xs = + List.mapi (fun i arg -> A.Var.make (Printf.sprintf "x_%d" i, Pos.get_position arg)) args + in let dummy = A.Var.make ("unit", pos) in - let e' final = args - |> List.map (translate_expr ctx) - |> List.combine xs - |> List.fold_left (fun acc (x, arg) -> - A.make_matchopt - arg - (A.make_abs (Array.of_list [dummy]) (A.make_none pos) (pos) [D.TLit D.TUnit, pos] pos) - (A.make_abs (Array.of_list [x]) acc pos [D.TAny, pos] pos) - ) final + let e' final = + args + |> List.map (translate_expr ctx) + |> List.combine xs + |> List.fold_left + (fun acc (x, arg) -> + A.make_matchopt arg + (A.make_abs + (Array.of_list [ dummy ]) + (A.make_none pos) pos [ (D.TLit D.TUnit, pos) ] pos) + (A.make_abs (Array.of_list [ x ]) acc pos [ (D.TAny, pos) ] pos)) + final in let new_e = - let+ args_var = xs - |> List.map (fun x -> Bindlib.box_var x) - |> Bindlib.box_list - in + let+ args_var = xs |> List.map (fun x -> Bindlib.box_var x) |> Bindlib.box_list in - let args_var = args_var - |> List.combine args - |> List.map (fun (arg, x) -> Pos.same_pos_as x arg) + let args_var = + args_var |> List.combine args |> List.map (fun (arg, x) -> Pos.same_pos_as x arg) in same_pos @@ A.make_some' @@ same_pos @@ A.EApp ((A.EOp op, pos), args_var) in e' new_e - end - | D.EIfThenElse (e1, e2, e3) -> let e1 = translate_expr ctx e1 in let pos = Pos.get_position (Bindlib.unbox e1) in let tau = (D.TAny, pos) in - - let new_e new_e1 = - let+ e1_new = new_e1 - and+ e2 = translate_expr ctx e2 - and+ e3 = translate_expr ctx e3 in + let+ e1_new = new_e1 and+ e2 = translate_expr ctx e2 and+ e3 = translate_expr ctx e3 in same_pos @@ A.EIfThenElse (e1_new, e2, e3) in A.make_bindopt pos tau e1 new_e - | D.EAssert e1 -> (* don't know the semantic of EAssert. *) (* Bindlib.box_apply (fun e1 -> Pos.same_pos_as (A.EAssert e1) e) (translate_expr ctx e1) *) @@ -219,46 +214,37 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl in A.make_bindopt pos tau e1 new_e + | D.EApp (e1, args) -> + let e1 = translate_expr ctx e1 in + let pos = Pos.get_position (Bindlib.unbox e1) in + let tau = (D.TAny, pos) in - | D.EApp (e1, args) -> - let e1 = translate_expr ctx e1 in - let pos = Pos.get_position (Bindlib.unbox e1) in - let tau = (D.TAny, pos) in - - let new_e new_e1 = - let+ new_e1 = new_e1 - and+ args = args - |> List.map (translate_expr ctx) - |> Bindlib.box_list + let new_e new_e1 = + let+ new_e1 = new_e1 + and+ args = args |> List.map (translate_expr ctx) |> Bindlib.box_list in + same_pos @@ A.EApp (new_e1, args) in - same_pos @@ A.EApp (new_e1, args) - in - - A.make_bindopt pos tau e1 new_e + A.make_bindopt pos tau e1 new_e | D.EAbs (binder, ts) -> let+ new_binder = translate_binder ctx binder in - same_pos - @@ A.make_some' (same_pos @@ A.EAbs (new_binder, List.map translate_typ ts)) + same_pos @@ A.make_some' (same_pos @@ A.EAbs (new_binder, List.map translate_typ ts)) | D.EDefault (exceptions, just, cons) -> translate_default ctx exceptions just cons (Pos.get_position e) - | D.ErrorOnEmpty arg -> - - (* we need to be carefull on this one *) - - begin + (* we need to be carefull on this one *) (* ~> match [| arg |] with None -> raise NoValueProvided | Some x -> x *) let pos_arg = Pos.get_position arg in let x = A.Var.make ("result", pos_arg) in let arg = translate_expr ctx arg in - + let tau = (D.TAny, pos_arg) in - + let e3 = A.make_abs (Array.of_list [ x ]) - (let+ v = Bindlib.box_var x in (v, pos_arg)) + (let+ v = Bindlib.box_var x in + (v, pos_arg)) pos_arg [ tau ] pos_arg and e1 = arg and e2 = @@ -267,232 +253,208 @@ and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindl (Bindlib.box @@ (A.ERaise A.NoValueProvided, Pos.get_position e)) pos_arg [ tau ] pos_arg in - - A.make_some @@ A.make_matchopt e1 e2 e3 - end - (* Errors.raise_spanned_error "Internal error: Error on empty found in incorrect place when compiling using the --avoid_exception option." (Pos.get_position e) *) + A.make_some @@ A.make_matchopt e1 e2 e3 +(* Errors.raise_spanned_error "Internal error: Error on empty found in incorrect place when + compiling using the --avoid_exception option." (Pos.get_position e) *) -let rec translate_scope_vardefinition ctx expr: A.expr Pos.marked Bindlib.box = +let rec translate_scope_vardefinition ctx expr : A.expr Pos.marked Bindlib.box = match expr with - | D.ErrorOnEmpty arg, pos_expr -> - begin - (* ~> match [| arg |] with None -> raise NoValueProvided | Some x -> x *) - let pos_arg = Pos.get_position arg in - let x = A.Var.make ("result", pos_arg) in - let arg = translate_expr ctx arg in - - let tau = (D.TAny, pos_arg) in - - let e3 = - A.make_abs - (Array.of_list [ x ]) - (let+ v = Bindlib.box_var x in (v, pos_arg)) - pos_arg [ tau ] pos_arg - and e1 = arg - and e2 = - A.make_abs - (Array.of_list [ x ]) - (Bindlib.box @@ (A.ERaise A.NoValueProvided, pos_expr)) - pos_arg [ tau ] pos_arg - in - - A.make_matchopt e1 e2 e3 - end - - | D.EApp((D.EOp (D.Unop (D.Log (le, l))), pos_log), [e']), pos -> - - let+ e' = translate_scope_vardefinition ctx e' in - A.EApp((A.EOp (D.Unop (D.Log (le, l))), pos_log), [e']), pos - - | (expr, pos) -> - - Errors.raise_spanned_error (Printf.sprintf "Internal error: Found unexpected expression when compiling an expression using the --avoid_exception option. ''Full'' term: %s" (D.show_expr expr)) pos - - -let translate_scope_let (ctx: ctx) (s: D.scope_let) : ctx * A.expr Pos.marked Bindlib.box = - - match s with { - D.scope_let_var = var; - D.scope_let_kind = kind; - D.scope_let_typ = typ; - D.scope_let_expr = expr; - } -> begin - - (* I need to match on the expression. *) - let expr' : A.expr Pos.marked Bindlib.box = - let expr = Bindlib.unbox expr in - - let same_pos e' = Pos.same_pos_as e' expr in - match kind, typ, expr with - | ScopeVarDefinition, _typ, expr -> - translate_scope_vardefinition ctx expr - | Assertion, _typ, expr -> begin - let pos = Pos.get_position expr in - let x = A.Var.make ("result", pos) in - let arg = translate_expr ctx expr in + (* ~> match [| arg |] with None -> raise NoValueProvided | Some x -> x *) + let pos_arg = Pos.get_position arg in + let x = A.Var.make ("result", pos_arg) in + let arg = translate_expr ctx arg in - let tau = (D.TAny, pos) in + let tau = (D.TAny, pos_arg) in let e3 = A.make_abs (Array.of_list [ x ]) - (let+ v = Bindlib.box_var x in (v, pos)) - pos [ tau ] pos + (let+ v = Bindlib.box_var x in + (v, pos_arg)) + pos_arg [ tau ] pos_arg and e1 = arg and e2 = A.make_abs (Array.of_list [ x ]) - (Bindlib.box @@ same_pos @@ A.ERaise A.NoValueProvided) - pos [ tau ] pos + (Bindlib.box @@ (A.ERaise A.NoValueProvided, pos_expr)) + pos_arg [ tau ] pos_arg in A.make_matchopt e1 e2 e3 - end - | SubScopeVarDefinition, _typ, (D.EAbs ((binder, pos_binder), _tau), pos) -> - begin - let vs, body = Bindlib.unmbind binder in - - (* we need to add them to the context momentally *) - - let ctx = ArrayLabels.fold_left vs - ~init:ctx - ~f:(fun ctx (v: D.expr Bindlib.var) -> - add_var pos_binder v false ctx - ) + | D.EApp ((D.EOp (D.Unop (D.Log (le, l))), pos_log), [ e' ]), pos -> + let+ e' = translate_scope_vardefinition ctx e' in + (A.EApp ((A.EOp (D.Unop (D.Log (le, l))), pos_log), [ e' ]), pos) + | expr, pos -> + Errors.raise_spanned_error + (Printf.sprintf + "Internal error: Found unexpected expression when compiling an expression using the \ + --avoid_exception option. ''Full'' term: %s" + (D.show_expr expr)) + pos + +let translate_scope_let (ctx : ctx) (s : D.scope_let) : ctx * A.expr Pos.marked Bindlib.box = + match s with + | { + D.scope_let_var = var; + D.scope_let_kind = kind; + D.scope_let_typ = typ; + D.scope_let_expr = expr; + } -> + (* I need to match on the expression. *) + let expr' : A.expr Pos.marked Bindlib.box = + let expr = Bindlib.unbox expr in + + let same_pos e' = Pos.same_pos_as e' expr in + match (kind, typ, expr) with + | ScopeVarDefinition, _typ, expr -> translate_scope_vardefinition ctx expr + | Assertion, _typ, expr -> + let pos = Pos.get_position expr in + let x = A.Var.make ("result", pos) in + let arg = translate_expr ctx expr in + + let tau = (D.TAny, pos) in + + let e3 = + A.make_abs + (Array.of_list [ x ]) + (let+ v = Bindlib.box_var x in + (v, pos)) + pos [ tau ] pos + and e1 = arg + and e2 = + A.make_abs + (Array.of_list [ x ]) + (Bindlib.box @@ same_pos @@ A.ERaise A.NoValueProvided) + pos [ tau ] pos + in + + A.make_matchopt e1 e2 e3 + | SubScopeVarDefinition, _typ, (D.EAbs ((binder, pos_binder), _tau), pos) -> + let vs, body = Bindlib.unmbind binder in + + (* we need to add them to the context momentally *) + let ctx = + ArrayLabels.fold_left vs ~init:ctx ~f:(fun ctx (v : D.expr Bindlib.var) -> + add_var pos_binder v false ctx) + in + + let vs' = Array.map (fun v -> (D.VarMap.find v ctx).var) vs in + + let body' = translate_expr ctx body in + + (* there is no need to add the binded var to the context since we know it is thunked *) + A.make_abs vs' body' pos_binder [ (D.TAny, pos_binder) ] pos + | DestructuringInputStruct, _typ, expr -> translate_expr ctx expr + | DestructuringSubScopeResults, _typ, expr -> translate_expr ctx expr + | CallingSubScope, _typ, expr -> translate_expr ctx expr + | kind, _typ, (expr, pos) -> + let kind_s = + match kind with + | ScopeVarDefinition -> "ScopeVarDefinition" + | Assertion -> "Assertion" + | SubScopeVarDefinition -> "SubScopeVarDefinition" + | DestructuringInputStruct -> "DestructuringInputStruct" + | DestructuringSubScopeResults -> "DestructuringSubScopeResults" + | CallingSubScope -> "CallingSubScope" + in + + let expr_s = + match expr with + | EVar _ -> "EVar" + | ETuple _ -> "ETuple" + | ETupleAccess _ -> "ETupleAccess" + | EInj _ -> "EInj" + | EMatch _ -> "EMatch" + | EArray _ -> "EArray" + | ELit _ -> "ELit" + | EAbs _ -> "EAbs" + | EApp _ -> "EApp" + | EAssert _ -> "EAssert" + | EOp _ -> "EOp" + | EDefault _ -> "EDefault" + | EIfThenElse _ -> "EIfThenElse" + | ErrorOnEmpty _ -> "ErrorOnEmpty" + in + + Errors.raise_spanned_error + (Printf.sprintf + "Internal error: Found unexpected %s when compiling an expression containing %s \ + using the --avoid_exception option. ''Full'' term: %s" + kind_s expr_s (D.show_expr expr)) + pos in - let vs' = Array.map (fun v -> (D.VarMap.find v ctx).var) vs in - - let body' = translate_expr ctx body in - - (* there is no need to add the binded var to the context since we know it is thunked *) - A.make_abs vs' body' pos_binder [D.TAny, pos_binder] pos - end - - | DestructuringInputStruct, _typ, expr -> - translate_expr ctx expr - - | DestructuringSubScopeResults, _typ, expr -> - translate_expr ctx expr - - | CallingSubScope, _typ, expr -> - translate_expr ctx expr - - - - - | kind, _typ, (expr, pos) -> - - let kind_s = match kind with - | ScopeVarDefinition -> "ScopeVarDefinition" - | Assertion -> "Assertion" - | SubScopeVarDefinition -> "SubScopeVarDefinition" - | DestructuringInputStruct -> "DestructuringInputStruct" - | DestructuringSubScopeResults -> "DestructuringSubScopeResults" - | CallingSubScope -> "CallingSubScope" in - - let expr_s = match expr with - | EVar _ -> "EVar" - | ETuple _ -> "ETuple" - | ETupleAccess _ -> "ETupleAccess" - | EInj _ -> "EInj" - | EMatch _ -> "EMatch" - | EArray _ -> "EArray" - | ELit _ -> "ELit" - | EAbs _ -> "EAbs" - | EApp _ -> "EApp" - | EAssert _ -> "EAssert" - | EOp _ -> "EOp" - | EDefault _ -> "EDefault" - | EIfThenElse _ -> "EIfThenElse" - | ErrorOnEmpty _ -> "ErrorOnEmpty" + let is_pure = + match kind with + | ScopeVarDefinition -> true + | Assertion -> true + | SubScopeVarDefinition -> true + | DestructuringInputStruct -> true + | DestructuringSubScopeResults -> true + | CallingSubScope -> false in - - Errors.raise_spanned_error (Printf.sprintf "Internal error: Found unexpected %s when compiling an expression containing %s using the --avoid_exception option. ''Full'' term: %s" kind_s expr_s (D.show_expr expr)) pos - in - - let is_pure = match kind with - | ScopeVarDefinition -> true - | Assertion -> true - | SubScopeVarDefinition -> true - | DestructuringInputStruct -> true - | DestructuringSubScopeResults -> true - | CallingSubScope -> false - in - let ctx' = add_var (snd var) (fst var) is_pure ctx in + let ctx' = add_var (snd var) (fst var) is_pure ctx in - (ctx', expr') + (ctx', expr') - end +let translate_scope_body (ctx : ctx) (s : D.scope_body) : A.expr Pos.marked Bindlib.box = + match s with + | { D.scope_body_lets = lets; D.scope_body_result = result; D.scope_body_arg = arg; _ } -> + (* first we add to the input the ctx *) + let ctx1 = add_var Pos.no_pos arg true ctx in -let translate_scope_body (ctx: ctx) (s: D.scope_body): A.expr Pos.marked Bindlib.box = -match s with { - D.scope_body_lets=lets; - D.scope_body_result=result; - D.scope_body_arg=arg; - _ -} -> begin + (* then, we compute the lets bindings and modification to the ctx *) + (* todo: once we update to ocaml 4.11, use fold_left_map instead of fold_left + List.rev *) + let ctx2, acc = + ListLabels.fold_left lets + ~init:(ctx1, []) + ~f:(fun (ctx, acc) (s : D.scope_let) -> + let ctx, e = translate_scope_let ctx s in + (ctx, (s.scope_let_var, D.TAny, e) :: acc)) + in + let acc = List.rev acc in - (* first we add to the input the ctx *) - let ctx1 = add_var Pos.no_pos arg true ctx in + (* we now have the context for the final transformation: the result *) + (* todo: alaid, result is boxed and hence incompatible with translate_expr... *) + let result = translate_expr ctx2 (Bindlib.unbox result) in - (* then, we compute the lets bindings and modification to the ctx *) - (* todo: once we update to ocaml 4.11, use fold_left_map instead of fold_left + List.rev *) - let ctx2, acc = ListLabels.fold_left lets - ~init:(ctx1, []) - ~f:begin fun (ctx, acc) (s: D.scope_let) -> - let ctx, e = translate_scope_let ctx s in - (ctx, (s.scope_let_var, D.TAny, e)::acc) - end - in - let acc = List.rev acc in - - (* we now have the context for the final transformation: the result *) - (* todo: alaid, result is boxed and hence incompatible with translate_expr... *) - let result = translate_expr ctx2 (Bindlib.unbox result) in - - (* finally, we can recombine everything using nested let ... = ... in *) - let body = - ListLabels.fold_left acc - ~init:result - ~f:(fun (body: (A.expr * Pos.t) Bindlib.box) ((v, pos), tau, e) -> - A.make_let_in (D.VarMap.find v ctx2).var (tau, pos) e body - ) - in - - - (* we finnally rebuild the binder *) - - A.make_abs (Array.of_list [(D.VarMap.find arg ctx1).var]) body Pos.no_pos [D.TAny, Pos.no_pos] Pos.no_pos -end + (* finally, we can recombine everything using nested let ... = ... in *) + let body = + ListLabels.fold_left acc ~init:result + ~f:(fun (body : (A.expr * Pos.t) Bindlib.box) ((v, pos), tau, e) -> + A.make_let_in (D.VarMap.find v ctx2).var (tau, pos) e body) + in + (* we finnally rebuild the binder *) + A.make_abs + (Array.of_list [ (D.VarMap.find arg ctx1).var ]) + body Pos.no_pos [ (D.TAny, Pos.no_pos) ] Pos.no_pos let translate_program (prgm : D.program) : A.program = - let new_scopes = (prgm.scopes : (D.ScopeName.t * D.expr Bindlib.var * D.scope_body) list) - |> ListLabels.fold_left - ~init:([], D.VarMap.empty) - ~f:begin fun (acc, ctx) (_, n, e) -> - - let env: ctx = D.VarMap.map (fun v -> - let new_var = A.Var.make (Bindlib.name_of v, Pos.no_pos) in - let expr = A.make_var (new_var, Pos.no_pos) in - {expr; var=new_var; is_pure=true} - ) ctx in - - let new_n = A.Var.make (Bindlib.name_of n, Pos.no_pos) in - let new_e = translate_scope_body env e in - - let new_acc = (new_n, Bindlib.unbox new_e) :: acc in - let new_ctx = D.VarMap.add n new_n ctx in - - (new_acc, new_ctx) - end - |> fst - |> List.rev + let new_scopes = + (prgm.scopes : (D.ScopeName.t * D.expr Bindlib.var * D.scope_body) list) + |> ListLabels.fold_left ~init:([], D.VarMap.empty) ~f:(fun (acc, ctx) (_, n, e) -> + let env : ctx = + D.VarMap.map + (fun v -> + let new_var = A.Var.make (Bindlib.name_of v, Pos.no_pos) in + let expr = A.make_var (new_var, Pos.no_pos) in + { expr; var = new_var; is_pure = true }) + ctx + in + + let new_n = A.Var.make (Bindlib.name_of n, Pos.no_pos) in + let new_e = translate_scope_body env e in + + let new_acc = (new_n, Bindlib.unbox new_e) :: acc in + let new_ctx = D.VarMap.add n new_n ctx in + + (new_acc, new_ctx)) + |> fst |> List.rev in { scopes = new_scopes; @@ -502,5 +464,3 @@ let translate_program (prgm : D.program) : A.program = ctx_structs = prgm.decl_ctx.ctx_structs; }; } - - From 2c4f9bfc7a3e25f86e2a6e0f3fa64378a04795e2 Mon Sep 17 00:00:00 2001 From: Alain Date: Wed, 2 Feb 2022 12:13:47 +0100 Subject: [PATCH 048/102] removed the old file --- compiler/lcalc/compile_without_exceptions.ml | 466 ------------------- 1 file changed, 466 deletions(-) delete mode 100644 compiler/lcalc/compile_without_exceptions.ml diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml deleted file mode 100644 index c17d37524..000000000 --- a/compiler/lcalc/compile_without_exceptions.ml +++ /dev/null @@ -1,466 +0,0 @@ -(* This file is part of the Catala compiler, a specification language for tax and social benefits - computation rules. Copyright (C) 2020 Inria, contributor: Denis Merigoux - - - Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - in compliance with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software distributed under the License - is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - or implied. See the License for the specific language governing permissions and limitations under - the License. *) - -open Utils -module D = Dcalc.Ast -module A = Ast - -type info = { expr : A.expr Pos.marked Bindlib.box; var : A.expr Bindlib.var; is_pure : bool } - -type ctx = info D.VarMap.t - -let translate_lit (l : D.lit) : A.expr = - let build lit = - fst @@ Bindlib.unbox @@ A.make_some (Bindlib.box (Pos.mark Pos.no_pos (A.ELit lit))) - in - match l with - | D.LBool l -> build (A.LBool l) - | D.LInt i -> build (A.LInt i) - | D.LRat r -> build (A.LRat r) - | D.LMoney m -> build (A.LMoney m) - | D.LUnit -> build A.LUnit - | D.LDate d -> build (A.LDate d) - | D.LDuration d -> build (A.LDuration d) - | D.LEmptyError -> fst @@ Bindlib.unbox @@ A.make_none Pos.no_pos - -let ( let+ ) x f = Bindlib.box_apply f x - -let ( and+ ) x y = Bindlib.box_pair x y - -let thunk_expr (e : A.expr Pos.marked Bindlib.box) (pos : Pos.t) : A.expr Pos.marked Bindlib.box = - let dummy_var = A.Var.make ("_", pos) in - A.make_abs [| dummy_var |] e pos [ (D.TAny, pos) ] pos - -let add_var pos var is_pure ctx = - let new_var = A.Var.make (Bindlib.name_of var, pos) in - let expr = A.make_var (new_var, pos) in - D.VarMap.add var { expr; var = new_var; is_pure } ctx - -let rec translate_default (ctx : ctx) (exceptions : D.expr Pos.marked list) - (just : D.expr Pos.marked) (cons : D.expr Pos.marked) (pos_default : Pos.t) : - A.expr Pos.marked Bindlib.box = - let exceptions = List.map (fun except -> translate_expr ctx except) exceptions in - let exceptions = - A.make_app - (A.make_var (A.handle_default, pos_default)) - [ - Bindlib.box_apply - (fun exceptions -> (A.EArray exceptions, pos_default)) - (Bindlib.box_list exceptions); - thunk_expr (translate_expr ctx just) pos_default; - thunk_expr (translate_expr ctx cons) pos_default; - ] - pos_default - in - exceptions - -and translate_typ (t : D.typ Pos.marked) : D.typ Pos.marked = - (* Hack: If the type is D.TAny, it means for the compiler to not put any type annotation.*) - Pos.same_pos_as D.TAny t - -and translate_binder (ctx : ctx) - ((binder, pos_binder) : (D.expr, D.expr Pos.marked) Bindlib.mbinder Pos.marked) : - (A.expr, A.expr Pos.marked) Bindlib.mbinder Pos.marked Bindlib.box = - let vars, body = Bindlib.unmbind binder in - let ctx, lc_vars = - Array.fold_right - begin - fun var (ctx, lc_vars) -> - let lc_var = A.Var.make (Bindlib.name_of var, pos_binder) in - let lc_var_expr = A.make_var (lc_var, pos_binder) in - let new_ctx = D.VarMap.add var { expr = lc_var_expr; is_pure = false; var = lc_var } ctx in - (new_ctx, lc_var :: lc_vars) - end - vars (ctx, []) - in - let lc_vars = Array.of_list lc_vars in - let new_body = translate_expr ctx body in - let+ binder = Bindlib.bind_mvar lc_vars new_body in - (binder, pos_binder) - -and translate_expr (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindlib.box = - let same_pos e' = Pos.same_pos_as e' e in - match Pos.unmark e with - | D.EVar v -> - let info = D.VarMap.find (Pos.unmark v) ctx in - if info.is_pure then A.make_some info.expr else info.expr - | D.ETuple (args, s) -> - let+ args = Bindlib.box_list (List.map (translate_expr ctx) args) in - Pos.same_pos_as (A.ETuple (args, s)) e - | D.ETupleAccess (e1, i, s, ts) -> - let e1 = translate_expr ctx e1 in - - let pos = Pos.get_position (Bindlib.unbox e1) in - let tau = (D.TAny, pos) in - - let new_e new_e1 = - let+ new_e1 = new_e1 in - same_pos @@ A.ETupleAccess (new_e1, i, s, ts) - in - - A.make_bindopt pos tau e1 new_e - | D.EInj (e1, i, en, ts) -> - let e1 = translate_expr ctx e1 in - let pos = Pos.get_position (Bindlib.unbox e1) in - let tau = (D.TAny, pos) in - - let new_e new_e1 = - let+ new_e1 = new_e1 in - same_pos @@ A.EInj (new_e1, i, en, ts) - in - - A.make_bindopt pos tau e1 new_e - | D.EMatch (e1, cases, en) -> - let e1 = translate_expr ctx e1 in - let pos = Pos.get_position (Bindlib.unbox e1) in - let tau = (D.TAny, pos) in - - let new_e new_e1 = - let+ new_e1 = new_e1 - and+ cases = - cases - |> List.map (fun (e', _pos) -> - match e' with - | D.EAbs (binder, ts) -> - let+ new_binder = translate_binder ctx binder in - same_pos @@ A.EAbs (new_binder, List.map translate_typ ts) - | _ -> - Errors.raise_spanned_error - "Internal error: an error occured during the translation of a amtch." - (Pos.get_position e)) - |> Bindlib.box_list - in - if List.for_all (fun (x, _) -> match x with A.EAbs _ -> true | _ -> false) cases then - Errors.raise_spanned_error - "Internal error: an error occured during the translation of a match." - (Pos.get_position e); - - same_pos @@ A.EMatch (new_e1, cases, en) - in - - A.make_bindopt pos tau e1 new_e - | D.EArray es -> - let+ es = es |> List.map (translate_expr ctx) |> Bindlib.box_list in - same_pos @@ A.make_some' (same_pos @@ A.EArray es) - | D.ELit l -> Bindlib.box @@ same_pos @@ translate_lit l - | D.EOp _op -> - Errors.raise_spanned_error - "Internal error: partial application of generic operator are not yet supported when using \ - --avoid_exception." - (Pos.get_position e) - | D.EApp ((D.EOp op, pos), args) -> - let xs = - List.mapi (fun i arg -> A.Var.make (Printf.sprintf "x_%d" i, Pos.get_position arg)) args - in - - let dummy = A.Var.make ("unit", pos) in - - let e' final = - args - |> List.map (translate_expr ctx) - |> List.combine xs - |> List.fold_left - (fun acc (x, arg) -> - A.make_matchopt arg - (A.make_abs - (Array.of_list [ dummy ]) - (A.make_none pos) pos [ (D.TLit D.TUnit, pos) ] pos) - (A.make_abs (Array.of_list [ x ]) acc pos [ (D.TAny, pos) ] pos)) - final - in - - let new_e = - let+ args_var = xs |> List.map (fun x -> Bindlib.box_var x) |> Bindlib.box_list in - - let args_var = - args_var |> List.combine args |> List.map (fun (arg, x) -> Pos.same_pos_as x arg) - in - same_pos @@ A.make_some' @@ same_pos @@ A.EApp ((A.EOp op, pos), args_var) - in - - e' new_e - | D.EIfThenElse (e1, e2, e3) -> - let e1 = translate_expr ctx e1 in - let pos = Pos.get_position (Bindlib.unbox e1) in - let tau = (D.TAny, pos) in - - let new_e new_e1 = - let+ e1_new = new_e1 and+ e2 = translate_expr ctx e2 and+ e3 = translate_expr ctx e3 in - same_pos @@ A.EIfThenElse (e1_new, e2, e3) - in - - A.make_bindopt pos tau e1 new_e - | D.EAssert e1 -> - (* don't know the semantic of EAssert. *) - (* Bindlib.box_apply (fun e1 -> Pos.same_pos_as (A.EAssert e1) e) (translate_expr ctx e1) *) - let e1 = translate_expr ctx e1 in - let pos = Pos.get_position (Bindlib.unbox e1) in - let tau = (D.TAny, pos) in - - let new_e new_e1 = - let+ e1_new = new_e1 in - same_pos @@ A.EAssert e1_new - in - - A.make_bindopt pos tau e1 new_e - | D.EApp (e1, args) -> - let e1 = translate_expr ctx e1 in - let pos = Pos.get_position (Bindlib.unbox e1) in - let tau = (D.TAny, pos) in - - let new_e new_e1 = - let+ new_e1 = new_e1 - and+ args = args |> List.map (translate_expr ctx) |> Bindlib.box_list in - same_pos @@ A.EApp (new_e1, args) - in - - A.make_bindopt pos tau e1 new_e - | D.EAbs (binder, ts) -> - let+ new_binder = translate_binder ctx binder in - same_pos @@ A.make_some' (same_pos @@ A.EAbs (new_binder, List.map translate_typ ts)) - | D.EDefault (exceptions, just, cons) -> - translate_default ctx exceptions just cons (Pos.get_position e) - | D.ErrorOnEmpty arg -> - (* we need to be carefull on this one *) - (* ~> match [| arg |] with None -> raise NoValueProvided | Some x -> x *) - let pos_arg = Pos.get_position arg in - let x = A.Var.make ("result", pos_arg) in - let arg = translate_expr ctx arg in - - let tau = (D.TAny, pos_arg) in - - let e3 = - A.make_abs - (Array.of_list [ x ]) - (let+ v = Bindlib.box_var x in - (v, pos_arg)) - pos_arg [ tau ] pos_arg - and e1 = arg - and e2 = - A.make_abs - (Array.of_list [ x ]) - (Bindlib.box @@ (A.ERaise A.NoValueProvided, Pos.get_position e)) - pos_arg [ tau ] pos_arg - in - - A.make_some @@ A.make_matchopt e1 e2 e3 - -(* Errors.raise_spanned_error "Internal error: Error on empty found in incorrect place when - compiling using the --avoid_exception option." (Pos.get_position e) *) - -let rec translate_scope_vardefinition ctx expr : A.expr Pos.marked Bindlib.box = - match expr with - | D.ErrorOnEmpty arg, pos_expr -> - (* ~> match [| arg |] with None -> raise NoValueProvided | Some x -> x *) - let pos_arg = Pos.get_position arg in - let x = A.Var.make ("result", pos_arg) in - let arg = translate_expr ctx arg in - - let tau = (D.TAny, pos_arg) in - - let e3 = - A.make_abs - (Array.of_list [ x ]) - (let+ v = Bindlib.box_var x in - (v, pos_arg)) - pos_arg [ tau ] pos_arg - and e1 = arg - and e2 = - A.make_abs - (Array.of_list [ x ]) - (Bindlib.box @@ (A.ERaise A.NoValueProvided, pos_expr)) - pos_arg [ tau ] pos_arg - in - - A.make_matchopt e1 e2 e3 - | D.EApp ((D.EOp (D.Unop (D.Log (le, l))), pos_log), [ e' ]), pos -> - let+ e' = translate_scope_vardefinition ctx e' in - (A.EApp ((A.EOp (D.Unop (D.Log (le, l))), pos_log), [ e' ]), pos) - | expr, pos -> - Errors.raise_spanned_error - (Printf.sprintf - "Internal error: Found unexpected expression when compiling an expression using the \ - --avoid_exception option. ''Full'' term: %s" - (D.show_expr expr)) - pos - -let translate_scope_let (ctx : ctx) (s : D.scope_let) : ctx * A.expr Pos.marked Bindlib.box = - match s with - | { - D.scope_let_var = var; - D.scope_let_kind = kind; - D.scope_let_typ = typ; - D.scope_let_expr = expr; - } -> - (* I need to match on the expression. *) - let expr' : A.expr Pos.marked Bindlib.box = - let expr = Bindlib.unbox expr in - - let same_pos e' = Pos.same_pos_as e' expr in - match (kind, typ, expr) with - | ScopeVarDefinition, _typ, expr -> translate_scope_vardefinition ctx expr - | Assertion, _typ, expr -> - let pos = Pos.get_position expr in - let x = A.Var.make ("result", pos) in - let arg = translate_expr ctx expr in - - let tau = (D.TAny, pos) in - - let e3 = - A.make_abs - (Array.of_list [ x ]) - (let+ v = Bindlib.box_var x in - (v, pos)) - pos [ tau ] pos - and e1 = arg - and e2 = - A.make_abs - (Array.of_list [ x ]) - (Bindlib.box @@ same_pos @@ A.ERaise A.NoValueProvided) - pos [ tau ] pos - in - - A.make_matchopt e1 e2 e3 - | SubScopeVarDefinition, _typ, (D.EAbs ((binder, pos_binder), _tau), pos) -> - let vs, body = Bindlib.unmbind binder in - - (* we need to add them to the context momentally *) - let ctx = - ArrayLabels.fold_left vs ~init:ctx ~f:(fun ctx (v : D.expr Bindlib.var) -> - add_var pos_binder v false ctx) - in - - let vs' = Array.map (fun v -> (D.VarMap.find v ctx).var) vs in - - let body' = translate_expr ctx body in - - (* there is no need to add the binded var to the context since we know it is thunked *) - A.make_abs vs' body' pos_binder [ (D.TAny, pos_binder) ] pos - | DestructuringInputStruct, _typ, expr -> translate_expr ctx expr - | DestructuringSubScopeResults, _typ, expr -> translate_expr ctx expr - | CallingSubScope, _typ, expr -> translate_expr ctx expr - | kind, _typ, (expr, pos) -> - let kind_s = - match kind with - | ScopeVarDefinition -> "ScopeVarDefinition" - | Assertion -> "Assertion" - | SubScopeVarDefinition -> "SubScopeVarDefinition" - | DestructuringInputStruct -> "DestructuringInputStruct" - | DestructuringSubScopeResults -> "DestructuringSubScopeResults" - | CallingSubScope -> "CallingSubScope" - in - - let expr_s = - match expr with - | EVar _ -> "EVar" - | ETuple _ -> "ETuple" - | ETupleAccess _ -> "ETupleAccess" - | EInj _ -> "EInj" - | EMatch _ -> "EMatch" - | EArray _ -> "EArray" - | ELit _ -> "ELit" - | EAbs _ -> "EAbs" - | EApp _ -> "EApp" - | EAssert _ -> "EAssert" - | EOp _ -> "EOp" - | EDefault _ -> "EDefault" - | EIfThenElse _ -> "EIfThenElse" - | ErrorOnEmpty _ -> "ErrorOnEmpty" - in - - Errors.raise_spanned_error - (Printf.sprintf - "Internal error: Found unexpected %s when compiling an expression containing %s \ - using the --avoid_exception option. ''Full'' term: %s" - kind_s expr_s (D.show_expr expr)) - pos - in - - let is_pure = - match kind with - | ScopeVarDefinition -> true - | Assertion -> true - | SubScopeVarDefinition -> true - | DestructuringInputStruct -> true - | DestructuringSubScopeResults -> true - | CallingSubScope -> false - in - - let ctx' = add_var (snd var) (fst var) is_pure ctx in - - (ctx', expr') - -let translate_scope_body (ctx : ctx) (s : D.scope_body) : A.expr Pos.marked Bindlib.box = - match s with - | { D.scope_body_lets = lets; D.scope_body_result = result; D.scope_body_arg = arg; _ } -> - (* first we add to the input the ctx *) - let ctx1 = add_var Pos.no_pos arg true ctx in - - (* then, we compute the lets bindings and modification to the ctx *) - (* todo: once we update to ocaml 4.11, use fold_left_map instead of fold_left + List.rev *) - let ctx2, acc = - ListLabels.fold_left lets - ~init:(ctx1, []) - ~f:(fun (ctx, acc) (s : D.scope_let) -> - let ctx, e = translate_scope_let ctx s in - (ctx, (s.scope_let_var, D.TAny, e) :: acc)) - in - let acc = List.rev acc in - - (* we now have the context for the final transformation: the result *) - (* todo: alaid, result is boxed and hence incompatible with translate_expr... *) - let result = translate_expr ctx2 (Bindlib.unbox result) in - - (* finally, we can recombine everything using nested let ... = ... in *) - let body = - ListLabels.fold_left acc ~init:result - ~f:(fun (body : (A.expr * Pos.t) Bindlib.box) ((v, pos), tau, e) -> - A.make_let_in (D.VarMap.find v ctx2).var (tau, pos) e body) - in - - (* we finnally rebuild the binder *) - A.make_abs - (Array.of_list [ (D.VarMap.find arg ctx1).var ]) - body Pos.no_pos [ (D.TAny, Pos.no_pos) ] Pos.no_pos - -let translate_program (prgm : D.program) : A.program = - let new_scopes = - (prgm.scopes : (D.ScopeName.t * D.expr Bindlib.var * D.scope_body) list) - |> ListLabels.fold_left ~init:([], D.VarMap.empty) ~f:(fun (acc, ctx) (_, n, e) -> - let env : ctx = - D.VarMap.map - (fun v -> - let new_var = A.Var.make (Bindlib.name_of v, Pos.no_pos) in - let expr = A.make_var (new_var, Pos.no_pos) in - { expr; var = new_var; is_pure = true }) - ctx - in - - let new_n = A.Var.make (Bindlib.name_of n, Pos.no_pos) in - let new_e = translate_scope_body env e in - - let new_acc = (new_n, Bindlib.unbox new_e) :: acc in - let new_ctx = D.VarMap.add n new_n ctx in - - (new_acc, new_ctx)) - |> fst |> List.rev - in - { - scopes = new_scopes; - decl_ctx = - { - ctx_enums = prgm.decl_ctx.ctx_enums |> D.EnumMap.add A.option_enum A.option_enum_config; - ctx_structs = prgm.decl_ctx.ctx_structs; - }; - } From 67ccfb0122af5fb61353da2355f4f113602ddbd0 Mon Sep 17 00:00:00 2001 From: Alain Date: Wed, 2 Feb 2022 12:14:07 +0100 Subject: [PATCH 049/102] renamed the new file --- ...mpile_without_exceptions2.ml => compile_without_exceptions.ml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename compiler/lcalc/{compile_without_exceptions2.ml => compile_without_exceptions.ml} (100%) diff --git a/compiler/lcalc/compile_without_exceptions2.ml b/compiler/lcalc/compile_without_exceptions.ml similarity index 100% rename from compiler/lcalc/compile_without_exceptions2.ml rename to compiler/lcalc/compile_without_exceptions.ml From d7c422d33ce2a9a45ef564962c83473657fb9f2d Mon Sep 17 00:00:00 2001 From: Alain Date: Wed, 2 Feb 2022 12:23:52 +0100 Subject: [PATCH 050/102] clarify make_matchopt + lcalc's ast ocamlformat --- compiler/lcalc/ast.ml | 147 +++++++++---------- compiler/lcalc/ast.mli | 27 ++-- compiler/lcalc/compile_without_exceptions.ml | 6 +- compiler/lcalc/dune | 4 +- 4 files changed, 92 insertions(+), 92 deletions(-) diff --git a/compiler/lcalc/ast.ml b/compiler/lcalc/ast.ml index c8740af92..73fa2a987 100644 --- a/compiler/lcalc/ast.ml +++ b/compiler/lcalc/ast.ml @@ -24,32 +24,35 @@ type lit = | LDate of Runtime.date | LDuration of Runtime.duration -type except = ConflictError | EmptyError | NoValueProvided | Crash -[@@deriving show] - +type except = ConflictError | EmptyError | NoValueProvided | Crash [@@deriving show] -let bla = fun _ b fmt x -> +let bla _ b fmt x = let xs, body = Bindlib.unmbind x in - let xs = xs - |> Array.to_list - |> List.map (fun x -> (Bindlib.name_of x ^ "_" ^ (string_of_int @@ Bindlib.uid_of x))) + let xs = + xs |> Array.to_list + |> List.map (fun x -> Bindlib.name_of x ^ "_" ^ string_of_int @@ Bindlib.uid_of x) |> String.concat ", " in Format.fprintf fmt "Binder(%a, %a)" Format.pp_print_string xs b body type expr = - | EVar of (expr Bindlib.var [@polyprinter fun _ fmt x -> Format.fprintf fmt "%s_%d" (Bindlib.name_of x) (Bindlib.uid_of x)]) Pos.marked - | ETuple of expr Pos.marked list * (D.StructName.t [@opaque]) option + | EVar of + (expr Bindlib.var + [@polyprinter + fun _ fmt x -> Format.fprintf fmt "%s_%d" (Bindlib.name_of x) (Bindlib.uid_of x)]) + Pos.marked + | ETuple of expr Pos.marked list * (D.StructName.t[@opaque]) option (** The [MarkedString.info] is the former struct field name*) - | ETupleAccess of expr Pos.marked * int * (D.StructName.t [@opaque]) option * D.typ Pos.marked list + | ETupleAccess of expr Pos.marked * int * (D.StructName.t[@opaque]) option * D.typ Pos.marked list (** The [MarkedString.info] is the former struct field name *) - | EInj of expr Pos.marked * int * (D.EnumName.t [@opaque]) * D.typ Pos.marked list + | EInj of expr Pos.marked * int * (D.EnumName.t[@opaque]) * D.typ Pos.marked list (** The [MarkedString.info] is the former enum case name *) - | EMatch of expr Pos.marked * expr Pos.marked list * (D.EnumName.t [@opaque]) + | EMatch of expr Pos.marked * expr Pos.marked list * (D.EnumName.t[@opaque]) (** The [MarkedString.info] is the former enum case name *) | EArray of expr Pos.marked list - | ELit of (lit [@opaque]) - | EAbs of ((expr, expr Pos.marked) Bindlib.mbinder [@polyprinter bla]) Pos.marked * D.typ Pos.marked list + | ELit of (lit[@opaque]) + | EAbs of + ((expr, expr Pos.marked) Bindlib.mbinder[@polyprinter bla]) Pos.marked * D.typ Pos.marked list | EApp of expr Pos.marked * expr Pos.marked list | EAssert of expr Pos.marked | EOp of D.operator @@ -116,80 +119,76 @@ let make_some (e : expr Pos.marked Bindlib.box) : expr Pos.marked Bindlib.box = let make_some' (e : expr Pos.marked) : expr = EInj (e, 1, option_enum, []) -let make_matchopt (e : expr Pos.marked Bindlib.box) (e_none : expr Pos.marked Bindlib.box) +(** [make_matchopt_dumb arg e_none e_some] build an expression [match arg with |None -> e_none | Some -> e_some] and requires e_some and e_none to be in the form [EAbs ...].*) +let make_matchopt_dumb (arg : expr Pos.marked Bindlib.box) (e_none : expr Pos.marked Bindlib.box) (e_some : expr Pos.marked Bindlib.box) : expr Pos.marked Bindlib.box = - let pos = Pos.get_position @@ Bindlib.unbox e in + let pos = Pos.get_position @@ Bindlib.unbox arg in let mark : 'a -> 'a Pos.marked = Pos.mark pos in - let+ e = e and+ e_none = e_none and+ e_some = e_some in - - mark @@ EMatch (e, [ e_none; e_some ], option_enum) - -let make_matchopt' - (pos: Pos.t) - (tau: D.typ Pos.marked) - (arg: expr Pos.marked Bindlib.box) - (e_none: expr Pos.marked Bindlib.box) - (e_some: expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box) -: expr Pos.marked Bindlib.box = - - let x = Var.make ("unit", pos) in - let v = Var.make ("v", pos) in - - make_matchopt arg - (make_abs (Array.of_list [x]) (e_none) (pos) [D.TLit D.TUnit, pos] pos) - (make_abs (Array.of_list [v]) (e_some (let+ v = Bindlib.box_var v in (v, pos))) pos [tau] pos) -;; - -let make_matchopt'' - (pos: Pos.t) - (v: Var.t) - (tau: D.typ Pos.marked) - (arg: expr Pos.marked Bindlib.box) - (e_none: expr Pos.marked Bindlib.box) - (e_some: expr Pos.marked Bindlib.box) - : expr Pos.marked Bindlib.box = - - (* todo: replace this "unit" variable by the [()] pattern *) - let x = Var.make ("unit", pos) in - - make_matchopt arg - (make_abs (Array.of_list [x]) e_none pos [D.TLit D.TUnit, pos] pos) - (make_abs (Array.of_list [v]) e_some pos [tau] pos) + let+ arg = arg and+ e_none = e_none and+ e_some = e_some in + mark @@ EMatch (arg, [ e_none; e_some ], option_enum) -let make_bindopt - (pos: Pos.t) - (tau: D.typ Pos.marked) - (e1: expr Pos.marked Bindlib.box) - (e2: expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box) - : expr Pos.marked Bindlib.box = - make_matchopt' pos tau e1 (make_none pos) e2 +(** [make_matchopt pos v tau arg e_none e_some] builds an expression [match arg with | None () -> e_none | Some v -> e_some]. It binds v to e_some, permitting it to be used inside the expression. There is no requirements on the form of both e_some and e_none. *) +let make_matchopt (pos : Pos.t) (v : Var.t) (tau : D.typ Pos.marked) + (arg : expr Pos.marked Bindlib.box) (e_none : expr Pos.marked Bindlib.box) + (e_some : expr Pos.marked Bindlib.box) : expr Pos.marked Bindlib.box = + (* todo: replace this "unit" variable by the [()] pattern *) + let x = Var.make ("unit", pos) in + make_matchopt_dumb arg + (make_abs (Array.of_list [ x ]) e_none pos [ (D.TLit D.TUnit, pos) ] pos) + (make_abs (Array.of_list [ v ]) e_some pos [ tau ] pos) -let make_bindmopt - (pos: Pos.t) - (taus: D.typ Pos.marked list) - (e1s: expr Pos.marked Bindlib.box list) - (e2s: expr Pos.marked Bindlib.box list -> expr Pos.marked Bindlib.box) - : expr Pos.marked Bindlib.box = +let make_matchopt' (pos : Pos.t) (tau : D.typ Pos.marked) (arg : expr Pos.marked Bindlib.box) + (e_none : expr Pos.marked Bindlib.box) + (e_some : expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box) : + expr Pos.marked Bindlib.box = + let x = Var.make ("unit", pos) in + let v = Var.make ("v", pos) in + + make_matchopt_dumb arg + (make_abs (Array.of_list [ x ]) e_none pos [ (D.TLit D.TUnit, pos) ] pos) + (make_abs + (Array.of_list [ v ]) + (e_some + (let+ v = Bindlib.box_var v in + (v, pos))) + pos [ tau ] pos) + + +let make_bindopt (pos : Pos.t) (tau : D.typ Pos.marked) (e1 : expr Pos.marked Bindlib.box) + (e2 : expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box) : expr Pos.marked Bindlib.box + = + make_matchopt' pos tau e1 (make_none pos) e2 + +let make_bindmopt (pos : Pos.t) (taus : D.typ Pos.marked list) + (e1s : expr Pos.marked Bindlib.box list) + (e2s : expr Pos.marked Bindlib.box list -> expr Pos.marked Bindlib.box) : + expr Pos.marked Bindlib.box = let dummy = Var.make ("unit", pos) in let vs = List.mapi (fun i _ -> Var.make (Format.sprintf "v_%i" i, pos)) e1s in - let e1' final = List.combine (List.combine vs taus) e1s - |> List.fold_left (fun acc ((x, tau), arg) -> - make_matchopt arg - (make_abs (Array.of_list [dummy]) (make_none pos) pos [D.TLit D.TUnit, pos] pos) - (make_abs (Array.of_list [x]) acc pos [tau] pos) - ) final + let e1' final = + List.combine (List.combine vs taus) e1s + |> List.fold_left + (fun acc ((x, tau), arg) -> + make_matchopt_dumb arg + (make_abs (Array.of_list [ dummy ]) (make_none pos) pos [ (D.TLit D.TUnit, pos) ] pos) + (make_abs (Array.of_list [ x ]) acc pos [ tau ] pos)) + final in - e1' (make_some (e2s (List.map (fun v -> let+ v = Bindlib.box_var v in (v, pos)) vs))) - - - + e1' + (make_some + (e2s + (List.map + (fun v -> + let+ v = Bindlib.box_var v in + (v, pos)) + vs))) let handle_default = Var.make ("handle_default", Pos.no_pos) diff --git a/compiler/lcalc/ast.mli b/compiler/lcalc/ast.mli index 87f49c473..228c2dc0a 100644 --- a/compiler/lcalc/ast.mli +++ b/compiler/lcalc/ast.mli @@ -30,8 +30,7 @@ type lit = | LDate of Runtime.date | LDuration of Runtime.duration -type except = ConflictError | EmptyError | NoValueProvided | Crash -[@@deriving show] +type except = ConflictError | EmptyError | NoValueProvided | Crash [@@deriving show] type expr = | EVar of expr Bindlib.var Pos.marked @@ -45,8 +44,9 @@ type expr = | EMatch of expr Pos.marked * expr Pos.marked list * Dcalc.Ast.EnumName.t (** The [MarkedString.info] is the former enum case name *) | EArray of expr Pos.marked list - | ELit of (lit [@opaque]) - | EAbs of ((expr, expr Pos.marked) Bindlib.mbinder [@opaque]) Pos.marked * Dcalc.Ast.typ Pos.marked list + | ELit of (lit[@opaque]) + | EAbs of + ((expr, expr Pos.marked) Bindlib.mbinder[@opaque]) Pos.marked * Dcalc.Ast.typ Pos.marked list | EApp of expr Pos.marked * expr Pos.marked list | EAssert of expr Pos.marked | EOp of Dcalc.Ast.operator @@ -106,23 +106,22 @@ val make_some : expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box val make_some' : expr Pos.marked -> expr -val make_matchopt : +val make_matchopt_dumb : expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box -(** [e' = make_matchopt'' pos v e e_none e_some] - Builds the term corresponding to [match e with | None -> fun () -> e_none |Some -> fun v -> e_some]. - *) -val make_matchopt'': +val make_matchopt : Pos.t -> Var.t -> - Dcalc.Ast.typ Pos.marked -> + Dcalc.Ast.typ Pos.marked -> expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box +(** [e' = make_matchopt'' pos v e e_none e_some] Builds the term corresponding to + [match e with | None -> fun () -> e_none |Some -> fun v -> e_some]. *) val make_bindopt : Pos.t -> @@ -131,10 +130,10 @@ val make_bindopt : (expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box) -> expr Pos.marked Bindlib.box -val make_bindmopt: - (Pos.t) -> - (Dcalc.Ast.typ Pos.marked list) -> - (expr Pos.marked Bindlib.box list) -> +val make_bindmopt : + Pos.t -> + Dcalc.Ast.typ Pos.marked list -> + expr Pos.marked Bindlib.box list -> (expr Pos.marked Bindlib.box list -> expr Pos.marked Bindlib.box) -> expr Pos.marked Bindlib.box diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index 1b2b906f9..0c98a1297 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -227,7 +227,7 @@ let rec translate_expr (ctx: ctx) (e: D.expr Pos.marked) let arg' = translate_expr ctx arg in - A.make_matchopt arg' + A.make_matchopt_dumb arg' (A.make_abs [| unit |] (Bindlib.box (A.ERaise A.NoValueProvided, pos_c)) pos_c [D.TAny, pos_c] pos_c) (A.make_abs [| x |] ((A.make_var (x, pos_c))) pos_c [D.TAny, pos_c] pos_c) @@ -244,7 +244,7 @@ let rec translate_expr (ctx: ctx) (e: D.expr Pos.marked) let unit = A.Var.make ("unit", pos_c) in let x = A.Var.make ("assertion_argument", pos_c) in - A.make_matchopt arg' + A.make_matchopt_dumb arg' (A.make_abs [| unit |] (Bindlib.box (A.ERaise A.NoValueProvided, pos_c)) pos_c [D.TAny, pos_c] pos_c) (A.make_abs [| x |] (Bindlib.box_apply (fun arg -> A.EAssert arg, pos_c) (A.make_var (x, pos_c))) pos_c [D.TAny, pos_c] pos_c) @@ -257,7 +257,7 @@ let rec translate_expr (ctx: ctx) (e: D.expr Pos.marked) | Some {{ v }} -> {{ acc }} end ] *) - A.make_matchopt'' pos_c v (D.TAny, pos_c) c' (A.make_none pos_c) acc + A.make_matchopt pos_c v (D.TAny, pos_c) c' (A.make_none pos_c) acc ) ;; diff --git a/compiler/lcalc/dune b/compiler/lcalc/dune index a14ee1d43..be662001f 100644 --- a/compiler/lcalc/dune +++ b/compiler/lcalc/dune @@ -1,7 +1,9 @@ (library (name lcalc) (public_name catala.lcalc) - (libraries bindlib dcalc scopelang runtime)) + (libraries bindlib dcalc scopelang runtime) + (preprocess + (pps visitors.ppx ppx_deriving.show))) (documentation (package catala) From 1db649db3e082aae4e911d279725f204f6867cac Mon Sep 17 00:00:00 2001 From: Alain Date: Wed, 2 Feb 2022 17:24:32 +0100 Subject: [PATCH 051/102] nicer internal error when Not_Found is raised inside the code generation of ocaml code. --- compiler/lcalc/to_ocaml.ml | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/compiler/lcalc/to_ocaml.ml b/compiler/lcalc/to_ocaml.ml index 07da473d2..7d9b4b69d 100644 --- a/compiler/lcalc/to_ocaml.ml +++ b/compiler/lcalc/to_ocaml.ml @@ -17,6 +17,19 @@ open Ast open Backends module D = Dcalc.Ast + +let find_struct s ctx = + try + D.StructMap.find s ctx.D.ctx_structs + with Not_found -> Errors.raise_spanned_error (Format.sprintf "Internal Error: Structure blah was not found in the current environment.") Pos.no_pos + +let find_enum en ctx = + try + D.EnumMap.find en ctx.D.ctx_enums + with Not_found -> + let en_name, pos = D.EnumName.get_info en in + Errors.raise_spanned_error (Format.sprintf "Internal Error: Enumeration %s was not found in the current environment." en_name) pos + let format_lit (fmt : Format.formatter) (l : lit Pos.marked) : unit = match Pos.unmark l with | LBool b -> Dcalc.Print.format_lit fmt (Pos.same_pos_as (Dcalc.Ast.LBool b) l) @@ -169,7 +182,7 @@ let rec format_typ (fmt : Format.formatter) (typ : Dcalc.Ast.typ Pos.marked) : u let format_var (fmt : Format.formatter) (v : Var.t) : unit = let lowercase_name = - to_lowercase (to_ascii (Bindlib.name_of v) (* ^ "_" ^ string_of_int (Bindlib.uid_of v) *)) + to_lowercase (to_ascii (Bindlib.name_of v ^ "_" ^ string_of_int (Bindlib.uid_of v))) in let lowercase_name = Re.Pcre.substitute ~rex:(Re.Pcre.regexp "\\.") ~subst:(fun _ -> "_dot_") lowercase_name @@ -222,7 +235,7 @@ let rec format_expr (ctx : Dcalc.Ast.decl_ctx) (fmt : Format.formatter) (e : exp (fun fmt (e, struct_field) -> Format.fprintf fmt "@[%a =@ %a@]" format_struct_field_name struct_field format_with_parens e)) - (List.combine es (List.map fst (Dcalc.Ast.StructMap.find s ctx.ctx_structs))) + (List.combine es (List.map fst (find_struct s ctx))) | EArray es -> Format.fprintf fmt "@[[|%a|]@]" (Format.pp_print_list @@ -240,10 +253,10 @@ let rec format_expr (ctx : Dcalc.Ast.decl_ctx) (fmt : Format.formatter) (e : exp format_with_parens e1 | Some s -> Format.fprintf fmt "%a.%a" format_with_parens e1 format_struct_field_name - (fst (List.nth (Dcalc.Ast.StructMap.find s ctx.ctx_structs) n))) + (fst (List.nth (find_struct s ctx) n))) | EInj (e, n, en, _ts) -> Format.fprintf fmt "@[%a@ %a@]" format_enum_cons_name - (fst (List.nth (Dcalc.Ast.EnumMap.find en ctx.ctx_enums) n)) + (fst (List.nth (find_enum en ctx) n)) format_with_parens e | EMatch (e, es, e_name) -> Format.fprintf fmt "@[match@ %a@]@ with@\n%a" format_with_parens e @@ -263,7 +276,7 @@ let rec format_expr (ctx : Dcalc.Ast.decl_ctx) (fmt : Format.formatter) (e : exp | _ -> assert false (* should not happen *)) e)) - (List.combine es (List.map fst (Dcalc.Ast.EnumMap.find e_name ctx.ctx_enums))) + (List.combine es (List.map fst (find_enum e_name ctx))) | ELit l -> Format.fprintf fmt "%a" format_lit (Pos.same_pos_as l e) | EApp ((EAbs ((binder, _), taus), _), args) -> let xs, body = Bindlib.unmbind binder in @@ -413,10 +426,10 @@ let format_ctx (type_ordering : Scopelang.Dependency.TVertex.t list) (fmt : Form match struct_or_enum with | Scopelang.Dependency.TVertex.Struct s -> Format.fprintf fmt "%a@\n@\n" format_struct_decl - (s, Dcalc.Ast.StructMap.find s ctx.Dcalc.Ast.ctx_structs) + (s, find_struct s ctx) | Scopelang.Dependency.TVertex.Enum e -> Format.fprintf fmt "%a@\n@\n" format_enum_decl - (e, Dcalc.Ast.EnumMap.find e ctx.Dcalc.Ast.ctx_enums)) + (e, find_enum e ctx)) (type_ordering @ scope_structs) let format_program (fmt : Format.formatter) (p : Ast.program) From 6158a2e1506eeb173af20ac7e8ca00936ce69ef3 Mon Sep 17 00:00:00 2001 From: Alain Date: Wed, 2 Feb 2022 17:33:36 +0100 Subject: [PATCH 052/102] nicer error messages when Not_Found error is raised inside the compilation without exceptions. added explicit match when finding [v ()] where v is a variable. Correct position of ErrorOnEmpty. added argument on translate_expr when adding an esome is not required renamed "unit" to "_" (silent_var) for consistency --- compiler/lcalc/compile_without_exceptions.ml | 178 +++++++++++-------- 1 file changed, 104 insertions(+), 74 deletions(-) diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index 0c98a1297..81a66a57f 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -29,8 +29,19 @@ type ctx = info D.VarMap.t +let find ?(info="none") n ctx = + try + D.VarMap.find n ctx + with Not_found -> Errors.raise_spanned_error (Format.sprintf "Internal Error: Variable %s_%d was not found in the current environment. Additional informations : %s." (Bindlib.name_of n) (Bindlib.uid_of n) info) Pos.no_pos + +let add_var pos var is_pure ctx = + let new_var = A.Var.make (Bindlib.name_of var, pos) in + let expr = A.make_var (new_var, pos) in + D.VarMap.add var { expr; var = new_var; is_pure } ctx +;; + let translate_lit (l : D.lit) (pos: Pos.t): A.lit = match l with | D.LBool l -> (A.LBool l) @@ -57,16 +68,24 @@ let rec translate_and_cut (ctx: ctx) (e: D.expr Pos.marked) let pos = Pos.get_position e in match Pos.unmark e with - (* empty-producing/using terms *) + (* empty-producing/using terms. We cut those. (D.EVar in some cases, EApp(D.EVar _, [ELit LUnit]), EDefault _, ELit LEmptyDefault) I'm unsure about assert. *) | D.EVar v -> (* todo: for now, we requires there is unpure variables. This can change if the said variable are always present in the tree as thunked. *) let v, pos_v = v in - if not (D.VarMap.find v ctx).is_pure then + if not (find ~info:"search for a variable" v ctx).is_pure then let v' = A.Var.make ((Bindlib.name_of v), pos_v) in (A.make_var (v', pos), A.VarMap.singleton v' e) else - (D.VarMap.find v ctx).expr, A.VarMap.empty + (find ~info:"should never happend" v ctx).expr, A.VarMap.empty + + | D.EApp ((D.EVar (v, pos_v), p), [ (D.ELit D.LUnit, _) ]) -> + if not (find ~info:"search for a variable" v ctx).is_pure then + let v' = A.Var.make ((Bindlib.name_of v), pos_v) in + (A.make_var (v', pos), A.VarMap.singleton v' (D.EVar (v, pos_v), p)) + else + Errors.raise_spanned_error "Internal error: an pure variable was found in an unpure environment." pos + | D.EDefault (_exceptions, _just, _cons) -> let v' = A.Var.make ("default_term", pos) in (A.make_var (v', pos), A.VarMap.singleton v' e) @@ -78,10 +97,23 @@ let rec translate_and_cut (ctx: ctx) (e: D.expr Pos.marked) let v' = A.Var.make ("assertion_value", pos) in (A.make_var (v', pos), A.VarMap.singleton v' e) - | ErrorOnEmpty _ -> - let v' = A.Var.make ("error_on_empty_value", pos) in - (A.make_var (v', pos), A.VarMap.singleton v' e) + (* This one is a very special case. It transform an unpure expression environement to a pure expression. *) + | ErrorOnEmpty arg -> + (* [ + match arg with + | None -> raise NoValueProvided + | Some v -> {{ v }} + ] *) + + let silent_var = A.Var.make ("_", pos) in + let x = A.Var.make ("non_empty_argument", pos) in + + let arg' = translate_expr ctx arg in + + (A.make_matchopt_dumb arg' + (A.make_abs [| silent_var |] (Bindlib.box (A.ERaise A.NoValueProvided, pos)) pos [D.TAny, pos] pos) + (A.make_abs [| x |] ((A.make_var (x, pos))) pos [D.TAny, pos] pos), A.VarMap.empty) (* pure terms *) | D.ELit l -> @@ -109,12 +141,14 @@ let rec translate_and_cut (ctx: ctx) (e: D.expr Pos.marked) let vars, body = Bindlib.unmbind binder in let ctx, lc_vars = ArrayLabels.fold_right vars ~init:(ctx, []) ~f:(fun var (ctx, lc_vars) -> - let lc_var = A.Var.make (Bindlib.name_of var, pos_binder) in - let lc_var_expr = A.make_var (lc_var, pos_binder) in + (* we suppose the invariant that when applying a function, its arguments cannot be of the type "option". - The code should behave correctly in the opposite direction if we put here an is_pure=false. *) - (D.VarMap.add var {var=lc_var; expr=lc_var_expr; is_pure=true} ctx, lc_var :: lc_vars)) + The code should behave correctly in the without this assumption if we put here an is_pure=false, but the types are more compilcated. (unimplemented for now) *) + + let ctx = add_var pos var true ctx in + let lc_var = (find var ctx).var in + ( ctx, lc_var :: lc_vars)) in let lc_vars = Array.of_list lc_vars in @@ -184,21 +218,21 @@ let rec translate_and_cut (ctx: ctx) (e: D.expr Pos.marked) (Bindlib.box_apply (fun es' -> (A.EArray es', pos)) (Bindlib.box_list es'), disjoint_union_maps pos cuts) | EOp op -> (Bindlib.box (A.EOp op, pos), A.VarMap.empty) -;; -let rec translate_expr (ctx: ctx) (e: D.expr Pos.marked) +and translate_expr ?(append_esome=true) (ctx: ctx) (e: D.expr Pos.marked) : (A.expr Pos.marked Bindlib.box) = let e', cs = translate_and_cut ctx e in let cs = A.VarMap.bindings cs in let _pos = Pos.get_position e in (* build the cuts *) - ListLabels.fold_left cs ~init:e' + ListLabels.fold_left cs + ~init:(if append_esome then A.make_some e' else e') ~f:(fun acc (v, (c, pos_c)) -> let c': A.expr Pos.marked Bindlib.box = match c with (* Here we have to handle only the cases appearing in cuts, as defined the [translate_and_cut] function. *) - | D.EVar v -> (D.VarMap.find (Pos.unmark v) ctx).expr + | D.EVar v -> (find ~info:"should never happend" (Pos.unmark v) ctx).expr | D.EDefault (excep, just, cons) -> let excep' = List.map (translate_expr ctx) excep in let just' = translate_expr ctx just in @@ -214,23 +248,6 @@ let rec translate_expr (ctx: ctx) (e: D.expr Pos.marked) | D.ELit D.LEmptyError -> A.make_none pos_c - - | ErrorOnEmpty arg -> - (* [ - match arg with - | None -> raise NoValueProvided - | Some v -> {{ v }} - ] *) - - let unit = A.Var.make ("unit", pos_c) in - let x = A.Var.make ("assertion_argument", pos_c) in - - let arg' = translate_expr ctx arg in - - A.make_matchopt_dumb arg' - (A.make_abs [| unit |] (Bindlib.box (A.ERaise A.NoValueProvided, pos_c)) pos_c [D.TAny, pos_c] pos_c) - (A.make_abs [| x |] ((A.make_var (x, pos_c))) pos_c [D.TAny, pos_c] pos_c) - | D.EAssert arg -> let arg' = translate_expr ctx arg in @@ -241,11 +258,11 @@ let rec translate_expr (ctx: ctx) (e: D.expr Pos.marked) | Some v -> assert {{ v }} ] *) - let unit = A.Var.make ("unit", pos_c) in + let silent_var = A.Var.make ("_", pos_c) in let x = A.Var.make ("assertion_argument", pos_c) in A.make_matchopt_dumb arg' - (A.make_abs [| unit |] (Bindlib.box (A.ERaise A.NoValueProvided, pos_c)) pos_c [D.TAny, pos_c] pos_c) + (A.make_abs [| silent_var |] (Bindlib.box (A.ERaise A.NoValueProvided, pos_c)) pos_c [D.TAny, pos_c] pos_c) (A.make_abs [| x |] (Bindlib.box_apply (fun arg -> A.EAssert arg, pos_c) (A.make_var (x, pos_c))) pos_c [D.TAny, pos_c] pos_c) | _ -> Errors.raise_spanned_error "Internal Error: An term was found in a position where it should not be" pos_c @@ -261,11 +278,7 @@ let rec translate_expr (ctx: ctx) (e: D.expr Pos.marked) ) ;; -let add_var pos var is_pure ctx = - let new_var = A.Var.make (Bindlib.name_of var, pos) in - let expr = A.make_var (new_var, pos) in - D.VarMap.add var { expr; var = new_var; is_pure } ctx -;; + let translate_scope_let (ctx: ctx) (s: D.scope_let): ctx * A.expr Pos.marked Bindlib.box = match s with @@ -275,31 +288,31 @@ let translate_scope_let (ctx: ctx) (s: D.scope_let): ctx * A.expr Pos.marked Bin D.scope_let_expr = expr; D.scope_let_kind = DestructuringInputStruct (** [let x = input.field]*) } -> - (add_var pos var false ctx, translate_expr ctx (Bindlib.unbox expr)) + (add_var pos var false ctx, translate_expr ~append_esome:false ctx (Bindlib.unbox expr)) | { D.scope_let_var = (var, pos); D.scope_let_typ = _typ; D.scope_let_expr = expr; D.scope_let_kind = ScopeVarDefinition (** [let x = error_on_empty e]*) - } -> (add_var pos var true ctx, translate_expr ctx (Bindlib.unbox expr)) + } -> (add_var pos var true ctx, translate_expr ~append_esome:false ctx (Bindlib.unbox expr)) | { D.scope_let_var = (var, pos); D.scope_let_typ = _typ; D.scope_let_expr = expr; D.scope_let_kind = SubScopeVarDefinition (** [let s.x = fun _ -> e] *) - } -> (add_var pos var true ctx, translate_expr ctx (Bindlib.unbox expr)) + } -> (add_var pos var true ctx, translate_expr ~append_esome:false ctx (Bindlib.unbox expr)) | { D.scope_let_var = (var, pos); D.scope_let_typ = _typ; D.scope_let_expr = expr; D.scope_let_kind = CallingSubScope (** [let result = s ({ x = s.x; y = s.x; ...}) ]*) - } -> (add_var pos var true ctx, translate_expr ctx (Bindlib.unbox expr)) + } -> (add_var pos var true ctx, translate_expr ~append_esome:false ctx (Bindlib.unbox expr)) | { D.scope_let_var = (var, pos); D.scope_let_typ = _typ; D.scope_let_expr = expr; D.scope_let_kind = DestructuringSubScopeResults (** [let s.x = result.x ]**) - } -> (add_var pos var true ctx, translate_expr ctx (Bindlib.unbox expr)) + } -> (add_var pos var true ctx, translate_expr ~append_esome:false ctx (Bindlib.unbox expr)) | { D.scope_let_var = (var, pos); D.scope_let_typ = _typ; @@ -320,35 +333,46 @@ let translate_scope_body scope_body_input_struct=_input_struct; scope_body_output_struct=_output_struct; } -> - (* first we add to the input the ctx *) - let ctx1 = add_var Pos.no_pos arg true ctx in - - (* then, we compute the lets bindings and modification to the ctx *) - (* todo: once we update to ocaml 4.11, use fold_left_map instead of fold_left + List.rev *) - let ctx2, acc = - ListLabels.fold_left lets - ~init:(ctx1, []) - ~f:(fun (ctx, acc) (s : D.scope_let) -> - let ctx, e = translate_scope_let ctx s in - (ctx, (s.scope_let_var, D.TAny, e) :: acc)) - in - let acc = List.rev acc in - - (* we now have the context for the final transformation: the result *) - (* todo: alaid, result is boxed and hence incompatible with translate_expr... *) - let result = translate_expr ctx2 (Bindlib.unbox result) in - - (* finally, we can recombine everything using nested let ... = ... in *) - let body = - ListLabels.fold_left acc ~init:result - ~f:(fun (body : (A.expr * Pos.t) Bindlib.box) ((v, pos), tau, e) -> - A.make_let_in (D.VarMap.find v ctx2).var (tau, pos) e body) - in - - (* we finnally rebuild the binder *) - A.make_abs - (Array.of_list [ (D.VarMap.find arg ctx1).var ]) - body Pos.no_pos [ (D.TAny, Pos.no_pos) ] Pos.no_pos + (* first we add to the input the ctx *) + let ctx1 = add_var Pos.no_pos arg true ctx in + + + let _ = lets + |> List.map (fun { + D.scope_let_kind = kind; + D.scope_let_var = (var, _); _} : string -> + D.show_scope_let_kind kind ^ ", " ^ (Bindlib.name_of var) ^ "_" ^ (string_of_int (Bindlib.uid_of var)) + ) + |> String.concat "; " + |> Printf.printf "[ %s ]" + in + + (* then, we compute the lets bindings and modification to the ctx *) + (* todo: once we update to ocaml 4.11, use fold_left_map instead of fold_left + List.rev *) + let ctx2, acc = + ListLabels.fold_left lets + ~init:(ctx1, []) + ~f:(fun (ctx, acc) (s : D.scope_let) -> + let ctx, e = translate_scope_let ctx s in + (ctx, (s.scope_let_var, D.TAny, e) :: acc)) + in + let acc = acc in + + (* we now have the context for the final transformation: the result *) + (* todo: alaid, result is boxed and hence incompatible with translate_expr... *) + let result = translate_expr ~append_esome:false ctx2 (Bindlib.unbox result) in + + (* finally, we can recombine everything using nested let ... = ... in *) + let body = + ListLabels.fold_left acc ~init:result + ~f:(fun (body : (A.expr * Pos.t) Bindlib.box) ((v, pos), tau, e) -> + A.make_let_in (find ~info:"body-building" v ctx2).var (tau, pos) e body) + in + + (* we finnally rebuild the binder *) + A.make_abs + (Array.of_list [ (find ~info:"final abs" arg ctx1).var ]) + body Pos.no_pos [ (D.TAny, Pos.no_pos) ] Pos.no_pos @@ -357,13 +381,19 @@ let translate_scope_body let translate_program (prgm: D.program) : A.program = (* modify *) - let decl_ctx = prgm.decl_ctx in + let decl_ctx = + { + D.ctx_enums = prgm.decl_ctx.ctx_enums |> D.EnumMap.add A.option_enum A.option_enum_config; + D.ctx_structs = prgm.decl_ctx.ctx_structs; + } + in let scopes = prgm.scopes |> ListLabels.fold_left ~init:([], D.VarMap.empty) ~f:(fun ((acc, ctx) : _ * info D.VarMap.t) (scope_name, n, scope_body) -> let new_ctx = add_var Pos.no_pos n true ctx in - let new_n = D.VarMap.find n new_ctx in + + let new_n = find ~info:"variable that was just created" n new_ctx in let scope_pos = Pos.get_position (D.ScopeName.get_info scope_name) in From 4290059ab82fe3d3d375a1baf342d7349ae1c5b3 Mon Sep 17 00:00:00 2001 From: Alain Date: Wed, 2 Feb 2022 18:10:27 +0100 Subject: [PATCH 053/102] newline --- compiler/lcalc/compile_without_exceptions.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index 81a66a57f..40e4fa108 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -406,4 +406,4 @@ let translate_program (prgm: D.program) : A.program = |> List.map (fun (info, e) -> (info.var, e)) in - {scopes; decl_ctx} \ No newline at end of file + {scopes; decl_ctx} From ef7f25b70dfbb6a2cd23ee481c086cd7f39e8e9f Mon Sep 17 00:00:00 2001 From: Alain Date: Thu, 3 Feb 2022 11:47:27 +0100 Subject: [PATCH 054/102] runtime correct type --- compiler/runtime.ml | 22 +++++++++------------- compiler/runtime.mli | 2 +- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/compiler/runtime.ml b/compiler/runtime.ml index fd898a723..07d0ea24f 100644 --- a/compiler/runtime.ml +++ b/compiler/runtime.ml @@ -215,24 +215,20 @@ let handle_default : 'a. (unit -> 'a) array -> (unit -> bool) -> (unit -> 'a) -> in match except with Some x -> x | None -> if just () then cons () else raise EmptyError -let handle_default_opt: 'a. 'a eoption array -> (unit -> bool eoption) -> (unit -> 'a eoption) -> 'a eoption = - fun exceptions just cons -> - let except = - Array.fold_left +let handle_default_opt : 'a. 'a eoption array -> bool eoption -> 'a eoption -> 'a eoption = + fun exceptions just cons -> + let except = + Array.fold_left (fun acc except -> - match acc, except with + match (acc, except) with | ENone _, _ -> except | ESome _, ENone _ -> acc | ESome _, ESome _ -> raise ConflictError) (ENone ()) exceptions - in - match except with - | ESome _ -> except - | ENone _ -> begin - match just () with - | ESome b -> if b then cons () else ENone () - | ENone _ -> ENone () - end + in + match except with + | ESome _ -> except + | ENone _ -> ( match just with ESome b -> if b then cons else ENone () | ENone _ -> ENone ()) let no_input : unit -> 'a = fun _ -> raise EmptyError diff --git a/compiler/runtime.mli b/compiler/runtime.mli index beffe79ce..af9559374 100644 --- a/compiler/runtime.mli +++ b/compiler/runtime.mli @@ -175,7 +175,7 @@ val handle_default : (unit -> 'a) array -> (unit -> bool) -> (unit -> 'a) -> 'a (** @raise EmptyError @raise ConflictError *) -val handle_default_opt: 'a eoption array -> (unit -> bool eoption) -> (unit -> 'a eoption) -> 'a eoption +val handle_default_opt : 'a eoption array -> bool eoption -> 'a eoption -> 'a eoption (** @raise ConflictError *) val no_input : unit -> 'a From 85fc1be4fb26d2104663e20e4f68ea486ee6bde9 Mon Sep 17 00:00:00 2001 From: Alain Date: Thu, 3 Feb 2022 11:50:18 +0100 Subject: [PATCH 055/102] printing ctx at each steps but no error found so far. --- compiler/lcalc/compile_without_exceptions.ml | 41 +++++++++++++++++--- 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index 40e4fa108..dbaef7090 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -16,6 +16,9 @@ module A = Ast type cuts = D.expr Pos.marked A.VarMap.t +let pp_var (fmt: Format.formatter) (n: _ Bindlib.var) = + Format.fprintf fmt "%s_%d" (Bindlib.name_of n) (Bindlib.uid_of n) + (** information about the Dcalc variable : what is the corresponding LCalc variable; an expression build correctly using Bindlib, and a boolean indicating whenever the variable should be matched (false) or not (true). *) type info = { @@ -28,18 +31,39 @@ type info = { type ctx = info D.VarMap.t +let pp_info (fmt: Format.formatter) (info: info) = + Format.fprintf fmt "{var: %a; is_pure: %b}" pp_var info.var info.is_pure + +let pp_binding (fmt: Format.formatter) ((v, info): D.Var.t * info) = + Format.fprintf fmt "%a:%a" pp_var v pp_info info + +let pp_ctx (fmt: Format.formatter) (ctx: ctx) = + + let pp_bindings = Format.pp_print_list ~pp_sep:(fun fmt () -> Format.pp_print_string fmt "; ") pp_binding in + Format.fprintf fmt "@[<2>[%a]@]@." pp_bindings (D.VarMap.bindings ctx) + + let find ?(info="none") n ctx = + let _ = + Format.asprintf "Searching for variable %a inside context %a" pp_var n pp_ctx ctx + |> Cli.debug_print + in try D.VarMap.find n ctx - with Not_found -> Errors.raise_spanned_error (Format.sprintf "Internal Error: Variable %s_%d was not found in the current environment. Additional informations : %s." (Bindlib.name_of n) (Bindlib.uid_of n) info) Pos.no_pos - - + with Not_found -> + Errors.raise_spanned_error (Format.sprintf "Internal Error: Variable %s_%d was not found in the current environment. Additional informations : %s." (Bindlib.name_of n) (Bindlib.uid_of n) info) Pos.no_pos let add_var pos var is_pure ctx = let new_var = A.Var.make (Bindlib.name_of var, pos) in let expr = A.make_var (new_var, pos) in - D.VarMap.add var { expr; var = new_var; is_pure } ctx + + Format.asprintf "adding a new variable %a" pp_var var + |> Cli.debug_print ; + + D.VarMap.update var (fun _ -> Some {expr; var=new_var; is_pure}) ctx + + (* D.VarMap.add var { expr; var = new_var; is_pure } ctx *) ;; let translate_lit (l : D.lit) (pos: Pos.t): A.lit = @@ -281,6 +305,10 @@ and translate_expr ?(append_esome=true) (ctx: ctx) (e: D.expr Pos.marked) let translate_scope_let (ctx: ctx) (s: D.scope_let): ctx * A.expr Pos.marked Bindlib.box = + + Cli.debug_print @@ Format.asprintf "translating an %a" D.pp_scope_let_kind s.scope_let_kind; + + match s with | { D.scope_let_var = (var, pos); @@ -318,7 +346,7 @@ let translate_scope_let (ctx: ctx) (s: D.scope_let): ctx * A.expr Pos.marked Bin D.scope_let_typ = _typ; D.scope_let_expr = expr; D.scope_let_kind = Assertion (** [let _ = assert e]*) - } -> (add_var pos var true ctx, translate_expr ctx (Bindlib.unbox expr)) + } -> (add_var pos var true ctx, translate_expr ~append_esome:false ctx (Bindlib.unbox expr)) let translate_scope_body (_scope_pos: Pos.t) @@ -344,7 +372,8 @@ let translate_scope_body D.show_scope_let_kind kind ^ ", " ^ (Bindlib.name_of var) ^ "_" ^ (string_of_int (Bindlib.uid_of var)) ) |> String.concat "; " - |> Printf.printf "[ %s ]" + |> Format.sprintf "scope order : [@[ %s @]]" + |> Cli.debug_print in (* then, we compute the lets bindings and modification to the ctx *) From 3e96db43ce9d38ef47dd6b458efd3f5b1d5c5aa4 Mon Sep 17 00:00:00 2001 From: Alain Date: Thu, 3 Feb 2022 17:16:45 +0100 Subject: [PATCH 056/102] more printing to debug --- compiler/lcalc/compile_without_exceptions.ml | 61 ++++++++++++++------ 1 file changed, 44 insertions(+), 17 deletions(-) diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index dbaef7090..a13bfec90 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -4,6 +4,8 @@ module D = Dcalc.Ast module A = Ast +(** hoisting *) + (** The main idea around this pass is to compile Dcalc to Lcalc without using [raise EmptyError] nor [try _ with EmptyError -> _]. To do so, we use the same technique as in rust or erlang to handle this kind of exceptions. Each [raise EmptyError] will be translated as [None] and each [try e1 with EmtpyError -> e2] as [match e1 with | None -> e2 | Some x -> x]. @@ -40,7 +42,7 @@ let pp_binding (fmt: Format.formatter) ((v, info): D.Var.t * info) = let pp_ctx (fmt: Format.formatter) (ctx: ctx) = let pp_bindings = Format.pp_print_list ~pp_sep:(fun fmt () -> Format.pp_print_string fmt "; ") pp_binding in - Format.fprintf fmt "@[<2>[%a]@]@." pp_bindings (D.VarMap.bindings ctx) + Format.fprintf fmt "@[<2>[%a]@]" pp_bindings (D.VarMap.bindings ctx) @@ -97,17 +99,19 @@ let rec translate_and_cut (ctx: ctx) (e: D.expr Pos.marked) (* todo: for now, we requires there is unpure variables. This can change if the said variable are always present in the tree as thunked. *) let v, pos_v = v in - if not (find ~info:"search for a variable" v ctx).is_pure then + if not (find ~info:"search for a variable" v ctx).is_pure then begin let v' = A.Var.make ((Bindlib.name_of v), pos_v) in + Cli.debug_print @@ Format.asprintf "Found an unpure variable %a, created a variable %a to replace it" pp_var v pp_var v'; (A.make_var (v', pos), A.VarMap.singleton v' e) - else + end else (find ~info:"should never happend" v ctx).expr, A.VarMap.empty | D.EApp ((D.EVar (v, pos_v), p), [ (D.ELit D.LUnit, _) ]) -> - if not (find ~info:"search for a variable" v ctx).is_pure then + if not (find ~info:"search for a variable" v ctx).is_pure then begin let v' = A.Var.make ((Bindlib.name_of v), pos_v) in + Cli.debug_print @@ Format.asprintf "Found an unpure variable %a, created a variable %a to replace it" pp_var v pp_var v'; (A.make_var (v', pos), A.VarMap.singleton v' (D.EVar (v, pos_v), p)) - else + end else Errors.raise_spanned_error "Internal error: an pure variable was found in an unpure environment." pos | D.EDefault (_exceptions, _just, _cons) -> @@ -250,10 +254,16 @@ and translate_expr ?(append_esome=true) (ctx: ctx) (e: D.expr Pos.marked) let _pos = Pos.get_position e in (* build the cuts *) + + Cli.debug_print @@ Format.asprintf "cut for the expression: [%a]" (Format.pp_print_list pp_var) (List.map fst cs); + ListLabels.fold_left cs ~init:(if append_esome then A.make_some e' else e') ~f:(fun acc (v, (c, pos_c)) -> + + Cli.debug_print @@ Format.asprintf "cut using %a" pp_var v; + let c': A.expr Pos.marked Bindlib.box = match c with (* Here we have to handle only the cases appearing in cuts, as defined the [translate_and_cut] function. *) | D.EVar v -> (find ~info:"should never happend" (Pos.unmark v) ctx).expr @@ -298,6 +308,8 @@ and translate_expr ?(append_esome=true) (ctx: ctx) (e: D.expr Pos.marked) | Some {{ v }} -> {{ acc }} end ] *) + + Cli.debug_print @@ Format.asprintf "build matchopt using %a" pp_var v; A.make_matchopt pos_c v (D.TAny, pos_c) c' (A.make_none pos_c) acc ) ;; @@ -307,7 +319,13 @@ and translate_expr ?(append_esome=true) (ctx: ctx) (e: D.expr Pos.marked) let translate_scope_let (ctx: ctx) (s: D.scope_let): ctx * A.expr Pos.marked Bindlib.box = Cli.debug_print @@ Format.asprintf "translating an %a" D.pp_scope_let_kind s.scope_let_kind; - + ListLabels.iter (D.VarMap.bindings ctx |> List.map fst) + ~f:(fun var -> + Cli.debug_print @@ Format.asprintf "[%a] The variable %a occurs in the expression: %b" + D.pp_scope_let_kind s.D.scope_let_kind + pp_var var + (Bindlib.occur var s.D.scope_let_expr) + ); match s with | { @@ -315,8 +333,10 @@ let translate_scope_let (ctx: ctx) (s: D.scope_let): ctx * A.expr Pos.marked Bin D.scope_let_typ = _typ; D.scope_let_expr = expr; D.scope_let_kind = DestructuringInputStruct (** [let x = input.field]*) - } -> - (add_var pos var false ctx, translate_expr ~append_esome:false ctx (Bindlib.unbox expr)) + } -> begin + + (add_var pos var false ctx, translate_expr ~append_esome:false ctx (Bindlib.unbox expr)) + end | { D.scope_let_var = (var, pos); D.scope_let_typ = _typ; @@ -365,19 +385,16 @@ let translate_scope_body let ctx1 = add_var Pos.no_pos arg true ctx in - let _ = lets - |> List.map (fun { - D.scope_let_kind = kind; - D.scope_let_var = (var, _); _} : string -> - D.show_scope_let_kind kind ^ ", " ^ (Bindlib.name_of var) ^ "_" ^ (string_of_int (Bindlib.uid_of var)) - ) - |> String.concat "; " - |> Format.sprintf "scope order : [@[ %s @]]" - |> Cli.debug_print + let pp_scope_ctx fmt {D.scope_let_kind=kind; D.scope_let_var = (var, _); _} = + Format.fprintf fmt "%a, %a" D.pp_scope_let_kind kind pp_var var in + Cli.debug_print @@ Format.asprintf "scope order : [@[ %a @]]@;" + (Format.pp_print_list ~pp_sep:(fun fmt _ -> Format.fprintf fmt ";@;") pp_scope_ctx) lets; (* then, we compute the lets bindings and modification to the ctx *) (* todo: once we update to ocaml 4.11, use fold_left_map instead of fold_left + List.rev *) + + let ctx2, acc = ListLabels.fold_left lets ~init:(ctx1, []) @@ -389,6 +406,16 @@ let translate_scope_body (* we now have the context for the final transformation: the result *) (* todo: alaid, result is boxed and hence incompatible with translate_expr... *) + + Cli.debug_print @@ Format.asprintf "The box is closed : %b" (Bindlib.is_closed result); + + ListLabels.iter lets + ~f:(fun {D.scope_let_var = (var, _); _} -> + Cli.debug_print @@ Format.asprintf "The variable %a occurs in the result: %b" pp_var var (Bindlib.occur var result) + ) + ; + + let result = translate_expr ~append_esome:false ctx2 (Bindlib.unbox result) in (* finally, we can recombine everything using nested let ... = ... in *) From 156dd71375858421cc12dd940fb0cf17a46c4a59 Mon Sep 17 00:00:00 2001 From: Alain Date: Thu, 3 Feb 2022 18:27:55 +0100 Subject: [PATCH 057/102] intermediate step --- compiler/lcalc/compile_without_exceptions.ml | 72 ++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index a13bfec90..b72a55927 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -315,6 +315,76 @@ and translate_expr ?(append_esome=true) (ctx: ctx) (e: D.expr Pos.marked) ;; +(* +type scope_let = { + scope_let_var : expr Bindlib.var Pos.marked; + scope_let_kind : scope_let_kind; + scope_let_typ : typ Pos.marked; + scope_let_expr : expr Pos.marked Bindlib.box; +} +*) +type scope_lets = + | Result of D.expr Pos.marked + | ScopeLet of + { + scope_let_kind: D.scope_let_kind; + scope_let_typ: D.typ Pos.marked; + scope_let_expr: D.expr Pos.marked; + scope_let_next: (D.expr, scope_lets) Bindlib.binder; + } + +let translate_and_bind_lets + (acc: scope_lets Bindlib.box) + (scope_let: D.scope_let): scope_lets Bindlib.box = + + Bindlib.box_apply2 ( + fun expr binder-> + ScopeLet { + scope_let_kind=scope_let.D.scope_let_kind; + scope_let_typ=scope_let.D.scope_let_typ; + scope_let_expr=expr; + scope_let_next=binder + + } + ) scope_let.D.scope_let_expr (Bindlib.bind_var (fst scope_let.D.scope_let_var) acc) + +(* +type scope_body = { + scope_body_lets : scope_let list; + scope_body_result : expr Pos.marked Bindlib.box; + (* {x1 = x1; x2 = x2; x3 = x3; ... } *) + scope_body_arg : expr Bindlib.var; + (* x: input_struct *) + scope_body_input_struct : StructName.t; + scope_body_output_struct : StructName.t; +} + +*) +type scope_body = { + scope_body_input_struct: D.StructName.t; + scope_body_output_struct: D.StructName.t; + scope_body_result: (D.expr, scope_lets) Bindlib.binder; +} + +let translate_and_bind (body: D.scope_body) : scope_body Bindlib.box = + + let body_result = ListLabels.fold_left body.D.scope_body_lets + ~init:(Bindlib.box_apply (fun e -> Result e) body.D.scope_body_result) + ~f:translate_and_bind_lets + in + + let scope_body_result = Bindlib.bind_var body.D.scope_body_arg body_result in + + + Bindlib.box_apply (fun scope_body_result -> + { + scope_body_output_struct=body.D.scope_body_output_struct; + scope_body_input_struct=body.D.scope_body_input_struct; + scope_body_result=scope_body_result; + } + ) scope_body_result + + let translate_scope_let (ctx: ctx) (s: D.scope_let): ctx * A.expr Pos.marked Bindlib.box = @@ -422,6 +492,8 @@ let translate_scope_body let body = ListLabels.fold_left acc ~init:result ~f:(fun (body : (A.expr * Pos.t) Bindlib.box) ((v, pos), tau, e) -> + + Cli.debug_print @@ Format.asprintf "The variable %a is being letted." pp_var v; A.make_let_in (find ~info:"body-building" v ctx2).var (tau, pos) e body) in From ebc2adc53e9c8f222df93489ac43e24329b8e5ef Mon Sep 17 00:00:00 2001 From: Alain Date: Thu, 3 Feb 2022 18:30:58 +0100 Subject: [PATCH 058/102] removed comments --- compiler/lcalc/compile_without_exceptions.ml | 21 +------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index b72a55927..793f23dc8 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -315,14 +315,7 @@ and translate_expr ?(append_esome=true) (ctx: ctx) (e: D.expr Pos.marked) ;; -(* -type scope_let = { - scope_let_var : expr Bindlib.var Pos.marked; - scope_let_kind : scope_let_kind; - scope_let_typ : typ Pos.marked; - scope_let_expr : expr Pos.marked Bindlib.box; -} -*) + type scope_lets = | Result of D.expr Pos.marked | ScopeLet of @@ -348,18 +341,6 @@ let translate_and_bind_lets } ) scope_let.D.scope_let_expr (Bindlib.bind_var (fst scope_let.D.scope_let_var) acc) -(* -type scope_body = { - scope_body_lets : scope_let list; - scope_body_result : expr Pos.marked Bindlib.box; - (* {x1 = x1; x2 = x2; x3 = x3; ... } *) - scope_body_arg : expr Bindlib.var; - (* x: input_struct *) - scope_body_input_struct : StructName.t; - scope_body_output_struct : StructName.t; -} - -*) type scope_body = { scope_body_input_struct: D.StructName.t; scope_body_output_struct: D.StructName.t; From 005646d2b2acf00611ca8465a2da9dc31a84c6bd Mon Sep 17 00:00:00 2001 From: Alain Date: Thu, 3 Feb 2022 18:48:17 +0100 Subject: [PATCH 059/102] implementation of scoping let function --- compiler/lcalc/compile_without_exceptions.ml | 153 ++++++------------- 1 file changed, 44 insertions(+), 109 deletions(-) diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index 793f23dc8..44621c2c1 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -324,28 +324,33 @@ type scope_lets = scope_let_typ: D.typ Pos.marked; scope_let_expr: D.expr Pos.marked; scope_let_next: (D.expr, scope_lets) Bindlib.binder; + scope_let_pos: Pos.t; } +type scope_body = { + scope_body_input_struct: D.StructName.t; + scope_body_output_struct: D.StructName.t; + scope_body_result: (D.expr, scope_lets) Bindlib.binder; +} + + let translate_and_bind_lets (acc: scope_lets Bindlib.box) (scope_let: D.scope_let): scope_lets Bindlib.box = + let pos = snd scope_let.D.scope_let_var in Bindlib.box_apply2 ( fun expr binder-> ScopeLet { scope_let_kind=scope_let.D.scope_let_kind; scope_let_typ=scope_let.D.scope_let_typ; scope_let_expr=expr; - scope_let_next=binder + scope_let_next=binder; + scope_let_pos=pos; } ) scope_let.D.scope_let_expr (Bindlib.bind_var (fst scope_let.D.scope_let_var) acc) -type scope_body = { - scope_body_input_struct: D.StructName.t; - scope_body_output_struct: D.StructName.t; - scope_body_result: (D.expr, scope_lets) Bindlib.binder; -} let translate_and_bind (body: D.scope_body) : scope_body Bindlib.box = @@ -365,123 +370,51 @@ let translate_and_bind (body: D.scope_body) : scope_body Bindlib.box = } ) scope_body_result +let rec translate_scope_let (ctx: ctx) (lets: scope_lets) = + match lets with + | Result e -> + translate_expr ~append_esome:false ctx e + | ScopeLet { + scope_let_kind = kind; + scope_let_typ = typ; + scope_let_expr = expr; + scope_let_next = next; + scope_let_pos = pos; + } -> + let var_is_pure = match kind with + | DestructuringInputStruct -> false + | ScopeVarDefinition + | SubScopeVarDefinition + | CallingSubScope + | DestructuringSubScopeResults + | Assertion -> true + in + let var, next = Bindlib.unbind next in + let ctx' = add_var pos var var_is_pure ctx in + let new_var = (find ~info:"variable that was just created" var ctx').var in + A.make_let_in new_var typ + (translate_expr ctx ~append_esome:false expr) + (translate_scope_let ctx' next) -let translate_scope_let (ctx: ctx) (s: D.scope_let): ctx * A.expr Pos.marked Bindlib.box = - - Cli.debug_print @@ Format.asprintf "translating an %a" D.pp_scope_let_kind s.scope_let_kind; - ListLabels.iter (D.VarMap.bindings ctx |> List.map fst) - ~f:(fun var -> - Cli.debug_print @@ Format.asprintf "[%a] The variable %a occurs in the expression: %b" - D.pp_scope_let_kind s.D.scope_let_kind - pp_var var - (Bindlib.occur var s.D.scope_let_expr) - ); - - match s with - | { - D.scope_let_var = (var, pos); - D.scope_let_typ = _typ; - D.scope_let_expr = expr; - D.scope_let_kind = DestructuringInputStruct (** [let x = input.field]*) - } -> begin - - (add_var pos var false ctx, translate_expr ~append_esome:false ctx (Bindlib.unbox expr)) - end - | { - D.scope_let_var = (var, pos); - D.scope_let_typ = _typ; - D.scope_let_expr = expr; - D.scope_let_kind = ScopeVarDefinition (** [let x = error_on_empty e]*) - } -> (add_var pos var true ctx, translate_expr ~append_esome:false ctx (Bindlib.unbox expr)) - | { - D.scope_let_var = (var, pos); - D.scope_let_typ = _typ; - D.scope_let_expr = expr; - D.scope_let_kind = SubScopeVarDefinition (** [let s.x = fun _ -> e] *) - } -> (add_var pos var true ctx, translate_expr ~append_esome:false ctx (Bindlib.unbox expr)) - | { - D.scope_let_var = (var, pos); - D.scope_let_typ = _typ; - D.scope_let_expr = expr; - D.scope_let_kind = CallingSubScope (** [let result = s ({ x = s.x; y = s.x; ...}) ]*) - } -> (add_var pos var true ctx, translate_expr ~append_esome:false ctx (Bindlib.unbox expr)) - | { - D.scope_let_var = (var, pos); - D.scope_let_typ = _typ; - D.scope_let_expr = expr; - D.scope_let_kind = DestructuringSubScopeResults (** [let s.x = result.x ]**) - } -> (add_var pos var true ctx, translate_expr ~append_esome:false ctx (Bindlib.unbox expr)) - | { - D.scope_let_var = (var, pos); - D.scope_let_typ = _typ; - D.scope_let_expr = expr; - D.scope_let_kind = Assertion (** [let _ = assert e]*) - } -> (add_var pos var true ctx, translate_expr ~append_esome:false ctx (Bindlib.unbox expr)) +;; let translate_scope_body - (_scope_pos: Pos.t) + (scope_pos: Pos.t) (_decl_ctx: D.decl_ctx) (ctx: ctx) - (body: D.scope_body): A.expr Pos.marked Bindlib.box = + (body: scope_body): A.expr Pos.marked Bindlib.box = match body with { - scope_body_lets=lets; scope_body_result=result; - scope_body_arg=arg; scope_body_input_struct=_input_struct; scope_body_output_struct=_output_struct; } -> - (* first we add to the input the ctx *) - let ctx1 = add_var Pos.no_pos arg true ctx in + let v, lets = Bindlib.unbind result in + let ctx' = add_var scope_pos v true ctx in - let pp_scope_ctx fmt {D.scope_let_kind=kind; D.scope_let_var = (var, _); _} = - Format.fprintf fmt "%a, %a" D.pp_scope_let_kind kind pp_var var - in - Cli.debug_print @@ Format.asprintf "scope order : [@[ %a @]]@;" - (Format.pp_print_list ~pp_sep:(fun fmt _ -> Format.fprintf fmt ";@;") pp_scope_ctx) lets; - - (* then, we compute the lets bindings and modification to the ctx *) - (* todo: once we update to ocaml 4.11, use fold_left_map instead of fold_left + List.rev *) - - - let ctx2, acc = - ListLabels.fold_left lets - ~init:(ctx1, []) - ~f:(fun (ctx, acc) (s : D.scope_let) -> - let ctx, e = translate_scope_let ctx s in - (ctx, (s.scope_let_var, D.TAny, e) :: acc)) - in - let acc = acc in - - (* we now have the context for the final transformation: the result *) - (* todo: alaid, result is boxed and hence incompatible with translate_expr... *) - - Cli.debug_print @@ Format.asprintf "The box is closed : %b" (Bindlib.is_closed result); - - ListLabels.iter lets - ~f:(fun {D.scope_let_var = (var, _); _} -> - Cli.debug_print @@ Format.asprintf "The variable %a occurs in the result: %b" pp_var var (Bindlib.occur var result) - ) - ; - - - let result = translate_expr ~append_esome:false ctx2 (Bindlib.unbox result) in - - (* finally, we can recombine everything using nested let ... = ... in *) - let body = - ListLabels.fold_left acc ~init:result - ~f:(fun (body : (A.expr * Pos.t) Bindlib.box) ((v, pos), tau, e) -> - - Cli.debug_print @@ Format.asprintf "The variable %a is being letted." pp_var v; - A.make_let_in (find ~info:"body-building" v ctx2).var (tau, pos) e body) - in - - (* we finnally rebuild the binder *) - A.make_abs - (Array.of_list [ (find ~info:"final abs" arg ctx1).var ]) - body Pos.no_pos [ (D.TAny, Pos.no_pos) ] Pos.no_pos + translate_scope_let ctx' lets @@ -500,6 +433,8 @@ let translate_program (prgm: D.program) : A.program = let scopes = prgm.scopes |> ListLabels.fold_left ~init:([], D.VarMap.empty) ~f:(fun ((acc, ctx) : _ * info D.VarMap.t) (scope_name, n, scope_body) -> + + let scope_body = Bindlib.unbox (translate_and_bind scope_body) in let new_ctx = add_var Pos.no_pos n true ctx in let new_n = find ~info:"variable that was just created" n new_ctx in From 9e301331e699d19f377115a9f333fec5cdf5d1af Mon Sep 17 00:00:00 2001 From: Alain Date: Thu, 3 Feb 2022 18:56:37 +0100 Subject: [PATCH 060/102] more printing --- compiler/lcalc/compile_without_exceptions.ml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index 44621c2c1..639019302 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -60,8 +60,9 @@ let add_var pos var is_pure ctx = let new_var = A.Var.make (Bindlib.name_of var, pos) in let expr = A.make_var (new_var, pos) in - Format.asprintf "adding a new variable %a" pp_var var - |> Cli.debug_print ; + Cli.debug_print @@ Format.asprintf "D.%a |-> A.%a" + pp_var var + pp_var new_var; D.VarMap.update var (fun _ -> Some {expr; var=new_var; is_pure}) ctx @@ -165,7 +166,7 @@ let rec translate_and_cut (ctx: ctx) (e: D.expr Pos.marked) (e', disjoint_union_maps pos [c1; c2; c3]) - | EAbs ((binder, pos_binder), ts) -> + | D.EAbs ((binder, pos_binder), ts) -> let vars, body = Bindlib.unmbind binder in let ctx, lc_vars = ArrayLabels.fold_right vars ~init:(ctx, []) ~f:(fun var (ctx, lc_vars) -> @@ -173,7 +174,7 @@ let rec translate_and_cut (ctx: ctx) (e: D.expr Pos.marked) (* we suppose the invariant that when applying a function, its arguments cannot be of the type "option". The code should behave correctly in the without this assumption if we put here an is_pure=false, but the types are more compilcated. (unimplemented for now) *) - + let ctx = add_var pos var true ctx in let lc_var = (find var ctx).var in ( ctx, lc_var :: lc_vars)) @@ -262,7 +263,7 @@ and translate_expr ?(append_esome=true) (ctx: ctx) (e: D.expr Pos.marked) ~f:(fun acc (v, (c, pos_c)) -> - Cli.debug_print @@ Format.asprintf "cut using %a" pp_var v; + Cli.debug_print @@ Format.asprintf "cut using A.%a" pp_var v; let c': A.expr Pos.marked Bindlib.box = match c with (* Here we have to handle only the cases appearing in cuts, as defined the [translate_and_cut] function. *) From b777d3215b06d0dad7675905781a3df8c5a3077d Mon Sep 17 00:00:00 2001 From: Alain Date: Fri, 4 Feb 2022 09:24:51 +0100 Subject: [PATCH 061/102] computing of free vars+ more debuging finally found an error (List.fold_left instead of List.fold_right --- compiler/dcalc/ast.ml | 82 +++++++++++++------- compiler/dcalc/ast.mli | 15 ++-- compiler/lcalc/compile_without_exceptions.ml | 47 +++++++++-- 3 files changed, 104 insertions(+), 40 deletions(-) diff --git a/compiler/dcalc/ast.ml b/compiler/dcalc/ast.ml index fa970e32a..3e519d5b4 100644 --- a/compiler/dcalc/ast.ml +++ b/compiler/dcalc/ast.ml @@ -32,8 +32,7 @@ module EnumConstructor : Uid.Id with type info = Uid.MarkedString.info = module EnumMap : Map.S with type key = EnumName.t = Map.Make (EnumName) -type typ_lit = TBool | TUnit | TInt | TRat | TMoney | TDate | TDuration -[@@ deriving show] +type typ_lit = TBool | TUnit | TInt | TRat | TMoney | TDate | TDuration [@@deriving show] type struct_name = StructName.t @@ -41,12 +40,12 @@ type enum_name = EnumName.t type typ = | TLit of typ_lit - | TTuple of typ Pos.marked list * (struct_name [@opaque]) option - | TEnum of typ Pos.marked list * (enum_name [@opaque]) + | TTuple of typ Pos.marked list * (struct_name[@opaque]) option + | TEnum of typ Pos.marked list * (enum_name[@opaque]) | TArrow of typ Pos.marked * typ Pos.marked | TArray of typ Pos.marked | TAny -[@@ deriving show] +[@@deriving show] type date = Runtime.date @@ -68,12 +67,9 @@ type lit = | LDate of date | LDuration of duration +type op_kind = KInt | KRat | KMoney | KDate | KDuration [@@deriving show] -type op_kind = KInt | KRat | KMoney | KDate | KDuration -[@@ deriving show] - -type ternop = Fold -[@@ deriving show] +type ternop = Fold [@@deriving show] type binop = | And @@ -92,41 +88,39 @@ type binop = | Map | Concat | Filter -[@@ deriving show] +[@@deriving show] -type log_entry = VarDef of typ | BeginCall | EndCall | PosRecordIfTrueBool -[@@ deriving show] +type log_entry = VarDef of typ | BeginCall | EndCall | PosRecordIfTrueBool [@@deriving show] type unop = | Not | Minus of op_kind - | Log of log_entry * (Utils.Uid.MarkedString.info list [@opaque]) + | Log of log_entry * (Utils.Uid.MarkedString.info list[@opaque]) | Length | IntToRat | GetDay | GetMonth | GetYear -[@@ deriving show] +[@@deriving show] -type operator = Ternop of ternop | Binop of binop | Unop of unop -[@@ deriving show] +type operator = Ternop of ternop | Binop of binop | Unop of unop [@@deriving show] type expr = - | EVar of (expr Bindlib.var [@opaque]) Pos.marked - | ETuple of expr Pos.marked list * (struct_name [@opaque]) option - | ETupleAccess of expr Pos.marked * int * (struct_name [@opaque]) option * typ Pos.marked list - | EInj of expr Pos.marked * int * (enum_name [@opaque]) * typ Pos.marked list - | EMatch of expr Pos.marked * expr Pos.marked list * (enum_name [@opaque]) + | EVar of (expr Bindlib.var[@opaque]) Pos.marked + | ETuple of expr Pos.marked list * (struct_name[@opaque]) option + | ETupleAccess of expr Pos.marked * int * (struct_name[@opaque]) option * typ Pos.marked list + | EInj of expr Pos.marked * int * (enum_name[@opaque]) * typ Pos.marked list + | EMatch of expr Pos.marked * expr Pos.marked list * (enum_name[@opaque]) | EArray of expr Pos.marked list - | ELit of (lit [@opaque]) - | EAbs of ((expr, expr Pos.marked) Bindlib.mbinder [@opaque]) Pos.marked * typ Pos.marked list + | ELit of (lit[@opaque]) + | EAbs of ((expr, expr Pos.marked) Bindlib.mbinder[@opaque]) Pos.marked * typ Pos.marked list | EApp of expr Pos.marked * expr Pos.marked list | EAssert of expr Pos.marked | EOp of operator | EDefault of expr Pos.marked list * expr Pos.marked * expr Pos.marked | EIfThenElse of expr Pos.marked * expr Pos.marked * expr Pos.marked | ErrorOnEmpty of expr Pos.marked -[@@ deriving show] +[@@deriving show] type struct_ctx = (StructFieldName.t * typ Pos.marked) list StructMap.t @@ -143,6 +137,7 @@ type scope_let_kind = | CallingSubScope | DestructuringSubScopeResults | Assertion +[@@deriving show] type scope_let = { scope_let_var : expr Bindlib.var Pos.marked; @@ -154,7 +149,9 @@ type scope_let = { type scope_body = { scope_body_lets : scope_let list; scope_body_result : expr Pos.marked Bindlib.box; + (* {x1 = x1; x2 = x2; x3 = x3; ... } *) scope_body_arg : expr Bindlib.var; + (* x: input_struct *) scope_body_input_struct : StructName.t; scope_body_output_struct : StructName.t; } @@ -174,6 +171,39 @@ end module VarMap = Map.Make (Var) + +let union = VarMap.union (fun _ _ _ -> Some ()) +let rec fv e = + match Pos.unmark e with + | EVar (v, _) -> VarMap.singleton v () + | ETuple(es, _) | EArray (es) -> + es |> List.map fv |> List.fold_left union VarMap.empty + | ETupleAccess(e1, _, _, _) + | EAssert e1 + | ErrorOnEmpty e1 + | EInj (e1, _, _, _) -> + fv e1 + | EApp (e1, es) + | EMatch(e1, es, _) -> + e1::es |> List.map fv |> List.fold_left union VarMap.empty + | EDefault(es, ejust, econs) -> + ejust::econs::es |> List.map fv |> List.fold_left union VarMap.empty + | EOp _ + | ELit _ -> VarMap.empty + + | EIfThenElse(e1, e2, e3) -> + [e1; e2; e3] |> List.map fv |> List.fold_left union VarMap.empty + | EAbs ((binder, _), _) -> + let vs, body = Bindlib.unmbind binder in + Array.fold_right VarMap.remove vs (fv body) + +let free_vars e = (fv e) +|> VarMap.bindings +|> List.map fst + + + + type vars = expr Bindlib.mvar let make_var ((x, pos) : Var.t Pos.marked) : expr Pos.marked Bindlib.box = @@ -191,7 +221,7 @@ let make_let_in (x : Var.t) (tau : typ Pos.marked) (e1 : expr Pos.marked Bindlib (e2 : expr Pos.marked Bindlib.box) (pos : Pos.t) : expr Pos.marked Bindlib.box = make_app (make_abs (Array.of_list [ x ]) e2 pos [ tau ] pos) [ e1 ] pos -let build_whole_scope_expr (ctx : decl_ctx) (body : scope_body) (pos_scope : Pos.t) = +let build_whole_scope_expr (ctx : decl_ctx) (body : scope_body) (pos_scope : Pos.t): expr Pos.marked Bindlib.box = let body_expr = List.fold_right (fun scope_let acc -> diff --git a/compiler/dcalc/ast.mli b/compiler/dcalc/ast.mli index b96ec56cd..5e6be0cdd 100644 --- a/compiler/dcalc/ast.mli +++ b/compiler/dcalc/ast.mli @@ -32,8 +32,7 @@ module EnumMap : Map.S with type key = EnumName.t (** {1 Abstract syntax tree} *) -type typ_lit = TBool | TUnit | TInt | TRat | TMoney | TDate | TDuration -[@@deriving show] +type typ_lit = TBool | TUnit | TInt | TRat | TMoney | TDate | TDuration [@@deriving show] type typ = | TLit of typ_lit @@ -103,10 +102,7 @@ type unop = | GetMonth | GetYear -type operator = Ternop of ternop | Binop of binop | Unop of unop -[@@deriving show] - - +type operator = Ternop of ternop | Binop of binop | Unop of unop [@@deriving show] (** The expressions use the {{:https://lepigre.fr/ocaml-bindlib/} Bindlib} library, based on higher-order abstract syntax*) @@ -122,7 +118,7 @@ type expr = (** The [MarkedString.info] is the former enum case name *) | EArray of expr Pos.marked list | ELit of lit - | EAbs of ((expr, expr Pos.marked) Bindlib.mbinder [@opaque]) Pos.marked * typ Pos.marked list + | EAbs of ((expr, expr Pos.marked) Bindlib.mbinder[@opaque]) Pos.marked * typ Pos.marked list | EApp of expr Pos.marked * expr Pos.marked list | EAssert of expr Pos.marked | EOp of operator @@ -131,6 +127,7 @@ type expr = | ErrorOnEmpty of expr Pos.marked [@@deriving show] + type struct_ctx = (StructFieldName.t * typ Pos.marked) list StructMap.t type enum_ctx = (EnumConstructor.t * typ Pos.marked) list EnumMap.t @@ -148,6 +145,7 @@ type scope_let_kind = | CallingSubScope (** [let result = s ({ x = s.x; y = s.x; ...}) ]*) | DestructuringSubScopeResults (** [let s.x = result.x ]**) | Assertion (** [let _ = assert e]*) +[@@deriving show] type scope_let = { scope_let_var : expr Bindlib.var Pos.marked; @@ -184,6 +182,9 @@ end module VarMap : Map.S with type key = Var.t +val fv : expr Pos.marked -> unit VarMap.t +val free_vars: expr Pos.marked -> Var.t list + type vars = expr Bindlib.mvar val make_var : Var.t Pos.marked -> expr Pos.marked Bindlib.box diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index 639019302..6510ddd2a 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -19,7 +19,7 @@ type cuts = D.expr Pos.marked A.VarMap.t let pp_var (fmt: Format.formatter) (n: _ Bindlib.var) = - Format.fprintf fmt "%s_%d" (Bindlib.name_of n) (Bindlib.uid_of n) + Format.fprintf fmt "%s_%d" (Bindlib.name_of n) (Bindlib.hash_var n) (** information about the Dcalc variable : what is the corresponding LCalc variable; an expression build correctly using Bindlib, and a boolean indicating whenever the variable should be matched (false) or not (true). *) @@ -32,7 +32,6 @@ type info = { (** information context about variables in the current scope *) type ctx = info D.VarMap.t - let pp_info (fmt: Format.formatter) (info: info) = Format.fprintf fmt "{var: %a; is_pure: %b}" pp_var info.var info.is_pure @@ -328,20 +327,45 @@ type scope_lets = scope_let_pos: Pos.t; } +let union = D.VarMap.union (fun _ _ _ -> Some ()) +let rec fv_scope_lets scope_lets = + match scope_lets with + | Result e -> D.fv e + | ScopeLet {scope_let_expr=e; scope_let_next=next; _} -> + let v, body = Bindlib.unbind next in + union (D.fv e) (D.VarMap.remove v (fv_scope_lets body)) + + type scope_body = { scope_body_input_struct: D.StructName.t; scope_body_output_struct: D.StructName.t; scope_body_result: (D.expr, scope_lets) Bindlib.binder; } - + +let fv_scope_body {scope_body_result=binder; _} = + let v, body = Bindlib.unbind binder in + D.VarMap.remove v (fv_scope_lets body) + +let free_vars_scope_body scope_body = + fv_scope_body scope_body + |> D.VarMap.bindings + |> List.map fst let translate_and_bind_lets (acc: scope_lets Bindlib.box) (scope_let: D.scope_let): scope_lets Bindlib.box = let pos = snd scope_let.D.scope_let_var in + + Cli.debug_print @@ Format.asprintf "binding let %a. Variable occurs = %b" + pp_var (fst scope_let.D.scope_let_var) + (Bindlib.occur (fst scope_let.D.scope_let_var) acc); + + let binder = Bindlib.bind_var (fst scope_let.D.scope_let_var) acc in Bindlib.box_apply2 ( fun expr binder-> + + Cli.debug_print @@ Format.asprintf "free variables in expression: %a" (Format.pp_print_list pp_var) (D.free_vars expr); ScopeLet { scope_let_kind=scope_let.D.scope_let_kind; scope_let_typ=scope_let.D.scope_let_typ; @@ -350,20 +374,22 @@ let translate_and_bind_lets scope_let_pos=pos; } - ) scope_let.D.scope_let_expr (Bindlib.bind_var (fst scope_let.D.scope_let_var) acc) + ) scope_let.D.scope_let_expr binder let translate_and_bind (body: D.scope_body) : scope_body Bindlib.box = - let body_result = ListLabels.fold_left body.D.scope_body_lets + let body_result = ListLabels.fold_right body.D.scope_body_lets ~init:(Bindlib.box_apply (fun e -> Result e) body.D.scope_body_result) - ~f:translate_and_bind_lets + ~f:(Fun.flip translate_and_bind_lets) in + Cli.debug_print @@ Format.asprintf "binding arg %a" pp_var body.D.scope_body_arg; let scope_body_result = Bindlib.bind_var body.D.scope_body_arg body_result in - + Cli.debug_print @@ Format.asprintf "isfinal term is closed: %b" (Bindlib.is_closed scope_body_result); Bindlib.box_apply (fun scope_body_result -> + Cli.debug_print @@ Format.asprintf "rank of the final term: %i" (Bindlib.binder_rank scope_body_result); { scope_body_output_struct=body.D.scope_body_output_struct; scope_body_input_struct=body.D.scope_body_input_struct; @@ -371,6 +397,9 @@ let translate_and_bind (body: D.scope_body) : scope_body Bindlib.box = } ) scope_body_result + + + let rec translate_scope_let (ctx: ctx) (lets: scope_lets) = match lets with | Result e -> @@ -392,6 +421,7 @@ let rec translate_scope_let (ctx: ctx) (lets: scope_lets) = | Assertion -> true in let var, next = Bindlib.unbind next in + Cli.debug_print @@ Format.asprintf "unbinding %a" pp_var var; let ctx' = add_var pos var var_is_pure ctx in let new_var = (find ~info:"variable that was just created" var ctx').var in A.make_let_in new_var typ @@ -436,6 +466,9 @@ let translate_program (prgm: D.program) : A.program = ~f:(fun ((acc, ctx) : _ * info D.VarMap.t) (scope_name, n, scope_body) -> let scope_body = Bindlib.unbox (translate_and_bind scope_body) in + + Cli.debug_print @@ Format.asprintf "global free variable : %a" + (Format.pp_print_list pp_var) (free_vars_scope_body scope_body); let new_ctx = add_var Pos.no_pos n true ctx in let new_n = find ~info:"variable that was just created" n new_ctx in From 88eedbc0006c8936350754289ed867a6d7e29da4 Mon Sep 17 00:00:00 2001 From: Alain Date: Fri, 4 Feb 2022 09:27:10 +0100 Subject: [PATCH 062/102] ocamlformat --- compiler/dcalc/ast.ml | 41 +- compiler/dcalc/ast.mli | 4 +- compiler/lcalc/compile_without_exceptions.ml | 698 +++++++++---------- 3 files changed, 349 insertions(+), 394 deletions(-) diff --git a/compiler/dcalc/ast.ml b/compiler/dcalc/ast.ml index 3e519d5b4..ec1544f3f 100644 --- a/compiler/dcalc/ast.ml +++ b/compiler/dcalc/ast.ml @@ -171,38 +171,24 @@ end module VarMap = Map.Make (Var) - let union = VarMap.union (fun _ _ _ -> Some ()) + let rec fv e = match Pos.unmark e with | EVar (v, _) -> VarMap.singleton v () - | ETuple(es, _) | EArray (es) -> - es |> List.map fv |> List.fold_left union VarMap.empty - | ETupleAccess(e1, _, _, _) - | EAssert e1 - | ErrorOnEmpty e1 - | EInj (e1, _, _, _) -> - fv e1 - | EApp (e1, es) - | EMatch(e1, es, _) -> - e1::es |> List.map fv |> List.fold_left union VarMap.empty - | EDefault(es, ejust, econs) -> - ejust::econs::es |> List.map fv |> List.fold_left union VarMap.empty - | EOp _ - | ELit _ -> VarMap.empty - - | EIfThenElse(e1, e2, e3) -> - [e1; e2; e3] |> List.map fv |> List.fold_left union VarMap.empty + | ETuple (es, _) | EArray es -> es |> List.map fv |> List.fold_left union VarMap.empty + | ETupleAccess (e1, _, _, _) | EAssert e1 | ErrorOnEmpty e1 | EInj (e1, _, _, _) -> fv e1 + | EApp (e1, es) | EMatch (e1, es, _) -> + e1 :: es |> List.map fv |> List.fold_left union VarMap.empty + | EDefault (es, ejust, econs) -> + ejust :: econs :: es |> List.map fv |> List.fold_left union VarMap.empty + | EOp _ | ELit _ -> VarMap.empty + | EIfThenElse (e1, e2, e3) -> [ e1; e2; e3 ] |> List.map fv |> List.fold_left union VarMap.empty | EAbs ((binder, _), _) -> - let vs, body = Bindlib.unmbind binder in - Array.fold_right VarMap.remove vs (fv body) + let vs, body = Bindlib.unmbind binder in + Array.fold_right VarMap.remove vs (fv body) -let free_vars e = (fv e) -|> VarMap.bindings -|> List.map fst - - - +let free_vars e = fv e |> VarMap.bindings |> List.map fst type vars = expr Bindlib.mvar @@ -221,7 +207,8 @@ let make_let_in (x : Var.t) (tau : typ Pos.marked) (e1 : expr Pos.marked Bindlib (e2 : expr Pos.marked Bindlib.box) (pos : Pos.t) : expr Pos.marked Bindlib.box = make_app (make_abs (Array.of_list [ x ]) e2 pos [ tau ] pos) [ e1 ] pos -let build_whole_scope_expr (ctx : decl_ctx) (body : scope_body) (pos_scope : Pos.t): expr Pos.marked Bindlib.box = +let build_whole_scope_expr (ctx : decl_ctx) (body : scope_body) (pos_scope : Pos.t) : + expr Pos.marked Bindlib.box = let body_expr = List.fold_right (fun scope_let acc -> diff --git a/compiler/dcalc/ast.mli b/compiler/dcalc/ast.mli index 5e6be0cdd..0a454710e 100644 --- a/compiler/dcalc/ast.mli +++ b/compiler/dcalc/ast.mli @@ -127,7 +127,6 @@ type expr = | ErrorOnEmpty of expr Pos.marked [@@deriving show] - type struct_ctx = (StructFieldName.t * typ Pos.marked) list StructMap.t type enum_ctx = (EnumConstructor.t * typ Pos.marked) list EnumMap.t @@ -183,7 +182,8 @@ end module VarMap : Map.S with type key = Var.t val fv : expr Pos.marked -> unit VarMap.t -val free_vars: expr Pos.marked -> Var.t list + +val free_vars : expr Pos.marked -> Var.t list type vars = expr Bindlib.mvar diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index 6510ddd2a..cb3fb2010 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -1,487 +1,455 @@ - open Utils module D = Dcalc.Ast module A = Ast - (** hoisting *) -(** - The main idea around this pass is to compile Dcalc to Lcalc without using [raise EmptyError] nor [try _ with EmptyError -> _]. To do so, we use the same technique as in rust or erlang to handle this kind of exceptions. Each [raise EmptyError] will be translated as [None] and each [try e1 with EmtpyError -> e2] as [match e1 with | None -> e2 | Some x -> x]. +(** The main idea around this pass is to compile Dcalc to Lcalc without using [raise EmptyError] nor + [try _ with EmptyError -> _]. To do so, we use the same technique as in rust or erlang to handle + this kind of exceptions. Each [raise EmptyError] will be translated as [None] and each + [try e1 with EmtpyError -> e2] as [match e1 with | None -> e2 | Some x -> x]. - When doing this naively, this requires to add matches and Some constructor everywhere. We apply here an other technique where we generate what we call `cuts`. Cuts are expression whom could minimally [raise EmptyError]. For instance [let x = * 3 in x + 1], the sub-expression [] can produce an empty error. So we make a cut with a new variable [y] linked to the Dcalc expression [], and we return as the translated expression [let x = y * 3 in x + 1]. + When doing this naively, this requires to add matches and Some constructor everywhere. We apply + here an other technique where we generate what we call `cuts`. Cuts are expression whom could + minimally [raise EmptyError]. For instance + [let x = * 3 in x + 1], the sub-expression + [] can produce an empty error. So we make a cut with a new + variable [y] linked to the Dcalc expression [], and we return + as the translated expression [let x = y * 3 in x + 1]. - The compilation of expressions is found in the functions [translate_and_cut ctx e] and [translate_expr ctx e]. Every option-generating expresion when calling [translate_and_cut] will be cutted and later handled by the [translate_expr] function. Every other cases is found in the translate_and_cut function. -*) + The compilation of expressions is found in the functions [translate_and_cut ctx e] and + [translate_expr ctx e]. Every option-generating expresion when calling [translate_and_cut] will + be cutted and later handled by the [translate_expr] function. Every other cases is found in the + translate_and_cut function. *) -(** cuts *) type cuts = D.expr Pos.marked A.VarMap.t +(** cuts *) - -let pp_var (fmt: Format.formatter) (n: _ Bindlib.var) = +let pp_var (fmt : Format.formatter) (n : _ Bindlib.var) = Format.fprintf fmt "%s_%d" (Bindlib.name_of n) (Bindlib.hash_var n) -(** - information about the Dcalc variable : what is the corresponding LCalc variable; an expression build correctly using Bindlib, and a boolean indicating whenever the variable should be matched (false) or not (true). *) -type info = { - expr: A.expr Pos.marked Bindlib.box; - var: A.expr Bindlib.var; - is_pure: bool -} +type info = { expr : A.expr Pos.marked Bindlib.box; var : A.expr Bindlib.var; is_pure : bool } +(** information about the Dcalc variable : what is the corresponding LCalc variable; an expression + build correctly using Bindlib, and a boolean indicating whenever the variable should be matched + (false) or not (true). *) +type ctx = info D.VarMap.t (** information context about variables in the current scope *) -type ctx = info D.VarMap.t -let pp_info (fmt: Format.formatter) (info: info) = +let pp_info (fmt : Format.formatter) (info : info) = Format.fprintf fmt "{var: %a; is_pure: %b}" pp_var info.var info.is_pure -let pp_binding (fmt: Format.formatter) ((v, info): D.Var.t * info) = +let pp_binding (fmt : Format.formatter) ((v, info) : D.Var.t * info) = Format.fprintf fmt "%a:%a" pp_var v pp_info info -let pp_ctx (fmt: Format.formatter) (ctx: ctx) = - - let pp_bindings = Format.pp_print_list ~pp_sep:(fun fmt () -> Format.pp_print_string fmt "; ") pp_binding in +let pp_ctx (fmt : Format.formatter) (ctx : ctx) = + let pp_bindings = + Format.pp_print_list ~pp_sep:(fun fmt () -> Format.pp_print_string fmt "; ") pp_binding + in Format.fprintf fmt "@[<2>[%a]@]" pp_bindings (D.VarMap.bindings ctx) - - -let find ?(info="none") n ctx = - let _ = +let find ?(info = "none") n ctx = + let _ = Format.asprintf "Searching for variable %a inside context %a" pp_var n pp_ctx ctx |> Cli.debug_print in - try - D.VarMap.find n ctx + try D.VarMap.find n ctx with Not_found -> - Errors.raise_spanned_error (Format.sprintf "Internal Error: Variable %s_%d was not found in the current environment. Additional informations : %s." (Bindlib.name_of n) (Bindlib.uid_of n) info) Pos.no_pos + Errors.raise_spanned_error + (Format.sprintf + "Internal Error: Variable %s_%d was not found in the current environment. Additional \ + informations : %s." + (Bindlib.name_of n) (Bindlib.uid_of n) info) + Pos.no_pos let add_var pos var is_pure ctx = let new_var = A.Var.make (Bindlib.name_of var, pos) in let expr = A.make_var (new_var, pos) in - Cli.debug_print @@ Format.asprintf "D.%a |-> A.%a" - pp_var var - pp_var new_var; - - D.VarMap.update var (fun _ -> Some {expr; var=new_var; is_pure}) ctx + Cli.debug_print @@ Format.asprintf "D.%a |-> A.%a" pp_var var pp_var new_var; + + D.VarMap.update var (fun _ -> Some { expr; var = new_var; is_pure }) ctx - (* D.VarMap.add var { expr; var = new_var; is_pure } ctx *) -;; +(* D.VarMap.add var { expr; var = new_var; is_pure } ctx *) -let translate_lit (l : D.lit) (pos: Pos.t): A.lit = +let translate_lit (l : D.lit) (pos : Pos.t) : A.lit = match l with - | D.LBool l -> (A.LBool l) - | D.LInt i -> (A.LInt i) - | D.LRat r -> (A.LRat r) - | D.LMoney m -> (A.LMoney m) + | D.LBool l -> A.LBool l + | D.LInt i -> A.LInt i + | D.LRat r -> A.LRat r + | D.LMoney m -> A.LMoney m | D.LUnit -> A.LUnit - | D.LDate d -> (A.LDate d) - | D.LDuration d -> (A.LDuration d) - | D.LEmptyError -> Errors.raise_spanned_error "Internal Error: An empty error was found in a place that shouldn't be possible." pos - - -(** [c = disjoint_union_maps cs] - Compute the disjoint union of multiple maps. Raises an internal error if there is two identicals keys in differnts parts. *) -let disjoint_union_maps (pos: Pos.t) (cs: 'a A.VarMap.t list): 'a A.VarMap.t = - let disjoint_union = A.VarMap.union (fun _ _ _ -> Errors.raise_spanned_error "Internal Error: Two supposed to be disjoints maps have one shared key." pos) in + | D.LDate d -> A.LDate d + | D.LDuration d -> A.LDuration d + | D.LEmptyError -> + Errors.raise_spanned_error + "Internal Error: An empty error was found in a place that shouldn't be possible." pos + +(** [c = disjoint_union_maps cs] Compute the disjoint union of multiple maps. Raises an internal + error if there is two identicals keys in differnts parts. *) +let disjoint_union_maps (pos : Pos.t) (cs : 'a A.VarMap.t list) : 'a A.VarMap.t = + let disjoint_union = + A.VarMap.union (fun _ _ _ -> + Errors.raise_spanned_error + "Internal Error: Two supposed to be disjoints maps have one shared key." pos) + in List.fold_left disjoint_union A.VarMap.empty cs -(** [e' = translate_and_cut ctx e ] - Translate the Dcalc expression e into an expression in Lcalc, given we translate each cuts correctly. It ensures the equivalence between the execution of e and the execution of e' are equivalent in an environement where each variable v, where (v, e_v) is in cuts, has the non-empty value in e_v. *) -let rec translate_and_cut (ctx: ctx) (e: D.expr Pos.marked) - : A.expr Pos.marked Bindlib.box * cuts = +(** [e' = translate_and_cut ctx e ] Translate the Dcalc expression e into an expression in Lcalc, + given we translate each cuts correctly. It ensures the equivalence between the execution of e + and the execution of e' are equivalent in an environement where each variable v, where (v, e_v) + is in cuts, has the non-empty value in e_v. *) +let rec translate_and_cut (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindlib.box * cuts + = let pos = Pos.get_position e in match Pos.unmark e with - (* empty-producing/using terms. We cut those. (D.EVar in some cases, EApp(D.EVar _, [ELit LUnit]), EDefault _, ELit LEmptyDefault) I'm unsure about assert. *) | D.EVar v -> - - (* todo: for now, we requires there is unpure variables. This can change if the said variable are always present in the tree as thunked. *) - let v, pos_v = v in - if not (find ~info:"search for a variable" v ctx).is_pure then begin - let v' = A.Var.make ((Bindlib.name_of v), pos_v) in - Cli.debug_print @@ Format.asprintf "Found an unpure variable %a, created a variable %a to replace it" pp_var v pp_var v'; - (A.make_var (v', pos), A.VarMap.singleton v' e) - end else - (find ~info:"should never happend" v ctx).expr, A.VarMap.empty - + (* todo: for now, we requires there is unpure variables. This can change if the said variable are always present in the tree as thunked. *) + let v, pos_v = v in + if not (find ~info:"search for a variable" v ctx).is_pure then begin + let v' = A.Var.make (Bindlib.name_of v, pos_v) in + Cli.debug_print + @@ Format.asprintf "Found an unpure variable %a, created a variable %a to replace it" pp_var + v pp_var v'; + (A.make_var (v', pos), A.VarMap.singleton v' e) + end + else ((find ~info:"should never happend" v ctx).expr, A.VarMap.empty) | D.EApp ((D.EVar (v, pos_v), p), [ (D.ELit D.LUnit, _) ]) -> - if not (find ~info:"search for a variable" v ctx).is_pure then begin - let v' = A.Var.make ((Bindlib.name_of v), pos_v) in - Cli.debug_print @@ Format.asprintf "Found an unpure variable %a, created a variable %a to replace it" pp_var v pp_var v'; - (A.make_var (v', pos), A.VarMap.singleton v' (D.EVar (v, pos_v), p)) - end else - Errors.raise_spanned_error "Internal error: an pure variable was found in an unpure environment." pos - + if not (find ~info:"search for a variable" v ctx).is_pure then begin + let v' = A.Var.make (Bindlib.name_of v, pos_v) in + Cli.debug_print + @@ Format.asprintf "Found an unpure variable %a, created a variable %a to replace it" pp_var + v pp_var v'; + (A.make_var (v', pos), A.VarMap.singleton v' (D.EVar (v, pos_v), p)) + end + else + Errors.raise_spanned_error + "Internal error: an pure variable was found in an unpure environment." pos | D.EDefault (_exceptions, _just, _cons) -> - let v' = A.Var.make ("default_term", pos) in - (A.make_var (v', pos), A.VarMap.singleton v' e) + let v' = A.Var.make ("default_term", pos) in + (A.make_var (v', pos), A.VarMap.singleton v' e) | D.ELit D.LEmptyError -> - let v' = A.Var.make ("empty_litteral", pos) in - (A.make_var (v', pos), A.VarMap.singleton v' e) + let v' = A.Var.make ("empty_litteral", pos) in + (A.make_var (v', pos), A.VarMap.singleton v' e) | D.EAssert _ -> - (* as discuted, if the value in an assertion is empty, an error should the raised. This beavior is different from the ICFP paper. *) - let v' = A.Var.make ("assertion_value", pos) in - (A.make_var (v', pos), A.VarMap.singleton v' e) - - + (* as discuted, if the value in an assertion is empty, an error should the raised. This beavior is different from the ICFP paper. *) + let v' = A.Var.make ("assertion_value", pos) in + (A.make_var (v', pos), A.VarMap.singleton v' e) (* This one is a very special case. It transform an unpure expression environement to a pure expression. *) | ErrorOnEmpty arg -> - (* [ - match arg with - | None -> raise NoValueProvided - | Some v -> {{ v }} - ] *) - - let silent_var = A.Var.make ("_", pos) in - let x = A.Var.make ("non_empty_argument", pos) in - - let arg' = translate_expr ctx arg in - - (A.make_matchopt_dumb arg' - (A.make_abs [| silent_var |] (Bindlib.box (A.ERaise A.NoValueProvided, pos)) pos [D.TAny, pos] pos) - (A.make_abs [| x |] ((A.make_var (x, pos))) pos [D.TAny, pos] pos), A.VarMap.empty) - + (* [ + match arg with + | None -> raise NoValueProvided + | Some v -> {{ v }} + ] *) + let silent_var = A.Var.make ("_", pos) in + let x = A.Var.make ("non_empty_argument", pos) in + + let arg' = translate_expr ctx arg in + + ( A.make_matchopt_dumb arg' + (A.make_abs [| silent_var |] + (Bindlib.box (A.ERaise A.NoValueProvided, pos)) + pos [ (D.TAny, pos) ] pos) + (A.make_abs [| x |] (A.make_var (x, pos)) pos [ (D.TAny, pos) ] pos), + A.VarMap.empty ) (* pure terms *) - | D.ELit l -> - (Bindlib.box (A.ELit (translate_lit l pos), pos), A.VarMap.empty) - + | D.ELit l -> (Bindlib.box (A.ELit (translate_lit l pos), pos), A.VarMap.empty) | D.EIfThenElse (e1, e2, e3) -> - let e1', c1 = translate_and_cut ctx e1 in - let e2', c2 = translate_and_cut ctx e2 in - let e3', c3 = translate_and_cut ctx e3 in - - let e' = Bindlib.box_apply3 ( - fun e1' e2' e3' -> (A.EIfThenElse(e1', e2', e3'), pos)) e1' e2' e3' - in - - (*(* equivalent code : *) - let e' = - let+ e1' = e1' and+ e2' = e2' and+ e3' = e3' in - (A.EIfThenElse (e1', e2', e3'), pos) - in - *) - - (e', disjoint_union_maps pos [c1; c2; c3]) + let e1', c1 = translate_and_cut ctx e1 in + let e2', c2 = translate_and_cut ctx e2 in + let e3', c3 = translate_and_cut ctx e3 in + let e' = + Bindlib.box_apply3 (fun e1' e2' e3' -> (A.EIfThenElse (e1', e2', e3'), pos)) e1' e2' e3' + in + + (*(* equivalent code : *) + let e' = + let+ e1' = e1' and+ e2' = e2' and+ e3' = e3' in + (A.EIfThenElse (e1', e2', e3'), pos) + in + *) + (e', disjoint_union_maps pos [ c1; c2; c3 ]) | D.EAbs ((binder, pos_binder), ts) -> - let vars, body = Bindlib.unmbind binder in - let ctx, lc_vars = ArrayLabels.fold_right vars ~init:(ctx, []) - ~f:(fun var (ctx, lc_vars) -> - - (* we suppose the invariant that when applying a function, its arguments cannot be of the type "option". - - The code should behave correctly in the without this assumption if we put here an is_pure=false, but the types are more compilcated. (unimplemented for now) *) - - let ctx = add_var pos var true ctx in - let lc_var = (find var ctx).var in - ( ctx, lc_var :: lc_vars)) - in - let lc_vars = Array.of_list lc_vars in - - (* here we take the guess that if we cannot build the closure because one of the variable is empty, then we cannot build the function. *) - let new_body, cuts = translate_and_cut ctx body in - let new_binder = Bindlib.bind_mvar lc_vars new_body in - - - (Bindlib.box_apply - (fun new_binder -> A.EAbs ((new_binder, pos_binder), ts), pos) - new_binder, cuts) - + let vars, body = Bindlib.unmbind binder in + let ctx, lc_vars = + ArrayLabels.fold_right vars ~init:(ctx, []) ~f:(fun var (ctx, lc_vars) -> + (* we suppose the invariant that when applying a function, its arguments cannot be of the type "option". + + The code should behave correctly in the without this assumption if we put here an is_pure=false, but the types are more compilcated. (unimplemented for now) *) + let ctx = add_var pos var true ctx in + let lc_var = (find var ctx).var in + (ctx, lc_var :: lc_vars)) + in + let lc_vars = Array.of_list lc_vars in + + (* here we take the guess that if we cannot build the closure because one of the variable is empty, then we cannot build the function. *) + let new_body, cuts = translate_and_cut ctx body in + let new_binder = Bindlib.bind_mvar lc_vars new_body in + + ( Bindlib.box_apply (fun new_binder -> (A.EAbs ((new_binder, pos_binder), ts), pos)) new_binder, + cuts ) | EApp (e1, args) -> (* general case is simple *) let e1', c1 = translate_and_cut ctx e1 in - let args', c_args = args - |> List.map (translate_and_cut ctx) - |> List.split - in + let args', c_args = args |> List.map (translate_and_cut ctx) |> List.split in - let cuts = disjoint_union_maps pos (c1::c_args) in - let e' = Bindlib.box_apply2 (fun e1' args' -> A.EApp (e1', args'), pos) - e1' (Bindlib.box_list args') + let cuts = disjoint_union_maps pos (c1 :: c_args) in + let e' = + Bindlib.box_apply2 + (fun e1' args' -> (A.EApp (e1', args'), pos)) + e1' (Bindlib.box_list args') in (e', cuts) - | ETuple (args, s) -> - let args', c_args = args - |> List.map (translate_and_cut ctx) - |> List.split - in + let args', c_args = args |> List.map (translate_and_cut ctx) |> List.split in - let cuts = disjoint_union_maps pos c_args in - (Bindlib.box_apply (fun args' -> A.ETuple (args', s), pos) (Bindlib.box_list args'), cuts) + let cuts = disjoint_union_maps pos c_args in + (Bindlib.box_apply (fun args' -> (A.ETuple (args', s), pos)) (Bindlib.box_list args'), cuts) | ETupleAccess (e1, i, s, ts) -> - let e1', cuts = translate_and_cut ctx e1 in - let e1' = Bindlib.box_apply - (fun e1' -> A.ETupleAccess (e1', i, s, ts), pos) - e1' - in - (e1', cuts) + let e1', cuts = translate_and_cut ctx e1 in + let e1' = Bindlib.box_apply (fun e1' -> (A.ETupleAccess (e1', i, s, ts), pos)) e1' in + (e1', cuts) | EInj (e1, i, en, ts) -> - let e1', cuts = translate_and_cut ctx e1 in - let e1' = Bindlib.box_apply - (fun e1' -> A.EInj (e1', i, en, ts), pos) - e1' - in - (e1', cuts) + let e1', cuts = translate_and_cut ctx e1 in + let e1' = Bindlib.box_apply (fun e1' -> (A.EInj (e1', i, en, ts), pos)) e1' in + (e1', cuts) | EMatch (e1, cases, en) -> - let e1', c1 = translate_and_cut ctx e1 in - let cases', c_cases = cases - |> List.map (translate_and_cut ctx) - |> List.split - in + let e1', c1 = translate_and_cut ctx e1 in + let cases', c_cases = cases |> List.map (translate_and_cut ctx) |> List.split in - let cuts = disjoint_union_maps pos (c1::c_cases) in - let e' = Bindlib.box_apply2 (fun e1' cases' -> A.EMatch (e1', cases', en), pos) - e1' (Bindlib.box_list cases') + let cuts = disjoint_union_maps pos (c1 :: c_cases) in + let e' = + Bindlib.box_apply2 + (fun e1' cases' -> (A.EMatch (e1', cases', en), pos)) + e1' (Bindlib.box_list cases') in (e', cuts) | EArray es -> - let es', cuts = es - |> List.map (translate_and_cut ctx) - |> List.split - in - - (Bindlib.box_apply (fun es' -> (A.EArray es', pos)) (Bindlib.box_list es'), disjoint_union_maps pos cuts) + let es', cuts = es |> List.map (translate_and_cut ctx) |> List.split in + ( Bindlib.box_apply (fun es' -> (A.EArray es', pos)) (Bindlib.box_list es'), + disjoint_union_maps pos cuts ) | EOp op -> (Bindlib.box (A.EOp op, pos), A.VarMap.empty) -and translate_expr ?(append_esome=true) (ctx: ctx) (e: D.expr Pos.marked) - : (A.expr Pos.marked Bindlib.box) = - let e', cs = translate_and_cut ctx e in - let cs = A.VarMap.bindings cs in - - let _pos = Pos.get_position e in - (* build the cuts *) - - Cli.debug_print @@ Format.asprintf "cut for the expression: [%a]" (Format.pp_print_list pp_var) (List.map fst cs); +and translate_expr ?(append_esome = true) (ctx : ctx) (e : D.expr Pos.marked) : + A.expr Pos.marked Bindlib.box = + let e', cs = translate_and_cut ctx e in + let cs = A.VarMap.bindings cs in - ListLabels.fold_left cs - ~init:(if append_esome then A.make_some e' else e') - ~f:(fun acc (v, (c, pos_c)) -> + let _pos = Pos.get_position e in + (* build the cuts *) + Cli.debug_print + @@ Format.asprintf "cut for the expression: [%a]" (Format.pp_print_list pp_var) (List.map fst cs); - Cli.debug_print @@ Format.asprintf "cut using A.%a" pp_var v; + ListLabels.fold_left cs + ~init:(if append_esome then A.make_some e' else e') + ~f:(fun acc (v, (c, pos_c)) -> + Cli.debug_print @@ Format.asprintf "cut using A.%a" pp_var v; - let c': A.expr Pos.marked Bindlib.box = match c with + let c' : A.expr Pos.marked Bindlib.box = + match c with (* Here we have to handle only the cases appearing in cuts, as defined the [translate_and_cut] function. *) | D.EVar v -> (find ~info:"should never happend" (Pos.unmark v) ctx).expr | D.EDefault (excep, just, cons) -> - let excep' = List.map (translate_expr ctx) excep in - let just' = translate_expr ctx just in - let cons' = translate_expr ctx cons in - (* calls handle_option. *) - A.make_app - (A.make_var (A.handle_default_opt, pos_c)) - [(Bindlib.box_apply (fun excep' -> (A.EArray excep', pos_c)) (Bindlib.box_list excep')); - just'; - cons' - ] - pos_c - - | D.ELit D.LEmptyError -> - A.make_none pos_c - + let excep' = List.map (translate_expr ctx) excep in + let just' = translate_expr ctx just in + let cons' = translate_expr ctx cons in + (* calls handle_option. *) + A.make_app + (A.make_var (A.handle_default_opt, pos_c)) + [ + Bindlib.box_apply (fun excep' -> (A.EArray excep', pos_c)) (Bindlib.box_list excep'); + just'; + cons'; + ] + pos_c + | D.ELit D.LEmptyError -> A.make_none pos_c | D.EAssert arg -> - let arg' = translate_expr ctx arg in - - (* [ - match arg with - | None -> raise NoValueProvided - | Some v -> assert {{ v }} - ] *) - - let silent_var = A.Var.make ("_", pos_c) in - let x = A.Var.make ("assertion_argument", pos_c) in - - A.make_matchopt_dumb arg' - (A.make_abs [| silent_var |] (Bindlib.box (A.ERaise A.NoValueProvided, pos_c)) pos_c [D.TAny, pos_c] pos_c) - (A.make_abs [| x |] (Bindlib.box_apply (fun arg -> A.EAssert arg, pos_c) (A.make_var (x, pos_c))) pos_c [D.TAny, pos_c] pos_c) - - | _ -> Errors.raise_spanned_error "Internal Error: An term was found in a position where it should not be" pos_c - in - - (* [ - match {{ c' }} with - | None -> None - | Some {{ v }} -> {{ acc }} - end - ] *) - - Cli.debug_print @@ Format.asprintf "build matchopt using %a" pp_var v; - A.make_matchopt pos_c v (D.TAny, pos_c) c' (A.make_none pos_c) acc - ) -;; - + let arg' = translate_expr ctx arg in + + (* [ + match arg with + | None -> raise NoValueProvided + | Some v -> assert {{ v }} + ] *) + let silent_var = A.Var.make ("_", pos_c) in + let x = A.Var.make ("assertion_argument", pos_c) in + + A.make_matchopt_dumb arg' + (A.make_abs [| silent_var |] + (Bindlib.box (A.ERaise A.NoValueProvided, pos_c)) + pos_c [ (D.TAny, pos_c) ] pos_c) + (A.make_abs [| x |] + (Bindlib.box_apply (fun arg -> (A.EAssert arg, pos_c)) (A.make_var (x, pos_c))) + pos_c [ (D.TAny, pos_c) ] pos_c) + | _ -> + Errors.raise_spanned_error + "Internal Error: An term was found in a position where it should not be" pos_c + in + (* [ + match {{ c' }} with + | None -> None + | Some {{ v }} -> {{ acc }} + end + ] *) + Cli.debug_print @@ Format.asprintf "build matchopt using %a" pp_var v; + A.make_matchopt pos_c v (D.TAny, pos_c) c' (A.make_none pos_c) acc) type scope_lets = - | Result of D.expr Pos.marked - | ScopeLet of - { - scope_let_kind: D.scope_let_kind; - scope_let_typ: D.typ Pos.marked; - scope_let_expr: D.expr Pos.marked; - scope_let_next: (D.expr, scope_lets) Bindlib.binder; - scope_let_pos: Pos.t; + | Result of D.expr Pos.marked + | ScopeLet of { + scope_let_kind : D.scope_let_kind; + scope_let_typ : D.typ Pos.marked; + scope_let_expr : D.expr Pos.marked; + scope_let_next : (D.expr, scope_lets) Bindlib.binder; + scope_let_pos : Pos.t; } let union = D.VarMap.union (fun _ _ _ -> Some ()) + let rec fv_scope_lets scope_lets = match scope_lets with | Result e -> D.fv e - | ScopeLet {scope_let_expr=e; scope_let_next=next; _} -> - let v, body = Bindlib.unbind next in - union (D.fv e) (D.VarMap.remove v (fv_scope_lets body)) - + | ScopeLet { scope_let_expr = e; scope_let_next = next; _ } -> + let v, body = Bindlib.unbind next in + union (D.fv e) (D.VarMap.remove v (fv_scope_lets body)) type scope_body = { - scope_body_input_struct: D.StructName.t; - scope_body_output_struct: D.StructName.t; - scope_body_result: (D.expr, scope_lets) Bindlib.binder; + scope_body_input_struct : D.StructName.t; + scope_body_output_struct : D.StructName.t; + scope_body_result : (D.expr, scope_lets) Bindlib.binder; } -let fv_scope_body {scope_body_result=binder; _} = +let fv_scope_body { scope_body_result = binder; _ } = let v, body = Bindlib.unbind binder in D.VarMap.remove v (fv_scope_lets body) -let free_vars_scope_body scope_body = - fv_scope_body scope_body - |> D.VarMap.bindings - |> List.map fst - -let translate_and_bind_lets - (acc: scope_lets Bindlib.box) - (scope_let: D.scope_let): scope_lets Bindlib.box = +let free_vars_scope_body scope_body = fv_scope_body scope_body |> D.VarMap.bindings |> List.map fst +let translate_and_bind_lets (acc : scope_lets Bindlib.box) (scope_let : D.scope_let) : + scope_lets Bindlib.box = let pos = snd scope_let.D.scope_let_var in - Cli.debug_print @@ Format.asprintf "binding let %a. Variable occurs = %b" - pp_var (fst scope_let.D.scope_let_var) - (Bindlib.occur (fst scope_let.D.scope_let_var) acc); - + Cli.debug_print + @@ Format.asprintf "binding let %a. Variable occurs = %b" pp_var (fst scope_let.D.scope_let_var) + (Bindlib.occur (fst scope_let.D.scope_let_var) acc); + let binder = Bindlib.bind_var (fst scope_let.D.scope_let_var) acc in - Bindlib.box_apply2 ( - fun expr binder-> - - Cli.debug_print @@ Format.asprintf "free variables in expression: %a" (Format.pp_print_list pp_var) (D.free_vars expr); - ScopeLet { - scope_let_kind=scope_let.D.scope_let_kind; - scope_let_typ=scope_let.D.scope_let_typ; - scope_let_expr=expr; - scope_let_next=binder; - scope_let_pos=pos; - - } - ) scope_let.D.scope_let_expr binder - - -let translate_and_bind (body: D.scope_body) : scope_body Bindlib.box = - - let body_result = ListLabels.fold_right body.D.scope_body_lets - ~init:(Bindlib.box_apply (fun e -> Result e) body.D.scope_body_result) - ~f:(Fun.flip translate_and_bind_lets) + Bindlib.box_apply2 + (fun expr binder -> + Cli.debug_print + @@ Format.asprintf "free variables in expression: %a" (Format.pp_print_list pp_var) + (D.free_vars expr); + ScopeLet + { + scope_let_kind = scope_let.D.scope_let_kind; + scope_let_typ = scope_let.D.scope_let_typ; + scope_let_expr = expr; + scope_let_next = binder; + scope_let_pos = pos; + }) + scope_let.D.scope_let_expr binder + +let translate_and_bind (body : D.scope_body) : scope_body Bindlib.box = + let body_result = + ListLabels.fold_right body.D.scope_body_lets + ~init:(Bindlib.box_apply (fun e -> Result e) body.D.scope_body_result) + ~f:(Fun.flip translate_and_bind_lets) in Cli.debug_print @@ Format.asprintf "binding arg %a" pp_var body.D.scope_body_arg; let scope_body_result = Bindlib.bind_var body.D.scope_body_arg body_result in - Cli.debug_print @@ Format.asprintf "isfinal term is closed: %b" (Bindlib.is_closed scope_body_result); - Bindlib.box_apply (fun scope_body_result -> - Cli.debug_print @@ Format.asprintf "rank of the final term: %i" (Bindlib.binder_rank scope_body_result); - { - scope_body_output_struct=body.D.scope_body_output_struct; - scope_body_input_struct=body.D.scope_body_input_struct; - scope_body_result=scope_body_result; - } - ) scope_body_result - - - + Cli.debug_print + @@ Format.asprintf "isfinal term is closed: %b" (Bindlib.is_closed scope_body_result); + Bindlib.box_apply + (fun scope_body_result -> + Cli.debug_print + @@ Format.asprintf "rank of the final term: %i" (Bindlib.binder_rank scope_body_result); + { + scope_body_output_struct = body.D.scope_body_output_struct; + scope_body_input_struct = body.D.scope_body_input_struct; + scope_body_result; + }) + scope_body_result -let rec translate_scope_let (ctx: ctx) (lets: scope_lets) = +let rec translate_scope_let (ctx : ctx) (lets : scope_lets) = match lets with - | Result e -> - translate_expr ~append_esome:false ctx e - | ScopeLet { - scope_let_kind = kind; - scope_let_typ = typ; - scope_let_expr = expr; - scope_let_next = next; - scope_let_pos = pos; - } -> - - let var_is_pure = match kind with - | DestructuringInputStruct -> false - | ScopeVarDefinition - | SubScopeVarDefinition - | CallingSubScope - | DestructuringSubScopeResults - | Assertion -> true - in - let var, next = Bindlib.unbind next in - Cli.debug_print @@ Format.asprintf "unbinding %a" pp_var var; - let ctx' = add_var pos var var_is_pure ctx in - let new_var = (find ~info:"variable that was just created" var ctx').var in - A.make_let_in new_var typ - (translate_expr ctx ~append_esome:false expr) - (translate_scope_let ctx' next) - -;; - -let translate_scope_body - (scope_pos: Pos.t) - (_decl_ctx: D.decl_ctx) - (ctx: ctx) - (body: scope_body): A.expr Pos.marked Bindlib.box = + | Result e -> translate_expr ~append_esome:false ctx e + | ScopeLet + { + scope_let_kind = kind; + scope_let_typ = typ; + scope_let_expr = expr; + scope_let_next = next; + scope_let_pos = pos; + } -> + let var_is_pure = + match kind with + | DestructuringInputStruct -> false + | ScopeVarDefinition | SubScopeVarDefinition | CallingSubScope + | DestructuringSubScopeResults | Assertion -> + true + in + let var, next = Bindlib.unbind next in + Cli.debug_print @@ Format.asprintf "unbinding %a" pp_var var; + let ctx' = add_var pos var var_is_pure ctx in + let new_var = (find ~info:"variable that was just created" var ctx').var in + A.make_let_in new_var typ + (translate_expr ctx ~append_esome:false expr) + (translate_scope_let ctx' next) + +let translate_scope_body (scope_pos : Pos.t) (_decl_ctx : D.decl_ctx) (ctx : ctx) + (body : scope_body) : A.expr Pos.marked Bindlib.box = match body with - { - scope_body_result=result; - scope_body_input_struct=_input_struct; - scope_body_output_struct=_output_struct; + | { + scope_body_result = result; + scope_body_input_struct = _input_struct; + scope_body_output_struct = _output_struct; } -> - let v, lets = Bindlib.unbind result in + let v, lets = Bindlib.unbind result in - let ctx' = add_var scope_pos v true ctx in + let ctx' = add_var scope_pos v true ctx in - translate_scope_let ctx' lets - - - - - -let translate_program (prgm: D.program) : A.program = + translate_scope_let ctx' lets +let translate_program (prgm : D.program) : A.program = (* modify *) - let decl_ctx = - { - D.ctx_enums = prgm.decl_ctx.ctx_enums |> D.EnumMap.add A.option_enum A.option_enum_config; - D.ctx_structs = prgm.decl_ctx.ctx_structs; - } + let decl_ctx = + { + D.ctx_enums = prgm.decl_ctx.ctx_enums |> D.EnumMap.add A.option_enum A.option_enum_config; + D.ctx_structs = prgm.decl_ctx.ctx_structs; + } in - let scopes = prgm.scopes + let scopes = + prgm.scopes |> ListLabels.fold_left ~init:([], D.VarMap.empty) - ~f:(fun ((acc, ctx) : _ * info D.VarMap.t) (scope_name, n, scope_body) -> - - let scope_body = Bindlib.unbox (translate_and_bind scope_body) in + ~f:(fun ((acc, ctx) : _ * info D.VarMap.t) (scope_name, n, scope_body) -> + let scope_body = Bindlib.unbox (translate_and_bind scope_body) in - Cli.debug_print @@ Format.asprintf "global free variable : %a" - (Format.pp_print_list pp_var) (free_vars_scope_body scope_body); - let new_ctx = add_var Pos.no_pos n true ctx in + Cli.debug_print + @@ Format.asprintf "global free variable : %a" (Format.pp_print_list pp_var) + (free_vars_scope_body scope_body); + let new_ctx = add_var Pos.no_pos n true ctx in - let new_n = find ~info:"variable that was just created" n new_ctx in + let new_n = find ~info:"variable that was just created" n new_ctx in - let scope_pos = Pos.get_position (D.ScopeName.get_info scope_name) in + let scope_pos = Pos.get_position (D.ScopeName.get_info scope_name) in - let new_acc = (new_n, Bindlib.unbox (translate_scope_body scope_pos decl_ctx ctx scope_body)) :: acc in + let new_acc = + (new_n, Bindlib.unbox (translate_scope_body scope_pos decl_ctx ctx scope_body)) :: acc + in - (new_acc, new_ctx) - ) - |> fst - |> List.rev + (new_acc, new_ctx)) + |> fst |> List.rev |> List.map (fun (info, e) -> (info.var, e)) in - {scopes; decl_ctx} + { scopes; decl_ctx } From f8343d1d0c3455de7c37619d11a8efbb902cca79 Mon Sep 17 00:00:00 2001 From: Alain Date: Fri, 4 Feb 2022 12:28:03 +0100 Subject: [PATCH 063/102] cleanup lcalc-ast.ml --- compiler/lcalc/ast.ml | 99 ++++++++++-------------------------------- compiler/lcalc/ast.mli | 21 ++------- 2 files changed, 28 insertions(+), 92 deletions(-) diff --git a/compiler/lcalc/ast.ml b/compiler/lcalc/ast.ml index 73fa2a987..4d772463d 100644 --- a/compiler/lcalc/ast.ml +++ b/compiler/lcalc/ast.ml @@ -26,44 +26,33 @@ type lit = type except = ConflictError | EmptyError | NoValueProvided | Crash [@@deriving show] -let bla _ b fmt x = - let xs, body = Bindlib.unmbind x in - let xs = - xs |> Array.to_list - |> List.map (fun x -> Bindlib.name_of x ^ "_" ^ string_of_int @@ Bindlib.uid_of x) - |> String.concat ", " - in - Format.fprintf fmt "Binder(%a, %a)" Format.pp_print_string xs b body - type expr = - | EVar of - (expr Bindlib.var - [@polyprinter - fun _ fmt x -> Format.fprintf fmt "%s_%d" (Bindlib.name_of x) (Bindlib.uid_of x)]) - Pos.marked - | ETuple of expr Pos.marked list * (D.StructName.t[@opaque]) option + | EVar of expr Bindlib.var Pos.marked + | ETuple of expr Pos.marked list * D.StructName.t option (** The [MarkedString.info] is the former struct field name*) - | ETupleAccess of expr Pos.marked * int * (D.StructName.t[@opaque]) option * D.typ Pos.marked list + | ETupleAccess of expr Pos.marked * int * D.StructName.t option * D.typ Pos.marked list (** The [MarkedString.info] is the former struct field name *) - | EInj of expr Pos.marked * int * (D.EnumName.t[@opaque]) * D.typ Pos.marked list + | EInj of expr Pos.marked * int * D.EnumName.t * D.typ Pos.marked list (** The [MarkedString.info] is the former enum case name *) - | EMatch of expr Pos.marked * expr Pos.marked list * (D.EnumName.t[@opaque]) + | EMatch of expr Pos.marked * expr Pos.marked list * D.EnumName.t (** The [MarkedString.info] is the former enum case name *) | EArray of expr Pos.marked list - | ELit of (lit[@opaque]) + | ELit of lit | EAbs of - ((expr, expr Pos.marked) Bindlib.mbinder[@polyprinter bla]) Pos.marked * D.typ Pos.marked list + (expr, expr Pos.marked) Bindlib.mbinder Pos.marked * D.typ Pos.marked list | EApp of expr Pos.marked * expr Pos.marked list | EAssert of expr Pos.marked | EOp of D.operator | EIfThenElse of expr Pos.marked * expr Pos.marked * expr Pos.marked | ERaise of except | ECatch of expr Pos.marked * except * expr Pos.marked -[@@deriving show] + module Var = struct type t = expr Bindlib.var + let pp fmt x = Format.fprintf fmt "%s_%d" (Bindlib.name_of x) (Bindlib.uid_of x) + let make (s : string Pos.marked) : t = Bindlib.new_var (fun (x : expr Bindlib.var) : expr -> EVar (x, Pos.get_position s)) @@ -90,6 +79,12 @@ let make_app (e : expr Pos.marked Bindlib.box) (u : expr Pos.marked Bindlib.box let make_let_in (x : Var.t) (tau : D.typ Pos.marked) (e1 : expr Pos.marked Bindlib.box) (e2 : expr Pos.marked Bindlib.box) : expr Pos.marked Bindlib.box = let pos = Pos.get_position (Bindlib.unbox e2) in + + if not (Bindlib.occur x e2) then + Cli.debug_print + @@ Format.asprintf "Variable %a is being binded but does not occurs inside the expression." + Var.pp x; + make_app (make_abs (Array.of_list [ x ]) e2 pos [ tau ] pos) [ e1 ] pos let ( let+ ) x f = Bindlib.box_apply f x @@ -119,8 +114,10 @@ let make_some (e : expr Pos.marked Bindlib.box) : expr Pos.marked Bindlib.box = let make_some' (e : expr Pos.marked) : expr = EInj (e, 1, option_enum, []) -(** [make_matchopt_dumb arg e_none e_some] build an expression [match arg with |None -> e_none | Some -> e_some] and requires e_some and e_none to be in the form [EAbs ...].*) -let make_matchopt_dumb (arg : expr Pos.marked Bindlib.box) (e_none : expr Pos.marked Bindlib.box) +(** [make_matchopt_with_abs_arms arg e_none e_some] build an expression + [match arg with |None -> e_none | Some -> e_some] and requires e_some and e_none to be in the + form [EAbs ...].*) +let make_matchopt_with_abs_arms (arg : expr Pos.marked Bindlib.box) (e_none : expr Pos.marked Bindlib.box) (e_some : expr Pos.marked Bindlib.box) : expr Pos.marked Bindlib.box = let pos = Pos.get_position @@ Bindlib.unbox arg in let mark : 'a -> 'a Pos.marked = Pos.mark pos in @@ -129,67 +126,19 @@ let make_matchopt_dumb (arg : expr Pos.marked Bindlib.box) (e_none : expr Pos.ma mark @@ EMatch (arg, [ e_none; e_some ], option_enum) - -(** [make_matchopt pos v tau arg e_none e_some] builds an expression [match arg with | None () -> e_none | Some v -> e_some]. It binds v to e_some, permitting it to be used inside the expression. There is no requirements on the form of both e_some and e_none. *) +(** [make_matchopt pos v tau arg e_none e_some] builds an expression + [match arg with | None () -> e_none | Some v -> e_some]. It binds v to e_some, permitting it to + be used inside the expression. There is no requirements on the form of both e_some and e_none. *) let make_matchopt (pos : Pos.t) (v : Var.t) (tau : D.typ Pos.marked) (arg : expr Pos.marked Bindlib.box) (e_none : expr Pos.marked Bindlib.box) (e_some : expr Pos.marked Bindlib.box) : expr Pos.marked Bindlib.box = (* todo: replace this "unit" variable by the [()] pattern *) let x = Var.make ("unit", pos) in - make_matchopt_dumb arg + make_matchopt_with_abs_arms arg (make_abs (Array.of_list [ x ]) e_none pos [ (D.TLit D.TUnit, pos) ] pos) (make_abs (Array.of_list [ v ]) e_some pos [ tau ] pos) - -let make_matchopt' (pos : Pos.t) (tau : D.typ Pos.marked) (arg : expr Pos.marked Bindlib.box) - (e_none : expr Pos.marked Bindlib.box) - (e_some : expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box) : - expr Pos.marked Bindlib.box = - let x = Var.make ("unit", pos) in - let v = Var.make ("v", pos) in - - make_matchopt_dumb arg - (make_abs (Array.of_list [ x ]) e_none pos [ (D.TLit D.TUnit, pos) ] pos) - (make_abs - (Array.of_list [ v ]) - (e_some - (let+ v = Bindlib.box_var v in - (v, pos))) - pos [ tau ] pos) - - -let make_bindopt (pos : Pos.t) (tau : D.typ Pos.marked) (e1 : expr Pos.marked Bindlib.box) - (e2 : expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box) : expr Pos.marked Bindlib.box - = - make_matchopt' pos tau e1 (make_none pos) e2 - -let make_bindmopt (pos : Pos.t) (taus : D.typ Pos.marked list) - (e1s : expr Pos.marked Bindlib.box list) - (e2s : expr Pos.marked Bindlib.box list -> expr Pos.marked Bindlib.box) : - expr Pos.marked Bindlib.box = - let dummy = Var.make ("unit", pos) in - let vs = List.mapi (fun i _ -> Var.make (Format.sprintf "v_%i" i, pos)) e1s in - - let e1' final = - List.combine (List.combine vs taus) e1s - |> List.fold_left - (fun acc ((x, tau), arg) -> - make_matchopt_dumb arg - (make_abs (Array.of_list [ dummy ]) (make_none pos) pos [ (D.TLit D.TUnit, pos) ] pos) - (make_abs (Array.of_list [ x ]) acc pos [ tau ] pos)) - final - in - - e1' - (make_some - (e2s - (List.map - (fun v -> - let+ v = Bindlib.box_var v in - (v, pos)) - vs))) - let handle_default = Var.make ("handle_default", Pos.no_pos) let handle_default_opt = Var.make ("handle_default_opt", Pos.no_pos) diff --git a/compiler/lcalc/ast.mli b/compiler/lcalc/ast.mli index 228c2dc0a..15350081e 100644 --- a/compiler/lcalc/ast.mli +++ b/compiler/lcalc/ast.mli @@ -44,22 +44,23 @@ type expr = | EMatch of expr Pos.marked * expr Pos.marked list * Dcalc.Ast.EnumName.t (** The [MarkedString.info] is the former enum case name *) | EArray of expr Pos.marked list - | ELit of (lit[@opaque]) + | ELit of lit | EAbs of - ((expr, expr Pos.marked) Bindlib.mbinder[@opaque]) Pos.marked * Dcalc.Ast.typ Pos.marked list + (expr, expr Pos.marked) Bindlib.mbinder Pos.marked * Dcalc.Ast.typ Pos.marked list | EApp of expr Pos.marked * expr Pos.marked list | EAssert of expr Pos.marked | EOp of Dcalc.Ast.operator | EIfThenElse of expr Pos.marked * expr Pos.marked * expr Pos.marked | ERaise of except | ECatch of expr Pos.marked * except * expr Pos.marked -[@@deriving show] (** {1 Variable helpers} *) module Var : sig type t = expr Bindlib.var + val pp : Format.formatter -> t -> unit + val make : string Pos.marked -> t val compare : t -> t -> int @@ -123,22 +124,8 @@ val make_matchopt : (** [e' = make_matchopt'' pos v e e_none e_some] Builds the term corresponding to [match e with | None -> fun () -> e_none |Some -> fun v -> e_some]. *) -val make_bindopt : - Pos.t -> - Dcalc.Ast.typ Pos.marked -> - expr Pos.marked Bindlib.box -> - (expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box) -> - expr Pos.marked Bindlib.box - -val make_bindmopt : - Pos.t -> - Dcalc.Ast.typ Pos.marked list -> - expr Pos.marked Bindlib.box list -> - (expr Pos.marked Bindlib.box list -> expr Pos.marked Bindlib.box) -> - expr Pos.marked Bindlib.box val handle_default : Var.t - val handle_default_opt : Var.t type binder = (expr, expr Pos.marked) Bindlib.binder From 6da5cc518b755d34bdf7a761861a44d9383c95f2 Mon Sep 17 00:00:00 2001 From: Alain Date: Fri, 4 Feb 2022 12:33:26 +0100 Subject: [PATCH 064/102] cleanup dcalc-ast.ml --- compiler/dcalc/ast.ml | 37 ++++++++++++++++++------------------- compiler/dcalc/ast.mli | 8 ++++---- compiler/lcalc/ast.mli | 2 +- 3 files changed, 23 insertions(+), 24 deletions(-) diff --git a/compiler/dcalc/ast.ml b/compiler/dcalc/ast.ml index ec1544f3f..572ed0d3c 100644 --- a/compiler/dcalc/ast.ml +++ b/compiler/dcalc/ast.ml @@ -32,7 +32,7 @@ module EnumConstructor : Uid.Id with type info = Uid.MarkedString.info = module EnumMap : Map.S with type key = EnumName.t = Map.Make (EnumName) -type typ_lit = TBool | TUnit | TInt | TRat | TMoney | TDate | TDuration [@@deriving show] +type typ_lit = TBool | TUnit | TInt | TRat | TMoney | TDate | TDuration type struct_name = StructName.t @@ -40,12 +40,12 @@ type enum_name = EnumName.t type typ = | TLit of typ_lit - | TTuple of typ Pos.marked list * (struct_name[@opaque]) option - | TEnum of typ Pos.marked list * (enum_name[@opaque]) + | TTuple of typ Pos.marked list * (struct_name) option + | TEnum of typ Pos.marked list * (enum_name) | TArrow of typ Pos.marked * typ Pos.marked | TArray of typ Pos.marked | TAny -[@@deriving show] + type date = Runtime.date @@ -67,9 +67,9 @@ type lit = | LDate of date | LDuration of duration -type op_kind = KInt | KRat | KMoney | KDate | KDuration [@@deriving show] +type op_kind = KInt | KRat | KMoney | KDate | KDuration -type ternop = Fold [@@deriving show] +type ternop = Fold type binop = | And @@ -88,39 +88,38 @@ type binop = | Map | Concat | Filter -[@@deriving show] -type log_entry = VarDef of typ | BeginCall | EndCall | PosRecordIfTrueBool [@@deriving show] +type log_entry = VarDef of typ | BeginCall | EndCall | PosRecordIfTrueBool type unop = | Not | Minus of op_kind - | Log of log_entry * (Utils.Uid.MarkedString.info list[@opaque]) + | Log of log_entry * (Utils.Uid.MarkedString.info list) | Length | IntToRat | GetDay | GetMonth | GetYear -[@@deriving show] -type operator = Ternop of ternop | Binop of binop | Unop of unop [@@deriving show] + +type operator = Ternop of ternop | Binop of binop | Unop of unop type expr = - | EVar of (expr Bindlib.var[@opaque]) Pos.marked - | ETuple of expr Pos.marked list * (struct_name[@opaque]) option - | ETupleAccess of expr Pos.marked * int * (struct_name[@opaque]) option * typ Pos.marked list - | EInj of expr Pos.marked * int * (enum_name[@opaque]) * typ Pos.marked list - | EMatch of expr Pos.marked * expr Pos.marked list * (enum_name[@opaque]) + | EVar of (expr Bindlib.var) Pos.marked + | ETuple of expr Pos.marked list * (struct_name) option + | ETupleAccess of expr Pos.marked * int * (struct_name) option * typ Pos.marked list + | EInj of expr Pos.marked * int * (enum_name) * typ Pos.marked list + | EMatch of expr Pos.marked * expr Pos.marked list * (enum_name) | EArray of expr Pos.marked list - | ELit of (lit[@opaque]) - | EAbs of ((expr, expr Pos.marked) Bindlib.mbinder[@opaque]) Pos.marked * typ Pos.marked list + | ELit of (lit) + | EAbs of ((expr, expr Pos.marked) Bindlib.mbinder) Pos.marked * typ Pos.marked list | EApp of expr Pos.marked * expr Pos.marked list | EAssert of expr Pos.marked | EOp of operator | EDefault of expr Pos.marked list * expr Pos.marked * expr Pos.marked | EIfThenElse of expr Pos.marked * expr Pos.marked * expr Pos.marked | ErrorOnEmpty of expr Pos.marked -[@@deriving show] + type struct_ctx = (StructFieldName.t * typ Pos.marked) list StructMap.t diff --git a/compiler/dcalc/ast.mli b/compiler/dcalc/ast.mli index 0a454710e..f18731b78 100644 --- a/compiler/dcalc/ast.mli +++ b/compiler/dcalc/ast.mli @@ -32,7 +32,7 @@ module EnumMap : Map.S with type key = EnumName.t (** {1 Abstract syntax tree} *) -type typ_lit = TBool | TUnit | TInt | TRat | TMoney | TDate | TDuration [@@deriving show] +type typ_lit = TBool | TUnit | TInt | TRat | TMoney | TDate | TDuration type typ = | TLit of typ_lit @@ -41,7 +41,7 @@ type typ = | TArrow of typ Pos.marked * typ Pos.marked | TArray of typ Pos.marked | TAny -[@@deriving show] + type date = Runtime.date @@ -102,7 +102,7 @@ type unop = | GetMonth | GetYear -type operator = Ternop of ternop | Binop of binop | Unop of unop [@@deriving show] +type operator = Ternop of ternop | Binop of binop | Unop of unop (** The expressions use the {{:https://lepigre.fr/ocaml-bindlib/} Bindlib} library, based on higher-order abstract syntax*) @@ -125,7 +125,7 @@ type expr = | EDefault of expr Pos.marked list * expr Pos.marked * expr Pos.marked | EIfThenElse of expr Pos.marked * expr Pos.marked * expr Pos.marked | ErrorOnEmpty of expr Pos.marked -[@@deriving show] + type struct_ctx = (StructFieldName.t * typ Pos.marked) list StructMap.t diff --git a/compiler/lcalc/ast.mli b/compiler/lcalc/ast.mli index 15350081e..f16f6b15a 100644 --- a/compiler/lcalc/ast.mli +++ b/compiler/lcalc/ast.mli @@ -107,7 +107,7 @@ val make_some : expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box val make_some' : expr Pos.marked -> expr -val make_matchopt_dumb : +val make_matchopt_with_abs_arms : expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box -> From 154baefd5ce895339f3d2065bb7a3a2b76861dd3 Mon Sep 17 00:00:00 2001 From: Alain Date: Fri, 4 Feb 2022 14:30:17 +0100 Subject: [PATCH 065/102] runtime fix --- compiler/runtime.ml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/runtime.ml b/compiler/runtime.ml index 07d0ea24f..1409f672a 100644 --- a/compiler/runtime.ml +++ b/compiler/runtime.ml @@ -215,8 +215,7 @@ let handle_default : 'a. (unit -> 'a) array -> (unit -> bool) -> (unit -> 'a) -> in match except with Some x -> x | None -> if just () then cons () else raise EmptyError -let handle_default_opt : 'a. 'a eoption array -> bool eoption -> 'a eoption -> 'a eoption = - fun exceptions just cons -> +let handle_default_opt (exceptions: 'a eoption array) (just: bool eoption) (cons: 'a eoption): 'a eoption = let except = Array.fold_left (fun acc except -> From 08651d33af03980ecd233cafa4c1c53b49a5f3de Mon Sep 17 00:00:00 2001 From: Alain Date: Fri, 4 Feb 2022 14:30:42 +0100 Subject: [PATCH 066/102] better error message in to_ocaml conversion --- compiler/lcalc/to_ocaml.ml | 47 ++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/compiler/lcalc/to_ocaml.ml b/compiler/lcalc/to_ocaml.ml index 7d9b4b69d..6ec260827 100644 --- a/compiler/lcalc/to_ocaml.ml +++ b/compiler/lcalc/to_ocaml.ml @@ -17,18 +17,22 @@ open Ast open Backends module D = Dcalc.Ast - let find_struct s ctx = - try - D.StructMap.find s ctx.D.ctx_structs - with Not_found -> Errors.raise_spanned_error (Format.sprintf "Internal Error: Structure blah was not found in the current environment.") Pos.no_pos - + try D.StructMap.find s ctx.D.ctx_structs + with Not_found -> + let s_name, pos = D.StructName.get_info s in + Errors.raise_spanned_error + (Format.asprintf "Internal Error: Structure %s was not found in the current environment." s_name) + pos + let find_enum en ctx = - try - D.EnumMap.find en ctx.D.ctx_enums + try D.EnumMap.find en ctx.D.ctx_enums with Not_found -> - let en_name, pos = D.EnumName.get_info en in - Errors.raise_spanned_error (Format.sprintf "Internal Error: Enumeration %s was not found in the current environment." en_name) pos + let en_name, pos = D.EnumName.get_info en in + Errors.raise_spanned_error + (Format.asprintf "Internal Error: Enumeration %s was not found in the current environment." + en_name) + pos let format_lit (fmt : Format.formatter) (l : lit Pos.marked) : unit = match Pos.unmark l with @@ -102,8 +106,9 @@ let format_unop (fmt : Format.formatter) (op : Dcalc.Ast.unop Pos.marked) : unit | Minus k -> Format.fprintf fmt "~-%a" format_op_kind k | Not -> Format.fprintf fmt "%s" "not" | Log (_entry, _infos) -> - Errors.raise_spanned_error "Internal error: a log operator has not been caught by the - expression match" (Pos.get_position op) + Errors.raise_spanned_error + "Internal error: a log operator has not been caught by the\n expression match" + (Pos.get_position op) | Length -> Format.fprintf fmt "%s" "array_length" | IntToRat -> Format.fprintf fmt "%s" "decimal_of_integer" | GetDay -> Format.fprintf fmt "%s" "day_of_month_of_date" @@ -181,17 +186,17 @@ let rec format_typ (fmt : Format.formatter) (typ : Dcalc.Ast.typ Pos.marked) : u | TAny -> Format.fprintf fmt "_" let format_var (fmt : Format.formatter) (v : Var.t) : unit = - let lowercase_name = - to_lowercase (to_ascii (Bindlib.name_of v ^ "_" ^ string_of_int (Bindlib.uid_of v))) - in + let lowercase_name = to_lowercase (to_ascii (Bindlib.name_of v)) in let lowercase_name = Re.Pcre.substitute ~rex:(Re.Pcre.regexp "\\.") ~subst:(fun _ -> "_dot_") lowercase_name in let lowercase_name = avoid_keywords (to_ascii lowercase_name) in - if List.mem lowercase_name ["handle_default"; "handle_default_opt"] || Dcalc.Print.begins_with_uppercase (Bindlib.name_of v) then - Format.fprintf fmt "%s" lowercase_name + if + List.mem lowercase_name [ "handle_default"; "handle_default_opt" ] + || Dcalc.Print.begins_with_uppercase (Bindlib.name_of v) + then Format.fprintf fmt "%s" lowercase_name else if lowercase_name = "_" then Format.fprintf fmt "%s" lowercase_name - else Format.fprintf fmt "%s_" lowercase_name + else Format.fprintf fmt "%s_%i_" lowercase_name (Bindlib.uid_of v) let needs_parens (e : expr Pos.marked) : bool = match Pos.unmark e with @@ -282,7 +287,7 @@ let rec format_expr (ctx : Dcalc.Ast.decl_ctx) (fmt : Format.formatter) (e : exp let xs, body = Bindlib.unmbind binder in let xs_tau = List.map2 (fun x tau -> (x, tau)) (Array.to_list xs) taus in let xs_tau_arg = List.map2 (fun (x, tau) arg -> (x, tau, arg)) xs_tau args in - Format.fprintf fmt "%a%a" + Format.fprintf fmt "(%a%a)" (Format.pp_print_list ~pp_sep:(fun fmt () -> Format.fprintf fmt "") (fun fmt (x, tau, arg) -> @@ -425,11 +430,9 @@ let format_ctx (type_ordering : Scopelang.Dependency.TVertex.t list) (fmt : Form (fun struct_or_enum -> match struct_or_enum with | Scopelang.Dependency.TVertex.Struct s -> - Format.fprintf fmt "%a@\n@\n" format_struct_decl - (s, find_struct s ctx) + Format.fprintf fmt "%a@\n@\n" format_struct_decl (s, find_struct s ctx) | Scopelang.Dependency.TVertex.Enum e -> - Format.fprintf fmt "%a@\n@\n" format_enum_decl - (e, find_enum e ctx)) + Format.fprintf fmt "%a@\n@\n" format_enum_decl (e, find_enum e ctx)) (type_ordering @ scope_structs) let format_program (fmt : Format.formatter) (p : Ast.program) From 541d5656ac6a5338973e3d16907badcf7f96f4f0 Mon Sep 17 00:00:00 2001 From: Alain Date: Fri, 4 Feb 2022 14:31:06 +0100 Subject: [PATCH 067/102] print uid too in Lcalc.Print --- compiler/lcalc/print.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/lcalc/print.ml b/compiler/lcalc/print.ml index 6df7a532d..ebb77313a 100644 --- a/compiler/lcalc/print.ml +++ b/compiler/lcalc/print.ml @@ -74,7 +74,7 @@ let needs_parens (e : expr Pos.marked) : bool = match Pos.unmark e with EAbs _ | ETuple (_, Some _) -> true | _ -> false let format_var (fmt : Format.formatter) (v : Var.t) : unit = - Format.fprintf fmt "%s" (Bindlib.name_of v) + Format.fprintf fmt "%s_%d" (Bindlib.name_of v) (Bindlib.uid_of v) let rec format_expr (ctx : Dcalc.Ast.decl_ctx) (fmt : Format.formatter) (e : expr Pos.marked) : unit = From d9fbe4b49923a361ad121ed5a18adf85b1b9314a Mon Sep 17 00:00:00 2001 From: Alain Date: Fri, 4 Feb 2022 14:32:12 +0100 Subject: [PATCH 068/102] use external pp in compile_without_exceptions better error messages fixed make_matchopt_with_abs_arms fixed license few documentation --- compiler/lcalc/compile_without_exceptions.ml | 58 +++++++++---------- compiler/lcalc/compile_without_exceptions.mli | 4 +- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index cb3fb2010..38c6b6761 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -25,22 +25,18 @@ module A = Ast type cuts = D.expr Pos.marked A.VarMap.t (** cuts *) -let pp_var (fmt : Format.formatter) (n : _ Bindlib.var) = - Format.fprintf fmt "%s_%d" (Bindlib.name_of n) (Bindlib.hash_var n) - type info = { expr : A.expr Pos.marked Bindlib.box; var : A.expr Bindlib.var; is_pure : bool } (** information about the Dcalc variable : what is the corresponding LCalc variable; an expression - build correctly using Bindlib, and a boolean indicating whenever the variable should be matched - (false) or not (true). *) + build correctly using Bindlib, and a boolean `is_pure` indicating whenever the variable can be an EmptyError and hence should be matched (false) or if it never can be EmptyError (true). *) type ctx = info D.VarMap.t (** information context about variables in the current scope *) let pp_info (fmt : Format.formatter) (info : info) = - Format.fprintf fmt "{var: %a; is_pure: %b}" pp_var info.var info.is_pure + Format.fprintf fmt "{var: %a; is_pure: %b}" Print.format_var info.var info.is_pure let pp_binding (fmt : Format.formatter) ((v, info) : D.Var.t * info) = - Format.fprintf fmt "%a:%a" pp_var v pp_info info + Format.fprintf fmt "%a:%a" Dcalc.Print.format_var v pp_info info let pp_ctx (fmt : Format.formatter) (ctx : ctx) = let pp_bindings = @@ -48,25 +44,29 @@ let pp_ctx (fmt : Format.formatter) (ctx : ctx) = in Format.fprintf fmt "@[<2>[%a]@]" pp_bindings (D.VarMap.bindings ctx) -let find ?(info = "none") n ctx = +(** [find ~info n ctx] is a warpper to ocaml's Map.find that handle errors in a slightly better way. *) +let find ?(info: string = "none") (n: D.Var.t) (ctx: ctx) : info = let _ = - Format.asprintf "Searching for variable %a inside context %a" pp_var n pp_ctx ctx + Format.asprintf "Searching for variable %a inside context %a" + Dcalc.Print.format_var n pp_ctx ctx |> Cli.debug_print in try D.VarMap.find n ctx with Not_found -> Errors.raise_spanned_error - (Format.sprintf - "Internal Error: Variable %s_%d was not found in the current environment. Additional \ + (Format.asprintf + "Internal Error: Variable %a was not found in the current environment. Additional \ informations : %s." - (Bindlib.name_of n) (Bindlib.uid_of n) info) + Dcalc.Print.format_var n info) Pos.no_pos -let add_var pos var is_pure ctx = +let add_var (pos: Pos.t) (var: D.Var.t) (is_pure: bool) (ctx: ctx) : ctx = let new_var = A.Var.make (Bindlib.name_of var, pos) in let expr = A.make_var (new_var, pos) in - Cli.debug_print @@ Format.asprintf "D.%a |-> A.%a" pp_var var pp_var new_var; + Cli.debug_print @@ Format.asprintf "D.%a |-> A.%a" + Dcalc.Print.format_var var + Print.format_var new_var; D.VarMap.update var (fun _ -> Some { expr; var = new_var; is_pure }) ctx @@ -106,13 +106,13 @@ let rec translate_and_cut (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marke match Pos.unmark e with (* empty-producing/using terms. We cut those. (D.EVar in some cases, EApp(D.EVar _, [ELit LUnit]), EDefault _, ELit LEmptyDefault) I'm unsure about assert. *) | D.EVar v -> - (* todo: for now, we requires there is unpure variables. This can change if the said variable are always present in the tree as thunked. *) + (* todo: for now, every unpure (such that [is_pure] is [false] in the current context) is thunked, hence matched in the next case. This assumption can change in the future, and this case is here for this reason. *) let v, pos_v = v in if not (find ~info:"search for a variable" v ctx).is_pure then begin let v' = A.Var.make (Bindlib.name_of v, pos_v) in Cli.debug_print - @@ Format.asprintf "Found an unpure variable %a, created a variable %a to replace it" pp_var - v pp_var v'; + @@ Format.asprintf "Found an unpure variable %a, created a variable %a to replace it" Dcalc.Print.format_var + v Print.format_var v'; (A.make_var (v', pos), A.VarMap.singleton v' e) end else ((find ~info:"should never happend" v ctx).expr, A.VarMap.empty) @@ -120,8 +120,8 @@ let rec translate_and_cut (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marke if not (find ~info:"search for a variable" v ctx).is_pure then begin let v' = A.Var.make (Bindlib.name_of v, pos_v) in Cli.debug_print - @@ Format.asprintf "Found an unpure variable %a, created a variable %a to replace it" pp_var - v pp_var v'; + @@ Format.asprintf "Found an unpure variable %a, created a variable %a to replace it" Dcalc.Print.format_var + v Print.format_var v'; (A.make_var (v', pos), A.VarMap.singleton v' (D.EVar (v, pos_v), p)) end else @@ -149,7 +149,7 @@ let rec translate_and_cut (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marke let arg' = translate_expr ctx arg in - ( A.make_matchopt_dumb arg' + ( A.make_matchopt_with_abs_arms arg' (A.make_abs [| silent_var |] (Bindlib.box (A.ERaise A.NoValueProvided, pos)) pos [ (D.TAny, pos) ] pos) @@ -244,12 +244,12 @@ and translate_expr ?(append_esome = true) (ctx : ctx) (e : D.expr Pos.marked) : (* build the cuts *) Cli.debug_print - @@ Format.asprintf "cut for the expression: [%a]" (Format.pp_print_list pp_var) (List.map fst cs); + @@ Format.asprintf "cut for the expression: [%a]" (Format.pp_print_list Print.format_var) (List.map fst cs); ListLabels.fold_left cs ~init:(if append_esome then A.make_some e' else e') ~f:(fun acc (v, (c, pos_c)) -> - Cli.debug_print @@ Format.asprintf "cut using A.%a" pp_var v; + Cli.debug_print @@ Format.asprintf "cut using A.%a" Print.format_var v; let c' : A.expr Pos.marked Bindlib.box = match c with @@ -280,7 +280,7 @@ and translate_expr ?(append_esome = true) (ctx : ctx) (e : D.expr Pos.marked) : let silent_var = A.Var.make ("_", pos_c) in let x = A.Var.make ("assertion_argument", pos_c) in - A.make_matchopt_dumb arg' + A.make_matchopt_with_abs_arms arg' (A.make_abs [| silent_var |] (Bindlib.box (A.ERaise A.NoValueProvided, pos_c)) pos_c [ (D.TAny, pos_c) ] pos_c) @@ -298,7 +298,7 @@ and translate_expr ?(append_esome = true) (ctx : ctx) (e : D.expr Pos.marked) : | Some {{ v }} -> {{ acc }} end ] *) - Cli.debug_print @@ Format.asprintf "build matchopt using %a" pp_var v; + Cli.debug_print @@ Format.asprintf "build matchopt using %a" Print.format_var v; A.make_matchopt pos_c v (D.TAny, pos_c) c' (A.make_none pos_c) acc) type scope_lets = @@ -337,14 +337,14 @@ let translate_and_bind_lets (acc : scope_lets Bindlib.box) (scope_let : D.scope_ let pos = snd scope_let.D.scope_let_var in Cli.debug_print - @@ Format.asprintf "binding let %a. Variable occurs = %b" pp_var (fst scope_let.D.scope_let_var) + @@ Format.asprintf "binding let %a. Variable occurs = %b" Dcalc.Print.format_var (fst scope_let.D.scope_let_var) (Bindlib.occur (fst scope_let.D.scope_let_var) acc); let binder = Bindlib.bind_var (fst scope_let.D.scope_let_var) acc in Bindlib.box_apply2 (fun expr binder -> Cli.debug_print - @@ Format.asprintf "free variables in expression: %a" (Format.pp_print_list pp_var) + @@ Format.asprintf "free variables in expression: %a" (Format.pp_print_list Dcalc.Print.format_var) (D.free_vars expr); ScopeLet { @@ -363,7 +363,7 @@ let translate_and_bind (body : D.scope_body) : scope_body Bindlib.box = ~f:(Fun.flip translate_and_bind_lets) in - Cli.debug_print @@ Format.asprintf "binding arg %a" pp_var body.D.scope_body_arg; + Cli.debug_print @@ Format.asprintf "binding arg %a" Dcalc.Print.format_var body.D.scope_body_arg; let scope_body_result = Bindlib.bind_var body.D.scope_body_arg body_result in Cli.debug_print @@ -398,7 +398,7 @@ let rec translate_scope_let (ctx : ctx) (lets : scope_lets) = true in let var, next = Bindlib.unbind next in - Cli.debug_print @@ Format.asprintf "unbinding %a" pp_var var; + Cli.debug_print @@ Format.asprintf "unbinding %a" Dcalc.Print.format_var var; let ctx' = add_var pos var var_is_pure ctx in let new_var = (find ~info:"variable that was just created" var ctx').var in A.make_let_in new_var typ @@ -435,7 +435,7 @@ let translate_program (prgm : D.program) : A.program = let scope_body = Bindlib.unbox (translate_and_bind scope_body) in Cli.debug_print - @@ Format.asprintf "global free variable : %a" (Format.pp_print_list pp_var) + @@ Format.asprintf "global free variable : %a" (Format.pp_print_list Dcalc.Print.format_var) (free_vars_scope_body scope_body); let new_ctx = add_var Pos.no_pos n true ctx in diff --git a/compiler/lcalc/compile_without_exceptions.mli b/compiler/lcalc/compile_without_exceptions.mli index 6e4acf406..664c6f922 100644 --- a/compiler/lcalc/compile_without_exceptions.mli +++ b/compiler/lcalc/compile_without_exceptions.mli @@ -1,6 +1,6 @@ (* This file is part of the Catala compiler, a specification language for tax and social benefits - computation rules. Copyright (C) 2020 Inria, contributor: Denis Merigoux - + computation rules. Copyright (C) 2020 Inria, contributor: Alain Delaët-Tixeuil + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at From 02187b4bc7985583cc47bc036c7494c1ff3f3358 Mon Sep 17 00:00:00 2001 From: Alain Date: Fri, 4 Feb 2022 14:53:47 +0100 Subject: [PATCH 069/102] removed useless file --- compiler/dcalc/implementing defaults | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 compiler/dcalc/implementing defaults diff --git a/compiler/dcalc/implementing defaults b/compiler/dcalc/implementing defaults deleted file mode 100644 index de6c49abd..000000000 --- a/compiler/dcalc/implementing defaults +++ /dev/null @@ -1,7 +0,0 @@ -implementing options translation - -practical issues: - * bindlib code is hard to read without let+. - * type inference is not implemented for lcalc terms. So i will need to go inside dcalc terms. - * manipulating lets requires types - * lets are use everywhere inside the translation From 6ad948ed76c59ee6ccdf087f8a95b17f6ff1ec57 Mon Sep 17 00:00:00 2001 From: Alain Date: Fri, 4 Feb 2022 15:13:28 +0100 Subject: [PATCH 070/102] more cleanup in lcalc-ast --- compiler/lcalc/ast.ml | 10 +--------- compiler/lcalc/ast.mli | 2 -- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/compiler/lcalc/ast.ml b/compiler/lcalc/ast.ml index 4d772463d..aff6e43e1 100644 --- a/compiler/lcalc/ast.ml +++ b/compiler/lcalc/ast.ml @@ -51,8 +51,6 @@ type expr = module Var = struct type t = expr Bindlib.var - let pp fmt x = Format.fprintf fmt "%s_%d" (Bindlib.name_of x) (Bindlib.uid_of x) - let make (s : string Pos.marked) : t = Bindlib.new_var (fun (x : expr Bindlib.var) : expr -> EVar (x, Pos.get_position s)) @@ -80,11 +78,6 @@ let make_let_in (x : Var.t) (tau : D.typ Pos.marked) (e1 : expr Pos.marked Bindl (e2 : expr Pos.marked Bindlib.box) : expr Pos.marked Bindlib.box = let pos = Pos.get_position (Bindlib.unbox e2) in - if not (Bindlib.occur x e2) then - Cli.debug_print - @@ Format.asprintf "Variable %a is being binded but does not occurs inside the expression." - Var.pp x; - make_app (make_abs (Array.of_list [ x ]) e2 pos [ tau ] pos) [ e1 ] pos let ( let+ ) x f = Bindlib.box_apply f x @@ -132,8 +125,7 @@ let make_matchopt_with_abs_arms (arg : expr Pos.marked Bindlib.box) (e_none : ex let make_matchopt (pos : Pos.t) (v : Var.t) (tau : D.typ Pos.marked) (arg : expr Pos.marked Bindlib.box) (e_none : expr Pos.marked Bindlib.box) (e_some : expr Pos.marked Bindlib.box) : expr Pos.marked Bindlib.box = - (* todo: replace this "unit" variable by the [()] pattern *) - let x = Var.make ("unit", pos) in + let x = Var.make ("_", pos) in make_matchopt_with_abs_arms arg (make_abs (Array.of_list [ x ]) e_none pos [ (D.TLit D.TUnit, pos) ] pos) diff --git a/compiler/lcalc/ast.mli b/compiler/lcalc/ast.mli index f16f6b15a..21df1cba5 100644 --- a/compiler/lcalc/ast.mli +++ b/compiler/lcalc/ast.mli @@ -59,8 +59,6 @@ type expr = module Var : sig type t = expr Bindlib.var - val pp : Format.formatter -> t -> unit - val make : string Pos.marked -> t val compare : t -> t -> int From a06dfbfaa51880de5d0e6d470a242d6ceb27c6b6 Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Fri, 4 Feb 2022 15:29:31 +0100 Subject: [PATCH 071/102] Assets and formatting --- compiler/dcalc/ast.ml | 23 +- compiler/dcalc/ast.mli | 2 - compiler/lcalc/ast.ml | 9 +- compiler/lcalc/ast.mli | 5 +- compiler/lcalc/compile_without_exceptions.ml | 89 +- compiler/lcalc/compile_without_exceptions.mli | 2 +- compiler/lcalc/optimizations.ml | 61 +- compiler/lcalc/to_ocaml.ml | 3 +- compiler/runtime.ml | 3 +- compiler/utils/dune | 3 +- compiler/utils/pos.ml | 5 +- compiler/utils/pos.mli | 6 +- french_law/js/french_law.js | 5200 ++++++----- .../law_source/allocations_familiales.ml | 8129 ++++++++-------- .../python/src/allocations_familiales.py | 8236 +++++++++-------- 15 files changed, 11681 insertions(+), 10095 deletions(-) diff --git a/compiler/dcalc/ast.ml b/compiler/dcalc/ast.ml index 572ed0d3c..4ee91e7f0 100644 --- a/compiler/dcalc/ast.ml +++ b/compiler/dcalc/ast.ml @@ -40,13 +40,12 @@ type enum_name = EnumName.t type typ = | TLit of typ_lit - | TTuple of typ Pos.marked list * (struct_name) option - | TEnum of typ Pos.marked list * (enum_name) + | TTuple of typ Pos.marked list * struct_name option + | TEnum of typ Pos.marked list * enum_name | TArrow of typ Pos.marked * typ Pos.marked | TArray of typ Pos.marked | TAny - type date = Runtime.date type duration = Runtime.duration @@ -94,25 +93,24 @@ type log_entry = VarDef of typ | BeginCall | EndCall | PosRecordIfTrueBool type unop = | Not | Minus of op_kind - | Log of log_entry * (Utils.Uid.MarkedString.info list) + | Log of log_entry * Utils.Uid.MarkedString.info list | Length | IntToRat | GetDay | GetMonth | GetYear - type operator = Ternop of ternop | Binop of binop | Unop of unop type expr = - | EVar of (expr Bindlib.var) Pos.marked - | ETuple of expr Pos.marked list * (struct_name) option - | ETupleAccess of expr Pos.marked * int * (struct_name) option * typ Pos.marked list - | EInj of expr Pos.marked * int * (enum_name) * typ Pos.marked list - | EMatch of expr Pos.marked * expr Pos.marked list * (enum_name) + | EVar of expr Bindlib.var Pos.marked + | ETuple of expr Pos.marked list * struct_name option + | ETupleAccess of expr Pos.marked * int * struct_name option * typ Pos.marked list + | EInj of expr Pos.marked * int * enum_name * typ Pos.marked list + | EMatch of expr Pos.marked * expr Pos.marked list * enum_name | EArray of expr Pos.marked list - | ELit of (lit) - | EAbs of ((expr, expr Pos.marked) Bindlib.mbinder) Pos.marked * typ Pos.marked list + | ELit of lit + | EAbs of (expr, expr Pos.marked) Bindlib.mbinder Pos.marked * typ Pos.marked list | EApp of expr Pos.marked * expr Pos.marked list | EAssert of expr Pos.marked | EOp of operator @@ -120,7 +118,6 @@ type expr = | EIfThenElse of expr Pos.marked * expr Pos.marked * expr Pos.marked | ErrorOnEmpty of expr Pos.marked - type struct_ctx = (StructFieldName.t * typ Pos.marked) list StructMap.t type enum_ctx = (EnumConstructor.t * typ Pos.marked) list EnumMap.t diff --git a/compiler/dcalc/ast.mli b/compiler/dcalc/ast.mli index f18731b78..85dc9eb40 100644 --- a/compiler/dcalc/ast.mli +++ b/compiler/dcalc/ast.mli @@ -42,7 +42,6 @@ type typ = | TArray of typ Pos.marked | TAny - type date = Runtime.date type duration = Runtime.duration @@ -126,7 +125,6 @@ type expr = | EIfThenElse of expr Pos.marked * expr Pos.marked * expr Pos.marked | ErrorOnEmpty of expr Pos.marked - type struct_ctx = (StructFieldName.t * typ Pos.marked) list StructMap.t type enum_ctx = (EnumConstructor.t * typ Pos.marked) list EnumMap.t diff --git a/compiler/lcalc/ast.ml b/compiler/lcalc/ast.ml index aff6e43e1..cd14fac49 100644 --- a/compiler/lcalc/ast.ml +++ b/compiler/lcalc/ast.ml @@ -38,8 +38,7 @@ type expr = (** The [MarkedString.info] is the former enum case name *) | EArray of expr Pos.marked list | ELit of lit - | EAbs of - (expr, expr Pos.marked) Bindlib.mbinder Pos.marked * D.typ Pos.marked list + | EAbs of (expr, expr Pos.marked) Bindlib.mbinder Pos.marked * D.typ Pos.marked list | EApp of expr Pos.marked * expr Pos.marked list | EAssert of expr Pos.marked | EOp of D.operator @@ -47,7 +46,6 @@ type expr = | ERaise of except | ECatch of expr Pos.marked * except * expr Pos.marked - module Var = struct type t = expr Bindlib.var @@ -110,8 +108,9 @@ let make_some' (e : expr Pos.marked) : expr = EInj (e, 1, option_enum, []) (** [make_matchopt_with_abs_arms arg e_none e_some] build an expression [match arg with |None -> e_none | Some -> e_some] and requires e_some and e_none to be in the form [EAbs ...].*) -let make_matchopt_with_abs_arms (arg : expr Pos.marked Bindlib.box) (e_none : expr Pos.marked Bindlib.box) - (e_some : expr Pos.marked Bindlib.box) : expr Pos.marked Bindlib.box = +let make_matchopt_with_abs_arms (arg : expr Pos.marked Bindlib.box) + (e_none : expr Pos.marked Bindlib.box) (e_some : expr Pos.marked Bindlib.box) : + expr Pos.marked Bindlib.box = let pos = Pos.get_position @@ Bindlib.unbox arg in let mark : 'a -> 'a Pos.marked = Pos.mark pos in diff --git a/compiler/lcalc/ast.mli b/compiler/lcalc/ast.mli index 21df1cba5..2d484a3d4 100644 --- a/compiler/lcalc/ast.mli +++ b/compiler/lcalc/ast.mli @@ -45,8 +45,7 @@ type expr = (** The [MarkedString.info] is the former enum case name *) | EArray of expr Pos.marked list | ELit of lit - | EAbs of - (expr, expr Pos.marked) Bindlib.mbinder Pos.marked * Dcalc.Ast.typ Pos.marked list + | EAbs of (expr, expr Pos.marked) Bindlib.mbinder Pos.marked * Dcalc.Ast.typ Pos.marked list | EApp of expr Pos.marked * expr Pos.marked list | EAssert of expr Pos.marked | EOp of Dcalc.Ast.operator @@ -122,8 +121,8 @@ val make_matchopt : (** [e' = make_matchopt'' pos v e e_none e_some] Builds the term corresponding to [match e with | None -> fun () -> e_none |Some -> fun v -> e_some]. *) - val handle_default : Var.t + val handle_default_opt : Var.t type binder = (expr, expr Pos.marked) Bindlib.binder diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index 38c6b6761..e11c74925 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -27,7 +27,8 @@ type cuts = D.expr Pos.marked A.VarMap.t type info = { expr : A.expr Pos.marked Bindlib.box; var : A.expr Bindlib.var; is_pure : bool } (** information about the Dcalc variable : what is the corresponding LCalc variable; an expression - build correctly using Bindlib, and a boolean `is_pure` indicating whenever the variable can be an EmptyError and hence should be matched (false) or if it never can be EmptyError (true). *) + build correctly using Bindlib, and a boolean `is_pure` indicating whenever the variable can be + an EmptyError and hence should be matched (false) or if it never can be EmptyError (true). *) type ctx = info D.VarMap.t (** information context about variables in the current scope *) @@ -45,10 +46,10 @@ let pp_ctx (fmt : Format.formatter) (ctx : ctx) = Format.fprintf fmt "@[<2>[%a]@]" pp_bindings (D.VarMap.bindings ctx) (** [find ~info n ctx] is a warpper to ocaml's Map.find that handle errors in a slightly better way. *) -let find ?(info: string = "none") (n: D.Var.t) (ctx: ctx) : info = +let find ?(info : string = "none") (n : D.Var.t) (ctx : ctx) : info = let _ = - Format.asprintf "Searching for variable %a inside context %a" - Dcalc.Print.format_var n pp_ctx ctx + Format.asprintf "Searching for variable %a inside context %a" Dcalc.Print.format_var n pp_ctx + ctx |> Cli.debug_print in try D.VarMap.find n ctx @@ -60,13 +61,12 @@ let find ?(info: string = "none") (n: D.Var.t) (ctx: ctx) : info = Dcalc.Print.format_var n info) Pos.no_pos -let add_var (pos: Pos.t) (var: D.Var.t) (is_pure: bool) (ctx: ctx) : ctx = +let add_var (pos : Pos.t) (var : D.Var.t) (is_pure : bool) (ctx : ctx) : ctx = let new_var = A.Var.make (Bindlib.name_of var, pos) in let expr = A.make_var (new_var, pos) in - Cli.debug_print @@ Format.asprintf "D.%a |-> A.%a" - Dcalc.Print.format_var var - Print.format_var new_var; + Cli.debug_print + @@ Format.asprintf "D.%a |-> A.%a" Dcalc.Print.format_var var Print.format_var new_var; D.VarMap.update var (fun _ -> Some { expr; var = new_var; is_pure }) ctx @@ -104,15 +104,18 @@ let rec translate_and_cut (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marke = let pos = Pos.get_position e in match Pos.unmark e with - (* empty-producing/using terms. We cut those. (D.EVar in some cases, EApp(D.EVar _, [ELit LUnit]), EDefault _, ELit LEmptyDefault) I'm unsure about assert. *) + (* empty-producing/using terms. We cut those. (D.EVar in some cases, EApp(D.EVar _, [ELit LUnit]), + EDefault _, ELit LEmptyDefault) I'm unsure about assert. *) | D.EVar v -> - (* todo: for now, every unpure (such that [is_pure] is [false] in the current context) is thunked, hence matched in the next case. This assumption can change in the future, and this case is here for this reason. *) + (* todo: for now, every unpure (such that [is_pure] is [false] in the current context) is + thunked, hence matched in the next case. This assumption can change in the future, and this + case is here for this reason. *) let v, pos_v = v in if not (find ~info:"search for a variable" v ctx).is_pure then begin let v' = A.Var.make (Bindlib.name_of v, pos_v) in Cli.debug_print - @@ Format.asprintf "Found an unpure variable %a, created a variable %a to replace it" Dcalc.Print.format_var - v Print.format_var v'; + @@ Format.asprintf "Found an unpure variable %a, created a variable %a to replace it" + Dcalc.Print.format_var v Print.format_var v'; (A.make_var (v', pos), A.VarMap.singleton v' e) end else ((find ~info:"should never happend" v ctx).expr, A.VarMap.empty) @@ -120,8 +123,8 @@ let rec translate_and_cut (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marke if not (find ~info:"search for a variable" v ctx).is_pure then begin let v' = A.Var.make (Bindlib.name_of v, pos_v) in Cli.debug_print - @@ Format.asprintf "Found an unpure variable %a, created a variable %a to replace it" Dcalc.Print.format_var - v Print.format_var v'; + @@ Format.asprintf "Found an unpure variable %a, created a variable %a to replace it" + Dcalc.Print.format_var v Print.format_var v'; (A.make_var (v', pos), A.VarMap.singleton v' (D.EVar (v, pos_v), p)) end else @@ -134,16 +137,14 @@ let rec translate_and_cut (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marke let v' = A.Var.make ("empty_litteral", pos) in (A.make_var (v', pos), A.VarMap.singleton v' e) | D.EAssert _ -> - (* as discuted, if the value in an assertion is empty, an error should the raised. This beavior is different from the ICFP paper. *) + (* as discuted, if the value in an assertion is empty, an error should the raised. This + beavior is different from the ICFP paper. *) let v' = A.Var.make ("assertion_value", pos) in (A.make_var (v', pos), A.VarMap.singleton v' e) - (* This one is a very special case. It transform an unpure expression environement to a pure expression. *) + (* This one is a very special case. It transform an unpure expression environement to a pure + expression. *) | ErrorOnEmpty arg -> - (* [ - match arg with - | None -> raise NoValueProvided - | Some v -> {{ v }} - ] *) + (* [ match arg with | None -> raise NoValueProvided | Some v -> {{ v }} ] *) let silent_var = A.Var.make ("_", pos) in let x = A.Var.make ("non_empty_argument", pos) in @@ -166,27 +167,26 @@ let rec translate_and_cut (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marke Bindlib.box_apply3 (fun e1' e2' e3' -> (A.EIfThenElse (e1', e2', e3'), pos)) e1' e2' e3' in - (*(* equivalent code : *) - let e' = - let+ e1' = e1' and+ e2' = e2' and+ e3' = e3' in - (A.EIfThenElse (e1', e2', e3'), pos) - in - *) + (*(* equivalent code : *) let e' = let+ e1' = e1' and+ e2' = e2' and+ e3' = e3' in + (A.EIfThenElse (e1', e2', e3'), pos) in *) (e', disjoint_union_maps pos [ c1; c2; c3 ]) | D.EAbs ((binder, pos_binder), ts) -> let vars, body = Bindlib.unmbind binder in let ctx, lc_vars = ArrayLabels.fold_right vars ~init:(ctx, []) ~f:(fun var (ctx, lc_vars) -> - (* we suppose the invariant that when applying a function, its arguments cannot be of the type "option". + (* we suppose the invariant that when applying a function, its arguments cannot be of + the type "option". - The code should behave correctly in the without this assumption if we put here an is_pure=false, but the types are more compilcated. (unimplemented for now) *) + The code should behave correctly in the without this assumption if we put here an + is_pure=false, but the types are more compilcated. (unimplemented for now) *) let ctx = add_var pos var true ctx in let lc_var = (find var ctx).var in (ctx, lc_var :: lc_vars)) in let lc_vars = Array.of_list lc_vars in - (* here we take the guess that if we cannot build the closure because one of the variable is empty, then we cannot build the function. *) + (* here we take the guess that if we cannot build the closure because one of the variable is + empty, then we cannot build the function. *) let new_body, cuts = translate_and_cut ctx body in let new_binder = Bindlib.bind_mvar lc_vars new_body in @@ -244,7 +244,9 @@ and translate_expr ?(append_esome = true) (ctx : ctx) (e : D.expr Pos.marked) : (* build the cuts *) Cli.debug_print - @@ Format.asprintf "cut for the expression: [%a]" (Format.pp_print_list Print.format_var) (List.map fst cs); + @@ Format.asprintf "cut for the expression: [%a]" + (Format.pp_print_list Print.format_var) + (List.map fst cs); ListLabels.fold_left cs ~init:(if append_esome then A.make_some e' else e') @@ -253,7 +255,8 @@ and translate_expr ?(append_esome = true) (ctx : ctx) (e : D.expr Pos.marked) : let c' : A.expr Pos.marked Bindlib.box = match c with - (* Here we have to handle only the cases appearing in cuts, as defined the [translate_and_cut] function. *) + (* Here we have to handle only the cases appearing in cuts, as defined the + [translate_and_cut] function. *) | D.EVar v -> (find ~info:"should never happend" (Pos.unmark v) ctx).expr | D.EDefault (excep, just, cons) -> let excep' = List.map (translate_expr ctx) excep in @@ -272,11 +275,7 @@ and translate_expr ?(append_esome = true) (ctx : ctx) (e : D.expr Pos.marked) : | D.EAssert arg -> let arg' = translate_expr ctx arg in - (* [ - match arg with - | None -> raise NoValueProvided - | Some v -> assert {{ v }} - ] *) + (* [ match arg with | None -> raise NoValueProvided | Some v -> assert {{ v }} ] *) let silent_var = A.Var.make ("_", pos_c) in let x = A.Var.make ("assertion_argument", pos_c) in @@ -292,12 +291,7 @@ and translate_expr ?(append_esome = true) (ctx : ctx) (e : D.expr Pos.marked) : "Internal Error: An term was found in a position where it should not be" pos_c in - (* [ - match {{ c' }} with - | None -> None - | Some {{ v }} -> {{ acc }} - end - ] *) + (* [ match {{ c' }} with | None -> None | Some {{ v }} -> {{ acc }} end ] *) Cli.debug_print @@ Format.asprintf "build matchopt using %a" Print.format_var v; A.make_matchopt pos_c v (D.TAny, pos_c) c' (A.make_none pos_c) acc) @@ -337,14 +331,16 @@ let translate_and_bind_lets (acc : scope_lets Bindlib.box) (scope_let : D.scope_ let pos = snd scope_let.D.scope_let_var in Cli.debug_print - @@ Format.asprintf "binding let %a. Variable occurs = %b" Dcalc.Print.format_var (fst scope_let.D.scope_let_var) + @@ Format.asprintf "binding let %a. Variable occurs = %b" Dcalc.Print.format_var + (fst scope_let.D.scope_let_var) (Bindlib.occur (fst scope_let.D.scope_let_var) acc); let binder = Bindlib.bind_var (fst scope_let.D.scope_let_var) acc in Bindlib.box_apply2 (fun expr binder -> Cli.debug_print - @@ Format.asprintf "free variables in expression: %a" (Format.pp_print_list Dcalc.Print.format_var) + @@ Format.asprintf "free variables in expression: %a" + (Format.pp_print_list Dcalc.Print.format_var) (D.free_vars expr); ScopeLet { @@ -435,7 +431,8 @@ let translate_program (prgm : D.program) : A.program = let scope_body = Bindlib.unbox (translate_and_bind scope_body) in Cli.debug_print - @@ Format.asprintf "global free variable : %a" (Format.pp_print_list Dcalc.Print.format_var) + @@ Format.asprintf "global free variable : %a" + (Format.pp_print_list Dcalc.Print.format_var) (free_vars_scope_body scope_body); let new_ctx = add_var Pos.no_pos n true ctx in diff --git a/compiler/lcalc/compile_without_exceptions.mli b/compiler/lcalc/compile_without_exceptions.mli index 664c6f922..61c6b7250 100644 --- a/compiler/lcalc/compile_without_exceptions.mli +++ b/compiler/lcalc/compile_without_exceptions.mli @@ -1,6 +1,6 @@ (* This file is part of the Catala compiler, a specification language for tax and social benefits computation rules. Copyright (C) 2020 Inria, contributor: Alain Delaët-Tixeuil - + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/compiler/lcalc/optimizations.ml b/compiler/lcalc/optimizations.ml index b8a04266b..b5aae1e39 100644 --- a/compiler/lcalc/optimizations.ml +++ b/compiler/lcalc/optimizations.ml @@ -18,10 +18,8 @@ let ( let+ ) x f = Bindlib.box_apply f x let ( and+ ) x y = Bindlib.box_pair x y -let visitor_map - (t : 'a -> expr Pos.marked -> expr Pos.marked Bindlib.box) - (ctx : 'a) - (e : expr Pos.marked) : expr Pos.marked Bindlib.box = +let visitor_map (t : 'a -> expr Pos.marked -> expr Pos.marked Bindlib.box) (ctx : 'a) + (e : expr Pos.marked) : expr Pos.marked Bindlib.box = (* calls [t ctx] on every direct childs of [e], then rebuild an abstract syntax tree modified. Used in other transformations. *) let default_mark e' = Pos.same_pos_as e' e in @@ -67,43 +65,39 @@ let rec iota_expr (_ : unit) (e : expr Pos.marked) : expr Pos.marked Bindlib.box let default_mark e' = Pos.mark (Pos.get_position e) e' in match Pos.unmark e with | EMatch ((EInj (e1, i, n', _ts), _), cases, n) when Dcalc.Ast.EnumName.compare n n' = 0 -> - let+ e1 = visitor_map iota_expr () e1 and+ case = visitor_map iota_expr () (List.nth cases i) in + let+ e1 = visitor_map iota_expr () e1 + and+ case = visitor_map iota_expr () (List.nth cases i) in default_mark @@ EApp (case, [ e1 ]) - - | EMatch (e', cases, n) when begin - cases - |> List.mapi (fun i (case, _pos) -> - match case with - | EInj (_ei, i', n', _ts') -> - i = i' && (* n = n' *) (Dcalc.Ast.EnumName.compare n n' = 0) - | _ -> false - ) - |> List.for_all Fun.id - end -> - visitor_map iota_expr () e' - + | EMatch (e', cases, n) + when begin + cases + |> List.mapi (fun i (case, _pos) -> + match case with + | EInj (_ei, i', n', _ts') -> + i = i' && (* n = n' *) Dcalc.Ast.EnumName.compare n n' = 0 + | _ -> false) + |> List.for_all Fun.id + end -> + visitor_map iota_expr () e' | _ -> visitor_map iota_expr () e - -let rec beta_expr (_: unit) (e: expr Pos.marked): expr Pos.marked Bindlib.box = +let rec beta_expr (_ : unit) (e : expr Pos.marked) : expr Pos.marked Bindlib.box = let default_mark e' = Pos.same_pos_as e' e in match Pos.unmark e with - | EApp (e1, args) -> - let+ e1 = visitor_map beta_expr () e1 - and+ args = List.map (visitor_map beta_expr ()) args |> Bindlib.box_list in - begin match Pos.unmark e1 with - | EAbs ((binder, _pos_binder), _ts) -> - let _ : (_, _) Bindlib.mbinder = binder in - Bindlib.msubst binder (List.map fst args |> Array.of_list) - | _ -> - default_mark @@ EApp (e1, args) - end + | EApp (e1, args) -> ( + let+ e1 = visitor_map beta_expr () e1 + and+ args = List.map (visitor_map beta_expr ()) args |> Bindlib.box_list in + match Pos.unmark e1 with + | EAbs ((binder, _pos_binder), _ts) -> + let (_ : (_, _) Bindlib.mbinder) = binder in + Bindlib.msubst binder (List.map fst args |> Array.of_list) + | _ -> default_mark @@ EApp (e1, args)) | _ -> visitor_map beta_expr () e let iota_optimizations (p : program) : program = { p with scopes = List.map (fun (var, e) -> (var, Bindlib.unbox (iota_expr () e))) p.scopes } -let _beta_optimizations (p: program): program = +let _beta_optimizations (p : program) : program = { p with scopes = List.map (fun (var, e) -> (var, Bindlib.unbox (beta_expr () e))) p.scopes } let rec peephole_expr (_ : unit) (e : expr Pos.marked) : expr Pos.marked Bindlib.box = @@ -123,7 +117,4 @@ let rec peephole_expr (_ : unit) (e : expr Pos.marked) : expr Pos.marked Bindlib let peephole_optimizations (p : program) : program = { p with scopes = List.map (fun (var, e) -> (var, Bindlib.unbox (peephole_expr () e))) p.scopes } -let optimize_program (p : program) : program = - p - |> iota_optimizations - |> peephole_optimizations +let optimize_program (p : program) : program = p |> iota_optimizations |> peephole_optimizations diff --git a/compiler/lcalc/to_ocaml.ml b/compiler/lcalc/to_ocaml.ml index 6ec260827..353794926 100644 --- a/compiler/lcalc/to_ocaml.ml +++ b/compiler/lcalc/to_ocaml.ml @@ -22,7 +22,8 @@ let find_struct s ctx = with Not_found -> let s_name, pos = D.StructName.get_info s in Errors.raise_spanned_error - (Format.asprintf "Internal Error: Structure %s was not found in the current environment." s_name) + (Format.asprintf "Internal Error: Structure %s was not found in the current environment." + s_name) pos let find_enum en ctx = diff --git a/compiler/runtime.ml b/compiler/runtime.ml index 1409f672a..2537b6b4a 100644 --- a/compiler/runtime.ml +++ b/compiler/runtime.ml @@ -215,7 +215,8 @@ let handle_default : 'a. (unit -> 'a) array -> (unit -> bool) -> (unit -> 'a) -> in match except with Some x -> x | None -> if just () then cons () else raise EmptyError -let handle_default_opt (exceptions: 'a eoption array) (just: bool eoption) (cons: 'a eoption): 'a eoption = +let handle_default_opt (exceptions : 'a eoption array) (just : bool eoption) (cons : 'a eoption) : + 'a eoption = let except = Array.fold_left (fun acc except -> diff --git a/compiler/utils/dune b/compiler/utils/dune index 10ebee56f..250d4142f 100644 --- a/compiler/utils/dune +++ b/compiler/utils/dune @@ -2,7 +2,8 @@ (name utils) (public_name catala.utils) (libraries cmdliner ANSITerminal re) - (preprocess (pps ppx_deriving.show))) + (preprocess + (pps ppx_deriving.show))) (documentation (package catala) diff --git a/compiler/utils/pos.ml b/compiler/utils/pos.ml index d7d96823d..e1e954d50 100644 --- a/compiler/utils/pos.ml +++ b/compiler/utils/pos.ml @@ -12,7 +12,7 @@ or implied. See the License for the specific language governing permissions and limitations under the License. *) -type t = { code_pos : Lexing.position * Lexing.position [@opaque]; law_pos : string list } +type t = { code_pos : Lexing.position * Lexing.position; [@opaque] law_pos : string list } [@@deriving show] let from_lpos (p : Lexing.position * Lexing.position) : t = { code_pos = p; law_pos = [] } @@ -168,8 +168,7 @@ let retrieve_loc_text (pos : t) : string = else Cli.print_with_style blue_style "%*s+-+ " (spaces + (2 * i) - 1) "")) with Sys_error _ -> "Location:" ^ to_string pos -type 'a marked = 'a * t -[@@deriving show] +type 'a marked = 'a * t [@@deriving show] let no_pos : t = let zero_pos = diff --git a/compiler/utils/pos.mli b/compiler/utils/pos.mli index 6864c788e..198d1587a 100644 --- a/compiler/utils/pos.mli +++ b/compiler/utils/pos.mli @@ -14,8 +14,7 @@ (** Source code position *) -type t -[@@deriving show] +type t [@@deriving show] (** A position in the source code is a file, as well as begin and end location of the form col:line *) (** Custom visitor for the [Pos.marked] type *) @@ -59,8 +58,7 @@ val retrieve_loc_text : t -> string (**{2 AST markings}*) -type 'a marked = 'a * t -[@@deriving show] +type 'a marked = 'a * t [@@deriving show] (** Everything related to the source code should keep its position stored, to improve error messages *) val no_pos : t diff --git a/french_law/js/french_law.js b/french_law/js/french_law.js index ec30f44d9..a4e21be0a 100644 --- a/french_law/js/french_law.js +++ b/french_law/js/french_law.js @@ -1,25 +1,30 @@ -// Generated by js_of_ocaml 3.11.0 -(function(B){"use strict";var -jq=214,jp=" is too large for shifting.",ll="Invalid_argument",jo="0.08",es="Map.bal",jn="@[",ky=640,x="Code de la s\xc3\xa9curit\xc3\xa9 sociale",mg="Article L521-1",kx=123,lk="577500",eF=152,lj="%ni",mf=43200.,gf="ml_z_overflow",me="EMFILE",_=86400.,aI=2020,kw=139,a1=0xff,li="ENOMEM",gp=-12,lh=-45,eE="Titre 5 : Dispositions particuli\xc3\xa8res \xc3\xa0 la Guadeloupe, \xc3\xa0 la Guyane, \xc3\xa0 la Martinique, \xc3\xa0 La R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy et \xc3\xa0 Saint-Martin",md="559500",b5="Article 1",gE=122,jm="582700",mc=992015837,lg="EPROTONOSUPPORT",k="0",lf="ENETRESET",mb="EACCES",eK="date_courante",le="EINVAL",kv="0.5",ld="EDOM",ck=128,jl="Sys_blocked_io",ku="fd ",lc="EFBIG",jk=548,ge="Chapitre 2 : Champ d'application",jj="0.0588",O=248,ji="EXDEV",eT=">",bu=153,ma=1027,l$="EINPROGRESS",jh="montant_vers\xc3\xa9",kt="enfants_\xc3\xa0_charge",lb="562800",b4="Chapitre 5 : Prestations familiales et prestations assimil\xc3\xa9es",jg=246,la=555,je=598,jf="%u",k$="resetLog",l_=358,cS=2011,e="AllocationsFamiliales",k_=3268,jc=298,jd="EHOSTUNREACH",ks=633,jb="./securite_sociale_R.catala_fr",F="Livre 5 : Prestations familiales et prestations assimil\xc3\xa9es",kr=108,az="2",bd=127,dC=1024,ja="@{",Y="1",eJ=133,eS="e",gd="Montant de la base mensuelle des allocations familiales",i$=" : flags Open_rdonly and Open_wronly are not compatible",kq="ressources_m\xc3\xa9nage",i_="D\xc3\xa9cret n\xc2\xb0 2019-1387 du 18 d\xc3\xa9cembre 2019 portant rel\xc3\xa8vement du salaire minimum de croissance",aC="-",l9=505,b0=803994948,kp="EAGAIN",go=": Not a directory",i8=216,i9=" : file already exists",l8="smic",ko="Article D521-3",k9=184,bM=0xffffff,cK=2012,kn="EDESTADDRREQ",k8="EISCONN",l5=-43,l6=612,X="./securite_sociale_D.catala_fr",l7="EROFS",eD=86400,km="Out_of_memory",l4="inf",gn="index out of bounds",l3="EPIPE",i7="ENOEXEC",eC="_bigarr02",l2="Circulaire interminist\xc3\xa9rielle N\xc2\xb0 DSS/SD2B/2017/352 du 22 d\xc3\xa9cembre 2017 relative \xc3\xa0 la revalorisation au 1er janvier 2018 des plafonds de ressources d\xe2\x80\x99attribution de certaines prestations familiales servies en m\xc3\xa9tropole, en Guadeloupe, en Guyane, en Martinique, \xc3\xa0 la R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy, \xc3\xa0 Saint-Martin et \xc3\xa0 Mayotte",kl=0xffffffff,gD=111,k6=2147483647,k7=208,l1=180,i6="Martinique",k5=", characters ",i5="EPFNOSUPPORT",bp=0xffff,kk="EBUSY",eB=417088404,kj="ENETUNREACH",l0="ENOLCK",i3="ENOTTY",i4=12520,gm=400,k4="ESHUTDOWN",lZ=619,i0=-46,i1="(Program not linked with -g, cannot print stack backtrace)\n",i2="ENXIO",aO=3600,ki=143,H="Chapitre 1er : Allocations familiales",gs="AllocationFamilialesAvril2008",lY="ERANGE",cE=2016,k3="retrieveLog",bo="\xc3\xa2ge_minimum_alin\xc3\xa9a_1_l521_3",lX="infinity",a8=1000,kh=142,o="",iZ="^",bZ=3600.,iY=86400000,kg=264,al="Partie l\xc3\xa9gislative",cD=0x3f,dz=124,a0="./epilogue.catala_fr",gl="Article L512-3",v="./decrets_divers.catala_fr",I="Titre 2 : Prestations g\xc3\xa9n\xc3\xa9rales d'entretien",gC=112,iX="Match_failure",k2=140,b1="Montant des plafonds de ressources",P="Annexe",lW="enfants",eA=135,lV="personne_charge_effective_permanente_est_parent",bm=2021,kf="enfant_le_plus_\xc3\xa2g\xc3\xa9",ez=252,ke="EPROTOTYPE",bn=".",dr="montant_initial_majoration",bI="+",kd="EINTR",iW="ESRCH",kc=0xf0,a_="12.",kb="Guadeloupe",lU="ESOCKTNOSUPPORT",gB=110,ac="PrestationsFamiliales",gk=116,iV="%li",j$=576,ka="EALREADY",cO=2015,ey=365,bL="prise_en_compte",dq="Smic",gA=-32,j_="avait_enfant_\xc3\xa0_charge_avant_1er_janvier_2012",bt=1023,j8=-1080,j9="EAFNOSUPPORT",am="./securite_sociale_L.catala_fr",q="./prologue.catala_fr",er=2299161,j7=969837588,gr="nan",lT=605,j6="ENFILE",iU=0xe0,j5=-1023,lS=117,k0="ECHILD",k1=0xdfff,dH="compl\xc3\xa9ment_d\xc3\xa9gressif",gj="Article L755-12",kZ="ETOOMANYREFS",br="/",lR="Assert_failure",eq=2400000.5,iT="ENAMETOOLONG",lQ="568400",j4=541,eI="ENOTDIR",lP="0.32",gq=1073741823,kY="ETIMEDOUT",lO=308,eR="r\xc3\xa9sidence",iS="EMSGSIZE",ep=250,dy=1582,kW=154,kX=513,lN="ENOTCONN",iQ=115,iR="ECONNREFUSED",kV="src/time_Zone.ml",lM=1e14,j3="Arr\xc3\xaat\xc3\xa9 du 14 d\xc3\xa9cembre 2020 relatif au montant des plafonds de ressources de certaines prestations familiales et aux tranches du bar\xc3\xa8me applicable au recouvrement des indus et \xc3\xa0 la saisie des prestations",ex='"',kT="Guyane",kU="EWOULDBLOCK",iP="allocations_familiales",gc=1255,gi="<",lL="Fatal error: exception %s\n",j1=196,j2=0x800,cN=255,j0="EPERM",aN=2019,gb="jsError",bl=0x8000,kS="Partie r\xc3\xa9glementaire - D\xc3\xa9crets en Conseil d'Etat",Z="droit_ouvert_majoration",dG=146097,cR=256,jZ=0.012,lK="Article L521-3",kR="End_of_file",jX="M\xc3\xa9tropole",jY=156,kQ="Failure",lI=367,lJ="ENOSPC",iO=129,iN="\n",jW=204,dx="conditions_hors_\xc3\xa2ge",kP=218,eQ="ENOENT",jV=534,L="Dispositions sp\xc3\xa9ciales relatives \xc3\xa0 Mayotte",jU=562,jT="([^/]+)",lH=315,kO="ENETDOWN",eP="EnfantLePlus\xc3\x82g\xc3\xa9",gh=0xf,lG="EOVERFLOW",eo=-48,kN=0xdc00,dw="montant_initial_m\xc3\xa9tropole_majoration",gz="ENOTEMPTY",iM="EBADF",aq="camlinternalFormat.ml",jS="Division_by_zero",gg=520,iL="EMLINK",kM="Sys_error",lE=647,lF="x",lD=335,cC=2017,cM="Article D521-2",eO="Article D755-5",ga="Titre 1 : Champ d'application - G\xc3\xa9n\xc3\xa9ralit\xc3\xa9s",bK=60.,f$="EEXIST",cJ=2014,gy="%d",kL="Printexc.handle_uncaught_exception",iK=32082,b3=1900,iJ=121,jR="EADDRNOTAVAIL",lC="buffer.ml",jQ=119,dv="montant_avec_garde_altern\xc3\xa9e_majoration",jP="version_avril_2008",bY=120,ew=127686388,cj=103,lB="ENOBUFS",f_="16",cH=2013,cI=102,f9=512,lA=527,cQ=113,iI=0x7ff0,t="D\xc3\xa9crets divers",ev=101,cL=132,iH="0x",iG="D\xc3\xa9cret n\xc2\xb0 2020-1598 du 16 d\xc3\xa9cembre 2020 portant rel\xc3\xa8vement du salaire minimum de croissance",ci=1e7,p="Prologue",du=254,aW=100,jN="ECONNABORTED",jO="EFAULT",dB="Article 7",kK="ENODEV",jM=" : flags Open_text and Open_binary are not compatible",kJ="%Li",jK="EIO",jL="EDEADLK",eN="3",W="Partie r\xc3\xa9glementaire - D\xc3\xa9crets simples",iF=105,ly="169.",lz=230,iE="Instruction interminist\xc3\xa9rielle n\xc2\xb0 DSS/SD2B/2018/279 du 17 d\xc3\xa9cembre 2018 relative \xc3\xa0 la revalorisation au 1er janvier 2019 des plafonds de ressources d\xe2\x80\x99attribution de certaines prestations familiales servies en m\xc3\xa9tropole, en Guadeloupe, en Guyane, en Martinique, \xc3\xa0 la R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy, \xc3\xa0 Saint-Martin et \xc3\xa0 Mayotte",kI=591,b2=0.5,jJ=584,aV="Article D521-1",jI="Instruction interministerielle no DSS/SD2B/2019/261 du 18 d\xc3\xa9cembre 2019 relative \xc3\xa0 la revalorisation au 1er janvier 2020 des plafonds de ressources d\xe2\x80\x99attribution de certaines prestations familiales servies en m\xc3\xa9tropole, en Guadeloupe, en Guyane, en Martinique, \xc3\xa0 La R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy, \xc3\xa0 Saint-Martin et \xc3\xa0 Mayotte",jH=188,bN="Livre 7 : R\xc3\xa9gimes divers - Dispositions diverses",ay="input",iD="str.ml",jG=160,iC="personne_charge_effective_permanente_remplit_titre_I",lx="prestations_familiales",dF="est_enfant_le_plus_\xc3\xa2g\xc3\xa9",jF="0.0463",iB="D\xc3\xa9cret n\xc2\xb0 2018-1173 du 19 d\xc3\xa9cembre 2018 portant rel\xc3\xa8vement du salaire minimum de croissance",eH="_z",lw="computeAllocationsFamiliales",dE="Unix.Unix_error",jD="0.55",jE="EHOSTDOWN",jC=109,dt="droit_ouvert",f8="mkdir",jB="ENOTSOCK",kH=136,lv="Stack_overflow",en=": No such file or directory",a9="Interface du programme",lu="/static/",dp="Titre 5 : D\xc3\xa9partements d'outre-mer",jA=-97,lt=253,ls="Not_found",ds=1461,aB="InterfaceAllocationsFamiliales",f7=151,K="D\xc3\xa9cret n\xc2\xb02002-423 du 29 mars 2002 relatif aux prestations familiales \xc3\xa0 Mayotte",cG="1.",kG=32044,eG=", ",iA=626,bq=2018,lr="Mayotte",jz="EOPNOTSUPP",iz="ENOPROTOOPT",gx=243,jy=2440588,gw="rmdir",kF="src/date.ml",lq=32752,jx="ECONNRESET",lp="ELOOP",eu=141,jw="ESPIPE",lo=280,aZ="\xc3\x89pilogue",kE="EADDRINUSE",ln=1026,bs="Article L521-2",kD="ENOSYS",eM="Invalid integer: ",et=2440587.5,jv="E2BIG",kC=359,ix="Pervasives.do_at_exit",iy="utf8",ju=155,kB=258,bJ=" ",gv="Fatal error: exception ",a$=0x80,kA="Undefined_recursive_module",aA="output",jt=569,f6=376,js=215,eL="src/calendar_builder.ml",iw="EISDIR",lm="_",cF="Montant du salaire minimum de croissance",gu="compare: functional value",f5="0.16",dA="droit_ouvert_forfaitaire",dD="0.",em=134,kz="%i",gt=114,cP=529348384,iv=176,jr=426;function -GC(d,b,e,c,f){if(c<=b)for(var +// Generated by js_of_ocaml 4.0.0 +(function(a){typeof +globalThis!=="object"&&(this?b():(a.defineProperty(a.prototype,"_T_",{configurable:true,get:b}),_T_));function +b(){var +b=this||self;b.globalThis=b;delete +a.prototype._T_}}(Object));(function(y){"use strict";var +IC=y,IF=typeof +module==="object"&&module.exports||y,jI=214,jH=" is too large for shifting.",lz="Invalid_argument",jG="0.08",ez="Map.bal",jF="@[",kQ=640,v="Code de la s\xc3\xa9curit\xc3\xa9 sociale",mw="Article L521-1",kP=123,ly="577500",eP=152,lx="%ni",mv=43200.,gr="ml_z_overflow",kO=159,mu="EMFILE",aa=86400.,aI=2020,gU=163,kN=139,aZ=0xff,lw="ENOMEM",gB=-12,lv=-45,eO="Titre 5 : Dispositions particuli\xc3\xa8res \xc3\xa0 la Guadeloupe, \xc3\xa0 la Guyane, \xc3\xa0 la Martinique, \xc3\xa0 La R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy et \xc3\xa0 Saint-Martin",mt="559500",b7="Article 1",gT=122,jE="582700",ms=992015837,lu="EPROTONOSUPPORT",m="0",lt="ENETRESET",mr="EACCES",eW="date_courante",ls="EINVAL",kM="0.5",lr="EDOM",bN=128,jD="Sys_blocked_io",kL="fd ",lq="EFBIG",jC=548,ey="Chapitre 2 : Champ d'application",jB="0.0588",N=248,jA="EXDEV",e6=">",bt=153,mq=1027,mp="EINPROGRESS",jz="montant_vers\xc3\xa9",kK="enfants_\xc3\xa0_charge",lp="562800",b6="Chapitre 5 : Prestations familiales et prestations assimil\xc3\xa9es",jy=246,lo=555,jw=598,jx="%u",ln="resetLog",mo=358,cW=2011,g="AllocationsFamiliales",lm=3268,ju=298,jv="EHOSTUNREACH",kJ=633,bk="./securite_sociale_R.catala_fr",x="Livre 5 : Prestations familiales et prestations assimil\xc3\xa9es",kI=108,az="2",ba=127,dE=1024,jt="@{",eN=-2147483648,_="1",eV=133,e5="e",gq="Montant de la base mensuelle des allocations familiales",js=" : flags Open_rdonly and Open_wronly are not compatible",kH="ressources_m\xc3\xa9nage",jr="D\xc3\xa9cret n\xc2\xb0 2019-1387 du 18 d\xc3\xa9cembre 2019 portant rel\xc3\xa8vement du salaire minimum de croissance",aD="-",mn=505,b1=803994948,kG="EAGAIN",gA=": Not a directory",jp=216,jq=" : file already exists",mm="smic",kF="Article D521-3",eU=184,bL=0xffffff,cO=2012,kE="EDESTADDRREQ",ll="EISCONN",mj=-43,mk=612,S="./securite_sociale_D.catala_fr",ml="EROFS",eM=86400,kD="Out_of_memory",mi="inf",gz="index out of bounds",mh="EPIPE",jo="ENOEXEC",eL="_bigarr02",mg="Circulaire interminist\xc3\xa9rielle N\xc2\xb0 DSS/SD2B/2017/352 du 22 d\xc3\xa9cembre 2017 relative \xc3\xa0 la revalorisation au 1er janvier 2018 des plafonds de ressources d\xe2\x80\x99attribution de certaines prestations familiales servies en m\xc3\xa9tropole, en Guadeloupe, en Guyane, en Martinique, \xc3\xa0 la R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy, \xc3\xa0 Saint-Martin et \xc3\xa0 Mayotte",kC=0xffffffff,gS=111,gG=2147483647,lk=208,mf=180,jn="Martinique",lj=", characters ",jm="EPFNOSUPPORT",bn=0xffff,kB="EBUSY",eK=417088404,kA="ENETUNREACH",me="ENOLCK",jk="ENOTTY",jl=12520,gy=400,li="ESHUTDOWN",md=619,ji=-46,jj="ENXIO",aP=3600,kz=143,B="Chapitre 1er : Allocations familiales",gF="AllocationFamilialesAvril2008",mc="ERANGE",cI=2016,lh="retrieveLog",bm="\xc3\xa2ge_minimum_alin\xc3\xa9a_1_l521_3",mb="infinity",a6=1000,eJ=142,k="",jh="^",b0=3600.,jg=86400000,ky=264,al="Partie l\xc3\xa9gislative",cH=0x3f,dC=124,Z="./epilogue.catala_fr",gR=385,eI="Article L512-3",w="./decrets_divers.catala_fr",C="Titre 2 : Prestations g\xc3\xa9n\xc3\xa9rales d'entretien",dK=112,jf="Match_failure",lg=140,b3="Montant des plafonds de ressources",O="Annexe",ma="enfants",eH=135,l$="personne_charge_effective_permanente_est_parent",bj=2021,kx="enfant_le_plus_\xc3\xa2g\xc3\xa9",eG=252,kw="EPROTOTYPE",bl=".",du="montant_initial_majoration",bH="+",kv="EINTR",je="ESRCH",ku=0xf0,a7="12.",kt="Guadeloupe",l_="ESOCKTNOSUPPORT",lf=187,gQ=110,af="PrestationsFamiliales",gx=116,jd="%li",kr=576,ks="EALREADY",cS=2015,eF=365,bK="prise_en_compte",dt="Smic",jc=178,gP=-32,kq="avait_enfant_\xc3\xa0_charge_avant_1er_janvier_2012",cl="R\xc3\xa8gles diverses",bs=1023,ko=-1080,kp="EAFNOSUPPORT",am="./securite_sociale_L.catala_fr",s="./prologue.catala_fr",ex=2299161,kn=969837588,gE="nan",l9=605,km="ENFILE",jb=0xe0,kl=-1023,l8=117,ld="ECHILD",le=0xdfff,dJ="compl\xc3\xa9ment_d\xc3\xa9gressif",gw="Article L755-12",lc="ETOOMANYREFS",bq="/",l7="Assert_failure",ew=2400000.5,ja="ENAMETOOLONG",l6="568400",kk=541,eT="ENOTDIR",l5="0.32",gD=1073741823,lb="ETIMEDOUT",l4=308,e4="r\xc3\xa9sidence",i$="EMSGSIZE",ev=250,dB=1582,eS=154,la=513,l3="ENOTCONN",i9=115,i_="ECONNREFUSED",k$="src/time_Zone.ml",l2=1e14,e3="Article R521-3",kj="Arr\xc3\xaat\xc3\xa9 du 14 d\xc3\xa9cembre 2020 relatif au montant des plafonds de ressources de certaines prestations familiales et aux tranches du bar\xc3\xa8me applicable au recouvrement des indus et \xc3\xa0 la saisie des prestations",eE='"',k9="Guyane",k_="EWOULDBLOCK",i8="allocations_familiales",gp=1255,gv="<",l1="Fatal error: exception %s\n",kh=196,ki=0x800,cR=255,kg="EPERM",aO=2019,gn="Article R521-1",go="jsError",bi=0x8000,$="droit_ouvert_majoration",bp="Partie r\xc3\xa9glementaire - D\xc3\xa9crets en Conseil d'Etat",dI=146097,cV=256,kf=0.012,l0="Article L521-3",k8="End_of_file",kd="M\xc3\xa9tropole",ke=156,gC="Failure",lY=367,lZ="ENOSPC",i7=129,i6="\n",kc=204,dA="conditions_hors_\xc3\xa2ge",k7=218,e2="ENOENT",kb=534,K="Dispositions sp\xc3\xa9ciales relatives \xc3\xa0 Mayotte",ka=562,lX=288,j$="([^/]+)",lW=315,i5=194,k6="ENETDOWN",e1="EnfantLePlus\xc3\x82g\xc3\xa9",gu=0xf,lV="EOVERFLOW",eu=-48,k5=0xdc00,dz="montant_initial_m\xc3\xa9tropole_majoration",gt=125,gO="ENOTEMPTY",i4="EBADF",ar="camlinternalFormat.ml",j_="Division_by_zero",gN=162,gs=520,i3="EMLINK",k4="Sys_error",lT=647,lU="x",lS=335,cG=2017,b2="Article D521-2",e0="Article D755-5",ds="Titre 1 : Champ d'application - G\xc3\xa9n\xc3\xa9ralit\xc3\xa9s",bJ=60.,gm="EEXIST",cN=2014,gM="%d",k3="Printexc.handle_uncaught_exception",i2=32082,b5=1900,i1=121,j9="EADDRNOTAVAIL",lR="buffer.ml",j8=119,dy="montant_avec_garde_altern\xc3\xa9e_majoration",j7="version_avril_2008",bZ=120,eD=127686388,cm=103,lQ="ENOBUFS",gl="16",cL=2013,cM=102,gk=512,lP=527,cU=113,i0=0x7ff0,p="D\xc3\xa9crets divers",eC=101,cQ=132,iZ="0x",iY="D\xc3\xa9cret n\xc2\xb0 2020-1598 du 16 d\xc3\xa9cembre 2020 portant rel\xc3\xa8vement du salaire minimum de croissance",ck=1e7,r="Prologue",dx=254,aW=100,j5="ECONNABORTED",j6="EFAULT",cP="Article 7",k2="ENODEV",j4=" : flags Open_text and Open_binary are not compatible",k1="%Li",j2="EIO",j3="EDEADLK",eZ="3",R="Partie r\xc3\xa9glementaire - D\xc3\xa9crets simples",iX=105,lN="169.",lO=230,iW="Instruction interminist\xc3\xa9rielle n\xc2\xb0 DSS/SD2B/2018/279 du 17 d\xc3\xa9cembre 2018 relative \xc3\xa0 la revalorisation au 1er janvier 2019 des plafonds de ressources d\xe2\x80\x99attribution de certaines prestations familiales servies en m\xc3\xa9tropole, en Guadeloupe, en Guyane, en Martinique, \xc3\xa0 la R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy, \xc3\xa0 Saint-Martin et \xc3\xa0 Mayotte",k0=591,b4=0.5,j1=584,aJ="Article D521-1",j0="Instruction interministerielle no DSS/SD2B/2019/261 du 18 d\xc3\xa9cembre 2019 relative \xc3\xa0 la revalorisation au 1er janvier 2020 des plafonds de ressources d\xe2\x80\x99attribution de certaines prestations familiales servies en m\xc3\xa9tropole, en Guadeloupe, en Guyane, en Martinique, \xc3\xa0 La R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy, \xc3\xa0 Saint-Martin et \xc3\xa0 Mayotte",jZ=188,bM="Livre 7 : R\xc3\xa9gimes divers - Dispositions diverses",ay="input",iV="str.ml",jY=160,lM=161,iU="personne_charge_effective_permanente_remplit_titre_I",lL="prestations_familiales",dH="est_enfant_le_plus_\xc3\xa2g\xc3\xa9",jX="0.0463",iT="D\xc3\xa9cret n\xc2\xb0 2018-1173 du 19 d\xc3\xa9cembre 2018 portant rel\xc3\xa8vement du salaire minimum de croissance",eR="_z",lK="computeAllocationsFamiliales",dG="Unix.Unix_error",jV="0.55",jW="EHOSTDOWN",jU=109,dw="droit_ouvert",gj="mkdir",jT="ENOTSOCK",kZ=136,lJ="Stack_overflow",et=": No such file or directory",aA="Interface du programme",lI="/static/",dr="Titre 5 : D\xc3\xa9partements d'outre-mer",jS=-97,lH=253,lG="Not_found",dv=1461,aC="InterfaceAllocationsFamiliales",gi=151,J="D\xc3\xa9cret n\xc2\xb02002-423 du 29 mars 2002 relatif aux prestations familiales \xc3\xa0 Mayotte",cK="1.",kY=32044,eQ=", ",iS=626,bo=2018,lF="Mayotte",jR="EOPNOTSUPP",iR="ENOPROTOOPT",gL=243,jQ=2440588,gK="rmdir",kX="src/date.ml",lE=32752,jP="ECONNRESET",lD="ELOOP",eB=141,jO="ESPIPE",lC=280,Y="\xc3\x89pilogue",kW="EADDRINUSE",lB=1026,br="Article L521-2",kV="ENOSYS",eY="Invalid integer: ",eA=2440587.5,jN="E2BIG",kU=359,iP="Pervasives.do_at_exit",iQ="utf8",jM=155,kT=258,bI=" ",gJ="Fatal error: exception ",a8=0x80,kS="Undefined_recursive_module",aB="output",jL=569,gh=376,jK=215,eX="src/calendar_builder.ml",iO="EISDIR",lA="_",cJ="Montant du salaire minimum de croissance",gI="compare: functional value",gg="0.16",dD="droit_ouvert_forfaitaire",dF="0.",es=134,kR="%i",gH=114,cT=529348384,iN=176,jJ=426;function +HH(d,b,e,c,f){if(c<=b)for(var a=1;a<=f;a++)e[c+a]=d[b+a];else for(var a=f;a>=1;a--)e[c+a]=d[b+a];return 0}function -GF(e,f,d){var +HK(e,f,d){var a=new Array(d+1);a[0]=0;for(var b=1,c=f+1;b<=d;b++,c++)a[b]=e[c];return a}function -e5(c,b,a){var +fg(c,b,a){var d=String.fromCharCode;if(b==0&&a<=4096&&a==c.length)return d.apply(null,c);var -e=o;for(;0=b.l||b.t==2&&c>=b.c.length)){b.c=d.t==4?e5(d.c,e,c):e==0&&d.c.length==c?d.c:d.c.substr(e,c);b.t=b.c.length==b.l?0:2}else -if(b.t==2&&f==b.c.length){b.c+=d.t==4?e5(d.c,e,c):e==0&&d.c.length==c?d.c:d.c.substr(e,c);b.t=b.c.length==b.l?0:2}else{if(b.t!=4)eU(b);var +b9(d,e,b,f,c){if(c==0)return 0;if(f==0&&(c>=b.l||b.t==2&&c>=b.c.length)){b.c=d.t==4?fg(d.c,e,c):e==0&&d.c.length==c?d.c:d.c.substr(e,c);b.t=b.c.length==b.l?0:2}else +if(b.t==2&&f==b.c.length){b.c+=d.t==4?fg(d.c,e,c):e==0&&d.c.length==c?d.c:d.c.substr(e,c);b.t=b.c.length==b.l?0:2}else{if(b.t!=4)e7(b);var g=d.c,h=b.c;if(d.t==4)if(f<=e)for(var a=0;a=0;a--)h[f+a]=g[e+a];else{var i=Math.min(c,g.length-e);for(var a=0;a>=1;if(b==0)return d;a+=a;c++;if(c==9)a.slice(0,1)}}function -b_(a){if(a.t==2)a.c+=cY(a.l-a.c.length,"\0");else -a.c=e5(a.c,0,a.c.length);a.t=0}function -mq(a,b){if(a===b)return 1;a.t&6&&b_(a);b.t&6&&b_(b);return a.c==b.c?1:0}function -Hn(b,a){throw[0,b,a]}function -mN(a){if(a.length<24){for(var -b=0;bbd)return false;return true}else +b_(a,b,c,d,e){b9(bO(a),b,c,d,e);return 0}function +c2(b,a){if(b==0)return k;if(a.repeat)return a.repeat(b);var +d=k,c=0;for(;;){if(b&1)d+=a;b>>=1;if(b==0)return d;a+=a;c++;if(c==9)a.slice(0,1)}}function +cn(a){if(a.t==2)a.c+=c2(a.l-a.c.length,"\0");else +a.c=fg(a.c,0,a.c.length);a.t=0}function +mG(a,b){if(a===b)return 1;a.t&6&&cn(a);b.t&6&&cn(b);return a.c==b.c?1:0}function +Ir(b,a){throw[0,b,a]}function +m2(a){if(a.length<24){for(var +b=0;bba)return false;return true}else return!/[^\x00-\x7f]/.test(a)}function -gY(e){for(var -j=o,c=o,g,f,h,a,b=0,i=e.length;bf9){c.substr(0,1);j+=c;c=o;j+=e.slice(b,d)}else -c+=e.slice(b,d);if(d==i)break;b=d}a=1;if(++b=0xd7ff&&a<0xe000)a=2}else{a=3;if(++b0x10ffff)a=3}}}}}if(a<4){b-=a;c+="\ufffd"}else -if(a>bp)c+=String.fromCharCode(0xd7c0+(a>>10),kN+(a&0x3FF));else -c+=String.fromCharCode(a);if(c.length>dC){c.substr(0,1);j+=c;c=o}}return j+c}function -bv(c,a,b){this.t=c;this.c=a;this.l=b}bv.prototype.toString=function(){switch(this.t){case -9:return this.c;default:b_(this);case -0:if(mN(this.c)){this.t=9;return this.c}this.t=8;case -8:return this.c}};bv.prototype.toUtf16=function(){var -a=this.toString();if(this.t==9)return a;return gY(a)};bv.prototype.slice=function(){var +hd(e){for(var +j=k,c=k,g,f,h,a,b=0,i=e.length;bgk){c.substr(0,1);j+=c;c=k;j+=e.slice(b,d)}else +c+=e.slice(b,d);if(d==i)break;b=d}a=1;if(++b=0xd7ff&&a<0xe000)a=2}else{a=3;if(++b0x10ffff)a=3}}}}}if(a<4){b-=a;c+="\ufffd"}else +if(a>bn)c+=String.fromCharCode(0xd7c0+(a>>10),k5+(a&0x3FF));else +c+=String.fromCharCode(a);if(c.length>dE){c.substr(0,1);j+=c;c=k}}return j+c}function +bu(c,a,b){this.t=c;this.c=a;this.l=b}bu.prototype.toString=function(){switch(this.t){case +9:return this.c;default:cn(this);case +0:if(m2(this.c)){this.t=9;return this.c}this.t=8;case +8:return this.c}};bu.prototype.toUtf16=function(){var +a=this.toString();if(this.t==9)return a;return hd(a)};bu.prototype.slice=function(){var a=this.t==4?this.c.slice():this.c;return new -bv(this.t,a,this.l)};function -mr(a){return new -bv(0,a,a.length)}function -a(a){return mr(a)}function -gU(c,b){Hn(c,a(b))}var -ag=[0];function -ah(a){gU(ag.Invalid_argument,a)}function -mo(){ah(gn)}function -dJ(a,b){switch(a.t&6){default:if(b>=a.c.length)return 0;case +bu(this.t,a,this.l)};function +mH(a){return new +bu(0,a,a.length)}function +a(a){return mH(a)}function +g$(c,b){Ir(c,a(b))}var +ab=[0];function +aj(a){g$(ab.Invalid_argument,a)}function +mE(){aj(gz)}function +dM(a,b){switch(a.t&6){default:if(b>=a.c.length)return 0;case 0:return a.c.charCodeAt(b);case 4:return a.c[b]}}function -b9(b,a){if(a>>>0>=b.l)mo();return dJ(b,a)}function -ad(a,c,b){b&=a1;if(a.t!=4){if(c==a.c.length){a.c+=String.fromCharCode(b);if(c+1==a.l)a.t=0;return 0}eU(a)}a.c[c]=b;return 0}function -ba(b,a,c){if(a>>>0>=b.l)mo();return ad(b,a,c)}function -be(c,a){if(c.fun)return be(c.fun,a);if(typeof +b$(b,a){if(a>>>0>=b.l)mE();return dM(b,a)}function +ag(a,c,b){b&=aZ;if(a.t!=4){if(c==a.c.length){a.c+=String.fromCharCode(b);if(c+1==a.l)a.t=0;return 0}e7(a)}a.c[c]=b;return 0}function +a9(b,a,c){if(a>>>0>=b.l)mE();return ag(b,a,c)}function +bb(c,a){if(c.fun)return bb(c.fun,a);if(typeof c!=="function")return c;var b=c.length|0;if(b===0)return c.apply(null,a);var e=a.length|0,d=b-e|0;if(d==0)return c.apply(null,a);else -if(d<0)return be(c.apply(null,a.slice(0,b)),a.slice(b));else +if(d<0)return bb(c.apply(null,a.slice(0,b)),a.slice(b));else return function(){var e=arguments.length==0?1:arguments.length,d=new Array(a.length+e);for(var b=0;b>>0>=a.length-1)dI();return a}function -GK(a){if(isFinite(a)){if(Math.abs(a)>=2.2250738585072014e-308)return 0;if(a!=0)return 1;return 2}return isNaN(a)?4:3}function -bf(a){if((a.t&6)!=0)b_(a);return a.c}var -HE=Math.log2&&Math.log2(1.1235582092889474E+307)==1020;function -HC(a){if(HE)return Math.floor(Math.log2(a));var +b=0;b>>0>=a.length-1)dL();return a}function +HP(a){if(isFinite(a)){if(Math.abs(a)>=2.2250738585072014e-308)return 0;if(a!=0)return 1;return 2}return isNaN(a)?4:3}function +bw(a){a.t&6&&cn(a);return a.c}var +II=Math.log2&&Math.log2(1.1235582092889474E+307)==1020;function +IG(a){if(II)return Math.floor(Math.log2(a));var b=0;if(a==0)return-Infinity;if(a>=1)while(a>=2){a/=2;b++}else while(a<1){a*=2;b--}return b}function -gL(c){var -a=new(B.Float32Array)(1);a[0]=c;var -b=new(B.Int32Array)(a.buffer);return b[0]|0}var -mC=Math.pow(2,-24);function -e3(a){throw a}function -cX(){e3(ag.Division_by_zero)}function -z(b,c,a){this.lo=b&bM;this.mi=c&bM;this.hi=a&bp}z.prototype.caml_custom="_j";z.prototype.copy=function(){return new -z(this.lo,this.mi,this.hi)};z.prototype.ucompare=function(a){if(this.hi>a.hi)return 1;if(this.hia.mi)return 1;if(this.mia.lo)return 1;if(this.loc)return 1;if(ba.mi)return 1;if(this.mia.lo)return 1;if(this.loa.hi)return 1;if(this.hia.mi)return 1;if(this.mia.lo)return 1;if(this.loc)return 1;if(ba.mi)return 1;if(this.mia.lo)return 1;if(this.lo>24),c=-this.hi+(b>>24);return new -z(a,b,c)};z.prototype.add=function(a){var +D(a,b,c)};D.prototype.add=function(a){var b=this.lo+a.lo,c=this.mi+a.mi+(b>>24),d=this.hi+a.hi+(c>>24);return new -z(b,c,d)};z.prototype.sub=function(a){var +D(b,c,d)};D.prototype.sub=function(a){var b=this.lo-a.lo,c=this.mi-a.mi+(b>>24),d=this.hi-a.hi+(c>>24);return new -z(b,c,d)};z.prototype.mul=function(a){var -b=this.lo*a.lo,c=(b*mC|0)+this.mi*a.lo+this.lo*a.mi,d=(c*mC|0)+this.hi*a.lo+this.mi*a.mi+this.lo*a.hi;return new -z(b,c,d)};z.prototype.isZero=function(){return(this.lo|this.mi|this.hi)==0};z.prototype.isNeg=function(){return this.hi<<16<0};z.prototype.and=function(a){return new -z(this.lo&a.lo,this.mi&a.mi,this.hi&a.hi)};z.prototype.or=function(a){return new -z(this.lo|a.lo,this.mi|a.mi,this.hi|a.hi)};z.prototype.xor=function(a){return new -z(this.lo^a.lo,this.mi^a.mi,this.hi^a.hi)};z.prototype.shift_left=function(a){a=a&63;if(a==0)return this;if(a<24)return new -z(this.lo<>24-a,this.hi<>24-a);if(a<48)return new -z(0,this.lo<>48-a);return new -z(0,0,this.lo<>a|this.mi<<24-a,this.mi>>a|this.hi<<24-a,this.hi>>a);if(a<48)return new -z(this.mi>>a-24|this.hi<<48-a,this.hi>>a-24,0);return new -z(this.hi>>a-48,0,0)};z.prototype.shift_right=function(a){a=a&63;if(a==0)return this;var +D(b,c,d)};D.prototype.mul=function(a){var +b=this.lo*a.lo,c=(b*mQ|0)+this.mi*a.lo+this.lo*a.mi,d=(c*mQ|0)+this.hi*a.lo+this.mi*a.mi+this.lo*a.hi;return new +D(b,c,d)};D.prototype.isZero=function(){return(this.lo|this.mi|this.hi)==0};D.prototype.isNeg=function(){return this.hi<<16<0};D.prototype.and=function(a){return new +D(this.lo&a.lo,this.mi&a.mi,this.hi&a.hi)};D.prototype.or=function(a){return new +D(this.lo|a.lo,this.mi|a.mi,this.hi|a.hi)};D.prototype.xor=function(a){return new +D(this.lo^a.lo,this.mi^a.mi,this.hi^a.hi)};D.prototype.shift_left=function(a){a=a&63;if(a==0)return this;if(a<24)return new +D(this.lo<>24-a,this.hi<>24-a);if(a<48)return new +D(0,this.lo<>48-a);return new +D(0,0,this.lo<>a|this.mi<<24-a,this.mi>>a|this.hi<<24-a,this.hi>>a);if(a<48)return new +D(this.mi>>a-24|this.hi<<48-a,this.hi>>a-24,0);return new +D(this.hi>>a-48,0,0)};D.prototype.shift_right=function(a){a=a&63;if(a==0)return this;var c=this.hi<<16>>16;if(a<24)return new -z(this.lo>>a|this.mi<<24-a,this.mi>>a|c<<24-a,this.hi<<16>>a>>>16);var +D(this.lo>>a|this.mi<<24-a,this.mi>>a|c<<24-a,this.hi<<16>>a>>>16);var b=this.hi<<16>>31;if(a<48)return new -z(this.mi>>a-24|this.hi<<48-a,this.hi<<16>>a-24>>16,b&bp);return new -z(this.hi<<16>>a-32,b,b)};z.prototype.lsl1=function(){this.hi=this.hi<<1|this.mi>>23;this.mi=(this.mi<<1|this.lo>>23)&bM;this.lo=this.lo<<1&bM};z.prototype.lsr1=function(){this.lo=(this.lo>>>1|this.mi<<23)&bM;this.mi=(this.mi>>>1|this.hi<<23)&bM;this.hi=this.hi>>>1};z.prototype.udivmod=function(e){var +D(this.mi>>a-24|this.hi<<48-a,this.hi<<16>>a-24>>16,b&bn);return new +D(this.hi<<16>>a-32,b,b)};D.prototype.lsl1=function(){this.hi=this.hi<<1|this.mi>>23;this.mi=(this.mi<<1|this.lo>>23)&bL;this.lo=this.lo<<1&bL};D.prototype.lsr1=function(){this.lo=(this.lo>>>1|this.mi<<23)&bL;this.mi=(this.mi>>>1|this.hi<<23)&bL;this.hi=this.hi>>>1};D.prototype.udivmod=function(e){var c=0,b=this.copy(),a=e.copy(),d=new -z(0,0,0);while(b.ucompare(a)>0){c++;a.lsl1()}while(c>=0){c--;d.lsl1();if(b.ucompare(a)>=0){d.lo++;b=b.sub(a)}a.lsr1()}return{quotient:d,modulus:b}};z.prototype.div=function(a){var -b=this;if(a.isZero())cX();var -d=b.hi^a.hi;if(b.hi&bl)b=b.neg();if(a.hi&bl)a=a.neg();var -c=b.udivmod(a).quotient;if(d&bl)c=c.neg();return c};z.prototype.mod=function(b){var -a=this;if(b.isZero())cX();var -d=a.hi;if(a.hi&bl)a=a.neg();if(b.hi&bl)b=b.neg();var -c=a.udivmod(b).modulus;if(d&bl)c=c.neg();return c};z.prototype.toInt=function(){return this.lo|this.mi<<24};z.prototype.toFloat=function(){return(this.hi<<16)*Math.pow(2,32)+this.mi*Math.pow(2,24)+this.lo};z.prototype.toArray=function(){return[this.hi>>8,this.hi&a1,this.mi>>16,this.mi>>8&a1,this.mi&a1,this.lo>>16,this.lo>>8&a1,this.lo&a1]};z.prototype.lo32=function(){return this.lo|(this.mi&a1)<<24};z.prototype.hi32=function(){return this.mi>>>8&bp|this.hi<<16};function -ca(b,c,a){return new -z(b,c,a)}function -eX(a){if(!isFinite(a)){if(isNaN(a))return ca(1,0,iI);return a>0?ca(0,0,iI):ca(0,0,0xfff0)}var -f=a==0&&1/a==-Infinity?bl:a>=0?0:bl;if(f)a=-a;var -b=HC(a)+bt;if(b<=0){b=0;a/=Math.pow(2,-ln)}else{a/=Math.pow(2,b-ma);if(a<16){a*=2;b-=1}if(b==0)a/=2}var +D(0,0,0);while(b.ucompare(a)>0){c++;a.lsl1()}while(c>=0){c--;d.lsl1();if(b.ucompare(a)>=0){d.lo++;b=b.sub(a)}a.lsr1()}return{quotient:d,modulus:b}};D.prototype.div=function(a){var +b=this;if(a.isZero())c1();var +d=b.hi^a.hi;if(b.hi&bi)b=b.neg();if(a.hi&bi)a=a.neg();var +c=b.udivmod(a).quotient;if(d&bi)c=c.neg();return c};D.prototype.mod=function(b){var +a=this;if(b.isZero())c1();var +d=a.hi;if(a.hi&bi)a=a.neg();if(b.hi&bi)b=b.neg();var +c=a.udivmod(b).modulus;if(d&bi)c=c.neg();return c};D.prototype.toInt=function(){return this.lo|this.mi<<24};D.prototype.toFloat=function(){return(this.hi<<16)*Math.pow(2,32)+this.mi*Math.pow(2,24)+this.lo};D.prototype.toArray=function(){return[this.hi>>8,this.hi&aZ,this.mi>>16,this.mi>>8&aZ,this.mi&aZ,this.lo>>16,this.lo>>8&aZ,this.lo&aZ]};D.prototype.lo32=function(){return this.lo|(this.mi&aZ)<<24};D.prototype.hi32=function(){return this.mi>>>8&bn|this.hi<<16};function +cb(b,c,a){return new +D(b,c,a)}function +e_(a){if(!isFinite(a)){if(isNaN(a))return cb(1,0,i0);return a>0?cb(0,0,i0):cb(0,0,0xfff0)}var +f=a==0&&1/a==-Infinity?bi:a>=0?0:bi;if(f)a=-a;var +b=IG(a)+bs;if(b<=0){b=0;a/=Math.pow(2,-lB)}else{a/=Math.pow(2,b-mq);if(a<16){a*=2;b-=1}if(b==0)a/=2}var d=Math.pow(2,24),c=a|0;a=(a-c)*d;var e=a|0;a=(a-e)*d;var -g=a|0;c=c&gh|f|b<<4;return ca(g,e,c)}function -dM(a){return a.toArray()}function -mn(c,b,g){c.write(32,b.dims.length);c.write(32,b.kind|b.layout<<8);if(b.caml_custom==eC)for(var -a=0;a>4;if(c==2047)return(f|g|b&gh)==0?b&bl?-Infinity:Infinity:NaN;var -e=Math.pow(2,-24),a=(f*e+g)*e+(b&gh);if(c>0){a+=16;a*=Math.pow(2,c-ma)}else -a*=Math.pow(2,-ln);if(b&bl)a=-a;return a}function -gF(b){var +a(e*mB(c));return d}function +g3(c){var +a=new(y.Int32Array)(1);a[0]=c;var +b=new(y.Float32Array)(a.buffer);return b[0]}function +dO(a){return new +D(a[7]<<0|a[6]<<8|a[5]<<16,a[4]<<0|a[3]<<8|a[2]<<16,a[1]<<0|a[0]<<8)}function +c0(d){var +f=d.lo,g=d.mi,b=d.hi,c=(b&0x7fff)>>4;if(c==2047)return(f|g|b&gu)==0?b&bi?-Infinity:Infinity:NaN;var +e=Math.pow(2,-24),a=(f*e+g)*e+(b&gu);if(c>0){a+=16;a*=Math.pow(2,c-mq)}else +a*=Math.pow(2,-lB);if(b&bi)a=-a;return a}function +gV(b){var d=b.length,c=1;for(var -a=0;a>>24&a1|(a&bp)<<8,a>>>16&bp)}function -gN(a){return a.hi32()}function -gO(a){return a.lo32()}var -GH=eC;function -b6(c,d,b,a){this.kind=c;this.layout=d;this.dims=b;this.data=a}b6.prototype.caml_custom=GH;b6.prototype.offset=function(b){var +a=0;a>>24&aZ|(a&bn)<<8,a>>>16&bn)}function +g4(a){return a.hi32()}function +g5(a){return a.lo32()}var +HM=eL;function +b8(c,d,b,a){this.kind=c;this.layout=d;this.dims=b;this.data=a}b8.prototype.caml_custom=HM;b8.prototype.offset=function(b){var c=0;if(typeof b==="number")b=[b];if(!(b instanceof -Array))ah("bigarray.js: invalid offset");if(this.dims.length!=b.length)ah("Bigarray.get/set: bad number of dimensions");if(this.layout==0)for(var -a=0;a=this.dims[a])dI();c=c*this.dims[a]+b[a]}else +Array))aj("bigarray.js: invalid offset");if(this.dims.length!=b.length)aj("Bigarray.get/set: bad number of dimensions");if(this.layout==0)for(var +a=0;a=this.dims[a])dL();c=c*this.dims[a]+b[a]}else for(var -a=this.dims.length-1;a>=0;a--){if(b[a]<1||b[a]>this.dims[a])dI();c=c*this.dims[a]+(b[a]-1)}return c};b6.prototype.get=function(a){switch(this.kind){case +a=this.dims.length-1;a>=0;a--){if(b[a]<1||b[a]>this.dims[a])dL();c=c*this.dims[a]+(b[a]-1)}return c};b8.prototype.get=function(a){switch(this.kind){case 7:var -d=this.data[a*2+0],b=this.data[a*2+1];return mB(d,b);case +d=this.data[a*2+0],b=this.data[a*2+1];return mP(d,b);case 10:case 11:var -e=this.data[a*2+0],c=this.data[a*2+1];return[du,e,c];default:return this.data[a]}};b6.prototype.set=function(a,b){switch(this.kind){case -7:this.data[a*2+0]=gO(b);this.data[a*2+1]=gN(b);break;case +e=this.data[a*2+0],c=this.data[a*2+1];return[dx,e,c];default:return this.data[a]}};b8.prototype.set=function(a,b){switch(this.kind){case +7:this.data[a*2+0]=g5(b);this.data[a*2+1]=g4(b);break;case 10:case -11:this.data[a*2+0]=b[1];this.data[a*2+1]=b[2];break;default:this.data[a]=b;break}return 0};b6.prototype.fill=function(b){switch(this.kind){case +11:this.data[a*2+0]=b[1];this.data[a*2+1]=b[2];break;default:this.data[a]=b;break}return 0};b8.prototype.fill=function(b){switch(this.kind){case 7:var -c=gO(b),e=gN(b);if(c==e)this.data.fill(c);else +c=g5(b),e=g4(b);if(c==e)this.data.fill(c);else for(var a=0;ab.data[a])return 1}break}return 0};function -cT(c,d,b,a){this.kind=c;this.layout=d;this.dims=b;this.data=a}cT.prototype=new -b6();cT.prototype.offset=function(a){if(typeof +cX(c,d,b,a){this.kind=c;this.layout=d;this.dims=b;this.data=a}cX.prototype=new +b8();cX.prototype.offset=function(a){if(typeof a!=="number")if(a instanceof Array&&a.length==1)a=a[0];else -ah("Ml_Bigarray_c_1_1.offset");if(a<0||a>=this.dims[0])dI();return a};cT.prototype.get=function(a){return this.data[a]};cT.prototype.set=function(a,b){this.data[a]=b;return 0};cT.prototype.fill=function(a){this.data.fill(a);return 0};function -mj(c,d,a,b){var -e=ml(c);if(gF(a)*e!=b.length)ah("length doesn't match dims");if(d==0&&a.length==1&&e==1)return new -cT(c,d,a,b);return new -b6(c,d,a,b)}function -b$(a){gU(ag.Failure,a)}function -mk(b,v,r){var -i=b.read32s();if(i<0||i>16)b$("input_value: wrong number of bigarray dimensions");var -p=b.read32s(),j=p&a1,o=p>>8&1,h=[];if(r==eC)for(var +aj("Ml_Bigarray_c_1_1.offset");if(a<0||a>=this.dims[0])dL();return a};cX.prototype.get=function(a){return this.data[a]};cX.prototype.set=function(a,b){this.data[a]=b;return 0};cX.prototype.fill=function(a){this.data.fill(a);return 0};function +mz(c,d,a,b){var +e=mB(c);if(gV(a)*e!=b.length)aj("length doesn't match dims");if(d==0&&a.length==1&&e==1)return new +cX(c,d,a,b);return new +b8(c,d,a,b)}function +ca(b){if(!ab.Failure)ab.Failure=[N,a(gC),-3];g$(ab.Failure,b)}function +mA(b,v,r){var +i=b.read32s();if(i<0||i>16)ca("input_value: wrong number of bigarray dimensions");var +p=b.read32s(),j=p&aZ,o=p>>8&1,h=[];if(r==eL)for(var a=0;a>>32-15;a=by(a,0x1b873593);b^=a;b=b<<13|b>>>32-13;return(b+(b<<2)|0)+(0xe6546b64|0)|0}function -GU(a,b){a=av(a,gO(b));a=av(a,gN(b));return a}function -gJ(a,b){return GU(a,eX(b))}function -mm(c){var -b=gF(c.dims),d=0;switch(c.kind){case +l=c0(dO(e));g.set(a,[dx,m,l])}break}v[0]=(4+i)*4;return mz(j,o,h,f)}function +my(a,b,c){return a.compare(b,c)}function +bc(a,b){return Math.imul(a,b)}function +av(b,a){a=bc(a,0xcc9e2d51|0);a=a<<15|a>>>32-15;a=bc(a,0x1b873593);b^=a;b=b<<13|b>>>32-13;return(b+(b<<2)|0)+(0xe6546b64|0)|0}function +HZ(a,b){a=av(a,g5(b));a=av(a,g4(b));return a}function +g0(a,b){return HZ(a,e_(b))}function +mC(c){var +b=gV(c.dims),d=0;switch(c.kind){case 2:case 3:case -12:if(b>cR)b=cR;var +12:if(b>cV)b=cV;var e=0,a=0;for(a=0;a+4<=c.data.length;a+=4){e=c.data[a+0]|c.data[a+1]<<8|c.data[a+2]<<16|c.data[a+3]<<24;d=av(d,e)}e=0;switch(b&3){case 3:e=c.data[a+2]<<16;case 2:e|=c.data[a+1]<<8;case 1:e|=c.data[a+0];d=av(d,e)}break;case 4:case -5:if(b>ck)b=ck;var +5:if(b>bN)b=bN;var e=0,a=0;for(a=0;a+2<=c.data.length;a+=2){e=c.data[a+0]|c.data[a+1]<<16;d=av(d,e)}if((b&1)!=0)d=av(d,c.data[a]);break;case 6:if(b>64)b=64;for(var a=0;a64)b=64;for(var -a=0;a32)b=32;for(var -a=0;a0?b(c,f,e):b(f,c,e);if(e&&a!=a)return d;if(+a!=+a)return+a;if((a|0)!=0)return a|0}return d}function -dN(a){return a +dQ(a){return a instanceof -bv}function -e0(a){return dN(a)}function -mu(a){if(typeof -a==="number")return a8;else -if(dN(a))return ez;else -if(e0(a))return 1252;else +bu}function +fb(a){return dQ(a)}function +mK(a){if(typeof +a==="number")return a6;else +if(dQ(a))return eG;else +if(fb(a))return 1252;else if(a instanceof -Array&&a[0]===a[0]>>>0&&a[0]<=cN){var -b=a[0]|0;return b==du?0:b}else +Array&&a[0]===a[0]>>>0&&a[0]<=cR){var +b=a[0]|0;return b==dx?0:b}else if(a instanceof -String)return i4;else +String)return jl;else if(typeof -a=="string")return i4;else +a=="string")return jl;else if(a instanceof -Number)return a8;else -if(a&&a.caml_custom)return gc;else +Number)return a6;else +if(a&&a.caml_custom)return gp;else if(a&&a.compare)return 1256;else if(typeof a=="function")return 1247;else if(typeof a=="symbol")return 1251;return 1001}function -eZ(a,b){if(ab.c?1:0}function -gW(a,b){return mp(a,b)}function -cU(a,b,d){var +fa(a,b){if(ab.c?1:0}function +hb(a,b){return mF(a,b)}function +cY(a,b,d){var e=[];for(;;){if(!(d&&a===b)){var -f=mu(a);if(f==ep){a=a[1];continue}var -g=mu(b);if(g==ep){b=b[1];continue}if(f!==g){if(f==a8){if(g==gc)return mt(a,b,-1,d);return-1}if(g==a8){if(f==gc)return mt(b,a,1,d);return 1}return fb)return 1;if(a!=b){if(!d)return NaN;if(a==a)return 1;if(b==b)return-1}break;case 1251:if(a!==b){if(!d)return NaN;return 1}break;case 1252:var -a=bf(a),b=bf(b);if(a!==b){if(ab)return 1}break;case +a=bw(a),b=bw(b);if(a!==b){if(ab)return 1}break;case 12520:var a=a.toString(),b=b.toString();if(a!==b){if(ab)return 1}break;case 246:case 254:default:if(a.length!=b.length)return a.length1)e.push(a,b,1);break}}if(e.length==0)return 0;var h=e.pop();b=e.pop();a=e.pop();if(h+10)if(c==0&&(b>=a.l||a.t==2&&b>=a.c.length))if(d==0){a.c=o;a.t=2}else{a.c=cY(b,String.fromCharCode(d));a.t=b==a.l?0:2}else{if(a.t!=4)eU(a);for(b+=c;c31)ah("format_int: format too long");var -a={justify:bI,signstyle:aC,filler:bJ,alternate:false,base:0,signedconv:false,width:0,uppercase:false,sign:1,prec:-1,conv:"f"};for(var +mI(a,b){return cY(a,b,true)}function +HQ(){return[0]}function +ai(a){if(a<0)aj("Bytes.create");return new +bu(a?2:9,k,a)}function +gX(b,a){if(a==0)c1();return b/a|0}function +E(a,b){return+(cY(a,b,false)==0)}function +HS(a,c,b,d){if(b>0)if(c==0&&(b>=a.l||a.t==2&&b>=a.c.length))if(d==0){a.c=k;a.t=2}else{a.c=c2(b,String.fromCharCode(d));a.t=b==a.l?0:2}else{if(a.t!=4)e7(a);for(b+=c;c31)aj("format_int: format too long");var +a={justify:bH,signstyle:aD,filler:bI,alternate:false,base:0,signedconv:false,width:0,uppercase:false,sign:1,prec:-1,conv:"f"};for(var c=0;c=0&&b<=9){a.width=a.width*10+b;c++}c--;break;case".":a.prec=0;c++;while(b=d.charCodeAt(c)-48,b>=0&&b<=9){a.prec=a.prec*10+b;c++}c--;case"d":case"i":a.signedconv=true;case"u":a.base=10;break;case"x":a.base=16;break;case"X":a.base=16;a.uppercase=true;break;case"o":a.base=8;break;case"e":case"f":case"g":a.signedconv=true;a.conv=b;break;case"E":case"F":case"G":a.signedconv=true;a.uppercase=true;a.conv=b.toLowerCase();break}}return a}function -gH(b,f){if(b.uppercase)f=f.toUpperCase();var -e=f.length;if(b.signedconv&&(b.sign<0||b.signstyle!=aC))e++;if(b.alternate){if(b.base==8)e+=1;if(b.base==16)e+=2}var -c=o;if(b.justify==bI&&b.filler==bJ)for(var -d=e;d=0&&b<=9){a.width=a.width*10+b;c++}c--;break;case".":a.prec=0;c++;while(b=d.charCodeAt(c)-48,b>=0&&b<=9){a.prec=a.prec*10+b;c++}c--;case"d":case"i":a.signedconv=true;case"u":a.base=10;break;case"x":a.base=16;break;case"X":a.base=16;a.uppercase=true;break;case"o":a.base=8;break;case"e":case"f":case"g":a.signedconv=true;a.conv=b;break;case"E":case"F":case"G":a.signedconv=true;a.uppercase=true;a.conv=b.toLowerCase();break}}return a}function +gY(b,f){if(b.uppercase)f=f.toUpperCase();var +e=f.length;if(b.signedconv&&(b.sign<0||b.signstyle!=aD))e++;if(b.alternate){if(b.base==8)e+=1;if(b.base==16)e+=2}var +c=k;if(b.justify==bH&&b.filler==bI)for(var +d=e;d20){c-=20;a/=Math.pow(10,c);a+=new -Array(c+1).join(k);if(b>0)a=a+bn+new -Array(b+1).join(k);return a}else +c=parseInt(a.toString().split(bH)[1]);if(c>20){c-=20;a/=Math.pow(10,c);a+=new +Array(c+1).join(m);if(b>0)a=a+bl+new +Array(b+1).join(m);return a}else return a.toFixed(b)}}var -a,e=gT(i),d=e.prec<0?6:e.prec;if(c<0||c==0&&1/c==-Infinity){e.sign=-1;c=-c}if(isNaN(c)){a=gr;e.filler=bJ}else -if(!isFinite(c)){a=l4;e.filler=bJ}else +a,e=g_(i),d=e.prec<0?6:e.prec;if(c<0||c==0&&1/c==-Infinity){e.sign=-1;c=-c}if(isNaN(c)){a=gE;e.filler=bI}else +if(!isFinite(c)){a=mi;e.filler=bI}else switch(e.conv){case"e":var -a=c.toExponential(d),b=a.length;if(a.charAt(b-3)==eS)a=a.slice(0,b-1)+k+a.slice(b-1);break;case"f":a=j(c,d);break;case"g":d=d?d:1;a=c.toExponential(d-1);var -h=a.indexOf(eS),g=+a.slice(h+1);if(g<-4||c>=1e21||c.toFixed(0).length>d){var -b=h-1;while(a.charAt(b)==k)b--;if(a.charAt(b)==bn)b--;a=a.slice(0,b+1)+a.slice(h);b=a.length;if(a.charAt(b-3)==eS)a=a.slice(0,b-1)+k+a.slice(b-1);break}else{var +a=c.toExponential(d),b=a.length;if(a.charAt(b-3)==e5)a=a.slice(0,b-1)+m+a.slice(b-1);break;case"f":a=j(c,d);break;case"g":d=d?d:1;a=c.toExponential(d-1);var +h=a.indexOf(e5),g=+a.slice(h+1);if(g<-4||c>=1e21||c.toFixed(0).length>d){var +b=h-1;while(a.charAt(b)==m)b--;if(a.charAt(b)==bl)b--;a=a.slice(0,b+1)+a.slice(h);b=a.length;if(a.charAt(b-3)==e5)a=a.slice(0,b-1)+m+a.slice(b-1);break}else{var f=d;if(g<0){f-=g+1;a=c.toFixed(f)}else while(a=c.toFixed(f),a.length>d+1)f--;if(f){var -b=a.length-1;while(a.charAt(b)==k)b--;if(a.charAt(b)==bn)b--;a=a.slice(0,b+1)}}break}return gH(e,a)}function -eV(e,c){if(bf(e)==gy)return a(o+c);var -b=gT(e);if(c<0)if(b.signedconv){b.sign=-1;c=-c}else +b=a.length-1;while(a.charAt(b)==m)b--;if(a.charAt(b)==bl)b--;a=a.slice(0,b+1)}}break}return gY(e,a)}function +e8(e,c){if(bw(e)==gM)return a(k+c);var +b=g_(e);if(c<0)if(b.signedconv){b.sign=-1;c=-c}else c>>>=0;var -d=c.toString(b.base);if(b.prec>=0){b.filler=bJ;var -f=b.prec-d.length;if(f>0)d=cY(f,k)+d}return gH(b,d)}var -mH=0;function -aj(){return mH++}function -a2(a){return a.toUtf16()}function -HF(){function -a(a){if(a.charAt(0)===br)return[o,a.substring(1)];return}function +d=c.toString(b.base);if(b.prec>=0){b.filler=bI;var +f=b.prec-d.length;if(f>0)d=c2(f,m)+d}return gY(b,d)}var +mW=0;function +aE(){return mW++}function +a0(a){return a.toUtf16()}function +dU(){return typeof +y.process!=="undefined"&&typeof +y.process.versions!=="undefined"&&typeof +y.process.versions.node!=="undefined"}function +IJ(){function +a(a){if(a.charAt(0)===bq)return[k,a.substring(1)];return}function b(c){var -g=/^([a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)?([\\/])?([\s\S]*?)$/,a=g.exec(c),b=a[1]||o,e=Boolean(b&&b.charAt(1)!==":");if(Boolean(a[2]||e)){var -d=a[1]||o,f=a[2]||o;return[d,c.substring(d.length+f.length)]}return}return B.process&&B.process.platform?B.process.platform==="win32"?b:a:a}var -g0=HF();function -mL(a){return a.slice(-1)!==br?a+br:a}if(B.process&&B.process.cwd)var -dK=B.process.cwd().replace(/\\/g,br);else +g=/^([a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)?([\\/])?([\s\S]*?)$/,a=g.exec(c),b=a[1]||k,e=Boolean(b&&b.charAt(1)!==":");if(Boolean(a[2]||e)){var +d=a[1]||k,f=a[2]||k;return[d,c.substring(d.length+f.length)]}return}return dU()&&y.process&&y.process.platform?y.process.platform==="win32"?b:a:a}var +hf=IJ();function +m0(a){return a.slice(-1)!==bq?a+bq:a}if(dU()&&y.process&&y.process.cwd)var +dN=y.process.cwd().replace(/\\/g,bq);else var -dK="/static";dK=mL(dK);function -Hb(a){a=a2(a);if(!g0(a))a=dK+a;var -e=g0(a),d=e[1].split(br),b=[];for(var +dN="/static";dN=m0(dN);function +If(a){a=a0(a);if(!hf(a))a=dN+a;var +e=hf(a),d=e[1].split(bq),b=[];for(var c=0;c1)b.pop();break;case".":break;default:b.push(d[c]);break}b.unshift(e[0]);b.orig=a;return b}function -Hx(e){for(var -f=o,b=f,a,h,c=0,g=e.length;cf9){b.substr(0,1);f+=b;b=o;f+=e.slice(c,d)}else -b+=e.slice(c,d);if(d==g)break;c=d}if(a>6);b+=String.fromCharCode(a$|a&cD)}else -if(a<0xd800||a>=k1)b+=String.fromCharCode(iU|a>>12,a$|a>>6&cD,a$|a&cD);else -if(a>=0xdbff||c+1==g||(h=e.charCodeAt(c+1))k1)b+="\xef\xbf\xbd";else{c++;a=(a<<10)+h-0x35fdc00;b+=String.fromCharCode(kc|a>>18,a$|a>>12&cD,a$|a>>6&cD,a$|a&cD)}if(b.length>dC){b.substr(0,1);f+=b;b=o}}return f+b}function -GJ(a){var -b=9;if(!mN(a))b=8,a=Hx(a);return new -bv(b,a,a.length)}function -aP(a){return GJ(a)}var -HR=[jv,mb,kp,iM,kk,k0,jL,ld,f$,jO,lc,kd,le,jK,iw,me,iL,iT,j6,kK,eQ,i7,l0,li,lJ,kD,eI,gz,i3,i2,j0,l3,lY,l7,jw,iW,ji,kU,l$,ka,jB,kn,iS,ke,iz,lg,lU,jz,i5,j9,kE,jR,kO,kj,lf,jN,jx,lB,k8,lN,k4,kZ,kY,iR,jE,jd,lp,lG];function -cp(d,f,e,a){var -b=HR.indexOf(d);if(b<0){if(a==null)a=-9999;b=[0,a]}var -c=[b,aP(f||o),aP(e||o)];return c}var -mF={};function -bQ(a){return mF[a]}function -co(b,a){throw[0,b].concat(a)}function -GI(a){return new -bv(4,a,a.length)}function -S(a){gU(ag.Sys_error,a)}function -Hl(a){a=bf(a);S(a+en)}function -a3(a){return a.l}function -mh(){}function +Iz(e){for(var +f=k,b=f,a,h,c=0,g=e.length;cgk){b.substr(0,1);f+=b;b=k;f+=e.slice(c,d)}else +b+=e.slice(c,d);if(d==g)break;c=d}if(a>6);b+=String.fromCharCode(a8|a&cH)}else +if(a<0xd800||a>=le)b+=String.fromCharCode(jb|a>>12,a8|a>>6&cH,a8|a&cH);else +if(a>=0xdbff||c+1==g||(h=e.charCodeAt(c+1))le)b+="\xef\xbf\xbd";else{c++;a=(a<<10)+h-0x35fdc00;b+=String.fromCharCode(ku|a>>18,a8|a>>12&cH,a8|a>>6&cH,a8|a&cH)}if(b.length>dE){b.substr(0,1);f+=b;b=k}}return f+b}function +HO(a){var +b=9;if(!m2(a))b=8,a=Iz(a);return new +bu(b,a,a.length)}function +aQ(a){return HO(a)}var +IY=[jN,mr,kG,i4,kB,ld,j3,lr,gm,j6,lq,kv,ls,j2,iO,mu,i3,ja,km,k2,e2,jo,me,lw,lZ,kV,eT,gO,jk,jj,kg,mh,mc,ml,jO,je,jA,k_,mp,ks,jT,kE,i$,kw,iR,lu,l_,jR,jm,kp,kW,j9,k6,kA,lt,j5,jP,lQ,ll,l3,li,lc,lb,i_,jW,jv,lD,lV];function +cs(d,f,e,a){var +b=IY.indexOf(d);if(b<0){if(a==null)a=-9999;b=[0,a]}var +c=[b,aQ(f||k),aQ(e||k)];return c}var +mU={};function +bQ(a){return mU[a]}function +cr(b,a){throw[0,b].concat(a)}function +HN(a){return new +bu(4,a,a.length)}function +T(a){g$(ab.Sys_error,a)}function +Ip(a){T(a+et)}function +a1(a){return a.l}function +mx(){}function at(a){this.data=a}at.prototype=new -mh();at.prototype.truncate=function(a){var -b=this.data;this.data=af(a|0);b7(b,0,this.data,0,a)};at.prototype.length=function(){return a3(this.data)};at.prototype.write=function(b,d,g,a){var +mx();at.prototype.truncate=function(a){var +b=this.data;this.data=ai(a|0);b9(b,0,this.data,0,a)};at.prototype.length=function(){return a1(this.data)};at.prototype.write=function(b,d,g,a){var c=this.length();if(b+a>=c){var -e=af(b+a),f=this.data;this.data=e;b7(f,0,this.data,0,c)}b8(d,g,this.data,b,a);return 0};at.prototype.read=function(c,a,d,b){var -e=this.length();b7(this.data,c,a,d,b);return 0};at.prototype.read_one=function(a){return b9(this.data,a)};at.prototype.close=function(){};at.prototype.constructor=at;function -aJ(b,a){this.content={};this.root=b;this.lookupFun=a}aJ.prototype.nm=function(a){return this.root+a};aJ.prototype.create_dir_if_needed=function(d){var -c=d.split(br),b=o;for(var -a=0;a>1|1;if(h=0)}function -gK(d,b){var +a=c}fd[d]=a+1;return h==b[a+1]?b[a]:0}function +mO(a,b){return+(cY(a,b,false)>=0)}function +g1(d,b){var e=b.length,a,c;for(a=0;a+4<=e;a+=4){c=b.charCodeAt(a)|b.charCodeAt(a+1)<<8|b.charCodeAt(a+2)<<16|b.charCodeAt(a+3)<<24;d=av(d,c)}c=0;switch(e&3){case 3:c=b.charCodeAt(a+2)<<16;case 2:c|=b.charCodeAt(a+1)<<8;case 1:c|=b.charCodeAt(a);d=av(d,c)}d^=e;return d}function -GV(a,b){return gK(a,bf(b))}function -GS(d,b){var +H0(a,b){return g1(a,bw(b))}function +HX(d,b){var e=b.length,a,c;for(a=0;a+4<=e;a+=4){c=b[a]|b[a+1]<<8|b[a+2]<<16|b[a+3]<<24;d=av(d,c)}c=0;switch(e&3){case 3:c=b[a+2]<<16;case 2:c|=b[a+1]<<8;case 1:c|=b[a];d=av(d,c)}d^=e;return d}function -GR(a,b){switch(b.t&6){default:b_(b);case -0:a=gK(a,b.c);break;case -2:a=GS(a,b.c)}return a}function -GT(a){a^=a>>>16;a=by(a,0x85ebca6b|0);a^=a>>>13;a=by(a,0xc2b2ae35|0);a^=a>>>16;return a}function -GQ(j,l,n,m){var -f,g,h,d,c,b,a,e,i;d=l;if(d<0||d>cR)d=cR;c=j;b=n;f=[m];g=0;h=1;while(g0){a=f[g++];if(a&&a.caml_custom){if(cV[a.caml_custom]&&cV[a.caml_custom].hash){var -k=cV[a.caml_custom].hash(a);b=av(b,k);c--}}else +mR(a){switch(a.t&6){default:cn(a);case +0:return a.c;case +4:return a.c}}function +HW(b,c){var +a=mR(c);return typeof +a==="string"?g1(b,a):HX(b,a)}function +HY(a){a^=a>>>16;a=bc(a,0x85ebca6b|0);a^=a>>>13;a=bc(a,0xc2b2ae35|0);a^=a>>>16;return a}function +HV(j,l,n,m){var +f,g,h,d,c,b,a,e,i;d=l;if(d<0||d>cV)d=cV;c=j;b=n;f=[m];g=0;h=1;while(g0){a=f[g++];if(a&&a.caml_custom){if(cZ[a.caml_custom]&&cZ[a.caml_custom].hash){var +k=cZ[a.caml_custom].hash(a);b=av(b,k);c--}}else if(a instanceof Array&&a[0]===(a[0]|0))switch(a[0]){case 248:b=av(b,a[2]);c--;break;case 250:f[--g]=a[1];break;default:var o=a.length-1<<10|a[0];b=av(b,o);for(e=1,i=a.length;e=d)break;f[h++]=a[e]}break}else -if(dN(a)){b=GR(b,a);c--}else -if(e0(a)){b=GV(b,a);c--}else +if(dQ(a)){b=HW(b,a);c--}else +if(fb(a)){b=H0(b,a);c--}else if(typeof -a==="string"){b=gK(b,a);c--}else +a==="string"){b=g1(b,a);c--}else if(a===(a|0)){b=av(b,a+a+1);c--}else -if(a===+a){b=gJ(b,a);c--}}b=GT(b);return b&0x3FFFFFFF}function -GW(a,c,l){if(!isFinite(a)){if(isNaN(a))return aP(gr);return aP(a>0?lX:"-infinity")}var +if(a===+a){b=g0(b,a);c--}}b=HY(b);return b&0x3FFFFFFF}function +H1(a,c,l){if(!isFinite(a)){if(isNaN(a))return aQ(gE);return aQ(a>0?mb:"-infinity")}var i=a==0&&1/a==-Infinity?1:a>=0?0:1;if(i)a=-a;var d=0;if(a==0);else if(a<1)while(a<1&&d>-1022){a*=2;d--}else while(a>=2){a/=2;d++}var -j=d<0?o:bI,e=o;if(i)e=aC;else +j=d<0?k:bH,e=k;if(i)e=aD;else switch(l){case -43:e=bI;break;case -32:e=bJ;break;default:break}if(c>=0&&c<13){var +43:e=bH;break;case +32:e=bI;break;default:break}if(c>=0&&c<13){var g=Math.pow(2,c*4);a=Math.round(a*g)/g}var b=a.toString(16);if(c>=0){var -h=b.indexOf(bn);if(h<0)b+=bn+cY(c,k);else{var -f=h+1+c;if(b.length>24&bM,a>>31&bp)}function -G7(a){return a.toInt()}function -G1(a){return+a.isNeg()}function -G4(a){return a.neg()}function -GZ(g,c){var -a=gT(g);if(a.signedconv&&G1(c)){a.sign=-1;c=G4(c)}var -b=o,h=G5(a.base),f="0123456789abcdef";do{var -e=c.udivmod(h);c=e.quotient;b=f.charAt(G7(e.modulus))+b}while(!G2(c));if(a.prec>=0){a.filler=bJ;var -d=a.prec-b.length;if(d>0)b=cY(d,k)+b}return gH(a,b)}function -G6(a,b){return a.or(b)}function -eY(a){return a.toFloat()}function -G_(){return typeof -module!=="undefined"&&module&&module.exports?module.exports:B}function -cl(a){return a.slice(1)}function -G$(c){var +h=b.indexOf(bl);if(h<0)b+=bl+c2(c,m);else{var +f=h+1+c;if(b.length>24&bL,a>>31&bn)}function +Ia(a){return a.toInt()}function +H6(a){return+a.isNeg()}function +H9(a){return a.neg()}function +H4(g,c){var +a=g_(g);if(a.signedconv&&H6(c)){a.sign=-1;c=H9(c)}var +b=k,h=H_(a.base),f="0123456789abcdef";do{var +e=c.udivmod(h);c=e.quotient;b=f.charAt(Ia(e.modulus))+b}while(!H7(c));if(a.prec>=0){a.filler=bI;var +d=a.prec-b.length;if(d>0)b=c2(d,m)+b}return gY(a,b)}function +H$(a,b){return a.or(b)}function +e$(a){return a.toFloat()}function +co(a){return a.slice(1)}function +Id(c){var d=c.length,b=new Array(d+1);b[0]=0;for(var a=0;a0){var c=new Array(b);for(var -a=0;abt){a-=bt;b*=Math.pow(2,bt);if(a>bt){a-=bt;b*=Math.pow(2,bt)}}if(a<-bt){a+=bt;b*=Math.pow(2,-bt)}b*=Math.pow(2,a);return b}function -Ha(a,b){return+(cU(a,b,false)<=0)}function -gR(a,b){return+(cU(a,b,false)<0)}function -bP(a,d){if(a<0)dI();var +a=0;abs){a-=bs;b*=Math.pow(2,bs);if(a>bs){a-=bs;b*=Math.pow(2,bs)}}if(a<-bs){a+=bs;b*=Math.pow(2,-bs)}b*=Math.pow(2,a);return b}function +Ie(a,b){return+(cY(a,b,false)<=0)}function +g8(a,b){return+(cY(a,b,false)<0)}function +bP(a,d){if(a<0)dL();var a=a+1|0,b=new Array(a);b[0]=0;for(var c=1;c>>32-b,c)}function g(c,b,d,e,h,f,g){return a(b&d|~b&e,c,b,h,f,g)}function @@ -713,42 +717,41 @@ h(d,b,e,c,h,f,g){return a(b&c|e&~c,d,b,h,f,g)}function i(c,b,d,e,h,f,g){return a(b^d^e,c,b,h,f,g)}function j(c,b,d,e,h,f,g){return a(d^(b|~e),c,b,h,f,g)}function k(f,n){var -e=n;f[e>>2]|=a$<<8*(e&3);for(e=(e&~0x3)+8;(e&0x3F)<60;e+=4)f[(e>>2)-1]=0;f[(e>>2)-1]=n<<3;f[e>>2]=n>>29&0x1FFFFFFF;var +e=n;f[e>>2]|=a8<<8*(e&3);for(e=(e&~0x3)+8;(e&0x3F)<60;e+=4)f[(e>>2)-1]=0;f[(e>>2)-1]=n<<3;f[e>>2]=n>>29&0x1FFFFFFF;var k=[0x67452301,0xEFCDAB89,0x98BADCFE,0x10325476];for(e=0;e>8*m&0xFF;return o}return function(h,g,f){var -e=[];switch(h.t&6){default:b_(h);case -0:var -d=h.c;for(var +m=0;m<4;m++)o[e*4+m]=k[e]>>8*m&0xFF;return o}return function(i,g,f){var +e=[],h=mR(i);if(typeof +h==="string"){var +d=h;for(var a=0;a>2]=d.charCodeAt(b)|d.charCodeAt(b+1)<<8|d.charCodeAt(b+2)<<16|d.charCodeAt(b+3)<<24}for(;a>2]|=d.charCodeAt(a+g)<<8*(a&3);break;case -4:var -c=h.c;for(var +b=a+g;e[a>>2]=d.charCodeAt(b)|d.charCodeAt(b+1)<<8|d.charCodeAt(b+2)<<16|d.charCodeAt(b+3)<<24}for(;a>2]|=d.charCodeAt(a+g)<<8*(a&3)}else{var +c=h;for(var a=0;a>2]=c[b]|c[b+1]<<8|c[b+2]<<16|c[b+3]<<24}for(;a>2]|=c[a+g]<<8*(a&3)}return Hr(k(e,f))}}();function -Hd(c,b,a){return Hc(bO(c),b,a)}function -He(){return 0}var +b=a+g;e[a>>2]=c[b]|c[b+1]<<8|c[b+2]<<16|c[b+3]<<24}for(;a>2]|=c[a+g]<<8*(a&3)}return Iv(k(e,f))}}();function +Ih(c,b,a){return Ig(bO(c),b,a)}function +Ii(){return 0}var bx=new Array();function -cm(c){var -a=bx[c];if(!a.opened)S("Cannot flush a closed channel");if(!a.buffer||a.buffer==o)return 0;if(a.fd&&ag.fds[a.fd]&&ag.fds[a.fd].output){var -b=ag.fds[a.fd].output;switch(b.length){case -2:b(c,a.buffer);break;default:b(a.buffer)}}a.buffer=o;return 0}function -mJ(e,f){var -b=bx[e],d=a(f),c=G(d);b.file.write(b.offset,d,0,c);b.offset+=c;return 0}function -HA(a){var -a=gY(a),b=B;if(b.process&&b.process.stdout&&b.process.stdout.write)b.process.stderr.write(a);else{if(a.charCodeAt(a.length-1)==10)a=a.substr(0,a.length-1);var +cp(c){var +a=bx[c];if(!a.opened)T("Cannot flush a closed channel");if(!a.buffer||a.buffer==k)return 0;if(a.fd&&ab.fds[a.fd]&&ab.fds[a.fd].output){var +b=ab.fds[a.fd].output;switch(b.length){case +2:b(c,a.buffer);break;default:b(a.buffer)}}a.buffer=k;return 0}function +mY(e,f){var +b=bx[e],d=a(f),c=I(d);b.file.write(b.offset,d,0,c);b.offset+=c;return 0}function +ID(a){var +a=hd(a),b=y;if(b.process&&b.process.stdout&&b.process.stdout.write)b.process.stderr.write(a);else{if(a.charCodeAt(a.length-1)==10)a=a.substr(0,a.length-1);var c=b.console;c&&c.error&&c.error(a)}}function -HB(a){var -a=gY(a),b=B;if(b.process&&b.process.stdout&&b.process.stdout.write)b.process.stdout.write(a);else{if(a.charCodeAt(a.length-1)==10)a=a.substr(0,a.length-1);var +IE(a){var +a=hd(a),b=y;if(b.process&&b.process.stdout&&b.process.stdout.write)b.process.stdout.write(a);else{if(a.charCodeAt(a.length-1)==10)a=a.substr(0,a.length-1);var c=b.console;c&&c.log&&c.log(a)}}function -e6(c,e,d,a){if(ag.fds===undefined)ag.fds=new +fh(c,e,d,a){if(ab.fds===undefined)ab.fds=new Array();a=a?a:{};var -b={};b.file=d;b.offset=a.append?d.length():0;b.flags=a;b.output=e;ag.fds[c]=b;if(!ag.fd_last_idx||c>ag.fd_last_idx)ag.fd_last_idx=c;return c}function -HT(c,b,g){var +b={};b.file=d;b.offset=a.append?d.length():0;b.flags=a;b.output=e;ab.fds[c]=b;if(!ab.fd_last_idx||c>ab.fd_last_idx)ab.fd_last_idx=c;return c}function +I0(c,b,g){var a={};while(b){switch(b[1]){case 0:a.rdonly=1;break;case 1:a.wronly=1;break;case @@ -758,141 +761,143 @@ a={};while(b){switch(b[1]){case 5:a.excl=1;break;case 6:a.binary=1;break;case 7:a.text=1;break;case -8:a.nonblock=1;break}b=b[2]}if(a.rdonly&&a.wronly)S(bf(c)+i$);if(a.text&&a.binary)S(bf(c)+jM);var -d=mS(c),e=d.device.open(d.rest,a),f=ag.fd_last_idx?ag.fd_last_idx:0;return e6(f+1,mJ,e,a)}e6(0,mJ,new -at(af(0)));e6(1,HB,new -at(af(0)));e6(2,HA,new -at(af(0)));function -Hf(a){var -c=ag.fds[a];if(c.flags.wronly)S(ku+a+" is writeonly");var -d=null;if(a==0&&mM()){var -e=require("fs");d=function(){return aP(e.readFileSync(0,iy))}}var +8:a.nonblock=1;break}b=b[2]}if(a.rdonly&&a.wronly)T(bw(c)+js);if(a.text&&a.binary)T(bw(c)+j4);var +d=m$(c),e=d.device.open(d.rest,a),f=ab.fd_last_idx?ab.fd_last_idx:0;return fh(f+1,mY,e,a)}fh(0,mY,new +at(ai(0)));fh(1,IE,new +at(ai(0)));fh(2,ID,new +at(ai(0)));function +Ij(a){var +c=ab.fds[a];if(c.flags.wronly)T(kL+a+" is writeonly");var +d=null;if(a==0&&dU()){var +e=require("fs");d=function(){return aQ(e.readFileSync(0,iQ))}}var b={file:c.file,offset:c.offset,fd:a,opened:true,out:false,refill:d};bx[b.fd]=b;return b.fd}function -mD(c){var -b=ag.fds[c];if(b.flags.rdonly)S(ku+c+" is readonly");var -a={file:b.file,offset:b.offset,fd:c,opened:true,out:true,buffer:o};bx[a.fd]=a;return a.fd}function -Hg(){var +mS(c){var +b=ab.fds[c];if(b.flags.rdonly)T(kL+c+" is readonly");var +a={file:b.file,offset:b.offset,fd:c,opened:true,out:true,buffer:k};bx[a.fd]=a;return a.fd}function +Ik(){var b=0;for(var a=0;a>>0)return a[0];else -if(dN(a))return ez;else -if(e0(a))return ez;else +if(dQ(a))return eG;else +if(fb(a))return eG;else if(a instanceof Function||typeof a=="function")return 247;else -if(a&&a.caml_custom)return cN;else -return a8}function -bb(b,c,a){if(a&&B.toplevelReloc)b=B.toplevelReloc(a);ag[b+1]=c;if(a)ag[a]=c}function -gV(a,b){mF[bf(a)]=b;return 0}function -Ho(a){a[2]=mH++;return a}function -gX(a,b){return mq(a,b)}function -Hq(){ah(gn)}function -E(b,a){if(a>>>0>=G(b))Hq();return cZ(b,a)}function -an(a,b){return 1-gX(a,b)}function -Hs(){return[0,a("js_of_ocaml")]}function -Ht(){return 0x7FFFFFFF/4|0}function -Hu(a){return 0}function -Hm(){e3(ag.Not_found)}function -mK(c){var -a=B,b=a2(c);if(a.process&&a.process.env&&a.process.env[b]!=undefined)return aP(a.process.env[b]);if(B.jsoo_static_env&&B.jsoo_static_env[b])return aP(B.jsoo_static_env[b]);Hm()}function -Hv(){var -a=new -Date().getTime(),b=a^kl*Math.random();return[0,b]}function -dQ(a){var +if(a&&a.caml_custom)return cR;else +return a6}function +a_(b,c,a){if(a&&y.toplevelReloc)b=y.toplevelReloc(a);ab[b+1]=c;if(a)ab[a]=c}function +ha(a,b){mU[bw(a)]=b;return 0}function +Is(a){a[2]=mW++;return a}function +hc(a,b){return mG(a,b)}function +Iu(){aj(gz)}function +H(b,a){if(a>>>0>=I(b))Iu();return c3(b,a)}function +ao(a,b){return 1-hc(a,b)}function +Iw(){return 0x7FFFFFFF/4|0}function +Iq(){fe(ab.Not_found)}function +mZ(c){var +a=y,b=a0(c);if(a.process&&a.process.env&&a.process.env[b]!=undefined)return aQ(a.process.env[b]);if(y.jsoo_static_env&&y.jsoo_static_env[b])return aQ(y.jsoo_static_env[b]);Iq()}function +Ix(){if(y.crypto)if(typeof +y.crypto.getRandomValues==="function"){var +a=new(y.Uint32Array)(1);y.crypto.getRandomValues(a);return[0,a[0]]}else +if(y.crypto.randomBytes==="function"){var +b=y.crypto.randomBytes(4),a=new(y.Uint32Array)(b);return[0,a[0]]}var +c=new +Date().getTime(),d=c^kC*Math.random();return[0,d]}function +dT(a){var b=1;while(a&&a.joo_tramp){a=a.joo_tramp.apply(null,a.joo_args);b++}return a}function -ao(b,a){return{joo_tramp:b,joo_args:a}}function -Hw(c,a){if(typeof +ap(b,a){return{joo_tramp:b,joo_args:a}}function +Iy(c,a){if(typeof a==="function"){c.fun=a;return 0}if(a.fun){c.fun=a.fun;return 0}var b=a.length;while(b--)c[b]=a[b];return 0}function -mI(a){return a}function +mX(a){return a}function d(a){if(a instanceof -Array)return a;if(B.RangeError&&a +Array)return a;if(y.RangeError&&a instanceof -B.RangeError&&a.message&&a.message.match(/maximum call stack/i))return mI(ag.Stack_overflow);if(B.InternalError&&a +y.RangeError&&a.message&&a.message.match(/maximum call stack/i))return mX(ab.Stack_overflow);if(y.InternalError&&a instanceof -B.InternalError&&a.message&&a.message.match(/too much recursion/i))return mI(ag.Stack_overflow);if(a +y.InternalError&&a.message&&a.message.match(/too much recursion/i))return mX(ab.Stack_overflow);if(a instanceof -B.Error&&bQ(gb))return[0,bQ(gb),a];return[0,ag.Failure,aP(String(a))]}var +y.Error&&bQ(go))return[0,bQ(go),a];return[0,ab.Failure,aQ(String(a))]}var u=function(A){"use strict";var -f=ci,ac=7,t=9007199254740992,J=q(t),O="0123456789abcdefghijklmnopqrstuvwxyz",g=B.BigInt,H=typeof +f=ck,ab=7,t=9007199254740992,I=q(t),N="0123456789abcdefghijklmnopqrstuvwxyz",g=IC.BigInt,G=typeof g==="function";function d(a,b,c,f){if(typeof a==="undefined")return d[0];if(typeof -b!=="undefined")return+b===10&&!c?e(a):ag(a,b,c,f);return e(a)}function -a(b,a){this.value=b;this.sign=a;this.isSmall=false;this.caml_custom=eH}a.prototype=Object.create(d.prototype);function -b(a){this.value=a;this.sign=a<0;this.isSmall=true;this.caml_custom=eH}b.prototype=Object.create(d.prototype);function -c(a){this.value=a;this.caml_custom=eH}c.prototype=Object.create(d.prototype);function -m(a){return-t0)return Math.floor(a);return Math.ceil(a)}function -P(g,h){var +O(g,h){var i=g.length,j=h.length,e=new Array(i),b=0,d=f,c,a;for(a=0;a=d?1:0;e[a]=c-b*d}while(a0)e.push(b);return e}function -v(a,b){if(a.length>=b.length)return P(a,b);return P(b,a)}function -C(g,a){var +v(a,b){if(a.length>=b.length)return O(a,b);return O(b,a)}function +B(g,a){var h=g.length,d=new Array(h),c=f,e,b;for(b=0;b0){d[b++]=a%c;a=Math.floor(a/c)}return d}a.prototype.add=function(f){var b=e(f);if(this.sign!==b.sign)return this.subtract(b.negate());var c=this.value,d=b.value;if(b.isSmall)return new -a(C(c,Math.abs(d)),this.sign);return new +a(B(c,Math.abs(d)),this.sign);return new a(v(c,d),this.sign)};a.prototype.plus=a.prototype.add;b.prototype.add=function(g){var f=e(g),c=this.value;if(c<0!==f.sign)return this.subtract(f.negate());var -d=f.value;if(f.isSmall){if(m(c+d))return new +d=f.value;if(f.isSmall){if(p(c+d))return new b(c+d);d=q(Math.abs(d))}return new -a(C(d,Math.abs(c)),c<0)};b.prototype.plus=b.prototype.add;c.prototype.add=function(a){return new +a(B(d,Math.abs(c)),c<0)};b.prototype.plus=b.prototype.add;c.prototype.add=function(a){return new c(this.value+e(a).value)};c.prototype.plus=c.prototype.add;function y(d,h){var g=d.length,i=h.length,c=new Array(g),e=0,j=f,a,b;for(a=0;a=0)c=y(e,f);else{c=y(f,e);d=!d}c=n(c);if(typeof +aj(e,f,d){var +c;if(o(e,f)>=0)c=y(e,f);else{c=y(f,e);d=!d}c=n(c);if(typeof c==="number"){if(d)c=-c;return new b(c)}return new a(c,d)}function -G(h,l,k){var +F(h,l,k){var j=h.length,c=new Array(j),i=-l,g=f,e,d;for(e=0;e=0)};b.prototype.minus=b.prototype.subtract;c.prototype.subtract=function(a){return new +b(a-d);return F(d,Math.abs(a),a>=0)};b.prototype.minus=b.prototype.subtract;c.prototype.subtract=function(a){return new c(this.value-e(a).value)};c.prototype.minus=c.prototype.subtract;a.prototype.negate=function(){return new a(this.value,!this.sign)};b.prototype.negate=function(){var c=this.sign,a=new @@ -901,58 +906,58 @@ c(-this.value)};a.prototype.abs=function(){return new a(this.value,false)};b.prototype.abs=function(){return new b(Math.abs(this.value))};c.prototype.abs=function(){return new c(this.value>=0?this.value:-this.value)};function -N(g,j){var -i=g.length,l=j.length,n=i+l,c=D(n),m=f,e,d,a,h,k;for(a=0;a0){e[b++]=a%c;a=Math.floor(a/c)}return e}function -Z(c,b){var +X(c,b){var a=[];while(b-->0)a.push(0);return a.concat(c)}function -E(b,c){var -a=Math.max(b.length,c.length);if(a<=30)return N(b,c);a=Math.ceil(a/2);var -f=b.slice(a),d=b.slice(0,a),i=c.slice(a),h=c.slice(0,a),e=E(d,h),g=E(f,i),k=E(v(d,f),v(h,i)),j=v(v(e,Z(y(y(k,e),g),a)),Z(g,2*a));r(j);return j}function -al(a,b){return-(jZ*a)-jZ*b+0.000015*a*b>0}a.prototype.multiply=function(j){var +D(b,c){var +a=Math.max(b.length,c.length);if(a<=30)return M(b,c);a=Math.ceil(a/2);var +f=b.slice(a),d=b.slice(0,a),i=c.slice(a),h=c.slice(0,a),e=D(d,h),g=D(f,i),k=D(v(d,f),v(h,i)),j=v(v(e,X(y(y(k,e),g),a)),X(g,2*a));r(j);return j}function +ak(a,b){return-(kf*a)-kf*b+0.000015*a*b>0}a.prototype.multiply=function(j){var h=e(j),c=this.value,b=h.value,i=this.sign!==h.sign,g;if(h.isSmall){if(b===0)return d[0];if(b===1)return this;if(b===-1)return this.negate();g=Math.abs(b);if(g=0;d--){j=g-1;if(b[d+h]!==l)j=Math.floor((b[d+h]*g+b[d+h-1])/l);c=0;e=0;m=i.length;for(a=0;ah)d=(d+1)*i;c=Math.ceil(d/m);do{j=w(b,c);if(p(j,a)<=0)break;c--}while(c);e.push(c);a=y(a,j)}e.reverse();return[n(e),n(a)]}function -Q(i,e){var -g=i.length,h=D(g),j=f,a,d,b,c;b=0;for(a=g-1;a>=0;--a){c=b*j+i[a];d=s(c/e);b=c-d*e;h[a]=d|0}return[h,b|0]}function +ac(q,k){var +r=q.length,h=k.length,g=f,s=C(k.length),l=k[h-1],o=Math.ceil(g/(2*l)),b=w(q,o),i=w(k,o),j,d,c,e,a,m,p;if(b.length<=r)b.push(0);i.push(0);l=i[h-1];for(d=r-h;d>=0;d--){j=g-1;if(b[d+h]!==l)j=Math.floor((b[d+h]*g+b[d+h-1])/l);c=0;e=0;m=i.length;for(a=0;ah)d=(d+1)*i;c=Math.ceil(d/m);do{j=w(b,c);if(o(j,a)<=0)break;c--}while(c);e.push(c);a=y(a,j)}e.reverse();return[n(e),n(a)]}function +P(i,e){var +g=i.length,h=C(g),j=f,a,d,b,c;b=0;for(a=g-1;a>=0;--a){c=b*j+i[a];d=s(c/e);b=c-d*e;h[a]=d|0}return[h,b|0]}function i(h,w){var -m,j=e(w);if(H)return[new +m,j=e(w);if(G)return[new c(h.value/j.value),new c(h.value%j.value)];var l=h.value,i=j.value,g;if(i===0)throw new Error("Cannot divide by zero");if(h.isSmall){if(j.isSmall)return[new b(s(l/i)),new b(l%i)];return[d[0],h]}if(j.isSmall){if(i===1)return[h,d[0]];if(i==-1)return[h.negate(),d[0]];var -r=Math.abs(i);if(rc.length?1:-1;for(var +o(b,c){if(b.length!==c.length)return b.length>c.length?1:-1;for(var a=b.length-1;a>=0;a--)if(b[a]!==c[a])return b[a]>c[a]?1:-1;return 0}a.prototype.compareAbs=function(d){var -a=e(d),b=this.value,c=a.value;if(a.isSmall)return 1;return p(b,c)};b.prototype.compareAbs=function(d){var +a=e(d),b=this.value,c=a.value;if(a.isSmall)return 1;return o(b,c)};b.prototype.compareAbs=function(d){var c=e(d),b=Math.abs(this.value),a=c.value;if(c.isSmall){a=Math.abs(a);return b===a?0:b>a?1:-1}return-1};c.prototype.compareAbs=function(c){var a=this.value,b=e(c).value;a=a>=0?a:-a;b=b>=0?b:-b;return a===b?0:a>b?1:-1};a.prototype.compare=function(b){if(b===Infinity)return-1;if(b===-Infinity)return 1;var -a=e(b),c=this.value,d=a.value;if(this.sign!==a.sign)return a.sign?1:-1;if(a.isSmall)return this.sign?-1:1;return p(c,d)*(this.sign?-1:1)};a.prototype.compareTo=a.prototype.compare;b.prototype.compare=function(c){if(c===Infinity)return-1;if(c===-Infinity)return 1;var +a=e(b),c=this.value,d=a.value;if(this.sign!==a.sign)return a.sign?1:-1;if(a.isSmall)return this.sign?-1:1;return o(c,d)*(this.sign?-1:1)};a.prototype.compareTo=a.prototype.compare;b.prototype.compare=function(c){if(c===Infinity)return-1;if(c===-Infinity)return 1;var b=e(c),a=this.value,d=b.value;if(b.isSmall)return a==d?0:a>d?1:-1;if(a<0!==b.sign)return a<0?-1:1;return a<0?1:-1};b.prototype.compareTo=b.prototype.compare;c.prototype.compare=function(a){if(a===Infinity)return-1;if(a===-Infinity)return 1;var b=this.value,c=e(a).value;return b===c?0:b>c?1:-1};c.prototype.compareTo=c.prototype.compare;a.prototype.equals=function(a){return this.compare(a)===0};c.prototype.eq=c.prototype.equals=b.prototype.eq=b.prototype.equals=a.prototype.eq=a.prototype.equals;a.prototype.notEquals=function(a){return this.compare(a)!==0};c.prototype.neq=c.prototype.notEquals=b.prototype.neq=b.prototype.notEquals=a.prototype.neq=a.prototype.notEquals;a.prototype.greater=function(a){return this.compare(a)>0};c.prototype.gt=c.prototype.greater=b.prototype.gt=b.prototype.greater=a.prototype.gt=a.prototype.greater;a.prototype.lesser=function(a){return this.compare(a)<0};c.prototype.lt=c.prototype.lesser=b.prototype.lt=b.prototype.lesser=a.prototype.lt=a.prototype.lesser;a.prototype.greaterOrEquals=function(a){return this.compare(a)>=0};c.prototype.geq=c.prototype.greaterOrEquals=b.prototype.geq=b.prototype.greaterOrEquals=a.prototype.geq=a.prototype.greaterOrEquals;a.prototype.lesserOrEquals=function(a){return this.compare(a)<=0};c.prototype.leq=c.prototype.lesserOrEquals=b.prototype.leq=b.prototype.lesserOrEquals=a.prototype.leq=a.prototype.lesserOrEquals;a.prototype.isEven=function(){return(this.value[0]&1)===0};b.prototype.isEven=function(){return(this.value&1)===0};c.prototype.isEven=function(){return(this.value&g(1))===g(0)};a.prototype.isOdd=function(){return(this.value[0]&1)===1};b.prototype.isOdd=function(){return(this.value&1)===1};c.prototype.isOdd=function(){return(this.value&g(1))===g(1)};a.prototype.isPositive=function(){return!this.sign};b.prototype.isPositive=function(){return this.value>0};c.prototype.isPositive=b.prototype.isPositive;a.prototype.isNegative=function(){return this.sign};b.prototype.isNegative=function(){return this.value<0};c.prototype.isNegative=b.prototype.isNegative;a.prototype.isUnit=function(){return false};b.prototype.isUnit=function(){return Math.abs(this.value)===1};c.prototype.isUnit=function(){return this.abs().value===g(1)};a.prototype.isZero=function(){return false};b.prototype.isZero=function(){return this.value===0};c.prototype.isZero=function(){return this.value===g(0)};a.prototype.isDivisibleBy=function(b){var a=e(b);if(a.isZero())return false;if(a.isUnit())return true;if(a.compareAbs(2)===0)return this.isEven();return this.mod(a).isZero()};c.prototype.isDivisibleBy=b.prototype.isDivisibleBy=a.prototype.isDivisibleBy;function -T(b){var +S(b){var a=b.abs();if(a.isUnit())return false;if(a.equals(2)||a.equals(3)||a.equals(5))return true;if(a.isEven()||a.isDivisibleBy(3)||a.isDivisibleBy(5))return false;if(a.lesser(49))return true}function -L(d,e){var +K(d,e){var g=d.prev(),c=g,h=0,f,i,b,a;while(c.isEven())c=c.divide(2),h++;next:for(b=0;b-t)return new b(c-1);return new -a(J,true)};c.prototype.prev=function(){return new +a(I,true)};c.prototype.prev=function(){return new c(this.value-g(1))};var h=[1];while(2*h[h.length-1]<=f)h.push(2*h[h.length-1]);var x=h.length,j=h[x-1];function -_(a){return Math.abs(a)<=f}a.prototype.shiftLeft=function(c){var -a=e(c).toJSNumber();if(!_(a))throw new -Error(String(a)+jp);if(a<0)return this.shiftRight(-a);var +Y(a){return Math.abs(a)<=f}a.prototype.shiftLeft=function(c){var +a=e(c).toJSNumber();if(!Y(a))throw new +Error(String(a)+jH);if(a<0)return this.shiftRight(-a);var b=this;if(b.isZero())return b;while(a>=x){b=b.multiply(j);a-=x-1}return b.multiply(h[a])};c.prototype.shiftLeft=b.prototype.shiftLeft=a.prototype.shiftLeft;a.prototype.shiftRight=function(d){var -a,b=e(d).toJSNumber();if(!_(b))throw new -Error(String(b)+jp);if(b<0)return this.shiftLeft(-b);var +a,b=e(d).toJSNumber();if(!Y(b))throw new +Error(String(b)+jH);if(b<0)return this.shiftLeft(-b);var c=this;while(b>=x){if(c.isZero()||c.isNegative()&&c.isUnit())return c;a=i(c,j);c=a[1].isNegative()?a[0].prev():a[0];b-=x-1}a=i(c,h[b]);return a[1].isNegative()?a[0].prev():a[0]};c.prototype.shiftRight=b.prototype.shiftRight=a.prototype.shiftRight;function -K(h,a,q){a=e(a);var +J(h,a,q){a=e(a);var m=h.isNegative(),p=a.isNegative(),l=m?h.not():h,o=p?a.not():a,b=0,c=0,k=null,n=null,f=[];while(!l.isZero()||!o.isZero()){k=i(l,j);b=k[1].toJSNumber();if(m)b=j-1-b;n=i(o,j);c=n[1].toJSNumber();if(p)c=j-1-c;l=k[0];o=n[0];f.push(q(b,c))}var g=q(m?1:0,p?1:0)!==0?u(-1):u(0);for(var -d=f.length-1;d>=0;d-=1)g=g.multiply(j).add(u(f[d]));return g}a.prototype.not=function(){return this.negate().prev()};c.prototype.not=b.prototype.not=a.prototype.not;a.prototype.and=function(a){return K(this,a,function(a,b){return a&b})};c.prototype.and=b.prototype.and=a.prototype.and;a.prototype.or=function(a){return K(this,a,function(a,b){return a|b})};c.prototype.or=b.prototype.or=a.prototype.or;a.prototype.xor=function(a){return K(this,a,function(a,b){return a^b})};c.prototype.xor=b.prototype.xor=a.prototype.xor;var -I=1<<30,ab=(f&-f)*(f&-f)|I;function -F(c){var +d=f.length-1;d>=0;d-=1)g=g.multiply(j).add(u(f[d]));return g}a.prototype.not=function(){return this.negate().prev()};c.prototype.not=b.prototype.not=a.prototype.not;a.prototype.and=function(a){return J(this,a,function(a,b){return a&b})};c.prototype.and=b.prototype.and=a.prototype.and;a.prototype.or=function(a){return J(this,a,function(a,b){return a|b})};c.prototype.or=b.prototype.or=a.prototype.or;a.prototype.xor=function(a){return J(this,a,function(a,b){return a^b})};c.prototype.xor=b.prototype.xor=a.prototype.xor;var +H=1<<30,aa=(f&-f)*(f&-f)|H;function +E(c){var a=c.value,b=typeof -a==="number"?a|I:typeof -a==="bigint"?a|g(I):a[0]+a[1]*f|ab;return b&-b}function -S(b,a){if(a.compareTo(b)<=0){var -f=S(b,a.square(a)),d=f.p,c=f.e,e=d.multiply(a);return e.compareTo(b)<=0?{p:e,e:c*2+1}:{p:d,e:c*2}}return{p:u(1),e:0}}a.prototype.bitLength=function(){var -a=this;if(a.compareTo(u(0))<0)a=a.negate().subtract(u(1));if(a.compareTo(u(0))===0)return u(0);return u(S(a,u(2)).e).add(u(1))};c.prototype.bitLength=b.prototype.bitLength=a.prototype.bitLength;function -U(a,b){a=e(a);b=e(b);return a.greater(b)?a:b}function -M(a,b){a=e(a);b=e(b);return a.lesser(b)?a:b}function -R(a,b){a=e(a).abs();b=e(b).abs();if(a.equals(b))return a;if(a.isZero())return b;if(b.isZero())return a;var -c=d[1],f,g;while(a.isEven()&&b.isEven()){f=M(F(a),F(b));a=a.divide(f);b=b.divide(f);c=c.multiply(f)}while(a.isEven())a=a.divide(F(a));do{while(b.isEven())b=b.divide(F(b));if(a.greater(b)){g=b;b=a;a=g}b=b.subtract(a)}while(!b.isZero());return c.isUnit()?a:a.multiply(c)}function -af(a,b){a=e(a).abs();b=e(b).abs();return a.divide(R(a,b)).multiply(b)}function -ai(a,b){a=e(a);b=e(b);var -g=M(a,b),n=U(a,b),h=n.subtract(g).add(1);if(h.isSmall)return g.add(Math.floor(Math.random()*h));var +a==="number"?a|H:typeof +a==="bigint"?a|g(H):a[0]+a[1]*f|aa;return b&-b}function +R(b,a){if(a.compareTo(b)<=0){var +f=R(b,a.square(a)),d=f.p,c=f.e,e=d.multiply(a);return e.compareTo(b)<=0?{p:e,e:c*2+1}:{p:d,e:c*2}}return{p:u(1),e:0}}a.prototype.bitLength=function(){var +a=this;if(a.compareTo(u(0))<0)a=a.negate().subtract(u(1));if(a.compareTo(u(0))===0)return u(0);return u(R(a,u(2)).e).add(u(1))};c.prototype.bitLength=b.prototype.bitLength=a.prototype.bitLength;function +T(a,b){a=e(a);b=e(b);return a.greater(b)?a:b}function +L(a,b){a=e(a);b=e(b);return a.lesser(b)?a:b}function +Q(a,b){a=e(a).abs();b=e(b).abs();if(a.equals(b))return a;if(a.isZero())return b;if(b.isZero())return a;var +c=d[1],f,g;while(a.isEven()&&b.isEven()){f=L(E(a),E(b));a=a.divide(f);b=b.divide(f);c=c.multiply(f)}while(a.isEven())a=a.divide(E(a));do{while(b.isEven())b=b.divide(E(b));if(a.greater(b)){g=b;b=a;a=g}b=b.subtract(a)}while(!b.isZero());return c.isUnit()?a:a.multiply(c)}function +ae(a,b){a=e(a).abs();b=e(b).abs();return a.divide(Q(a,b)).multiply(b)}function +ah(a,b){a=e(a);b=e(b);var +g=L(a,b),n=T(a,b),h=n.subtract(g).add(1);if(h.isSmall)return g.add(Math.floor(Math.random()*h));var j=z(h,f).value,l=[],k=true;for(var c=0;c=i){if(c===Y&&i===1)continue;throw new -Error(c+" is not a valid digit in base "+g+bn)}}g=e(g);var -h=[],j=b[0]===aC;for(a=j?1:0;a=i){if(c===_&&i===1)continue;throw new +Error(c+" is not a valid digit in base "+g+bl)}}g=e(g);var +h=[],j=b[0]===aD;for(a=j?1:0;a=0;a--){b=b.add(e[a].times(c));c=c.times(f)}return g?b.negate():b}function -aj(b,a){a=a||O;if(b=0){e=c.divmod(b);c=e.quotient;var d=e.remainder;if(d.isNegative()){d=b.minus(d).abs();c=c.next()}g.push(d.toJSNumber())}g.push(c.toJSNumber());return{value:g.reverse(),isNegative:f}}function -aa(d,c,b){var -a=z(d,c);return(a.isNegative?aC:o)+a.value.map(function(a){return aj(a,b)}).join(o)}a.prototype.toArray=function(a){return z(this,a)};b.prototype.toArray=function(a){return z(this,a)};c.prototype.toArray=function(a){return z(this,a)};a.prototype.toString=function(a,f){if(a===A)a=10;if(a!==10)return aa(this,a,f);var +$(d,c,b){var +a=z(d,c);return(a.isNegative?aD:k)+a.value.map(function(a){return ai(a,b)}).join(k)}a.prototype.toArray=function(a){return z(this,a)};b.prototype.toArray=function(a){return z(this,a)};c.prototype.toArray=function(a){return z(this,a)};a.prototype.toString=function(a,f){if(a===A)a=10;if(a!==10)return $(this,a,f);var d=this.value,c=d.length,e=String(d[--c]),h="0000000",b;while(--c>=0){b=String(d[c]);e+=h.slice(b.length)+b}var -g=this.sign?aC:o;return g+e};b.prototype.toString=function(a,b){if(a===A)a=10;if(a!=10)return aa(this,a,b);return String(this.value)};c.prototype.toString=b.prototype.toString;c.prototype.toJSON=a.prototype.toJSON=b.prototype.toJSON=function(){return this.toString()};a.prototype.valueOf=function(){return parseInt(this.toString(),10)};a.prototype.toJSNumber=a.prototype.valueOf;b.prototype.valueOf=function(){return this.value};b.prototype.toJSNumber=b.prototype.valueOf;c.prototype.valueOf=c.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};function -X(d){if(m(+d)){var -n=+d;if(n===s(n))return H?new -c(g(n)):new -b(n);throw new -Error(eM+d)}var -q=d[0]===aC;if(q)d=d.slice(1);var +g=this.sign?aD:k;return g+e};b.prototype.toString=function(a,b){if(a===A)a=10;if(a!=10)return $(this,a,b);return String(this.value)};c.prototype.toString=b.prototype.toString;c.prototype.toJSON=a.prototype.toJSON=b.prototype.toJSON=function(){return this.toString()};a.prototype.valueOf=function(){return parseInt(this.toString(),10)};a.prototype.toJSNumber=a.prototype.valueOf;b.prototype.valueOf=function(){return this.value};b.prototype.toJSNumber=b.prototype.valueOf;c.prototype.valueOf=c.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};function +W(d){if(p(+d)){var +l=+d;if(l===s(l))return G?new +c(g(l)):new +b(l);throw new +Error(eY+d)}var +q=d[0]===aD;if(q)d=d.slice(1);var h=d.split(/e/i);if(h.length>2)throw new -Error(eM+h.join(eS));if(h.length===2){var -e=h[1];if(e[0]===bI)e=e.slice(1);e=+e;if(e!==s(e)||!m(e))throw new -Error(eM+e+" is not a valid exponent.");var -f=h[0],i=f.indexOf(bn);if(i>=0){e-=f.length-i-1;f=f.slice(0,i)+f.slice(i+1)}if(e<0)throw new +Error(eY+h.join(e5));if(h.length===2){var +e=h[1];if(e[0]===bH)e=e.slice(1);e=+e;if(e!==s(e)||!p(e))throw new +Error(eY+e+" is not a valid exponent.");var +f=h[0],i=f.indexOf(bl);if(i>=0){e-=f.length-i-1;f=f.slice(0,i)+f.slice(i+1)}if(e<0)throw new Error("Cannot include negative exponent part for integers");f+=new -Array(e+1).join(k);d=f}var +Array(e+1).join(m);d=f}var t=/^([0-9][0-9]*)$/.test(d);if(!t)throw new -Error(eM+d);if(H)return new -c(g(q?aC+d:d));var -p=[],j=d.length,o=ac,l=j-o;while(j>0){p.push(+d.slice(l,j));l-=o;if(l<0)l=0;j-=o}r(p);return new -a(p,q)}function -ah(a){if(H)return new -c(g(a));if(m(a)){if(a!==s(a))throw new +Error(eY+d);if(G)return new +c(g(q?aD+d:d));var +o=[],j=d.length,n=ab,k=j-n;while(j>0){o.push(+d.slice(k,j));k-=n;if(k<0)k=0;j-=n}r(o);return new +a(o,q)}function +ag(a){if(G)return new +c(g(a));if(p(a)){if(a!==s(a))throw new Error(a+" is not an integer.");return new -b(a)}return X(a.toString())}function +b(a)}return W(a.toString())}function e(a){if(typeof -a==="number")return ah(a);if(typeof -a==="string")return X(a);if(typeof +a==="number")return ag(a);if(typeof +a==="string")return W(a);if(typeof a==="bigint")return new c(a);return a}for(var -l=0;l0)d[-l]=e(-l)}d.one=d[1];d.zero=d[0];d.minusOne=d[-1];d.max=U;d.min=M;d.gcd=R;d.lcm=af;d.isInstance=function(d){return d +l=0;l0)d[-l]=e(-l)}d.one=d[1];d.zero=d[0];d.minusOne=d[-1];d.max=T;d.min=L;d.gcd=Q;d.lcm=ae;d.isInstance=function(d){return d instanceof a||d instanceof b||d instanceof -c};d.randBetween=ai;d.fromArray=function(b,a,c){return W(b.map(e),e(a||10),c)};return d}();function -aK(a){var +c};d.randBetween=ah;d.fromArray=function(b,a,c){return V(b.map(e),e(a||10),c)};return d}();function +aL(a){var b=a.toJSNumber()|0;if(a.equals(u(b)))return b;return a}function -HG(a){return aK(u(a).abs())}function -N(a,b){return aK(u(a).add(u(b)))}function -cq(a,b){return u(a).compare(u(b))}function -mO(b,a){a=u(a);if(a.equals(u(0)))cX();return aK(u(b).divide(u(a)))}function -HO(b,a){a=u(a);if(a.equals(u(0)))cX();return aK(u(b).mod(a))}function -mP(a,b){return[0,mO(a,b),HO(a,b)]}function -mQ(a,b){return mO(a,b)}function -HH(a,b){return u(a).equals(u(b))}function -HJ(a,b){return aK(u.gcd(u(a),u(b)).abs())}function -Hy(c,e,g){e=u(e);var +m3(a){return aL(u(a).abs())}function +m4(a,b){return aL(u(a).add(u(b)))}function +ct(a,b){return u(a).compare(u(b))}function +m5(b,a){a=u(a);if(a.equals(u(0)))c1();return aL(u(b).divide(u(a)))}function +IU(b,a){a=u(a);if(a.equals(u(0)))c1();return aL(u(b).mod(a))}function +m6(a,b){return[0,m5(a,b),IU(a,b)]}function +m7(a,b){return m5(a,b)}function +IK(a,b){return u(a).equals(u(b))}function +IM(a,b){return aL(u.gcd(u(a),u(b)).abs())}function +IA(c,e,g){e=u(e);var a=e.toArray(Math.pow(2,32));c.write(8,a.isNegative?1:0);var f=a.value.length,d=f*4;c.write(32,d);for(var -b=f-1;b>=0;b--){c.write(8,a.value[b]>>>0&a1);c.write(8,a.value[b]>>>8&a1);c.write(8,a.value[b]>>>16&a1);c.write(8,a.value[b]>>>24&a1)}g[0]=4*(1+((d+3)/4|0));g[1]=8*(1+((d+7)/8|0))}function -Hz(b,g){var +b=f-1;b>=0;b--){c.write(8,a.value[b]>>>0&aZ);c.write(8,a.value[b]>>>8&aZ);c.write(8,a.value[b]>>>16&aZ);c.write(8,a.value[b]>>>24&aZ)}g[0]=4*(1+((d+3)/4|0));g[1]=8*(1+((d+7)/8|0))}function +IB(b,g){var e;switch(b.read8u()){case 1:e=true;break;case -0:e=false;break;default:b$("input_value: z (malformed input)")}var +0:e=false;break;default:ca("input_value: z (malformed input)")}var f=b.read32u(),c=u(0);for(var d=0;d>>0);c=a.shiftLeft(d*32).add(c)}if(e)c=c.negate();g[0]=f+4;return aK(c)}function -HK(d){var +a=u(b.read8u());a=a.add(b.read8u()<<8);a=a.add(b.read8u()<<16);a=a.add(b.read8u()<<24>>>0);c=a.shiftLeft(d*32).add(c)}if(e)c=c.negate();g[0]=f+4;return aL(c)}function +IN(d){var b=u(d).toArray(Math.pow(2,32)),a=0;for(var c=0;c=48&&a<=57)return a-48;if(a>=97&&a<=cI)return a-97+10;if(a>=65&&a<=70)return a-65+10}var -e=0;if(a[e]==aC)e++;for(;e=c)ah("Z.of_substring_base: invalid digit")}return aK(u(a,c))}function -cr(d,a,b,c){a=bf(a);if(b!=0||c!=a.length){if(a.length-b=0?1:0}function -e7(a){a=u(a);if(!HI(a))e3(bQ(gf));var -b=u(kl),d=a.and(b).toJSNumber(),c=a.shiftRight(32).and(b).toJSNumber(),e=mB(d,c);return e}function -e8(){return new -Date().getTime()/a8}function -c2(e){var +if(d==lU||d=="X")c=16;else +if(d=="b"||d=="B")c=2;if(c!=10){a=a.substring(b+1);if(g==-1)a=aD+a}}}}if(a[0]==bH)a=a.substring(1);a=a.replace(/^0+/,k);if(a==aD||a==k)a=m;function +h(a){if(a>=48&&a<=57)return a-48;if(a>=97&&a<=cM)return a-97+10;if(a>=65&&a<=70)return a-65+10}var +e=0;if(a[e]==aD)e++;for(;e=c)aj("Z.of_substring_base: invalid digit")}return aL(u(a,c))}function +cu(d,a,b,c){a=bw(a);if(b!=0||c!=a.length){if(a.length-b=0?1:0}function +fi(a){a=u(a);if(!IL(a))fe(bQ(gr));var +b=u(kC),d=a.and(b).toJSNumber(),c=a.shiftRight(32).and(b).toJSNumber(),e=mP(d,c);return e}function +fj(){return new +Date().getTime()/a6}function +c5(e){var a=new -Date(e*a8),b=a.getTime(),d=new -Date(Date.UTC(a.getUTCFullYear(),0,1)).getTime(),c=Math.floor((b-d)/iY);return[0,a.getUTCSeconds(),a.getUTCMinutes(),a.getUTCHours(),a.getUTCDate(),a.getUTCMonth(),a.getUTCFullYear()-b3,a.getUTCDay(),c,false|0]}function -e9(){return 0}function -HS(h){var +Date(e*a6),b=a.getTime(),d=new +Date(Date.UTC(a.getUTCFullYear(),0,1)).getTime(),c=Math.floor((b-d)/jg);return[0,a.getUTCSeconds(),a.getUTCMinutes(),a.getUTCHours(),a.getUTCDate(),a.getUTCMonth(),a.getUTCFullYear()-b5,a.getUTCDay(),c,false|0]}function +fk(){return 0}function +IZ(h){var a=new -Date(h*a8),b=a.getTime(),e=new -Date(a.getFullYear(),0,1).getTime(),c=Math.floor((b-e)/iY),d=new +Date(h*a6),b=a.getTime(),e=new +Date(a.getFullYear(),0,1).getTime(),c=Math.floor((b-e)/jg),d=new Date(a.getFullYear(),0,1),f=new -Date(a.getFullYear(),6,1),g=Math.max(d.getTimezoneOffset(),f.getTimezoneOffset());return[0,a.getSeconds(),a.getMinutes(),a.getHours(),a.getDate(),a.getMonth(),a.getFullYear()-b3,a.getDay(),c,a.getTimezoneOffset()f)a+=eG;var +d=f;df)a+=eQ;var c=e[d];if(typeof c=="number")a+=c.toString();else if(c instanceof -bv)a+=ex+c.toString()+ex;else +bu)a+=eE+c.toString()+eE;else if(typeof -c=="string")a+=ex+c.toString()+ex;else -a+=lm}a+=")"}else -if(b[0]==O)a+=b[1];return a}function -mx(a){if(a +c=="string")a+=eE+c.toString()+eE;else +a+=lA}a+=")"}else +if(b[0]==N)a+=b[1];return a}function +mL(a){if(a instanceof -Array&&(a[0]==0||a[0]==O)){var -c=bQ(kL);if(c)c(a,false);else{var -d=GN(a),b=bQ(ix);if(b)b(0);B.console.error(gv+d+iN)}}else +Array&&(a[0]==0||a[0]==N)){var +c=bQ(k3);if(c)c(a,false);else{var +d=HT(a),b=bQ(iP);if(b)b(0);y.console.error(gJ+d+i6)}}else throw a}function -Hp(){var -a=B;if(a.process&&a.process.on)a.process.on("uncaughtException",function(b,c){mx(b);a.process.exit(2)});else -if(a.addEventListener)a.addEventListener("error",function(a){if(a.error)mx(a.error)})}Hp();function -c(a,b){return a.length==1?a(b):be(a,[b])}function -h(a,b,c){return a.length==2?a(b,c):be(a,[b,c])}function -R(a,b,c,d){return a.length==3?a(b,c,d):be(a,[b,c,d])}function -f4(a,b,c,d,e,f){return a.length==5?a(b,c,d,e,f):be(a,[b,c,d,e,f])}function -GB(a,b,c,d,e,f,g,h){return a.length==7?a(b,c,d,e,f,g,h):be(a,[b,c,d,e,f,g,h])}GO();var -e$=[O,a(km),-1],g6=[O,a(kM),-2],dT=[O,a(kQ),-3],g2=[O,a(ll),-4],g7=[O,a(jS),-6],aL=[O,a(ls),-7],g4=[O,a(iX),-8],g5=[O,a(lv),-9],J=[O,a(lR),-11],g8=[O,a(kA),gp],ht=[0,cj],GA=[4,0,0,0,[12,45,[4,0,0,0,0]]],fl=[0,[11,a('File "'),[2,0,[11,a('", line '),[4,0,0,0,[11,a(k5),[4,0,0,0,[12,45,[4,0,0,0,[11,a(": "),[2,0,0]]]]]]]]]],a('File "%s", line %d, characters %d-%d: %s')],cA=[0,0,0],el=[0,a(k$),a(k3),a(lw)];bb(11,g8,kA);bb(10,J,lR);bb(9,[O,a(jl),-10],jl);bb(8,g5,lv);bb(7,g4,iX);bb(6,aL,ls);bb(5,g7,jS);bb(4,[O,a(kR),-5],kR);bb(3,g2,ll);bb(2,dT,kQ);bb(1,g6,kM);bb(0,e$,km);var -m8=a("output_substring"),m5=a("%.12g"),m4=a(bn),m2=a("true"),m3=a("false"),mT=a("Stdlib.Exit"),mV=ca(0,0,lq),mX=ca(0,0,65520),mZ=ca(1,0,lq),m_=a("\\\\"),m$=a("\\'"),na=a("\\b"),nb=a("\\t"),nc=a("\\n"),nd=a("\\r"),m9=a("Char.chr"),nf=a("hd"),ni=a("String.blit / Bytes.blit_string"),nh=a("Bytes.blit"),ng=a("String.sub / Bytes.sub"),nk=a("String.contains_from / Bytes.contains_from"),nn=a("Array.blit"),nm=a("Array.sub"),ns=a("Map.remove_min_elt"),nt=[0,0,0,0],nu=[0,a("map.ml"),gm,10],nv=[0,0,0],no=a(es),np=a(es),nq=a(es),nr=a(es),nw=a("Stdlib.Queue.Empty"),ny=a("CamlinternalLazy.Undefined"),nF=a("Buffer.add_substring/add_subbytes"),nE=a("Buffer.add: cannot grow buffer"),nD=[0,a(lC),93,2],nC=[0,a(lC),94,2],nO=a("%c"),nP=a("%s"),nQ=a(kz),nR=a(iV),nS=a(lj),nT=a(kJ),nU=a("%f"),nV=a("%B"),nW=a("%{"),nX=a("%}"),nY=a("%("),nZ=a("%)"),n0=a("%a"),n1=a("%t"),n2=a("%?"),n3=a("%r"),n4=a("%_r"),n5=[0,a(aq),850,23],oe=[0,a(aq),814,21],n8=[0,a(aq),815,21],of=[0,a(aq),818,21],n9=[0,a(aq),819,21],og=[0,a(aq),822,19],n_=[0,a(aq),823,19],oh=[0,a(aq),826,22],n$=[0,a(aq),827,22],oi=[0,a(aq),831,30],oa=[0,a(aq),832,30],oc=[0,a(aq),836,26],n6=[0,a(aq),837,26],od=[0,a(aq),846,28],n7=[0,a(aq),847,28],ob=[0,a(aq),851,23],pk=a(jf),pi=[0,a(aq),1558,4],pj=a("Printf: bad conversion %["),pl=[0,a(aq),1626,39],pm=[0,a(aq),1649,31],pn=[0,a(aq),1650,31],po=a("Printf: bad conversion %_"),pp=a(ja),pq=a(jn),pr=a(ja),ps=a(jn),pg=a(gr),pe=a("neg_infinity"),pf=a(lX),pd=a(bn),oZ=a("%+nd"),o0=a("% nd"),o2=a("%+ni"),o3=a("% ni"),o4=a("%nx"),o5=a("%#nx"),o6=a("%nX"),o7=a("%#nX"),o8=a("%no"),o9=a("%#no"),oY=a("%nd"),o1=a(lj),o_=a("%nu"),oM=a("%+ld"),oN=a("% ld"),oP=a("%+li"),oQ=a("% li"),oR=a("%lx"),oS=a("%#lx"),oT=a("%lX"),oU=a("%#lX"),oV=a("%lo"),oW=a("%#lo"),oL=a("%ld"),oO=a(iV),oX=a("%lu"),oz=a("%+Ld"),oA=a("% Ld"),oC=a("%+Li"),oD=a("% Li"),oE=a("%Lx"),oF=a("%#Lx"),oG=a("%LX"),oH=a("%#LX"),oI=a("%Lo"),oJ=a("%#Lo"),oy=a("%Ld"),oB=a(kJ),oK=a("%Lu"),om=a("%+d"),on=a("% d"),op=a("%+i"),oq=a("% i"),or=a("%x"),os=a("%#x"),ot=a("%X"),ou=a("%#X"),ov=a("%o"),ow=a("%#o"),ol=a(gy),oo=a(kz),ox=a(jf),nG=a("@]"),nH=a("@}"),nI=a("@?"),nJ=a("@\n"),nK=a("@."),nL=a("@@"),nM=a("@%"),nN=a("@"),oj=a("CamlinternalFormat.Type_mismatch"),pw=a(o),px=[0,[11,a(eG),[2,0,[2,0,0]]],a(", %s%s")],pX=[0,[11,a(gv),[2,0,[12,10,0]]],a(lL)],pY=[0,[11,a("Fatal error in uncaught exception handler: exception "),[2,0,[12,10,0]]],a("Fatal error in uncaught exception handler: exception %s\n")],pW=a("Fatal error: out of memory in uncaught exception handler"),pU=[0,[11,a(gv),[2,0,[12,10,0]]],a(lL)],pP=[0,[2,0,[12,10,0]],a("%s\n")],pQ=[0,[11,a(i1),0],a(i1)],pH=a("Raised at"),pI=a("Re-raised at"),pJ=a("Raised by primitive operation at"),pK=a("Called from"),pL=a(" (inlined)"),pN=a(o),pM=[0,[2,0,[12,32,[2,0,[11,a(' in file "'),[2,0,[12,34,[2,0,[11,a(", line "),[4,0,0,0,[11,a(k5),GA]]]]]]]]]],a('%s %s in file "%s"%s, line %d, characters %d-%d')],pO=[0,[2,0,[11,a(" unknown location"),0]],a("%s unknown location")],pC=a("Out of memory"),pD=a("Stack overflow"),pE=a("Pattern matching failed"),pF=a("Assertion failed"),pG=a("Undefined recursive module"),py=[0,[12,40,[2,0,[2,0,[12,41,0]]]],a("(%s%s)")],pz=a(o),pA=a(o),pB=[0,[12,40,[2,0,[12,41,0]]],a("(%s)")],pv=[0,[4,0,0,0,0],a(gy)],pt=[0,[3,0,0],a("%S")],pu=a(lm),pR=[0,a(o),a("(Cannot print locations:\n bytecode executable program file not found)"),a("(Cannot print locations:\n bytecode executable program file appears to be corrupt)"),a("(Cannot print locations:\n bytecode executable program file has wrong magic number)"),a("(Cannot print locations:\n bytecode executable program file cannot be opened;\n -- too many open files. Try running with OCAMLRUNPARAM=b=2)")],p1=a("Fun.Finally_raised: "),pZ=a("Stdlib.Fun.Finally_raised"),p2=a(lF),Gy=a("OCAMLRUNPARAM"),Gw=a("CAMLRUNPARAM"),p3=a(o),qn=[3,0,3],qo=a(bn),qi=a(eT),qj=a("<\/"),qk=a(o),qe=a(eT),qf=a(gi),qg=a(o),qc=a("\n"),qb=[0,a(o)],p9=a(o),p_=a(o),p$=a(o),qa=a(o),p8=[0,a(o),0,a(o)],p7=a(o),p6=a("Stdlib.Format.String_tag"),qB=a(o),qG=a(jv),qI=a(mb),qJ=a(kp),qK=a(iM),qL=a(kk),qM=a(k0),qN=a(jL),qO=a(ld),qP=a(f$),qQ=a(jO),qR=a(lc),qS=a(kd),qT=a(le),qU=a(jK),qV=a(iw),qW=a(me),qX=a(iL),qY=a(iT),qZ=a(j6),q0=a(kK),q1=a(eQ),q2=a(i7),q3=a(l0),q4=a(li),q5=a(lJ),q6=a(kD),q7=a(eI),q8=a(gz),q9=a(i3),q_=a(i2),q$=a(j0),ra=a(l3),rb=a(lY),rc=a(l7),rd=a(jw),re=a(iW),rf=a(ji),rg=a(kU),rh=a(l$),ri=a(ka),rj=a(jB),rk=a(kn),rl=a(iS),rm=a(ke),rn=a(iz),ro=a(lg),rp=a(lU),rq=a(jz),rr=a(i5),rs=a(j9),rt=a(kE),ru=a(jR),rv=a(kO),rw=a(kj),rx=a(lf),ry=a(jN),rz=a(jx),rA=a(lB),rB=a(k8),rC=a(lN),rD=a(k4),rE=a(kZ),rF=a(kY),rG=a(iR),rH=a(jE),rI=a(jd),rJ=a(lp),rK=a(lG),rL=[0,[11,a("EUNKNOWNERR "),[4,0,0,0,0]],a("EUNKNOWNERR %d")],qH=[0,[11,a("Unix.Unix_error(Unix."),[2,0,[11,a(eG),[3,0,[11,a(eG),[3,0,[12,41,0]]]]]]],a("Unix.Unix_error(Unix.%s, %S, %S)")],qC=a(dE),qD=a(o),qE=a(o),qF=a(dE),rM=a("0.0.0.0"),rN=a("127.0.0.1"),Gv=a("::"),Gu=a("::1"),r3=a(o),r4=a(o),r_=[0,92],sa=a("\\( group not closed by \\)"),r$=[0,a(iD),gg,10],sb=a("[ class not closed by ]"),sc=a("spurious \\) in regular expression"),r6=a("too many r* or r+ where r is nullable"),r7=a(o),r8=a(o),r5=[0,a(iD),213,11],si=[0,a(kV),52,4],sh=[0,a(kV),58,34],sg=a("Not a valid time zone"),uu=a("Not a month"),us=a("Not a day"),up=a("from_business: bad week"),uq=a("from_business: bad date"),tC=[0,a(kF),jQ,4],tB=[0,a(kF),gE,4],tu=[0,-4713,12,31],tv=[0,k_,1,23],tw=[0,dy,10,14],tx=[0,dy,10,5],ts=a("Date.Out_of_bounds"),tt=a("Date.Undefined"),tS=a("Date.Period.Not_computable"),t1=[0,31,59,90,bY,f7,181,212,gx,273,304,334,ey],uy=[0,a(eL),429,6],ux=[0,a(eL),lz,4],uw=[0,a(eL),167,6],uv=[0,a(eL),67,4],uC=a("[a-zA-Z]+"),uI=ca(1,0,0),uD=a("Z.Overflow"),uF=a(gf),uM=a(o),uN=a("+inf"),uO=a("-inf"),uP=a(l4),uQ=a("undef"),uS=[0,a("q.ml"),486,25],uR=a("Q.of_string: invalid digit"),uK=a("impossible case"),uT=a("Runtime.EmptyError"),uU=a("Runtime.AssertionFailed"),uW=a("Runtime.ConflictError"),uY=a("Runtime.ImpossibleDate"),u0=a("Runtime.NoValueProvided"),FE=[0,a(a0),96,20,96,64,[0,a(a9),[0,a(aZ),[0,a(t),0]]]],FD=[0,a(aB),[0,a("allocations_familiales.avait_enfant_\xc3\xa0_charge_avant_1er_janvier_2012"),0]],FC=[0,a(aB),[0,a("allocations_familiales.enfants_\xc3\xa0_charge"),0]],FB=[0,a(aB),[0,a("allocations_familiales.date_courante"),0]],FA=[0,a(aB),[0,a("allocations_familiales.r\xc3\xa9sidence"),0]],Fz=[0,a(aB),[0,a("allocations_familiales.ressources_m\xc3\xa9nage"),0]],Fy=[0,a(a0),93,20,93,72,[0,a(a9),[0,a(aZ),[0,a(t),0]]]],Fx=[0,a(aB),[0,a("allocations_familiales.personne_charge_effective_permanente_remplit_titre_I"),0]],Fw=[0,a(a0),90,20,90,67,[0,a(a9),[0,a(aZ),[0,a(t),0]]]],Fv=[0,a(aB),[0,a("allocations_familiales.personne_charge_effective_permanente_est_parent"),0]],Fr=[0,0],Fs=[1,0],Ft=[2,0],Fc=[0,a(a0),72,12,72,25,[0,a(a9),[0,a(aZ),[0,a(t),0]]]],Fd=[0,a(aB),[0,a(eK),0]],Fe=[0,a(a0),73,12,73,19,[0,a(a9),[0,a(aZ),[0,a(t),0]]]],Ff=[0,a(aB),[0,a(lW),0]],Fg=[0,a(a0),76,12,76,29,[0,a(a9),[0,a(aZ),[0,a(t),0]]]],Fh=[0,a(aB),[0,a(kq),0]],Fi=[0,a(a0),77,12,77,21,[0,a(a9),[0,a(aZ),[0,a(t),0]]]],Fj=[0,a(aB),[0,a(eR),0]],Fk=[0,a(a0),79,12,79,59,[0,a(a9),[0,a(aZ),[0,a(t),0]]]],Fl=[0,a(aB),[0,a(lV),0]],Fm=[0,a(a0),80,12,80,64,[0,a(a9),[0,a(aZ),[0,a(t),0]]]],Fn=[0,a(aB),[0,a(iC),0]],Fo=[0,a(a0),81,12,81,56,[0,a(a9),[0,a(aZ),[0,a(t),0]]]],Fp=[0,a(aB),[0,a(j_),0]],Fq=[0,a(a0),74,12,74,28,[0,a(a9),[0,a(aZ),[0,a(t),0]]]],Fu=[0,a(aB),[0,a(kt),0]],FF=[0,a(aB),[0,a(iP),[0,a(e),0]]],FG=[0,a(aB),[0,a(iP),[0,a(e),0]]],FH=[0,a(a0),78,12,78,25,[0,a(a9),[0,a(aZ),[0,a(t),0]]]],FI=[0,a(aB),[0,a(jh),0]],EH=[0,a(e),[0,a(dv),[0,a(ay),0]]],EI=[0,a(e),[0,a(dv),0]],EJ=[0,a(e),[0,a(dv),[0,a(aA),0]]],EK=[0,a(e),[0,a(dv),0]],Er=[0,a(e),[0,a(bL),[0,a(ay),0]]],Es=[0,a(e),[0,a(bL),0]],Et=[0,a(e),[0,a(bL),[0,a(aA),0]]],Eu=[0,a(e),[0,a(bL),0]],Ev=a(cG),EA=a(kv),EB=a(dD),Ew=[0,a(e),[0,a(dr),[0,a(ay),0]]],Ex=[0,a(e),[0,a(dr),0]],Ey=[0,a(e),[0,a(dr),[0,a(aA),0]]],Ez=[0,a(e),[0,a(dr),0]],Eq=[0,a(q),eA,12,eA,50,[0,a(p),0]],Eh=a(a_),Ei=[0,a(X),272,5,274,41,[0,a(cM),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],Ej=a(a_),Ek=a(cG),El=a(a_),Ec=a(a_),Ed=[0,a(X),262,5,kg,42,[0,a(cM),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],Ee=a(a_),Ef=a(cG),Eg=a(a_),Eb=[0,a(X),lo,14,lo,55,[0,a(cM),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],Ea=a(k),D2=[0,a(e),[0,a(Z),[0,a(ay),0]]],D3=[0,a(e),[0,a(Z),0]],D4=[0,a(e),[0,a(Z),[0,a(aA),0]]],D5=[0,a(e),[0,a(Z),0]],D6=a(Y),D7=a(f_),D8=[0,a(X),382,5,385,23,[0,a(eO),[0,a(b4),[0,a(dp),[0,a(bN),[0,a(W),[0,a(x),0]]]]]]],D9=a("0.0567"),DT=[0,a(e),[0,a(Z),[0,a(ay),0]]],DU=[0,a(e),[0,a(Z),0]],DV=[0,a(e),[0,a(Z),[0,a(aA),0]]],DW=[0,a(e),[0,a(Z),0]],DX=a(Y),DY=a("11"),DZ=a(f_),D0=[0,a(X),373,5,f6,42,[0,a(eO),[0,a(b4),[0,a(dp),[0,a(bN),[0,a(W),[0,a(x),0]]]]]]],D1=a("0.0369"),DS=[0,a(X),22,14,22,40,[0,a(aV),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],DO=[0,a(e),[0,a(dw),[0,a(ay),0]]],DP=[0,a(e),[0,a(dw),0]],DQ=[0,a(e),[0,a(dw),[0,a(aA),0]]],DR=[0,a(e),[0,a(dw),0]],DN=[0,a(q),em,12,em,38,[0,a(p),0]],DJ=[8,0],DK=[0,a(v),lD,5,lD,24,[0,a(dB),[0,a(K),[0,a(L),[0,a(t),0]]]]],DH=a(Y),DI=[0,a(X),350,5,351,69,[0,a(eO),[0,a(b4),[0,a(dp),[0,a(bN),[0,a(W),[0,a(x),0]]]]]]],DG=[0,a(X),18,14,18,34,[0,a(aV),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],Dz=[0,a(e),[0,a(dA),[0,a(ay),0]]],DA=[0,a(e),[0,a(dA),0]],DB=[0,a(e),[0,a(dA),[0,a(aA),0]]],DC=[0,a(e),[0,a(dA),0]],DD=a(Y),Dq=[0,a(e),[0,a(Z),[0,a(ay),0]]],Dr=[0,a(e),[0,a(Z),0]],Ds=[0,a(e),[0,a(Z),[0,a(aA),0]]],Dt=[0,a(e),[0,a(Z),0]],Du=[0,a(a0),27,5,27,44,[0,a("R\xc3\xa8gles diverses"),[0,a(aZ),[0,a(t),0]]]],Dv=a(k),Dk=[0,a(e),[0,a(Z),[0,a(ay),0]]],Dl=[0,a(e),[0,a(Z),0]],Dm=[0,a(e),[0,a(Z),[0,a(aA),0]]],Dn=[0,a(e),[0,a(Z),0]],Do=[0,a(X),cL,3,cL,41,[0,a(aV),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],Dp=a("0.04"),De=[0,a(e),[0,a(Z),[0,a(ay),0]]],Df=[0,a(e),[0,a(Z),0]],Dg=[0,a(e),[0,a(Z),[0,a(aA),0]]],Dh=[0,a(e),[0,a(Z),0]],Di=[0,a(X),95,3,96,44,[0,a(aV),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],Dj=a(jo),C_=[0,a(e),[0,a(Z),[0,a(ay),0]]],C$=[0,a(e),[0,a(Z),0]],Da=[0,a(e),[0,a(Z),[0,a(aA),0]]],Db=[0,a(e),[0,a(Z),0]],Dc=[0,a(X),55,3,55,41,[0,a(aV),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],Dd=a(f5),C9=[0,a(o),0,1,0,1,0],C8=[0,a(q),eJ,12,eJ,48,[0,a(p),0]],CY=[0,a(X),cQ,3,cQ,41,[0,a(aV),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],CZ=a(Y),C0=a(jo),C1=a(k),CU=[0,a(X),74,3,75,44,[0,a(aV),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],CV=a(Y),CW=a(f5),CX=a(k),CQ=[0,a(X),35,3,35,41,[0,a(aV),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],CR=a(Y),CS=a(lP),CT=a(k),CP=[0,a(o),0,1,0,1,0],CI=[0,a(X),cQ,3,cQ,41,[0,a(aV),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],CJ=a(az),CK=a(az),CL=a("0.1025"),CM=a(k),CD=[0,a(X),74,3,75,44,[0,a(aV),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],CE=a(az),CF=a(az),CG=a("0.205"),CH=a(k),Cy=[0,a(X),35,3,35,41,[0,a(aV),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],Cz=a(az),CA=a(az),CB=a("0.41"),CC=a(k),Cx=[0,a(o),0,1,0,1,0],Ct=[0,a(X),gx,5,gx,43,[0,a(cM),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],Cu=a("0.0559"),Cr=[0,a(X),229,5,lz,46,[0,a(cM),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],Cs=a("0.1117"),Cp=[0,a(X),js,5,js,43,[0,a(cM),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],Cq=a("0.20234"),Co=[0,a(o),0,1,0,1,0],Ch=a(a_),Ci=[0,a(X),170,5,171,68,[0,a(aV),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],Cj=a(a_),Ck=a(cG),Cl=a(a_),Cc=a(a_),Cd=[0,a(X),162,5,163,68,[0,a(aV),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],Ce=a(a_),Cf=a(cG),Cg=a(a_),Cb=[0,a(X),iv,14,iv,34,[0,a(aV),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],Ca=a(k),B$=[0,a(q),eu,12,eu,32,[0,a(p),0]],B4=[0,a(e),[0,a(bo),[0,a(ay),0]]],B5=[0,a(e),[0,a(bo),0]],B6=[0,a(e),[0,a(bo),[0,a(aA),0]]],B7=[0,a(e),[0,a(bo),0]],B8=[0,a(am),313,5,lH,58,[0,a(lK),[0,a(H),[0,a(I),[0,a(F),[0,a(al),[0,a(x),0]]]]]]],BV=[0,a(e),[0,a(dF),[0,a(ay),0]]],BW=[0,a(e),[0,a(dF),0]],BX=[0,a(e),[0,a(dF),[0,a(aA),0]]],BY=[0,a(e),[0,a(dF),0]],BZ=[0,a(e),[0,a(bo),[0,a(ay),0]]],B0=[0,a(e),[0,a(bo),0]],B1=[0,a(e),[0,a(bo),[0,a(aA),0]]],B2=[0,a(e),[0,a(bo),0]],B3=[0,a(am),299,5,300,58,[0,a(lK),[0,a(H),[0,a(I),[0,a(F),[0,a(al),[0,a(x),0]]]]]]],BU=[0,a(q),cL,12,cL,35,[0,a(p),0]],E4=[8,0],E5=a(Y),E6=[0,a(v),344,5,345,72,[0,a(dB),[0,a(K),[0,a(L),[0,a(t),0]]]]],E2=a(Y),E3=[0,a(am),406,5,407,72,[0,a(gj),[0,a(b4),[0,a(eE),[0,a(bN),[0,a(al),[0,a(x),0]]]]]]],E0=a(az),E1=[0,a(am),ev,5,ev,70,[0,a(mg),[0,a(H),[0,a(I),[0,a(F),[0,a(al),[0,a(x),0]]]]]]],BG=[0,a(e),[0,a(bL),[0,a(ay),0]]],BH=[0,a(e),[0,a(bL),0]],BI=[0,a(e),[0,a(bL),[0,a(aA),0]]],BJ=[0,a(e),[0,a(bL),0]],BK=a(cG),BL=a(kv),BM=a(dD),Bx=[0,a(v),l9,5,l9,49,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],By=a(k),Bz=a("5728"),BA=a(k),Bt=[0,a(v),497,5,498,53,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],Bu=a(k),Bv=a("0.0717"),Bw=a(k),Bp=[0,a(v),489,5,490,53,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],Bq=a(k),Br=a("0.0847"),Bs=a(k),Bl=[0,a(v),481,5,482,53,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],Bm=a(k),Bn=a("0.0976"),Bo=a(k),Bh=[0,a(v),473,5,474,53,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],Bi=a(k),Bj=a("0.115"),Bk=a(k),Bd=[0,a(v),465,5,466,53,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],Be=a(k),Bf=a("0.1163"),Bg=a(k),A$=[0,a(v),457,5,458,53,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],Ba=a(k),Bb=a("0.122"),Bc=a(k),A7=[0,a(v),449,5,450,53,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],A8=a(k),A9=a("0.1278"),A_=a(k),A3=[0,a(v),441,5,442,53,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],A4=a(k),A5=a("0.1335"),A6=a(k),AZ=[0,a(v),433,5,434,53,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],A0=a(k),A1=a("0.1393"),A2=a(k),AV=[0,a(v),425,5,jr,53,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],AW=a(k),AX=a("0.145"),AY=a(k),AU=[0,a(v),l_,14,l_,57,[0,a(dB),[0,a(K),[0,a(L),[0,a(t),0]]]]],AR=a(k),AS=a(jj),AT=a(k),AL=[0,a(v),j$,5,j$,69,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],AM=a(Y),AN=a("0.3068"),AO=a(k),AH=[0,a(v),jt,5,jt,69,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],AI=a(Y),AJ=a("0.2936"),AK=a(k),AD=[0,a(v),jU,5,jU,69,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],AE=a(Y),AF=a("0.284"),AG=a(k),Az=[0,a(v),la,5,la,69,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],AA=a(Y),AB=a("0.2672"),AC=a(k),Av=[0,a(v),jk,5,jk,69,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],Aw=a(Y),Ax=a("0.273"),Ay=a(k),Ar=[0,a(v),j4,5,j4,69,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],As=a(Y),At=a("0.2555"),Au=a(k),An=[0,a(v),jV,5,jV,69,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],Ao=a(Y),Ap=a("0.2496"),Aq=a(k),Aj=[0,a(v),lA,5,lA,69,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],Ak=a(Y),Al=a("0.2437"),Am=a(k),Af=[0,a(v),gg,5,gg,69,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],Ag=a(Y),Ah=a("0.2379"),Ai=a(k),Ab=[0,a(v),kX,5,kX,69,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],Ac=a(Y),Ad=a("0.232"),Ae=a(k),Aa=[0,a(v),lI,14,lI,58,[0,a(dB),[0,a(K),[0,a(L),[0,a(t),0]]]]],z9=a(Y),z_=a(lP),z$=a(k),z3=[0,a(v),lE,5,lE,69,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],z4=a(az),z5=a("0.143"),z6=a(k),zZ=[0,a(v),ky,5,ky,69,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],z0=a(az),z1=a("0.1259"),z2=a(k),zV=[0,a(v),ks,5,ks,69,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],zW=a(az),zX=a("0.1089"),zY=a(k),zR=[0,a(v),iA,5,iA,69,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],zS=a(az),zT=a("0.0918"),zU=a(k),zN=[0,a(v),lZ,5,lZ,69,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],zO=a(az),zP=a("0.0842"),zQ=a(k),zJ=[0,a(v),l6,5,l6,69,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],zK=a(az),zL=a("0.0766"),zM=a(k),zF=[0,a(v),lT,5,lT,69,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],zG=a(az),zH=a("0.069"),zI=a(k),zB=[0,a(v),je,5,je,69,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],zC=a(az),zD=a("0.075"),zE=a(k),zx=[0,a(v),kI,5,kI,69,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],zy=a(az),zz=a("0.0539"),zA=a(k),zt=[0,a(v),jJ,5,jJ,69,[0,a(P),[0,a(K),[0,a(L),[0,a(t),0]]]]],zu=a(az),zv=a(jF),zw=a(k),zs=[0,a(v),f6,14,f6,59,[0,a(dB),[0,a(K),[0,a(L),[0,a(t),0]]]]],zp=a(az),zq=a(f5),zr=a(k),zg=a(Y),zh=[0,a(am),420,6,421,72,[0,a(gj),[0,a(b4),[0,a(eE),[0,a(bN),[0,a(al),[0,a(x),0]]]]]]],zb=[0,a(ac),[0,a(dx),[0,a(ay),0]]],zc=[0,a(ac),[0,a(dx),0]],zd=[0,a(ac),[0,a(dx),[0,a(aA),0]]],ze=[0,a(ac),[0,a(dx),0]],zf=[0,a(am),jQ,5,125,59,[0,a(mg),[0,a(H),[0,a(I),[0,a(F),[0,a(al),[0,a(x),0]]]]]]],za=[0,a(q),bd,12,bd,36,[0,a(p),0]],y5=[0,a(v),l1,5,l1,69,[0,a(b5),[0,a(j3),[0,a(b1),[0,a(t),0]]]]],y6=a(jm),y7=a("5827900"),y2=[0,a(v),bu,5,bu,69,[0,a(jI),[0,a(b1),[0,a(t),0]]]],y3=a(lk),y4=a("5775900"),yZ=[0,a(v),bY,5,bY,69,[0,a(iE),[0,a(b1),[0,a(t),0]]]],y0=a(lQ),y1=a("5684900"),yW=[0,a(v),87,5,87,69,[0,a(l2),[0,a(b1),[0,a(t),0]]]],yX=a(lb),yY=a("5628600"),yV=[0,a(X),jc,14,jc,30,[0,a(ko),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],yT=a(md),yU=a("5595000"),yO=[0,a(v),j1,5,j1,69,[0,a(b5),[0,a(j3),[0,a(b1),[0,a(t),0]]]]],yP=a(jm),yQ=a("8155800"),yL=[0,a(v),jG,5,jG,69,[0,a(jI),[0,a(b1),[0,a(t),0]]]],yM=a(lk),yN=a("8083100"),yI=[0,a(v),bd,5,bd,69,[0,a(iE),[0,a(b1),[0,a(t),0]]]],yJ=a(lQ),yK=a("7955800"),yF=[0,a(v),94,5,94,69,[0,a(l2),[0,a(b1),[0,a(t),0]]]],yG=a(lb),yH=a("7877000"),yE=[0,a(X),lO,14,lO,31,[0,a(ko),[0,a(H),[0,a(I),[0,a(F),[0,a(W),[0,a(x),0]]]]]]],yC=a(md),yD=a("7830000"),yu=[0,a(ac),[0,a(dt),[0,a(ay),0]]],yv=[0,a(ac),[0,a(dt),0]],yw=[0,a(ac),[0,a(dt),[0,a(aA),0]]],yx=[0,a(ac),[0,a(dt),0]],yr=[0,a(jb),83,19,83,69,[0,a("Article R521-1"),[0,a(H),[0,a(I),[0,a(F),[0,a(kS),[0,a(x),0]]]]]]],yq=a("14"),yp=[0,a(q),eF,12,eF,39,[0,a(p),0]],yl=[0,a(e),[0,a("enfant_le_plus_\xc3\xa2g\xc3\xa9.enfants"),0]],yi=[0,a(e),[0,a("prestations_familiales.r\xc3\xa9sidence"),0]],yg=[1,0],yh=[0,a(e),[0,a("prestations_familiales.prestation_courante"),0]],yf=[0,a(e),[0,a("prestations_familiales.date_courante"),0]],x4=[0,a(am),269,5,270,48,[0,a(bs),[0,a(H),[0,a(I),[0,a(F),[0,a(al),[0,a(x),0]]]]]]],x5=[0,0],x2=[0,a(am),kB,5,259,56,[0,a(bs),[0,a(H),[0,a(I),[0,a(F),[0,a(al),[0,a(x),0]]]]]]],x3=[1,0],x0=[0,a(am),kP,5,kP,70,[0,a(bs),[0,a(H),[0,a(I),[0,a(F),[0,a(al),[0,a(x),0]]]]]]],x1=[0,0],xY=[0,a(am),k7,5,k7,69,[0,a(bs),[0,a(H),[0,a(I),[0,a(F),[0,a(al),[0,a(x),0]]]]]]],xZ=[0,0],xW=[0,a(am),jH,5,jH,60,[0,a(bs),[0,a(H),[0,a(I),[0,a(F),[0,a(al),[0,a(x),0]]]]]]],xX=[0,0],xV=[0,a(o),0,1,0,1,0],xU=[0,a(q),cj,12,cj,21,[0,a(p),0]],xQ=[0,a(am),263,5,kg,48,[0,a(bs),[0,a(H),[0,a(I),[0,a(F),[0,a(al),[0,a(x),0]]]]]]],xR=[0,0],xO=[0,a(am),lt,5,du,56,[0,a(bs),[0,a(H),[0,a(I),[0,a(F),[0,a(al),[0,a(x),0]]]]]]],xP=[2,0],xM=[0,a(am),jq,5,jq,70,[0,a(bs),[0,a(H),[0,a(I),[0,a(F),[0,a(al),[0,a(x),0]]]]]]],xN=[1,0],xK=[0,a(am),jW,5,jW,69,[0,a(bs),[0,a(H),[0,a(I),[0,a(F),[0,a(al),[0,a(x),0]]]]]]],xL=[0,0],xI=[0,a(am),k9,5,k9,60,[0,a(bs),[0,a(H),[0,a(I),[0,a(F),[0,a(al),[0,a(x),0]]]]]]],xJ=[0,0],xH=[0,a(o),0,1,0,1,0],xG=[0,a(q),cI,12,cI,27,[0,a(p),0]],xt=[0,a(q),90,12,90,59,[0,a(p),0]],xu=[0,a(e),[0,a(lV),0]],xv=[0,a(q),91,12,91,64,[0,a(p),0]],xw=[0,a(e),[0,a(iC),0]],xx=[0,a(q),92,12,92,29,[0,a(p),0]],xy=[0,a(e),[0,a(kq),0]],xz=[0,a(q),93,12,93,21,[0,a(p),0]],xA=[0,a(e),[0,a(eR),0]],xB=[0,a(q),96,12,96,25,[0,a(p),0]],xC=[0,a(e),[0,a(eK),0]],xD=[0,a(q),99,12,99,28,[0,a(p),0]],xE=[0,a(e),[0,a(kt),0]],xF=[0,a(q),cI,12,cI,27,[0,a(p),0]],xS=[0,a(e),[0,a(bL),0]],xT=[0,a(q),cj,12,cj,21,[0,a(p),0]],x6=[0,a(e),[0,a("versement"),0]],x7=[0,a(q),bY,12,bY,56,[0,a(p),0]],x8=[0,a(e),[0,a(j_),0]],x_=a(eN),x9=[0,a(q),f7,12,f7,33,[0,a(p),0]],x$=[0,a(e),[0,a("nombre_enfants_l521_1"),0]],yb=a(eN),ya=[0,a(q),bu,12,bu,42,[0,a(p),0]],yc=[0,a(e),[0,a("nombre_enfants_alin\xc3\xa9a_2_l521_3"),0]],yd=[0,a(e),[0,a(jP),[0,a(gs),0]]],ye=[0,a(e),[0,a(jP),[0,a(gs),0]]],yj=[0,a(e),[0,a(lx),[0,a(ac),0]]],yk=[0,a(e),[0,a(lx),[0,a(ac),0]]],ym=[0,a(e),[0,a(kf),[0,a(eP),0]]],yn=[0,a(e),[0,a(kf),[0,a(eP),0]]],yo=[0,a(q),eF,12,eF,39,[0,a(p),0]],ys=[0,a(e),[0,a(bo),0]],yt=[0,a(q),aW,12,aW,62,[0,a(p),0]],yy=[0,a(e),[0,a("enfants_\xc3\xa0_charge_droit_ouvert_prestation_familiale"),0]],yz=[0,a(q),kW,12,kW,34,[0,a(p),0]],yA=[0,a(e),[0,a(dF),0]],yB=[0,a(q),jY,12,jY,29,[0,a(p),0]],yR=[0,a(e),[0,a("plafond_II_d521_3"),0]],yS=[0,a(q),ju,12,ju,28,[0,a(p),0]],y8=[0,a(e),[0,a("plafond_I_d521_3"),0]],E$=a(Y),Fa=[0,a(am),jr,5,427,71,[0,a(gj),[0,a(b4),[0,a(eE),[0,a(bN),[0,a(al),[0,a(x),0]]]]]]],y9=[0,a(q),kw,12,kw,35,[0,a(p),0]],y_=[0,a(e),[0,a("droit_ouvert_compl\xc3\xa9ment"),0]],y$=[0,a(q),bd,12,bd,36,[0,a(p),0]],zi=[0,a(e),[0,a(dA),0]],zk=a(eN),zl=a(eN),zm=a(jF),E_=a(k),zj=[0,a(q),dz,12,dz,65,[0,a(p),0]],zn=[0,a(e),[0,a("montant_initial_base_quatri\xc3\xa8me_enfant_et_plus_mayotte"),0]],zo=[0,a(q),kx,12,kx,57,[0,a(p),0]],z7=[0,a(e),[0,a("montant_initial_base_troisi\xc3\xa8me_enfant_mayotte"),0]],z8=[0,a(q),gE,12,gE,56,[0,a(p),0]],AP=[0,a(e),[0,a("montant_initial_base_deuxi\xc3\xa8me_enfant_mayotte"),0]],AQ=[0,a(q),iJ,12,iJ,55,[0,a(p),0]],BB=[0,a(e),[0,a("montant_initial_base_premier_enfant_mayotte"),0]],BC=[0,a(q),iQ,12,iQ,32,[0,a(p),0]],BD=[0,a(e),[0,a("nombre_total_enfants"),0]],BF=a(dD),BE=[0,a(q),gt,12,gt,32,[0,a(p),0]],BN=[0,a(e),[0,a("nombre_moyen_enfants"),0]],E7=a(Y),E8=[0,a(X),kC,5,360,71,[0,a(eO),[0,a(b4),[0,a(dp),[0,a(bN),[0,a(W),[0,a(x),0]]]]]]],E9=a(jj),BP=a(k),BO=[0,a(q),gB,12,gB,47,[0,a(p),0]],BQ=[0,a(e),[0,a("montant_initial_base_premier_enfant"),0]],BR=[0,a(q),kr,12,kr,29,[0,a(p),0]],BS=[0,a(e),[0,a("droit_ouvert_base"),0]],BT=[0,a(q),cL,12,cL,35,[0,a(p),0]],B9=[0,a(e),[0,a(Z),0]],B_=[0,a(q),eu,12,eu,32,[0,a(p),0]],Cm=[0,a(e),[0,a(dH),0]],Cn=[0,a(q),ck,12,ck,48,[0,a(p),0]],Cv=[0,a(e),[0,a("montant_vers\xc3\xa9_forfaitaire_par_enfant"),0]],Cw=[0,a(q),gC,12,gC,57,[0,a(p),0]],CN=[0,a(e),[0,a("montant_initial_base_troisi\xc3\xa8me_enfant_et_plus"),0]],CO=[0,a(q),gD,12,gD,48,[0,a(p),0]],C2=[0,a(e),[0,a("montant_initial_base_deuxi\xc3\xa8me_enfant"),0]],C4=a(dD),C5=a(dD),C3=[0,a(q),cQ,12,cQ,39,[0,a(p),0]],C6=[0,a(e),[0,a("rapport_enfants_total_moyen"),0]],C7=[0,a(q),eJ,12,eJ,48,[0,a(p),0]],Dw=[0,a(e),[0,a(dw),0]],Dy=a(k),Dx=[0,a(q),iO,12,iO,37,[0,a(p),0]],DE=[0,a(e),[0,a("montant_vers\xc3\xa9_forfaitaire"),0]],DF=[0,a(q),jC,12,jC,32,[0,a(p),0]],DL=[0,a(e),[0,a("montant_initial_base"),0]],DM=[0,a(q),em,12,em,38,[0,a(p),0]],D_=[0,a(e),[0,a(dr),0]],D$=[0,a(q),ki,12,ki,53,[0,a(p),0]],Em=[0,a(e),[0,a("montant_vers\xc3\xa9_compl\xc3\xa9ment_pour_forfaitaire"),0]],En=[0,a(q),gk,12,gk,44,[0,a(p),0]],Eo=[0,a(e),[0,a("montant_avec_garde_altern\xc3\xa9e_base"),0]],Ep=[0,a(q),eA,12,eA,50,[0,a(p),0]],EC=[0,a(e),[0,a(dv),0]],EZ=a(k),ED=[0,a(q),lS,12,lS,30,[0,a(p),0]],EE=[0,a(e),[0,a("montant_vers\xc3\xa9_base"),0]],EG=a(k),EY=a(k),EF=[0,a(q),kH,12,kH,36,[0,a(p),0]],EL=[0,a(e),[0,a("montant_vers\xc3\xa9_majoration"),0]],EM=[0,a(q),k2,12,k2,59,[0,a(p),0]],EN=[0,a(e),[0,a("montant_base_compl\xc3\xa9ment_pour_base_et_majoration"),0]],EP=[0,a(e),[0,a(dH),[0,a(ay),0]]],EQ=[0,a(e),[0,a(dH),0]],ER=[0,a(e),[0,a(dH),[0,a(aA),0]]],ES=[0,a(e),[0,a(dH),0]],EX=a(k),EO=[0,a(q),kh,12,kh,60,[0,a(p),0]],ET=[0,a(e),[0,a("montant_vers\xc3\xa9_compl\xc3\xa9ment_pour_base_et_majoration"),0]],EW=a(k),EU=[0,a(q),iF,12,iF,25,[0,a(p),0]],EV=[0,a(e),[0,a(jh),0]],xg=[0,a(am),60,5,62,32,[0,a(gl),[0,a(ge),[0,a(ga),[0,a(F),[0,a(al),[0,a(x),0]]]]]]],xf=[0,a(am),49,5,50,50,[0,a(gl),[0,a(ge),[0,a(ga),[0,a(F),[0,a(al),[0,a(x),0]]]]]]],xe=[0,a(o),0,1,0,1,0],xd=[0,a(q),65,12,65,24,[0,a(p),0]],xa=[0,a(am),68,5,71,57,[0,a(gl),[0,a(ge),[0,a(ga),[0,a(F),[0,a(al),[0,a(x),0]]]]]]],w$=[0,a(q),66,12,66,31,[0,a(p),0]],w1=[0,a(ac),[0,a("smic.r\xc3\xa9sidence"),0]],w0=[0,a(ac),[0,a("smic.date_courante"),0]],wX=[0,a(v),60,5,61,34,[0,a("Instruction interminist\xc3\xa9rielle n\xc2\xb0DSS/2B/2021/65 du 19 mars 2021 relative \xc3\xa0 la revalorisation au 1er avril 2021 des prestations familiales servies en m\xc3\xa9tropole, en Guadeloupe, en Guyane, en Martinique, \xc3\xa0 la R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy, \xc3\xa0 Saint-Martin et dans le d\xc3\xa9partement de Mayotte"),[0,a(gd),[0,a(t),0]]]],wY=a("41481"),wV=[0,a(v),44,5,45,34,[0,a("Instruction interminist\xc3\xa9rielle no DSS/SD2B/2020/33 du 18 f\xc3\xa9vrier 2020 relative \xc3\xa0 la revalorisation au 1er avril 2020 des prestations familiales servies en m\xc3\xa9tropole, en Guadeloupe, en Guyane, en Martinique, \xc3\xa0 La R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy, \xc3\xa0 Saint-Martin et dans le d\xc3\xa9partement de Mayotte"),[0,a(gd),[0,a(t),0]]]],wW=a("41404"),wT=[0,a(v),24,5,25,34,[0,a("Instruction minist\xc3\xa9rielle N\xc2\xb0DSS/SD2B/2019/65 du 25 mars 2019 relative \xc3\xa0 la revalorisation au 1er avril 2019 des prestations familiales servies en m\xc3\xa9tropole"),[0,a(gd),[0,a(t),0]]]],wU=a("41316"),wS=[0,a(o),0,1,0,1,0],wJ=a("20"),wI=[0,a(q),68,12,68,24,[0,a(p),0]],wK=[0,a(ac),[0,a("\xc3\xa2ge_l512_3_2"),0]],wL=[0,a(q),70,12,70,25,[0,a(p),0]],wM=[0,a(ac),[0,a(eK),0]],wN=[0,a(q),71,12,71,31,[0,a(p),0]],wO=[0,a(ac),[0,a("prestation_courante"),0]],wP=[0,a(q),72,12,72,21,[0,a(p),0]],wQ=[0,a(ac),[0,a(eR),0]],wR=[0,a(q),74,12,74,26,[0,a(p),0]],wZ=[0,a(ac),[0,a("base_mensuelle"),0]],w2=[0,a(ac),[0,a(l8),[0,a(dq),0]]],w3=[0,a(ac),[0,a(l8),[0,a(dq),0]]],xl=[0,0],xn=[1,0],xo=[2,0],xp=[3,0],xq=[4,0],xr=[5,0],xm=[0,a(am),354,5,kC,30,[0,a("Article L751-1"),[0,a("Chapitre 1er : G\xc3\xa9n\xc3\xa9ralit\xc3\xa9s"),[0,a(eE),[0,a(bN),[0,a(al),[0,a(x),0]]]]]]],w4=[0,a(q),69,12,69,35,[0,a(p),0]],w5=[0,a(ac),[0,a("r\xc3\xa9gime_outre_mer_l751_1"),0]],xi=[0,a(jb),i8,18,i8,41,[0,a("Article R755-0-2"),[0,a(b4),[0,a(dp),[0,a(bN),[0,a(kS),[0,a(x),0]]]]]]],xj=a(ly),xk=a(jD),w7=a(ly),w8=a(jD),w6=[0,a(q),67,12,67,28,[0,a(p),0]],w9=[0,a(ac),[0,a("plafond_l512_3_2"),0]],w_=[0,a(q),66,12,66,31,[0,a(p),0]],xb=[0,a(ac),[0,a(dx),0]],xc=[0,a(q),65,12,65,24,[0,a(p),0]],xh=[0,a(ac),[0,a(dt),0]],wy=[0,a(q),84,12,84,19,[0,a(p),0]],wz=[0,a(eP),[0,a(lW),0]],wB=[2,0],wC=a(k),wD=a(k),wE=[1,0],wF=a(Y),wA=[0,a(q),85,12,85,23,[0,a(p),0]],wG=[0,a(eP),[0,a("le_plus_\xc3\xa2g\xc3\xa9"),0]],wv=a(f_),wu=[0,a(q),81,12,81,39,[0,a(p),0]],ww=[0,a(gs),[0,a(bo),0]],wp=[8,0],wq=[0,a(v),lH,5,317,6,[0,a(b5),[0,a(iG),[0,a(cF),[0,a(t),0]]]]],wr=a("774"),wf=[6,0],wi=[0,0],wj=[1,0],wk=[2,0],wl=[3,0],wm=[4,0],wn=[5,0],wo=[7,0],wg=[0,a(v),297,5,306,6,[0,a(b5),[0,a(iG),[0,a(cF),[0,a(t),0]]]]],wh=a("1025"),wc=[8,0],wd=[0,a(v),276,5,278,6,[0,a(b5),[0,a(i_),[0,a(cF),[0,a(t),0]]]]],we=a("766"),v4=[6,0],v7=[0,0],v8=[1,0],v9=[2,0],v_=[3,0],v$=[4,0],wa=[5,0],wb=[7,0],v5=[0,a(v),kB,5,267,6,[0,a(b5),[0,a(i_),[0,a(cF),[0,a(t),0]]]]],v6=a("1015"),v1=[8,0],v2=[0,a(v),237,5,239,6,[0,a(b5),[0,a(iB),[0,a(cF),[0,a(t),0]]]]],v3=a("757"),vR=[6,0],vU=[0,0],vV=[1,0],vW=[2,0],vX=[3,0],vY=[4,0],vZ=[5,0],v0=[7,0],vS=[0,a(v),219,5,228,6,[0,a(b5),[0,a(iB),[0,a(cF),[0,a(t),0]]]]],vT=a("1003"),vQ=[0,a(o),0,1,0,1,0],vL=[0,a(q),41,12,41,25,[0,a(p),0]],vM=[0,a(dq),[0,a(eK),0]],vN=[0,a(q),42,12,42,21,[0,a(p),0]],vO=[0,a(dq),[0,a(eR),0]],vP=[0,a(q),43,12,43,24,[0,a(p),0]],ws=[0,a(dq),[0,a("brut_horaire"),0]],vC=a("a_d\xc3\xa9j\xc3\xa0_ouvert_droit_aux_allocations_familiales"),vD=a("prise_en_charge"),vE=a("\xc3\xa2ge"),vF=a("date_de_naissance"),vG=a("r\xc3\xa9muneration_mensuelle"),vH=a("obligation_scolaire"),vI=a("identifiant"),vJ=[0,a("Enfant"),0],vw=a("d_a_d\xc3\xa9j\xc3\xa0_ouvert_droit_aux_allocations_familiales"),vx=a("d_prise_en_charge"),vy=a("d_date_de_naissance"),vz=a("d_r\xc3\xa9muneration_mensuelle"),vA=a("d_identifiant"),vB=[0,a("EnfantEntr\xc3\xa9e"),0],vm=a("PrestationAccueilJeuneEnfant"),vo=a(e),vp=a("Compl\xc3\xa9mentFamilial"),vq=a("AllocationLogement"),vr=a("Allocation\xc3\x89ducationEnfantHandicap\xc3\xa9"),vs=a("AllocationSoutienFamilial"),vt=a("AllocationRentr\xc3\xa9eScolaire"),vu=a("AllocationJournali\xc3\xa8rePresenceParentale"),vn=[0,a("\xc3\x89l\xc3\xa9mentPrestationsFamiliales"),0],vc=a(kb),ve=a(kT),vf=a(i6),vg=a("LaR\xc3\xa9union"),vh=a("SaintBarth\xc3\xa9lemy"),vi=a("SaintMartin"),vj=a(jX),vk=a("SaintPierreEtMiquelon"),vl=a(lr),vd=[0,a("Collectivit\xc3\xa9"),0],u_=a("Avant"),va=a("Pendant"),vb=a("Apr\xc3\xa8s"),u$=[0,a("SituationObligationScolaire"),0],u4=a("GardeAltern\xc3\xa9ePartageAllocations"),u6=a("GardeAltern\xc3\xa9eAllocataireUnique"),u7=a("EffectiveEtPermanente"),u8=a("ServicesSociauxAllocationVers\xc3\xa9e\xc3\x80LaFamille"),u9=a("ServicesSociauxAllocationVers\xc3\xa9eAuxServicesSociaux"),u5=[0,a("PriseEnCharge"),0],FN=a("Js_of_ocaml__Js.Error"),FO=a(gb),Go=a("Begin call"),Gp=a("End call"),Gq=a("Variable definition"),Gr=a("Decision taken"),Gc=a("Confi\xc3\xa9 aux service sociaux, allocation vers\xc3\xa9e aux services sociaux"),Gd=a("Confi\xc3\xa9 aux service sociaux, allocation vers\xc3\xa9e \xc3\xa0 la famille"),Ge=a("Effective et permanente"),Gf=a("Garde altern\xc3\xa9e, allocataire unique"),Gg=a("Garde altern\xc3\xa9e, partage des allocations"),Gi=[0,0],Gj=[1,0],Gk=[2,0],Gl=[3,0],Gm=[4,0],Gh=a("Unknown prise en charge"),FV=a(kb),FW=a(kT),FX=a("La R\xc3\xa9union"),FY=a(i6),FZ=a(lr),F0=a(jX),F1=a("Saint Barth\xc3\xa9lemy"),F2=a("Saint Martin"),F3=a("Saint Pierre et Miquelon"),F5=[7,0],F6=[5,0],F7=[4,0],F8=[6,0],F9=[8,0],F_=[2,0],F$=[3,0],Ga=[1,0],Gb=[0,0],F4=a("unknown collectivite!"),FT=a(o),FR=[0,[4,0,0,0,[12,68,[4,0,0,0,[12,77,[4,0,0,0,[12,89,0]]]]]],a("%dD%dM%dY")],FQ=[0,a(k3),a(k$),a(lw)];function -$(a){if(typeof +It(){var +a=y;if(a.process&&a.process.on)a.process.on("uncaughtException",function(b,c){mL(b);a.process.exit(2)});else +if(a.addEventListener)a.addEventListener("error",function(a){if(a.error)mL(a.error)})}It();function +c(a,b){return a.length==1?a(b):bb(a,[b])}function +i(a,b,c){return a.length==2?a(b,c):bb(a,[b,c])}function +Q(a,b,c,d){return a.length==3?a(b,c,d):bb(a,[b,c,d])}function +gf(a,b,c,d,e,f){return a.length==5?a(b,c,d,e,f):bb(a,[b,c,d,e,f])}function +HG(a,b,c,d,e,f,g,h){return a.length==7?a(b,c,d,e,f,g,h):bb(a,[b,c,d,e,f,g,h])}HU();var +fm=[N,a(kD),-1],hl=[N,a(k4),-2],dV=[N,a(gC),-3],hh=[N,a(lz),-4],hm=[N,a(j_),-6],aM=[N,a(lG),-7],hj=[N,a(jf),-8],hk=[N,a(lJ),-9],L=[N,a(l7),-11],hn=[N,a(kS),gB],HF=[4,0,0,0,[12,45,[4,0,0,0,0]]],fx=[0,[11,a('File "'),[2,0,[11,a('", line '),[4,0,0,0,[11,a(lj),[4,0,0,0,[12,45,[4,0,0,0,[11,a(": "),[2,0,0]]]]]]]]]],a('File "%s", line %d, characters %d-%d: %s')],cD=[0,0,0],er=[0,a(ln),a(lh),a(lK)];a_(11,hn,kS);a_(10,L,l7);a_(9,[N,a(jD),-10],jD);a_(8,hk,lJ);a_(7,hj,jf);a_(6,aM,lG);a_(5,hm,j_);a_(4,[N,a(k8),-5],k8);a_(3,hh,lz);a_(2,dV,gC);a_(1,hl,k4);a_(0,fm,kD);var +np=a("output_substring"),nm=a("%.12g"),nl=a(bl),nj=a("true"),nk=a("false"),na=a("Stdlib.Exit"),nc=cb(0,0,lE),ne=cb(0,0,65520),ng=cb(1,0,lE),ns=a("\\\\"),nt=a("\\'"),nu=a("\\b"),nv=a("\\t"),nw=a("\\n"),nx=a("\\r"),nr=a("Char.chr"),ny=a("hd"),nB=a("String.blit / Bytes.blit_string"),nA=a("Bytes.blit"),nz=a("String.sub / Bytes.sub"),nD=a("String.contains_from / Bytes.contains_from"),nG=a("Array.blit"),nF=a("Array.sub"),nL=a("Map.remove_min_elt"),nM=[0,0,0,0],nN=[0,a("map.ml"),gy,10],nO=[0,0,0],nH=a(ez),nI=a(ez),nJ=a(ez),nK=a(ez),nP=a("Stdlib.Queue.Empty"),nR=a("CamlinternalLazy.Undefined"),nY=a("Buffer.add_substring/add_subbytes"),nX=a("Buffer.add: cannot grow buffer"),nW=[0,a(lR),93,2],nV=[0,a(lR),94,2],n7=a("%c"),n8=a("%s"),n9=a(kR),n_=a(jd),n$=a(lx),oa=a(k1),ob=a("%f"),oc=a("%B"),od=a("%{"),oe=a("%}"),of=a("%("),og=a("%)"),oh=a("%a"),oi=a("%t"),oj=a("%?"),ok=a("%r"),ol=a("%_r"),om=[0,a(ar),850,23],ox=[0,a(ar),814,21],op=[0,a(ar),815,21],oy=[0,a(ar),818,21],oq=[0,a(ar),819,21],oz=[0,a(ar),822,19],or=[0,a(ar),823,19],oA=[0,a(ar),826,22],os=[0,a(ar),827,22],oB=[0,a(ar),831,30],ot=[0,a(ar),832,30],ov=[0,a(ar),836,26],on=[0,a(ar),837,26],ow=[0,a(ar),846,28],oo=[0,a(ar),847,28],ou=[0,a(ar),851,23],pE=a(jx),pC=[0,a(ar),1558,4],pD=a("Printf: bad conversion %["),pF=[0,a(ar),1626,39],pG=[0,a(ar),1649,31],pH=[0,a(ar),1650,31],pI=a("Printf: bad conversion %_"),pJ=a(jt),pK=a(jF),pL=a(jt),pM=a(jF),pA=a(gE),py=a("neg_infinity"),pz=a(mb),px=a(bl),ps=[0,cm],pg=a("%+nd"),ph=a("% nd"),pj=a("%+ni"),pk=a("% ni"),pl=a("%nx"),pm=a("%#nx"),pn=a("%nX"),po=a("%#nX"),pp=a("%no"),pq=a("%#no"),pf=a("%nd"),pi=a(lx),pr=a("%nu"),o5=a("%+ld"),o6=a("% ld"),o8=a("%+li"),o9=a("% li"),o_=a("%lx"),o$=a("%#lx"),pa=a("%lX"),pb=a("%#lX"),pc=a("%lo"),pd=a("%#lo"),o4=a("%ld"),o7=a(jd),pe=a("%lu"),oS=a("%+Ld"),oT=a("% Ld"),oV=a("%+Li"),oW=a("% Li"),oX=a("%Lx"),oY=a("%#Lx"),oZ=a("%LX"),o0=a("%#LX"),o1=a("%Lo"),o2=a("%#Lo"),oR=a("%Ld"),oU=a(k1),o3=a("%Lu"),oF=a("%+d"),oG=a("% d"),oI=a("%+i"),oJ=a("% i"),oK=a("%x"),oL=a("%#x"),oM=a("%X"),oN=a("%#X"),oO=a("%o"),oP=a("%#o"),oE=a(gM),oH=a(kR),oQ=a(jx),nZ=a("@]"),n0=a("@}"),n1=a("@?"),n2=a("@\n"),n3=a("@."),n4=a("@@"),n5=a("@%"),n6=a("@"),oC=a("CamlinternalFormat.Type_mismatch"),pQ=a(k),pR=[0,[11,a(eQ),[2,0,[2,0,0]]],a(", %s%s")],qe=[0,[11,a(gJ),[2,0,[12,10,0]]],a(l1)],qf=[0,[11,a("Fatal error in uncaught exception handler: exception "),[2,0,[12,10,0]]],a("Fatal error in uncaught exception handler: exception %s\n")],qd=a("Fatal error: out of memory in uncaught exception handler"),qb=[0,[11,a(gJ),[2,0,[12,10,0]]],a(l1)],p9=[0,[2,0,[12,10,0]],a("%s\n")],p1=a("Raised at"),p2=a("Re-raised at"),p3=a("Raised by primitive operation at"),p4=a("Called from"),p5=a(" (inlined)"),p7=a(k),p6=[0,[2,0,[12,32,[2,0,[11,a(' in file "'),[2,0,[12,34,[2,0,[11,a(", line "),[4,0,0,0,[11,a(lj),HF]]]]]]]]]],a('%s %s in file "%s"%s, line %d, characters %d-%d')],p8=[0,[2,0,[11,a(" unknown location"),0]],a("%s unknown location")],pW=a("Out of memory"),pX=a("Stack overflow"),pY=a("Pattern matching failed"),pZ=a("Assertion failed"),p0=a("Undefined recursive module"),pS=[0,[12,40,[2,0,[2,0,[12,41,0]]]],a("(%s%s)")],pT=a(k),pU=a(k),pV=[0,[12,40,[2,0,[12,41,0]]],a("(%s)")],pP=[0,[4,0,0,0,0],a(gM)],pN=[0,[3,0,0],a("%S")],pO=a(lA),p_=[0,a(k),a("(Cannot print locations:\n bytecode executable program file not found)"),a("(Cannot print locations:\n bytecode executable program file appears to be corrupt)"),a("(Cannot print locations:\n bytecode executable program file has wrong magic number)"),a("(Cannot print locations:\n bytecode executable program file cannot be opened;\n -- too many open files. Try running with OCAMLRUNPARAM=b=2)")],qi=a("Fun.Finally_raised: "),qg=a("Stdlib.Fun.Finally_raised"),qj=a(lU),HD=a("OCAMLRUNPARAM"),HB=a("CAMLRUNPARAM"),qk=a(k),qH=[3,0,3],qI=a(bl),qC=a(e6),qD=a("<\/"),qE=a(k),qy=a(e6),qz=a(gv),qA=a(k),qw=a("\n"),qv=[0,a(k)],qr=a(k),qs=a(k),qt=a(k),qu=a(k),qp=[0,a(k),0,a(k)],qo=a(k),qn=a("Stdlib.Format.String_tag"),qV=a(k),q0=a(jN),q2=a(mr),q3=a(kG),q4=a(i4),q5=a(kB),q6=a(ld),q7=a(j3),q8=a(lr),q9=a(gm),q_=a(j6),q$=a(lq),ra=a(kv),rb=a(ls),rc=a(j2),rd=a(iO),re=a(mu),rf=a(i3),rg=a(ja),rh=a(km),ri=a(k2),rj=a(e2),rk=a(jo),rl=a(me),rm=a(lw),rn=a(lZ),ro=a(kV),rp=a(eT),rq=a(gO),rr=a(jk),rs=a(jj),rt=a(kg),ru=a(mh),rv=a(mc),rw=a(ml),rx=a(jO),ry=a(je),rz=a(jA),rA=a(k_),rB=a(mp),rC=a(ks),rD=a(jT),rE=a(kE),rF=a(i$),rG=a(kw),rH=a(iR),rI=a(lu),rJ=a(l_),rK=a(jR),rL=a(jm),rM=a(kp),rN=a(kW),rO=a(j9),rP=a(k6),rQ=a(kA),rR=a(lt),rS=a(j5),rT=a(jP),rU=a(lQ),rV=a(ll),rW=a(l3),rX=a(li),rY=a(lc),rZ=a(lb),r0=a(i_),r1=a(jW),r2=a(jv),r3=a(lD),r4=a(lV),r5=[0,[11,a("EUNKNOWNERR "),[4,0,0,0,0]],a("EUNKNOWNERR %d")],q1=[0,[11,a("Unix.Unix_error(Unix."),[2,0,[11,a(eQ),[3,0,[11,a(eQ),[3,0,[12,41,0]]]]]]],a("Unix.Unix_error(Unix.%s, %S, %S)")],qW=a(dG),qX=a(k),qY=a(k),qZ=a(dG),r6=a("0.0.0.0"),r7=a("127.0.0.1"),HA=a("::"),Hz=a("::1"),sl=a(k),sm=a(k),ss=[0,92],su=a("\\( group not closed by \\)"),st=[0,a(iV),gs,10],sv=a("[ class not closed by ]"),sw=a("spurious \\) in regular expression"),so=a("too many r* or r+ where r is nullable"),sp=a(k),sq=a(k),sn=[0,a(iV),213,11],sC=[0,a(k$),52,4],sB=[0,a(k$),58,34],sA=a("Not a valid time zone"),uO=a("Not a month"),uM=a("Not a day"),uJ=a("from_business: bad week"),uK=a("from_business: bad date"),tW=[0,a(kX),j8,4],tV=[0,a(kX),gT,4],tO=[0,-4713,12,31],tP=[0,lm,1,23],tQ=[0,dB,10,14],tR=[0,dB,10,5],tM=a("Date.Out_of_bounds"),tN=a("Date.Undefined"),ua=a("Date.Period.Not_computable"),uj=[0,31,59,90,bZ,gi,181,212,gL,273,304,334,eF],uS=[0,a(eX),429,6],uR=[0,a(eX),lO,4],uQ=[0,a(eX),167,6],uP=[0,a(eX),67,4],uW=a("[a-zA-Z]+"),u1=cb(1,0,0),uX=a("Z.Overflow"),uY=a(gr),u5=a(k),u6=a("+inf"),u7=a("-inf"),u8=a(mi),u9=a("undef"),u$=[0,a("q.ml"),486,25],u_=a("Q.of_string: invalid digit"),u3=a("impossible case"),va=a("Runtime.EmptyError"),vb=a("Runtime.AssertionFailed"),vd=a("Runtime.ConflictError"),vf=a("Runtime.ImpossibleDate"),vh=a("Runtime.NoValueProvided"),GM=[0,a(Z),88,14,88,27,[0,a(aA),[0,a(Y),[0,a(p),0]]]],GI=[0,a(Z),96,20,96,64,[0,a(aA),[0,a(Y),[0,a(p),0]]]],GH=[0,a(aC),[0,a("allocations_familiales.avait_enfant_\xc3\xa0_charge_avant_1er_janvier_2012"),0]],GF=[0,a(Z),85,14,85,53,[0,a(aA),[0,a(Y),[0,a(p),0]]]],GG=[0,a(aC),[0,a("allocations_familiales.enfants_\xc3\xa0_charge"),0]],GD=[0,a(Z),84,14,84,50,[0,a(aA),[0,a(Y),[0,a(p),0]]]],GE=[0,a(aC),[0,a("allocations_familiales.date_courante"),0]],GB=[0,a(Z),87,14,87,46,[0,a(aA),[0,a(Y),[0,a(p),0]]]],GC=[0,a(aC),[0,a("allocations_familiales.r\xc3\xa9sidence"),0]],Gz=[0,a(Z),86,14,86,54,[0,a(aA),[0,a(Y),[0,a(p),0]]]],GA=[0,a(aC),[0,a("allocations_familiales.ressources_m\xc3\xa9nage"),0]],Gy=[0,a(Z),93,20,93,72,[0,a(aA),[0,a(Y),[0,a(p),0]]]],Gx=[0,a(aC),[0,a("allocations_familiales.personne_charge_effective_permanente_remplit_titre_I"),0]],Gw=[0,a(Z),90,20,90,67,[0,a(aA),[0,a(Y),[0,a(p),0]]]],Gv=[0,a(aC),[0,a("allocations_familiales.personne_charge_effective_permanente_est_parent"),0]],Gt=[0,a(Z),dK,14,dK,30,[0,a("Article L131-1"),[0,a(aA),[0,a(Y),[0,a(p),0]]]]],Gq=[0,0],Gr=[1,0],Gs=[2,0],Gn=[0,a(k),0,1,0,1,0],Gk=[0,a(k),0,1,0,1,0],Gh=[0,a(k),0,1,0,1,0],Ge=[0,a(k),0,1,0,1,0],Gb=[0,a(k),0,1,0,1,0],F_=[0,a(k),0,1,0,1,0],F7=[0,a(k),0,1,0,1,0],F6=[0,a(Z),72,12,72,25,[0,a(aA),[0,a(Y),[0,a(p),0]]]],F8=[0,a(aC),[0,a(eW),0]],F9=[0,a(Z),73,12,73,19,[0,a(aA),[0,a(Y),[0,a(p),0]]]],F$=[0,a(aC),[0,a(ma),0]],Ga=[0,a(Z),76,12,76,29,[0,a(aA),[0,a(Y),[0,a(p),0]]]],Gc=[0,a(aC),[0,a(kH),0]],Gd=[0,a(Z),77,12,77,21,[0,a(aA),[0,a(Y),[0,a(p),0]]]],Gf=[0,a(aC),[0,a(e4),0]],Gg=[0,a(Z),79,12,79,59,[0,a(aA),[0,a(Y),[0,a(p),0]]]],Gi=[0,a(aC),[0,a(l$),0]],Gj=[0,a(Z),80,12,80,64,[0,a(aA),[0,a(Y),[0,a(p),0]]]],Gl=[0,a(aC),[0,a(iU),0]],Gm=[0,a(Z),81,12,81,56,[0,a(aA),[0,a(Y),[0,a(p),0]]]],Go=[0,a(aC),[0,a(kq),0]],Gp=[0,a(Z),74,12,74,28,[0,a(aA),[0,a(Y),[0,a(p),0]]]],Gu=[0,a(aC),[0,a(kK),0]],GJ=[0,a(aC),[0,a(i8),[0,a(g),0]]],GK=[0,a(aC),[0,a(i8),[0,a(g),0]]],GL=[0,a(Z),78,12,78,25,[0,a(aA),[0,a(Y),[0,a(p),0]]]],GN=[0,a(aC),[0,a(jz),0]],FR=[0,a(Z),44,14,44,27,[0,a(cl),[0,a(Y),[0,a(p),0]]]],FQ=a(m),FN=[0,a(S),jc,14,jc,62,[0,a(aJ),[0,a(B),[0,a(C),[0,a(x),[0,a(R),[0,a(v),0]]]]]]],FI=[0,a(g),[0,a(dJ),[0,a(ay),0]]],FJ=[0,a(g),[0,a(dJ),0]],FK=[0,a(g),[0,a(dJ),[0,a(aB),0]]],FL=[0,a(g),[0,a(dJ),0]],FM=a(m),FF=[0,a(S),eU,14,eU,61,[0,a(aJ),[0,a(B),[0,a(C),[0,a(x),[0,a(R),[0,a(v),0]]]]]]],FC=[0,a(Z),38,14,38,38,[0,a(cl),[0,a(Y),[0,a(p),0]]]],Fx=[0,a(g),[0,a(dy),[0,a(ay),0]]],Fy=[0,a(g),[0,a(dy),0]],Fz=[0,a(g),[0,a(dy),[0,a(aB),0]]],FA=[0,a(g),[0,a(dy),0]],Fw=a(m),FB=a(m),Ft=[0,a(Z),36,14,36,32,[0,a(cl),[0,a(Y),[0,a(p),0]]]],Fs=a(m),Fp=[0,a(bk),lf,5,lf,43,[0,a("Article R521-4"),[0,a(B),[0,a(C),[0,a(x),[0,a(bp),[0,a(v),0]]]]]]],Fe=[0,a(g),[0,a(bK),[0,a(ay),0]]],Ff=[0,a(g),[0,a(bK),0]],Fg=[0,a(g),[0,a(bK),[0,a(aB),0]]],Fh=[0,a(g),[0,a(bK),0]],Fi=a(cK),Fn=a(kM),Fo=a(dF),Fj=[0,a(g),[0,a(du),[0,a(ay),0]]],Fk=[0,a(g),[0,a(du),0]],Fl=[0,a(g),[0,a(du),[0,a(aB),0]]],Fm=[0,a(g),[0,a(du),0]],Fd=[0,a(s),eH,12,eH,50,[0,a(r),0]],Fa=[0,a(bk),gt,14,gt,46,[0,a(e3),[0,a(B),[0,a(C),[0,a(x),[0,a(bp),[0,a(v),0]]]]]]],E8=a(a7),E9=[0,a(S),272,5,274,41,[0,a(b2),[0,a(B),[0,a(C),[0,a(x),[0,a(R),[0,a(v),0]]]]]]],E5=a(a7),E6=a(cK),E7=a(a7),E3=a(a7),E4=[0,a(S),262,5,ky,42,[0,a(b2),[0,a(B),[0,a(C),[0,a(x),[0,a(R),[0,a(v),0]]]]]]],E0=a(a7),E1=a(cK),E2=a(a7),EZ=[0,a(S),lC,14,lC,55,[0,a(b2),[0,a(B),[0,a(C),[0,a(x),[0,a(R),[0,a(v),0]]]]]]],EY=a(m),EP=[0,a(g),[0,a($),[0,a(ay),0]]],EQ=[0,a(g),[0,a($),0]],ER=[0,a(g),[0,a($),[0,a(aB),0]]],ES=[0,a(g),[0,a($),0]],ET=a(_),EU=a(gl),EV=[0,a(S),382,5,gR,23,[0,a(e0),[0,a(b6),[0,a(dr),[0,a(bM),[0,a(R),[0,a(v),0]]]]]]],EO=a("0.0567"),EG=[0,a(g),[0,a($),[0,a(ay),0]]],EH=[0,a(g),[0,a($),0]],EI=[0,a(g),[0,a($),[0,a(aB),0]]],EJ=[0,a(g),[0,a($),0]],EK=a(_),EL=a("11"),EM=a(gl),EN=[0,a(S),373,5,gh,42,[0,a(e0),[0,a(b6),[0,a(dr),[0,a(bM),[0,a(R),[0,a(v),0]]]]]]],EF=a("0.0369"),EE=[0,a(S),22,14,22,40,[0,a(aJ),[0,a(B),[0,a(C),[0,a(x),[0,a(R),[0,a(v),0]]]]]]],EA=[0,a(g),[0,a(dz),[0,a(ay),0]]],EB=[0,a(g),[0,a(dz),0]],EC=[0,a(g),[0,a(dz),[0,a(aB),0]]],ED=[0,a(g),[0,a(dz),0]],Ez=[0,a(s),es,12,es,38,[0,a(r),0]],Ev=[8,0],Ew=[0,a(w),lS,5,lS,24,[0,a(cP),[0,a(J),[0,a(K),[0,a(p),0]]]]],Et=a(_),Eu=[0,a(S),350,5,351,69,[0,a(e0),[0,a(b6),[0,a(dr),[0,a(bM),[0,a(R),[0,a(v),0]]]]]]],Es=[0,a(S),18,14,18,34,[0,a(aJ),[0,a(B),[0,a(C),[0,a(x),[0,a(R),[0,a(v),0]]]]]]],Ep=[0,a(S),i5,14,i5,39,[0,a(b2),[0,a(B),[0,a(C),[0,a(x),[0,a(R),[0,a(v),0]]]]]]],Ek=[0,a(g),[0,a(dD),[0,a(ay),0]]],El=[0,a(g),[0,a(dD),0]],Em=[0,a(g),[0,a(dD),[0,a(aB),0]]],En=[0,a(g),[0,a(dD),0]],Eo=a(_),Ej=a(m),Ec=[0,a(g),[0,a($),[0,a(ay),0]]],Ed=[0,a(g),[0,a($),0]],Ee=[0,a(g),[0,a($),[0,a(aB),0]]],Ef=[0,a(g),[0,a($),0]],Eg=[0,a(Z),27,5,27,44,[0,a(cl),[0,a(Y),[0,a(p),0]]]],Eb=a(m),D8=[0,a(g),[0,a($),[0,a(ay),0]]],D9=[0,a(g),[0,a($),0]],D_=[0,a(g),[0,a($),[0,a(aB),0]]],D$=[0,a(g),[0,a($),0]],Ea=[0,a(S),cQ,3,cQ,41,[0,a(aJ),[0,a(B),[0,a(C),[0,a(x),[0,a(R),[0,a(v),0]]]]]]],D7=a("0.04"),D2=[0,a(g),[0,a($),[0,a(ay),0]]],D3=[0,a(g),[0,a($),0]],D4=[0,a(g),[0,a($),[0,a(aB),0]]],D5=[0,a(g),[0,a($),0]],D6=[0,a(S),95,3,96,44,[0,a(aJ),[0,a(B),[0,a(C),[0,a(x),[0,a(R),[0,a(v),0]]]]]]],D1=a(jG),DW=[0,a(g),[0,a($),[0,a(ay),0]]],DX=[0,a(g),[0,a($),0]],DY=[0,a(g),[0,a($),[0,a(aB),0]]],DZ=[0,a(g),[0,a($),0]],D0=[0,a(S),55,3,55,41,[0,a(aJ),[0,a(B),[0,a(C),[0,a(x),[0,a(R),[0,a(v),0]]]]]]],DV=a(gg),DU=[0,a(k),0,1,0,1,0],DT=[0,a(s),eV,12,eV,48,[0,a(r),0]],DQ=[0,a(bk),bN,14,bN,41,[0,a(e3),[0,a(B),[0,a(C),[0,a(x),[0,a(bp),[0,a(v),0]]]]]]],DO=a(dF),DP=a(dF),DL=[0,a(S),cU,3,cU,41,[0,a(aJ),[0,a(B),[0,a(C),[0,a(x),[0,a(R),[0,a(v),0]]]]]]],DI=a(_),DJ=a(jG),DK=a(m),DH=[0,a(S),74,3,75,44,[0,a(aJ),[0,a(B),[0,a(C),[0,a(x),[0,a(R),[0,a(v),0]]]]]]],DE=a(_),DF=a(gg),DG=a(m),DD=[0,a(S),35,3,35,41,[0,a(aJ),[0,a(B),[0,a(C),[0,a(x),[0,a(R),[0,a(v),0]]]]]]],DA=a(_),DB=a(l5),DC=a(m),Dz=[0,a(k),0,1,0,1,0],Dw=[0,a(S),cU,3,cU,41,[0,a(aJ),[0,a(B),[0,a(C),[0,a(x),[0,a(R),[0,a(v),0]]]]]]],Ds=a(az),Dt=a(az),Du=a("0.1025"),Dv=a(m),Dr=[0,a(S),74,3,75,44,[0,a(aJ),[0,a(B),[0,a(C),[0,a(x),[0,a(R),[0,a(v),0]]]]]]],Dn=a(az),Do=a(az),Dp=a("0.205"),Dq=a(m),Dm=[0,a(S),35,3,35,41,[0,a(aJ),[0,a(B),[0,a(C),[0,a(x),[0,a(R),[0,a(v),0]]]]]]],Di=a(az),Dj=a(az),Dk=a("0.41"),Dl=a(m),Dh=[0,a(k),0,1,0,1,0],De=[0,a(S),gL,5,gL,43,[0,a(b2),[0,a(B),[0,a(C),[0,a(x),[0,a(R),[0,a(v),0]]]]]]],Dd=a("0.0559"),Dc=[0,a(S),229,5,lO,46,[0,a(b2),[0,a(B),[0,a(C),[0,a(x),[0,a(R),[0,a(v),0]]]]]]],Db=a("0.1117"),Da=[0,a(S),jK,5,jK,43,[0,a(b2),[0,a(B),[0,a(C),[0,a(x),[0,a(R),[0,a(v),0]]]]]]],C$=a("0.20234"),C_=[0,a(k),0,1,0,1,0],C6=a(a7),C7=[0,a(S),170,5,171,68,[0,a(aJ),[0,a(B),[0,a(C),[0,a(x),[0,a(R),[0,a(v),0]]]]]]],C3=a(a7),C4=a(cK),C5=a(a7),C1=a(a7),C2=[0,a(S),gN,5,gU,68,[0,a(aJ),[0,a(B),[0,a(C),[0,a(x),[0,a(R),[0,a(v),0]]]]]]],CY=a(a7),CZ=a(cK),C0=a(a7),CX=[0,a(S),iN,14,iN,34,[0,a(aJ),[0,a(B),[0,a(C),[0,a(x),[0,a(R),[0,a(v),0]]]]]]],CW=a(m),CV=[0,a(s),eB,12,eB,32,[0,a(r),0]],CO=[0,a(g),[0,a(bm),[0,a(ay),0]]],CP=[0,a(g),[0,a(bm),0]],CQ=[0,a(g),[0,a(bm),[0,a(aB),0]]],CR=[0,a(g),[0,a(bm),0]],CS=[0,a(am),313,5,lW,58,[0,a(l0),[0,a(B),[0,a(C),[0,a(x),[0,a(al),[0,a(v),0]]]]]]],CF=[0,a(g),[0,a(dH),[0,a(ay),0]]],CG=[0,a(g),[0,a(dH),0]],CH=[0,a(g),[0,a(dH),[0,a(aB),0]]],CI=[0,a(g),[0,a(dH),0]],CJ=[0,a(g),[0,a(bm),[0,a(ay),0]]],CK=[0,a(g),[0,a(bm),0]],CL=[0,a(g),[0,a(bm),[0,a(aB),0]]],CM=[0,a(g),[0,a(bm),0]],CN=[0,a(am),299,5,300,58,[0,a(l0),[0,a(B),[0,a(C),[0,a(x),[0,a(al),[0,a(v),0]]]]]]],CE=[0,a(s),cQ,12,cQ,35,[0,a(r),0]],FX=[8,0],FY=a(_),FZ=[0,a(w),344,5,345,72,[0,a(cP),[0,a(J),[0,a(K),[0,a(p),0]]]]],FV=a(_),FW=[0,a(am),406,5,407,72,[0,a(gw),[0,a(b6),[0,a(eO),[0,a(bM),[0,a(al),[0,a(v),0]]]]]]],FT=a(az),FU=[0,a(am),eC,5,eC,70,[0,a(mw),[0,a(B),[0,a(C),[0,a(x),[0,a(al),[0,a(v),0]]]]]]],F1=a(_),F2=[0,a(S),kU,5,360,71,[0,a(e0),[0,a(b6),[0,a(dr),[0,a(bM),[0,a(R),[0,a(v),0]]]]]]],F0=a(jB),Cw=[0,a(bk),eJ,14,eJ,34,[0,a(e3),[0,a(B),[0,a(C),[0,a(x),[0,a(bp),[0,a(v),0]]]]]]],Cp=[0,a(g),[0,a(bK),[0,a(ay),0]]],Cq=[0,a(g),[0,a(bK),0]],Cr=[0,a(g),[0,a(bK),[0,a(aB),0]]],Cs=[0,a(g),[0,a(bK),0]],Ct=a(cK),Cu=a(kM),Cv=a(dF),Co=a(dF),Cl=[0,a(bk),gN,14,gN,34,[0,a(e3),[0,a(B),[0,a(C),[0,a(x),[0,a(bp),[0,a(v),0]]]]]]],Ci=[0,a(w),mn,5,mn,49,[0,a(O),[0,a(J),[0,a(K),[0,a(p),0]]]]],Cf=a(m),Cg=a("5728"),Ch=a(m),Ce=[0,a(w),497,5,498,53,[0,a(O),[0,a(J),[0,a(K),[0,a(p),0]]]]],Cb=a(m),Cc=a("0.0717"),Cd=a(m),Ca=[0,a(w),489,5,490,53,[0,a(O),[0,a(J),[0,a(K),[0,a(p),0]]]]],B9=a(m),B_=a("0.0847"),B$=a(m),B8=[0,a(w),481,5,482,53,[0,a(O),[0,a(J),[0,a(K),[0,a(p),0]]]]],B5=a(m),B6=a("0.0976"),B7=a(m),B4=[0,a(w),473,5,474,53,[0,a(O),[0,a(J),[0,a(K),[0,a(p),0]]]]],B1=a(m),B2=a("0.115"),B3=a(m),B0=[0,a(w),465,5,466,53,[0,a(O),[0,a(J),[0,a(K),[0,a(p),0]]]]],BX=a(m),BY=a("0.1163"),BZ=a(m),BW=[0,a(w),457,5,458,53,[0,a(O),[0,a(J),[0,a(K),[0,a(p),0]]]]],BT=a(m),BU=a("0.122"),BV=a(m),BS=[0,a(w),449,5,450,53,[0,a(O),[0,a(J),[0,a(K),[0,a(p),0]]]]],BP=a(m),BQ=a("0.1278"),BR=a(m),BO=[0,a(w),441,5,442,53,[0,a(O),[0,a(J),[0,a(K),[0,a(p),0]]]]],BL=a(m),BM=a("0.1335"),BN=a(m),BK=[0,a(w),433,5,434,53,[0,a(O),[0,a(J),[0,a(K),[0,a(p),0]]]]],BH=a(m),BI=a("0.1393"),BJ=a(m),BG=[0,a(w),425,5,jJ,53,[0,a(O),[0,a(J),[0,a(K),[0,a(p),0]]]]],BD=a(m),BE=a("0.145"),BF=a(m),BC=[0,a(w),mo,14,mo,57,[0,a(cP),[0,a(J),[0,a(K),[0,a(p),0]]]]],Bz=a(m),BA=a(jB),BB=a(m),Bw=[0,a(w),kr,5,kr,69,[0,a(O),[0,a(J),[0,a(K),[0,a(p),0]]]]],Bt=a(_),Bu=a("0.3068"),Bv=a(m),Bs=[0,a(w),jL,5,jL,69,[0,a(O),[0,a(J),[0,a(K),[0,a(p),0]]]]],Bp=a(_),Bq=a("0.2936"),Br=a(m),Bo=[0,a(w),ka,5,ka,69,[0,a(O),[0,a(J),[0,a(K),[0,a(p),0]]]]],Bl=a(_),Bm=a("0.284"),Bn=a(m),Bk=[0,a(w),lo,5,lo,69,[0,a(O),[0,a(J),[0,a(K),[0,a(p),0]]]]],Bh=a(_),Bi=a("0.2672"),Bj=a(m),Bg=[0,a(w),jC,5,jC,69,[0,a(O),[0,a(J),[0,a(K),[0,a(p),0]]]]],Bd=a(_),Be=a("0.273"),Bf=a(m),Bc=[0,a(w),kk,5,kk,69,[0,a(O),[0,a(J),[0,a(K),[0,a(p),0]]]]],A$=a(_),Ba=a("0.2555"),Bb=a(m),A_=[0,a(w),kb,5,kb,69,[0,a(O),[0,a(J),[0,a(K),[0,a(p),0]]]]],A7=a(_),A8=a("0.2496"),A9=a(m),A6=[0,a(w),lP,5,lP,69,[0,a(O),[0,a(J),[0,a(K),[0,a(p),0]]]]],A3=a(_),A4=a("0.2437"),A5=a(m),A2=[0,a(w),gs,5,gs,69,[0,a(O),[0,a(J),[0,a(K),[0,a(p),0]]]]],AZ=a(_),A0=a("0.2379"),A1=a(m),AY=[0,a(w),la,5,la,69,[0,a(O),[0,a(J),[0,a(K),[0,a(p),0]]]]],AV=a(_),AW=a("0.232"),AX=a(m),AU=[0,a(w),lY,14,lY,58,[0,a(cP),[0,a(J),[0,a(K),[0,a(p),0]]]]],AR=a(_),AS=a(l5),AT=a(m),AO=[0,a(w),lT,5,lT,69,[0,a(O),[0,a(J),[0,a(K),[0,a(p),0]]]]],AL=a(az),AM=a("0.143"),AN=a(m),AK=[0,a(w),kQ,5,kQ,69,[0,a(O),[0,a(J),[0,a(K),[0,a(p),0]]]]],AH=a(az),AI=a("0.1259"),AJ=a(m),AG=[0,a(w),kJ,5,kJ,69,[0,a(O),[0,a(J),[0,a(K),[0,a(p),0]]]]],AD=a(az),AE=a("0.1089"),AF=a(m),AC=[0,a(w),iS,5,iS,69,[0,a(O),[0,a(J),[0,a(K),[0,a(p),0]]]]],Az=a(az),AA=a("0.0918"),AB=a(m),Ay=[0,a(w),md,5,md,69,[0,a(O),[0,a(J),[0,a(K),[0,a(p),0]]]]],Av=a(az),Aw=a("0.0842"),Ax=a(m),Au=[0,a(w),mk,5,mk,69,[0,a(O),[0,a(J),[0,a(K),[0,a(p),0]]]]],Ar=a(az),As=a("0.0766"),At=a(m),Aq=[0,a(w),l9,5,l9,69,[0,a(O),[0,a(J),[0,a(K),[0,a(p),0]]]]],An=a(az),Ao=a("0.069"),Ap=a(m),Am=[0,a(w),jw,5,jw,69,[0,a(O),[0,a(J),[0,a(K),[0,a(p),0]]]]],Aj=a(az),Ak=a("0.075"),Al=a(m),Ai=[0,a(w),k0,5,k0,69,[0,a(O),[0,a(J),[0,a(K),[0,a(p),0]]]]],Af=a(az),Ag=a("0.0539"),Ah=a(m),Ae=[0,a(w),j1,5,j1,69,[0,a(O),[0,a(J),[0,a(K),[0,a(p),0]]]]],Ab=a(az),Ac=a(jX),Ad=a(m),Aa=[0,a(w),gh,14,gh,59,[0,a(cP),[0,a(J),[0,a(K),[0,a(p),0]]]]],z9=a(az),z_=a(gg),z$=a(m),z6=[0,a(w),gR,14,gR,67,[0,a(cP),[0,a(J),[0,a(K),[0,a(p),0]]]]],z2=a(eZ),z3=a(eZ),z4=a(jX),z5=a(m),zY=a(_),zZ=[0,a(am),420,6,421,72,[0,a(gw),[0,a(b6),[0,a(eO),[0,a(bM),[0,a(al),[0,a(v),0]]]]]]],zT=[0,a(af),[0,a(dA),[0,a(ay),0]]],zU=[0,a(af),[0,a(dA),0]],zV=[0,a(af),[0,a(dA),[0,a(aB),0]]],zW=[0,a(af),[0,a(dA),0]],zX=[0,a(am),j8,5,gt,59,[0,a(mw),[0,a(B),[0,a(C),[0,a(x),[0,a(al),[0,a(v),0]]]]]]],zS=[0,a(s),ba,12,ba,36,[0,a(r),0]],F3=a(_),F4=[0,a(am),jJ,5,427,71,[0,a(gw),[0,a(b6),[0,a(eO),[0,a(bM),[0,a(al),[0,a(v),0]]]]]]],zN=[0,a(w),mf,5,mf,69,[0,a(b7),[0,a(kj),[0,a(b3),[0,a(p),0]]]]],zL=a(jE),zM=a("5827900"),zK=[0,a(w),bt,5,bt,69,[0,a(j0),[0,a(b3),[0,a(p),0]]]],zI=a(ly),zJ=a("5775900"),zH=[0,a(w),bZ,5,bZ,69,[0,a(iW),[0,a(b3),[0,a(p),0]]]],zF=a(l6),zG=a("5684900"),zE=[0,a(w),87,5,87,69,[0,a(mg),[0,a(b3),[0,a(p),0]]]],zC=a(lp),zD=a("5628600"),zB=[0,a(S),ju,14,ju,30,[0,a(kF),[0,a(B),[0,a(C),[0,a(x),[0,a(R),[0,a(v),0]]]]]]],zz=a(mt),zA=a("5595000"),zw=[0,a(w),kh,5,kh,69,[0,a(b7),[0,a(kj),[0,a(b3),[0,a(p),0]]]]],zu=a(jE),zv=a("8155800"),zt=[0,a(w),jY,5,jY,69,[0,a(j0),[0,a(b3),[0,a(p),0]]]],zr=a(ly),zs=a("8083100"),zq=[0,a(w),ba,5,ba,69,[0,a(iW),[0,a(b3),[0,a(p),0]]]],zo=a(l6),zp=a("7955800"),zn=[0,a(w),94,5,94,69,[0,a(mg),[0,a(b3),[0,a(p),0]]]],zl=a(lp),zm=a("7877000"),zk=[0,a(S),l4,14,l4,31,[0,a(kF),[0,a(B),[0,a(C),[0,a(x),[0,a(R),[0,a(v),0]]]]]]],zi=a(mt),zj=a("7830000"),zf=[0,a(Z),33,14,33,36,[0,a(cl),[0,a(Y),[0,a(p),0]]]],ze=[0,a(s),eS,12,eS,34,[0,a(r),0]],zb=[0,a(am),75,14,75,64,[0,a(eI),[0,a(ey),[0,a(ds),[0,a(x),[0,a(al),[0,a(v),0]]]]]]],y9=[0,a(af),[0,a(dw),[0,a(ay),0]]],y_=[0,a(af),[0,a(dw),0]],y$=[0,a(af),[0,a(dw),[0,a(aB),0]]],za=[0,a(af),[0,a(dw),0]],y6=[0,a(bk),83,19,83,69,[0,a(gn),[0,a(B),[0,a(C),[0,a(x),[0,a(bp),[0,a(v),0]]]]]]],y5=a("14"),y4=[0,a(s),eP,12,eP,39,[0,a(r),0]],yZ=[0,a(Z),32,14,32,40,[0,a(cl),[0,a(Y),[0,a(p),0]]]],y0=[0,a(g),[0,a("enfant_le_plus_\xc3\xa2g\xc3\xa9.enfants"),0]],yV=[0,a(s),gU,14,gU,46,[0,a(r),0]],yW=[0,a(g),[0,a("prestations_familiales.r\xc3\xa9sidence"),0]],yT=[0,a(s),kO,14,kO,56,[0,a(r),0]],yS=[1,0],yU=[0,a(g),[0,a("prestations_familiales.prestation_courante"),0]],yQ=[0,a(s),lM,14,lM,50,[0,a(r),0]],yR=[0,a(g),[0,a("prestations_familiales.date_courante"),0]],yM=[0,a(bk),64,14,64,44,[0,a(gn),[0,a(B),[0,a(C),[0,a(x),[0,a(bp),[0,a(v),0]]]]]]],yL=a(eZ),yI=[0,a(S),lX,14,lX,35,[0,a(b2),[0,a(B),[0,a(C),[0,a(x),[0,a(R),[0,a(v),0]]]]]]],yH=a(eZ),yE=[0,a(k),0,1,0,1,0],yB=[0,a(am),269,5,270,48,[0,a(br),[0,a(B),[0,a(C),[0,a(x),[0,a(al),[0,a(v),0]]]]]]],yA=[0,0],yz=[0,a(am),kT,5,259,56,[0,a(br),[0,a(B),[0,a(C),[0,a(x),[0,a(al),[0,a(v),0]]]]]]],yy=[1,0],yx=[0,a(am),k7,5,k7,70,[0,a(br),[0,a(B),[0,a(C),[0,a(x),[0,a(al),[0,a(v),0]]]]]]],yw=[0,0],yv=[0,a(am),lk,5,lk,69,[0,a(br),[0,a(B),[0,a(C),[0,a(x),[0,a(al),[0,a(v),0]]]]]]],yu=[0,0],yt=[0,a(am),jZ,5,jZ,60,[0,a(br),[0,a(B),[0,a(C),[0,a(x),[0,a(al),[0,a(v),0]]]]]]],ys=[0,0],yr=[0,a(k),0,1,0,1,0],yq=[0,a(s),cm,12,cm,21,[0,a(r),0]],yn=[0,a(am),263,5,ky,48,[0,a(br),[0,a(B),[0,a(C),[0,a(x),[0,a(al),[0,a(v),0]]]]]]],ym=[0,0],yl=[0,a(am),lH,5,dx,56,[0,a(br),[0,a(B),[0,a(C),[0,a(x),[0,a(al),[0,a(v),0]]]]]]],yk=[2,0],yj=[0,a(am),jI,5,jI,70,[0,a(br),[0,a(B),[0,a(C),[0,a(x),[0,a(al),[0,a(v),0]]]]]]],yi=[1,0],yh=[0,a(am),kc,5,kc,69,[0,a(br),[0,a(B),[0,a(C),[0,a(x),[0,a(al),[0,a(v),0]]]]]]],yg=[0,0],yf=[0,a(am),eU,5,eU,60,[0,a(br),[0,a(B),[0,a(C),[0,a(x),[0,a(al),[0,a(v),0]]]]]]],ye=[0,0],yd=[0,a(k),0,1,0,1,0],yc=[0,a(s),cM,12,cM,27,[0,a(r),0]],x$=[0,a(k),0,1,0,1,0],x8=[0,a(k),0,1,0,1,0],x5=[0,a(k),0,1,0,1,0],x2=[0,a(k),0,1,0,1,0],xZ=[0,a(k),0,1,0,1,0],xW=[0,a(k),0,1,0,1,0],xV=[0,a(s),90,12,90,59,[0,a(r),0]],xX=[0,a(g),[0,a(l$),0]],xY=[0,a(s),91,12,91,64,[0,a(r),0]],x0=[0,a(g),[0,a(iU),0]],x1=[0,a(s),92,12,92,29,[0,a(r),0]],x3=[0,a(g),[0,a(kH),0]],x4=[0,a(s),93,12,93,21,[0,a(r),0]],x6=[0,a(g),[0,a(e4),0]],x7=[0,a(s),96,12,96,25,[0,a(r),0]],x9=[0,a(g),[0,a(eW),0]],x_=[0,a(s),99,12,99,28,[0,a(r),0]],ya=[0,a(g),[0,a(kK),0]],yb=[0,a(s),cM,12,cM,27,[0,a(r),0]],yo=[0,a(g),[0,a(bK),0]],yp=[0,a(s),cm,12,cm,21,[0,a(r),0]],yC=[0,a(g),[0,a("versement"),0]],yD=[0,a(s),bZ,12,bZ,56,[0,a(r),0]],yF=[0,a(g),[0,a(kq),0]],yG=[0,a(s),gi,12,gi,33,[0,a(r),0]],yJ=[0,a(g),[0,a("nombre_enfants_l521_1"),0]],yK=[0,a(s),bt,12,bt,42,[0,a(r),0]],yN=[0,a(g),[0,a("nombre_enfants_alin\xc3\xa9a_2_l521_3"),0]],yO=[0,a(g),[0,a(j7),[0,a(gF),0]]],yP=[0,a(g),[0,a(j7),[0,a(gF),0]]],yX=[0,a(g),[0,a(lL),[0,a(af),0]]],yY=[0,a(g),[0,a(lL),[0,a(af),0]]],y1=[0,a(g),[0,a(kx),[0,a(e1),0]]],y2=[0,a(g),[0,a(kx),[0,a(e1),0]]],y3=[0,a(s),eP,12,eP,39,[0,a(r),0]],y7=[0,a(g),[0,a(bm),0]],y8=[0,a(s),aW,12,aW,62,[0,a(r),0]],zc=[0,a(g),[0,a("enfants_\xc3\xa0_charge_droit_ouvert_prestation_familiale"),0]],zd=[0,a(s),eS,12,eS,34,[0,a(r),0]],zg=[0,a(g),[0,a(dH),0]],zh=[0,a(s),ke,12,ke,29,[0,a(r),0]],zx=[0,a(g),[0,a("plafond_II_d521_3"),0]],zy=[0,a(s),jM,12,jM,28,[0,a(r),0]],zO=[0,a(g),[0,a("plafond_I_d521_3"),0]],zP=[0,a(s),kN,12,kN,35,[0,a(r),0]],zQ=[0,a(g),[0,a("droit_ouvert_compl\xc3\xa9ment"),0]],zR=[0,a(s),ba,12,ba,36,[0,a(r),0]],z0=[0,a(g),[0,a(dD),0]],z1=[0,a(s),dC,12,dC,65,[0,a(r),0]],z7=[0,a(g),[0,a("montant_initial_base_quatri\xc3\xa8me_enfant_et_plus_mayotte"),0]],z8=[0,a(s),kP,12,kP,57,[0,a(r),0]],AP=[0,a(g),[0,a("montant_initial_base_troisi\xc3\xa8me_enfant_mayotte"),0]],AQ=[0,a(s),gT,12,gT,56,[0,a(r),0]],Bx=[0,a(g),[0,a("montant_initial_base_deuxi\xc3\xa8me_enfant_mayotte"),0]],By=[0,a(s),i1,12,i1,55,[0,a(r),0]],Cj=[0,a(g),[0,a("montant_initial_base_premier_enfant_mayotte"),0]],Ck=[0,a(s),i9,12,i9,32,[0,a(r),0]],Cm=[0,a(g),[0,a("nombre_total_enfants"),0]],Cn=[0,a(s),gH,12,gH,32,[0,a(r),0]],Cx=[0,a(g),[0,a("nombre_moyen_enfants"),0]],Cz=a(m),Cy=[0,a(s),gQ,12,gQ,47,[0,a(r),0]],CA=[0,a(g),[0,a("montant_initial_base_premier_enfant"),0]],CB=[0,a(s),kI,12,kI,29,[0,a(r),0]],CC=[0,a(g),[0,a("droit_ouvert_base"),0]],CD=[0,a(s),cQ,12,cQ,35,[0,a(r),0]],CT=[0,a(g),[0,a($),0]],CU=[0,a(s),eB,12,eB,32,[0,a(r),0]],C8=[0,a(g),[0,a(dJ),0]],C9=[0,a(s),bN,12,bN,48,[0,a(r),0]],Df=[0,a(g),[0,a("montant_vers\xc3\xa9_forfaitaire_par_enfant"),0]],Dg=[0,a(s),dK,12,dK,57,[0,a(r),0]],Dx=[0,a(g),[0,a("montant_initial_base_troisi\xc3\xa8me_enfant_et_plus"),0]],Dy=[0,a(s),gS,12,gS,48,[0,a(r),0]],DM=[0,a(g),[0,a("montant_initial_base_deuxi\xc3\xa8me_enfant"),0]],DN=[0,a(s),cU,12,cU,39,[0,a(r),0]],DR=[0,a(g),[0,a("rapport_enfants_total_moyen"),0]],DS=[0,a(s),eV,12,eV,48,[0,a(r),0]],Eh=[0,a(g),[0,a(dz),0]],Ei=[0,a(s),i7,12,i7,37,[0,a(r),0]],Eq=[0,a(g),[0,a("montant_vers\xc3\xa9_forfaitaire"),0]],Er=[0,a(s),jU,12,jU,32,[0,a(r),0]],Ex=[0,a(g),[0,a("montant_initial_base"),0]],Ey=[0,a(s),es,12,es,38,[0,a(r),0]],EW=[0,a(g),[0,a(du),0]],EX=[0,a(s),kz,12,kz,53,[0,a(r),0]],E_=[0,a(g),[0,a("montant_vers\xc3\xa9_compl\xc3\xa9ment_pour_forfaitaire"),0]],E$=[0,a(s),gx,12,gx,44,[0,a(r),0]],Fb=[0,a(g),[0,a("montant_avec_garde_altern\xc3\xa9e_base"),0]],Fc=[0,a(s),eH,12,eH,50,[0,a(r),0]],Fq=[0,a(g),[0,a(dy),0]],Fr=[0,a(s),l8,12,l8,30,[0,a(r),0]],Fu=[0,a(g),[0,a("montant_vers\xc3\xa9_base"),0]],Fv=[0,a(s),kZ,12,kZ,36,[0,a(r),0]],FD=[0,a(g),[0,a("montant_vers\xc3\xa9_majoration"),0]],FE=[0,a(s),lg,12,lg,59,[0,a(r),0]],FG=[0,a(g),[0,a("montant_base_compl\xc3\xa9ment_pour_base_et_majoration"),0]],FH=[0,a(s),eJ,12,eJ,60,[0,a(r),0]],FO=[0,a(g),[0,a("montant_vers\xc3\xa9_compl\xc3\xa9ment_pour_base_et_majoration"),0]],FP=[0,a(s),iX,12,iX,25,[0,a(r),0]],FS=[0,a(g),[0,a(jz),0]],xI=[0,a(am),60,5,62,32,[0,a(eI),[0,a(ey),[0,a(ds),[0,a(x),[0,a(al),[0,a(v),0]]]]]]],xH=[0,a(am),49,5,50,50,[0,a(eI),[0,a(ey),[0,a(ds),[0,a(x),[0,a(al),[0,a(v),0]]]]]]],xG=[0,a(k),0,1,0,1,0],xF=[0,a(s),65,12,65,24,[0,a(r),0]],xC=[0,a(am),68,5,71,57,[0,a(eI),[0,a(ey),[0,a(ds),[0,a(x),[0,a(al),[0,a(v),0]]]]]]],xB=[0,a(s),66,12,66,31,[0,a(r),0]],xM=[0,a(bk),jp,18,jp,41,[0,a("Article R755-0-2"),[0,a(b6),[0,a(dr),[0,a(bM),[0,a(bp),[0,a(v),0]]]]]]],xK=a(lN),xL=a(jV),xN=[0,0],xP=[1,0],xQ=[2,0],xR=[3,0],xS=[4,0],xT=[5,0],xO=[0,a(am),354,5,kU,30,[0,a("Article L751-1"),[0,a("Chapitre 1er : G\xc3\xa9n\xc3\xa9ralit\xc3\xa9s"),[0,a(eO),[0,a(bM),[0,a(al),[0,a(v),0]]]]]]],xq=[0,a(s),77,14,77,28,[0,a(r),0]],xr=[0,a(af),[0,a("smic.r\xc3\xa9sidence"),0]],xo=[0,a(s),78,14,78,32,[0,a(r),0]],xp=[0,a(af),[0,a("smic.date_courante"),0]],xm=[0,a(w),60,5,61,34,[0,a("Instruction interminist\xc3\xa9rielle n\xc2\xb0DSS/2B/2021/65 du 19 mars 2021 relative \xc3\xa0 la revalorisation au 1er avril 2021 des prestations familiales servies en m\xc3\xa9tropole, en Guadeloupe, en Guyane, en Martinique, \xc3\xa0 la R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy, \xc3\xa0 Saint-Martin et dans le d\xc3\xa9partement de Mayotte"),[0,a(gq),[0,a(p),0]]]],xl=a("41481"),xk=[0,a(w),44,5,45,34,[0,a("Instruction interminist\xc3\xa9rielle no DSS/SD2B/2020/33 du 18 f\xc3\xa9vrier 2020 relative \xc3\xa0 la revalorisation au 1er avril 2020 des prestations familiales servies en m\xc3\xa9tropole, en Guadeloupe, en Guyane, en Martinique, \xc3\xa0 La R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy, \xc3\xa0 Saint-Martin et dans le d\xc3\xa9partement de Mayotte"),[0,a(gq),[0,a(p),0]]]],xj=a("41404"),xi=[0,a(w),24,5,25,34,[0,a("Instruction minist\xc3\xa9rielle N\xc2\xb0DSS/SD2B/2019/65 du 25 mars 2019 relative \xc3\xa0 la revalorisation au 1er avril 2019 des prestations familiales servies en m\xc3\xa9tropole"),[0,a(gq),[0,a(p),0]]]],xh=a("41316"),xg=[0,a(k),0,1,0,1,0],xd=[0,a(k),0,1,0,1,0],xa=[0,a(k),0,1,0,1,0],w9=[0,a(k),0,1,0,1,0],w6=[0,a(bk),21,14,21,26,[0,a("Article R512-2"),[0,a("Chapitre 2 : Champ d'application."),[0,a(ds),[0,a(x),[0,a(bp),[0,a(v),0]]]]]]],w5=a("20"),w4=[0,a(s),68,12,68,24,[0,a(r),0]],w7=[0,a(af),[0,a("\xc3\xa2ge_l512_3_2"),0]],w8=[0,a(s),70,12,70,25,[0,a(r),0]],w_=[0,a(af),[0,a(eW),0]],w$=[0,a(s),71,12,71,31,[0,a(r),0]],xb=[0,a(af),[0,a("prestation_courante"),0]],xc=[0,a(s),72,12,72,21,[0,a(r),0]],xe=[0,a(af),[0,a(e4),0]],xf=[0,a(s),74,12,74,26,[0,a(r),0]],xn=[0,a(af),[0,a("base_mensuelle"),0]],xs=[0,a(af),[0,a(mm),[0,a(dt),0]]],xt=[0,a(af),[0,a(mm),[0,a(dt),0]]],xu=[0,a(s),69,12,69,35,[0,a(r),0]],xv=[0,a(af),[0,a("r\xc3\xa9gime_outre_mer_l751_1"),0]],xx=a(lN),xy=a(jV),xw=[0,a(s),67,12,67,28,[0,a(r),0]],xz=[0,a(af),[0,a("plafond_l512_3_2"),0]],xA=[0,a(s),66,12,66,31,[0,a(r),0]],xD=[0,a(af),[0,a(dA),0]],xE=[0,a(s),65,12,65,24,[0,a(r),0]],xJ=[0,a(af),[0,a(dw),0]],w1=[0,a(Z),12,14,12,25,[0,a(cl),[0,a(Y),[0,a(p),0]]]],wW=[2,0],wX=a(m),wY=a(m),wZ=[1,0],w0=a(_),wT=[0,a(k),0,1,0,1,0],wS=[0,a(s),84,12,84,19,[0,a(r),0]],wU=[0,a(e1),[0,a(ma),0]],wV=[0,a(s),85,12,85,23,[0,a(r),0]],w2=[0,a(e1),[0,a("le_plus_\xc3\xa2g\xc3\xa9"),0]],wP=[0,a(bk),78,14,78,41,[0,a(gn),[0,a(B),[0,a(C),[0,a(x),[0,a(bp),[0,a(v),0]]]]]]],wO=a(gl),wN=[0,a(s),81,12,81,39,[0,a(r),0]],wQ=[0,a(gF),[0,a(bm),0]],wJ=[8,0],wK=[0,a(w),lW,5,317,6,[0,a(b7),[0,a(iY),[0,a(cJ),[0,a(p),0]]]]],wI=a("774"),wz=[6,0],wB=[0,0],wC=[1,0],wD=[2,0],wE=[3,0],wF=[4,0],wG=[5,0],wH=[7,0],wA=[0,a(w),297,5,306,6,[0,a(b7),[0,a(iY),[0,a(cJ),[0,a(p),0]]]]],wy=a("1025"),ww=[8,0],wx=[0,a(w),276,5,278,6,[0,a(b7),[0,a(jr),[0,a(cJ),[0,a(p),0]]]]],wv=a("766"),wm=[6,0],wo=[0,0],wp=[1,0],wq=[2,0],wr=[3,0],ws=[4,0],wt=[5,0],wu=[7,0],wn=[0,a(w),kT,5,267,6,[0,a(b7),[0,a(jr),[0,a(cJ),[0,a(p),0]]]]],wl=a("1015"),wj=[8,0],wk=[0,a(w),237,5,239,6,[0,a(b7),[0,a(iT),[0,a(cJ),[0,a(p),0]]]]],wi=a("757"),v$=[6,0],wb=[0,0],wc=[1,0],wd=[2,0],we=[3,0],wf=[4,0],wg=[5,0],wh=[7,0],wa=[0,a(w),219,5,228,6,[0,a(b7),[0,a(iT),[0,a(cJ),[0,a(p),0]]]]],v_=a("1003"),v9=[0,a(k),0,1,0,1,0],v6=[0,a(k),0,1,0,1,0],v3=[0,a(k),0,1,0,1,0],v2=[0,a(s),41,12,41,25,[0,a(r),0]],v4=[0,a(dt),[0,a(eW),0]],v5=[0,a(s),42,12,42,21,[0,a(r),0]],v7=[0,a(dt),[0,a(e4),0]],v8=[0,a(s),43,12,43,24,[0,a(r),0]],wL=[0,a(dt),[0,a("brut_horaire"),0]],vT=a("a_d\xc3\xa9j\xc3\xa0_ouvert_droit_aux_allocations_familiales"),vU=a("prise_en_charge"),vV=a("\xc3\xa2ge"),vW=a("date_de_naissance"),vX=a("r\xc3\xa9muneration_mensuelle"),vY=a("obligation_scolaire"),vZ=a("identifiant"),v0=[0,a("Enfant"),0],vN=a("d_a_d\xc3\xa9j\xc3\xa0_ouvert_droit_aux_allocations_familiales"),vO=a("d_prise_en_charge"),vP=a("d_date_de_naissance"),vQ=a("d_r\xc3\xa9muneration_mensuelle"),vR=a("d_identifiant"),vS=[0,a("EnfantEntr\xc3\xa9e"),0],vD=a("PrestationAccueilJeuneEnfant"),vF=a(g),vG=a("Compl\xc3\xa9mentFamilial"),vH=a("AllocationLogement"),vI=a("Allocation\xc3\x89ducationEnfantHandicap\xc3\xa9"),vJ=a("AllocationSoutienFamilial"),vK=a("AllocationRentr\xc3\xa9eScolaire"),vL=a("AllocationJournali\xc3\xa8rePresenceParentale"),vE=[0,a("\xc3\x89l\xc3\xa9mentPrestationsFamiliales"),0],vt=a(kt),vv=a(k9),vw=a(jn),vx=a("LaR\xc3\xa9union"),vy=a("SaintBarth\xc3\xa9lemy"),vz=a("SaintMartin"),vA=a(kd),vB=a("SaintPierreEtMiquelon"),vC=a(lF),vu=[0,a("Collectivit\xc3\xa9"),0],vp=a("Avant"),vr=a("Pendant"),vs=a("Apr\xc3\xa8s"),vq=[0,a("SituationObligationScolaire"),0],vj=a("GardeAltern\xc3\xa9ePartageAllocations"),vl=a("GardeAltern\xc3\xa9eAllocataireUnique"),vm=a("EffectiveEtPermanente"),vn=a("ServicesSociauxAllocationVers\xc3\xa9e\xc3\x80LaFamille"),vo=a("ServicesSociauxAllocationVers\xc3\xa9eAuxServicesSociaux"),vk=[0,a("PriseEnCharge"),0],GO=a("Jsoo_runtime.Error.Exn"),GP=a(go),Ht=a("Begin call"),Hu=a("End call"),Hv=a("Variable definition"),Hw=a("Decision taken"),Hh=a("Confi\xc3\xa9 aux service sociaux, allocation vers\xc3\xa9e aux services sociaux"),Hi=a("Confi\xc3\xa9 aux service sociaux, allocation vers\xc3\xa9e \xc3\xa0 la famille"),Hj=a("Effective et permanente"),Hk=a("Garde altern\xc3\xa9e, allocataire unique"),Hl=a("Garde altern\xc3\xa9e, partage des allocations"),Hn=[0,0],Ho=[1,0],Hp=[2,0],Hq=[3,0],Hr=[4,0],Hm=a("Unknown prise en charge"),G0=a(kt),G1=a(k9),G2=a("La R\xc3\xa9union"),G3=a(jn),G4=a(lF),G5=a(kd),G6=a("Saint Barth\xc3\xa9lemy"),G7=a("Saint Martin"),G8=a("Saint Pierre et Miquelon"),G_=[7,0],G$=[5,0],Ha=[4,0],Hb=[6,0],Hc=[8,0],Hd=[2,0],He=[3,0],Hf=[1,0],Hg=[0,0],G9=a("unknown collectivite!"),GY=a(k),GW=[0,[4,0,0,0,[12,68,[4,0,0,0,[12,77,[4,0,0,0,[12,89,0]]]]]],a("%dD%dM%dY")],GV=[0,a(lh),a(ln),a(lK)];function +ac(a){if(typeof a==="number")return 0;else switch(a[0]){case -0:return[0,$(a[1])];case -1:return[1,$(a[1])];case -2:return[2,$(a[1])];case -3:return[3,$(a[1])];case -4:return[4,$(a[1])];case -5:return[5,$(a[1])];case -6:return[6,$(a[1])];case -7:return[7,$(a[1])];case +0:return[0,ac(a[1])];case +1:return[1,ac(a[1])];case +2:return[2,ac(a[1])];case +3:return[3,ac(a[1])];case +4:return[4,ac(a[1])];case +5:return[5,ac(a[1])];case +6:return[6,ac(a[1])];case +7:return[7,ac(a[1])];case 8:var -c=a[1];return[8,c,$(a[2])];case +c=a[1];return[8,c,ac(a[2])];case 9:var -b=a[1];return[9,b,b,$(a[3])];case -10:return[10,$(a[1])];case -11:return[11,$(a[1])];case -12:return[12,$(a[1])];case -13:return[13,$(a[1])];default:return[14,$(a[1])]}}function -aF(a,b){if(typeof +b=a[1];return[9,b,b,ac(a[3])];case +10:return[10,ac(a[1])];case +11:return[11,ac(a[1])];case +12:return[12,ac(a[1])];case +13:return[13,ac(a[1])];default:return[14,ac(a[1])]}}function +aG(a,b){if(typeof a==="number")return b;else switch(a[0]){case -0:return[0,aF(a[1],b)];case -1:return[1,aF(a[1],b)];case -2:return[2,aF(a[1],b)];case -3:return[3,aF(a[1],b)];case -4:return[4,aF(a[1],b)];case -5:return[5,aF(a[1],b)];case -6:return[6,aF(a[1],b)];case -7:return[7,aF(a[1],b)];case +0:return[0,aG(a[1],b)];case +1:return[1,aG(a[1],b)];case +2:return[2,aG(a[1],b)];case +3:return[3,aG(a[1],b)];case +4:return[4,aG(a[1],b)];case +5:return[5,aG(a[1],b)];case +6:return[6,aG(a[1],b)];case +7:return[7,aG(a[1],b)];case 8:var -c=a[1];return[8,c,aF(a[2],b)];case +c=a[1];return[8,c,aG(a[2],b)];case 9:var -d=a[2],e=a[1];return[9,e,d,aF(a[3],b)];case -10:return[10,aF(a[1],b)];case -11:return[11,aF(a[1],b)];case -12:return[12,aF(a[1],b)];case -13:return[13,aF(a[1],b)];default:return[14,aF(a[1],b)]}}function -U(a,b){if(typeof +d=a[2],e=a[1];return[9,e,d,aG(a[3],b)];case +10:return[10,aG(a[1],b)];case +11:return[11,aG(a[1],b)];case +12:return[12,aG(a[1],b)];case +13:return[13,aG(a[1],b)];default:return[14,aG(a[1],b)]}}function +W(a,b){if(typeof a==="number")return b;else switch(a[0]){case -0:return[0,U(a[1],b)];case -1:return[1,U(a[1],b)];case +0:return[0,W(a[1],b)];case +1:return[1,W(a[1],b)];case 2:var -c=a[1];return[2,c,U(a[2],b)];case +c=a[1];return[2,c,W(a[2],b)];case 3:var -d=a[1];return[3,d,U(a[2],b)];case +d=a[1];return[3,d,W(a[2],b)];case 4:var -e=a[3],f=a[2],g=a[1];return[4,g,f,e,U(a[4],b)];case +e=a[3],f=a[2],g=a[1];return[4,g,f,e,W(a[4],b)];case 5:var -h=a[3],i=a[2],j=a[1];return[5,j,i,h,U(a[4],b)];case +h=a[3],i=a[2],j=a[1];return[5,j,i,h,W(a[4],b)];case 6:var -k=a[3],l=a[2],m=a[1];return[6,m,l,k,U(a[4],b)];case +k=a[3],l=a[2],m=a[1];return[6,m,l,k,W(a[4],b)];case 7:var -n=a[3],o=a[2],p=a[1];return[7,p,o,n,U(a[4],b)];case +n=a[3],o=a[2],p=a[1];return[7,p,o,n,W(a[4],b)];case 8:var -q=a[3],r=a[2],s=a[1];return[8,s,r,q,U(a[4],b)];case +q=a[3],r=a[2],s=a[1];return[8,s,r,q,W(a[4],b)];case 9:var -t=a[1];return[9,t,U(a[2],b)];case -10:return[10,U(a[1],b)];case +t=a[1];return[9,t,W(a[2],b)];case +10:return[10,W(a[1],b)];case 11:var -u=a[1];return[11,u,U(a[2],b)];case +u=a[1];return[11,u,W(a[2],b)];case 12:var -v=a[1];return[12,v,U(a[2],b)];case +v=a[1];return[12,v,W(a[2],b)];case 13:var -w=a[2],x=a[1];return[13,x,w,U(a[3],b)];case +w=a[2],x=a[1];return[13,x,w,W(a[3],b)];case 14:var -y=a[2],z=a[1];return[14,z,y,U(a[3],b)];case -15:return[15,U(a[1],b)];case -16:return[16,U(a[1],b)];case +y=a[2],z=a[1];return[14,z,y,W(a[3],b)];case +15:return[15,W(a[1],b)];case +16:return[16,W(a[1],b)];case 17:var -A=a[1];return[17,A,U(a[2],b)];case +A=a[1];return[17,A,W(a[2],b)];case 18:var -B=a[1];return[18,B,U(a[2],b)];case -19:return[19,U(a[1],b)];case +B=a[1];return[18,B,W(a[2],b)];case +19:return[19,W(a[1],b)];case 20:var -C=a[2],D=a[1];return[20,D,C,U(a[3],b)];case +C=a[2],D=a[1];return[20,D,C,W(a[3],b)];case 21:var -E=a[1];return[21,E,U(a[2],b)];case -22:return[22,U(a[1],b)];case +E=a[1];return[21,E,W(a[2],b)];case +22:return[22,W(a[1],b)];case 23:var -F=a[1];return[23,F,U(a[2],b)];default:var -G=a[2],H=a[1];return[24,H,G,U(a[3],b)]}}function -e_(a,c,b){return a[1]===c?(a[1]=b,1):0}function -bB(a){throw[0,dT,a]}function -ai(a){throw[0,g2,a]}var -g3=[O,mT,aj(0)];function -dU(b,a){return mA(b,a)?b:a}function -c3(a){return 0<=a?a:-a|0}var -mU=k6,mW=cW(mV),mY=cW(mX),m0=cW(mZ);function -bc(d,c){var -a=G(d),e=G(c),b=af(a+e|0);b8(d,0,b,0,a);b8(c,0,b,a,e);return aD(b)}function -m1(a){return a?m2:m3}Hf(0);var -m6=mD(1),bg=mD(2);function -m7(b){function +F=a[1];return[23,F,W(a[2],b)];default:var +G=a[2],H=a[1];return[24,H,G,W(a[3],b)]}}function +fl(a,c,b){return a[1]===c?(a[1]=b,1):0}function +bz(a){throw[0,dV,a]}function +ak(a){throw[0,hh,a]}var +hi=[N,na,aE(0)];function +dW(b,a){return mO(b,a)?b:a}function +c6(a){return 0<=a?a:-a|0}var +nb=gG,nd=c0(nc),nf=c0(ne),nh=c0(ng);function +a$(d,c){var +a=I(d),e=I(c),b=ai(a+e|0);b_(d,0,b,0,a);b_(c,0,b,a,e);return aF(b)}function +ni(a){return a?nj:nk}Ij(0);var +nn=mS(1),bd=mS(2);function +no(b){function a(b){var a=b;for(;;){if(a){var -c=a[2],e=a[1];try{cm(e)}catch(a){a=d(a);if(a[1]!==g6)throw a;var +c=a[2],e=a[1];try{cp(e)}catch(a){a=d(a);if(a[1]!==hl)throw a;var f=a}var -a=c;continue}return 0}}return a(Hg(0))}function -c4(b,a){return gS(b,a,0,G(a))}function -g9(a){c4(bg,a);mE(bg,10);return cm(bg)}var -fa=[0,m7];function -g_(d){for(;;){var -a=fa[1],e=[0,1],b=1-e_(fa,a,function(a,b){return function(e){if(e_(a,1,0))c(d,0);return c(b,0)}}(e,a));if(b)continue;return b}}function -fb(a){return c(fa[1],0)}gV(a(ix),fb);if(Hu(0))g_(function(a){return GP(a)});function -cs(a){if(0<=a&&!(cN>>0){if(!(25<(b+bd|0)>>>0))c=1}else +a=c;continue}return 0}}return a(Ik(0))}function +c7(b,a){return g9(b,a,0,I(a))}function +ho(a){c7(bd,a);mT(bd,10);return cp(bd)}var +fn=[0,no];function +nq(d){for(;;){var +a=fn[1],e=[0,1],b=1-fl(fn,a,function(a,b){return function(e){if(fl(a,1,0))c(d,0);return c(b,0)}}(e,a));if(b)continue;return b}}function +fo(a){return c(fn[1],0)}ha(a(iP),fo);function +cv(a){if(0<=a&&!(cR>>0){if(!(25>>0))c=1}else if(23!==b)c=1;return c?a+32|0:a}var -ha=Ht(0),c5=(4*ha|0)-1|0;aj(0);var -ne=Hs(0);function -hb(c){var +hq=Iw(0),c8=(4*hq|0)-1|0;function +hr(c){var b=0,a=c;for(;;){if(a){var b=b+1|0,a=a[2];continue}return b}}function -hc(a){return a?a[1]:bB(nf)}function -dV(d){var +hs(a){return a?a[1]:bz(ny)}function +dX(d){var a=d,b=0;for(;;){if(a){var -c=[0,a[1],b],a=a[2],b=c;continue}return b}}typeof -ne==="number";function +c=[0,a[1],b],a=a[2],b=c;continue}return b}}function cc(b,a){if(a){var d=a[2],e=c(b,a[1]);return[0,e,cc(b,d)]}return 0}function -bh(a,c){var -b=af(a);GM(b,0,a,c);return b}function -hd(a){var -b=a3(a),c=af(b);b7(a,0,c,0,b);return c}function -dW(a){return aD(hd(a))}function -he(c,b,a){if(0<=b&&0<=a&&!((a3(c)-a|0)>>0))e=1}else +f=0;if(1>>0))e=1}else if(65<=d)e=1}else{var -f=0;if(32!==d)if(43<=d)switch(d+l5|0){case +f=0;if(32!==d)if(43<=d)switch(d+mj|0){case 5:if(a<(c+2|0)&&1>>0){if(33<(n-61|0)>>>0)p=1}else +n=c3(k,j)+gP|0,p=0;if(59>>0){if(33>>0)p=1}else if(2===n)p=1;if(!p){var j=j+1|0;continue}var -e=bO(k),a=[0,0],r=a3(e)-1|0,w=0;if(!(r<0)){var +e=bO(k),a=[0,0],r=a1(e)-1|0,w=0;if(!(r<0)){var i=w;for(;;){var -f=dJ(e,i),g=0;if(32<=f){var +f=dM(e,i),g=0;if(32<=f){var l=f-34|0,q=0;if(58>>0){if(93<=l)q=1}else -if(56<(l-1|0)>>>0){g=1;q=1}if(!q){var +if(56>>0){g=1;q=1}if(!q){var m=1;g=2}}else if(11<=f){if(13===f)g=1}else if(8<=f)g=1;switch(g){case @@ -2077,40 +2081,40 @@ m=4;break;case 1:var m=2;break}a[1]=a[1]+m|0;var z=i+1|0;if(r!==i){var -i=z;continue}break}}if(a[1]===a3(e))var -t=hd(e);else{var -b=af(a[1]);a[1]=0;var -s=a3(e)-1|0,x=0;if(!(s<0)){var +i=z;continue}break}}if(a[1]===a1(e))var +t=ht(e);else{var +b=ai(a[1]);a[1]=0;var +s=a1(e)-1|0,x=0;if(!(s<0)){var h=x;for(;;){var -c=dJ(e,h),d=0;if(35<=c)if(92===c)d=2;else -if(bd<=c)d=1;else +c=dM(e,h),d=0;if(35<=c)if(92===c)d=2;else +if(ba<=c)d=1;else d=3;else if(32<=c)if(34<=c)d=2;else d=3;else if(14<=c)d=1;else switch(c){case -8:ad(b,a[1],92);a[1]++;ad(b,a[1],98);break;case -9:ad(b,a[1],92);a[1]++;ad(b,a[1],gk);break;case -10:ad(b,a[1],92);a[1]++;ad(b,a[1],gB);break;case -13:ad(b,a[1],92);a[1]++;ad(b,a[1],gt);break;default:d=1}switch(d){case -1:ad(b,a[1],92);a[1]++;ad(b,a[1],48+(c/aW|0)|0);a[1]++;ad(b,a[1],48+((c/10|0)%10|0)|0);a[1]++;ad(b,a[1],48+(c%10|0)|0);break;case -2:ad(b,a[1],92);a[1]++;ad(b,a[1],c);break;case -3:ad(b,a[1],c);break}a[1]++;var +8:ag(b,a[1],92);a[1]++;ag(b,a[1],98);break;case +9:ag(b,a[1],92);a[1]++;ag(b,a[1],gx);break;case +10:ag(b,a[1],92);a[1]++;ag(b,a[1],gQ);break;case +13:ag(b,a[1],92);a[1]++;ag(b,a[1],gH);break;default:d=1}switch(d){case +1:ag(b,a[1],92);a[1]++;ag(b,a[1],48+(c/aW|0)|0);a[1]++;ag(b,a[1],48+((c/10|0)%10|0)|0);a[1]++;ag(b,a[1],48+(c%10|0)|0);break;case +2:ag(b,a[1],92);a[1]++;ag(b,a[1],c);break;case +3:ag(b,a[1],c);break}a[1]++;var y=h+1|0;if(s!==h){var h=y;continue}break}}var t=b}var -o=aD(t)}var -u=G(o),v=bh(u+2|0,34);b8(o,0,v,1,u);return aD(v)}}function -hs(d,f){var -g=c3(f),e=ht?ht[1]:70;switch(d[2]){case +o=aF(t)}var +u=I(o),v=be(u+2|0,34);b_(o,0,v,1,u);return aF(v)}}function +hI(d,f){var +g=c6(f),e=ps[1];switch(d[2]){case 0:var -b=cI;break;case +b=cM;break;case 1:var -b=ev;break;case +b=eC;break;case 2:var b=69;break;case 3:var -b=cj;break;case +b=cm;break;case 4:var b=71;break;case 5:var @@ -2120,160 +2124,160 @@ b=104;break;case 7:var b=72;break;default:var b=70}var -c=ho(16);cx(c,37);switch(d[1]){case +c=hE(16);cA(c,37);switch(d[1]){case 0:break;case -1:cx(c,43);break;default:cx(c,32)}if(8<=d[2])cx(c,35);cx(c,46);aw(c,a(o+g));cx(c,b);return hq(c)}function -d0(m,a){if(13<=m){var -g=[0,0],h=G(a)-1|0,n=0;if(!(h<0)){var -c=n;for(;;){if(!(9<(cZ(a,c)+eo|0)>>>0))g[1]++;var +1:cA(c,43);break;default:cA(c,32)}if(8<=d[2])cA(c,35);cA(c,46);aw(c,a(k+g));cA(c,b);return hG(c)}function +d2(m,a){if(13<=m){var +g=[0,0],h=I(a)-1|0,n=0;if(!(h<0)){var +c=n;for(;;){if(!(9>>0))g[1]++;var q=c+1|0;if(h!==c){var c=q;continue}break}}var -i=g[1],j=af(G(a)+((i-1|0)/3|0)|0),k=[0,0],d=function(a){ba(j,k[1],a);k[1]++;return 0},e=[0,((i-1|0)%3|0)+1|0],l=G(a)-1|0,o=0;if(!(l<0)){var +i=g[1],j=ai(I(a)+((i-1|0)/3|0)|0),k=[0,0],d=function(a){a9(j,k[1],a);k[1]++;return 0},e=[0,((i-1|0)%3|0)+1|0],l=I(a)-1|0,o=0;if(!(l<0)){var b=o;for(;;){var -f=cZ(a,b);if(9<(f+eo|0)>>>0)d(f);else{if(0===e[1]){d(95);e[1]=3}e[1]+=-1;d(f)}var +f=c3(a,b);if(9>>0)d(f);else{if(0===e[1]){d(95);e[1]=3}e[1]+=-1;d(f)}var p=b+1|0;if(l!==b){var -b=p;continue}break}}return aD(j)}return a}function -o$(b,c){switch(b){case +b=p;continue}break}}return aF(j)}return a}function +pt(b,c){switch(b){case 1:var -a=om;break;case +a=oF;break;case 2:var -a=on;break;case +a=oG;break;case 4:var -a=op;break;case +a=oI;break;case 5:var -a=oq;break;case +a=oJ;break;case 6:var -a=or;break;case +a=oK;break;case 7:var -a=os;break;case +a=oL;break;case 8:var -a=ot;break;case +a=oM;break;case 9:var -a=ou;break;case +a=oN;break;case 10:var -a=ov;break;case +a=oO;break;case 11:var -a=ow;break;case +a=oP;break;case 0:case 13:var -a=ol;break;case +a=oE;break;case 3:case 14:var -a=oo;break;default:var -a=ox}return d0(b,eV(a,c))}function -pa(b,c){switch(b){case +a=oH;break;default:var +a=oQ}return d2(b,e8(a,c))}function +pu(b,c){switch(b){case 1:var -a=oM;break;case +a=o5;break;case 2:var -a=oN;break;case +a=o6;break;case 4:var -a=oP;break;case +a=o8;break;case 5:var -a=oQ;break;case +a=o9;break;case 6:var -a=oR;break;case +a=o_;break;case 7:var -a=oS;break;case +a=o$;break;case 8:var -a=oT;break;case +a=pa;break;case 9:var -a=oU;break;case +a=pb;break;case 10:var -a=oV;break;case +a=pc;break;case 11:var -a=oW;break;case +a=pd;break;case 0:case 13:var -a=oL;break;case +a=o4;break;case 3:case 14:var -a=oO;break;default:var -a=oX}return d0(b,eV(a,c))}function -pb(b,c){switch(b){case +a=o7;break;default:var +a=pe}return d2(b,e8(a,c))}function +pv(b,c){switch(b){case 1:var -a=oZ;break;case +a=pg;break;case 2:var -a=o0;break;case +a=ph;break;case 4:var -a=o2;break;case +a=pj;break;case 5:var -a=o3;break;case +a=pk;break;case 6:var -a=o4;break;case +a=pl;break;case 7:var -a=o5;break;case +a=pm;break;case 8:var -a=o6;break;case +a=pn;break;case 9:var -a=o7;break;case +a=po;break;case 10:var -a=o8;break;case +a=pp;break;case 11:var -a=o9;break;case +a=pq;break;case 0:case 13:var -a=oY;break;case +a=pf;break;case 3:case 14:var -a=o1;break;default:var -a=o_}return d0(b,eV(a,c))}function -pc(b,c){switch(b){case +a=pi;break;default:var +a=pr}return d2(b,e8(a,c))}function +pw(b,c){switch(b){case 1:var -a=oz;break;case +a=oS;break;case 2:var -a=oA;break;case +a=oT;break;case 4:var -a=oC;break;case +a=oV;break;case 5:var -a=oD;break;case +a=oW;break;case 6:var -a=oE;break;case +a=oX;break;case 7:var -a=oF;break;case +a=oY;break;case 8:var -a=oG;break;case +a=oZ;break;case 9:var -a=oH;break;case +a=o0;break;case 10:var -a=oI;break;case +a=o1;break;case 11:var -a=oJ;break;case +a=o2;break;case 0:case 13:var -a=oy;break;case +a=oR;break;case 3:case 14:var -a=oB;break;default:var -a=oK}return d0(b,GZ(a,c))}function -bD(c,i,b){function +a=oU;break;default:var +a=o3}return d2(b,H4(a,c))}function +bB(c,i,b){function j(d){switch(c[1]){case 0:var a=45;break;case 1:var a=43;break;default:var -a=32}return GW(b,i,a)}function +a=32}return H1(b,i,a)}function q(c){var -a=GK(b);return 3===a?b<0.?pe:pf:4<=a?pg:c}switch(c[2]){case +a=HP(b);return 3===a?b<0.?py:pz:4<=a?pA:c}switch(c[2]){case 5:var -e=gI(hs(c,i),b),d=0,u=G(e);for(;;){if(d===u)var +e=gZ(hI(c,i),b),d=0,u=I(e);for(;;){if(d===u)var p=0;else{var -k=E(e,d)+i0|0,l=0;if(23>>0){if(55===k)l=1}else -if(21<(k-1|0)>>>0)l=1;if(!l){var +k=H(e,d)+ji|0,l=0;if(23>>0){if(55===k)l=1}else +if(21>>0)l=1;if(!l){var d=d+1|0;continue}var p=1}var -v=p?e:bc(e,pd);return q(v)}case +v=p?e:a$(e,px);return q(v)}case 6:return j(0);case 7:var -h=bO(j(0)),f=a3(h);if(0===f)var +h=bO(j(0)),f=a1(h);if(0===f)var o=h;else{var -m=af(f),n=f-1|0,r=0;if(!(n<0)){var +m=ai(f),n=f-1|0,r=0;if(!(n<0)){var a=r;for(;;){var -g=dJ(h,a),s=25<(g+jA|0)>>>0?g:g+gA|0;ad(m,a,s);var +g=dM(h,a),s=25>>0?g:g+gP|0;ag(m,a,s);var t=a+1|0;if(n!==a){var a=t;continue}break}}var -o=m}return aD(o);case -8:return q(j(0));default:return gI(hs(c,i),b)}}function -dn(e,y,x,w){var +o=m}return aF(o);case +8:return q(j(0));default:return gZ(hI(c,i),b)}}function +dq(e,y,x,w){var b=y,a=x,d=w;for(;;)if(typeof d==="number")return c(b,a);else switch(d[0]){case @@ -2282,48 +2286,48 @@ z=d[1];return function(c){return M(b,[5,a,c],z)};case 1:var A=d[1];return function(c){var e=0;if(40<=c)if(92===c)var -d=m_;else -if(bd<=c)e=1;else +d=ns;else +if(ba<=c)e=1;else e=2;else if(32<=c)if(39<=c)var -d=m$;else +d=nt;else e=2;else if(14<=c)e=1;else switch(c){case 8:var -d=na;break;case +d=nu;break;case 9:var -d=nb;break;case +d=nv;break;case 10:var -d=nc;break;case +d=nw;break;case 13:var -d=nd;break;default:e=1}switch(e){case +d=nx;break;default:e=1}switch(e){case 1:var -f=af(4);ad(f,0,92);ad(f,1,48+(c/aW|0)|0);ad(f,2,48+((c/10|0)%10|0)|0);ad(f,3,48+(c%10|0)|0);var -d=aD(f);break;case +f=ai(4);ag(f,0,92);ag(f,1,48+(c/aW|0)|0);ag(f,2,48+((c/10|0)%10|0)|0);ag(f,3,48+(c%10|0)|0);var +d=aF(f);break;case 2:var -g=af(1);ad(g,0,c);var -d=aD(g);break}var -h=G(d),i=bh(h+2|0,39);b8(d,0,i,1,h);return M(b,[4,a,aD(i)],A)};case +g=ai(1);ag(g,0,c);var +d=aF(g);break}var +h=I(d),i=be(h+2|0,39);b_(d,0,i,1,h);return M(b,[4,a,aF(i)],A)};case 2:var -B=d[2],C=d[1];return fh(b,a,B,C,function(a){return a});case -3:return fh(b,a,d[2],d[1],ok);case -4:return d1(b,a,d[4],d[2],d[3],o$,d[1]);case -5:return d1(b,a,d[4],d[2],d[3],pa,d[1]);case -6:return d1(b,a,d[4],d[2],d[3],pb,d[1]);case -7:return d1(b,a,d[4],d[2],d[3],pc,d[1]);case +B=d[2],C=d[1];return fu(b,a,B,C,function(a){return a});case +3:return fu(b,a,d[2],d[1],oD);case +4:return d3(b,a,d[4],d[2],d[3],pt,d[1]);case +5:return d3(b,a,d[4],d[2],d[3],pu,d[1]);case +6:return d3(b,a,d[4],d[2],d[3],pv,d[1]);case +7:return d3(b,a,d[4],d[2],d[3],pw,d[1]);case 8:var -i=d[4],j=d[3],k=d[2],g=d[1];if(typeof +h=d[4],j=d[3],k=d[2],g=d[1];if(typeof k==="number"){if(typeof -j==="number")return j?function(d,c){return M(b,[4,a,bD(g,d,c)],i)}:function(c){return M(b,[4,a,bD(g,ff(g),c)],i)};var -Z=j[1];return function(c){return M(b,[4,a,bD(g,Z,c)],i)}}else{if(0===k[0]){var +j==="number")return j?function(d,c){return M(b,[4,a,bB(g,d,c)],h)}:function(c){return M(b,[4,a,bB(g,fs(g),c)],h)};var +Z=j[1];return function(c){return M(b,[4,a,bB(g,Z,c)],h)}}else{if(0===k[0]){var n=k[2],o=k[1];if(typeof -j==="number")return j?function(d,c){return M(b,[4,a,aR(o,n,bD(g,d,c))],i)}:function(c){return M(b,[4,a,aR(o,n,bD(g,ff(g),c))],i)};var -_=j[1];return function(c){return M(b,[4,a,aR(o,n,bD(g,_,c))],i)}}var +j==="number")return j?function(d,c){return M(b,[4,a,aS(o,n,bB(g,d,c))],h)}:function(c){return M(b,[4,a,aS(o,n,bB(g,fs(g),c))],h)};var +_=j[1];return function(c){return M(b,[4,a,aS(o,n,bB(g,_,c))],h)}}var p=k[1];if(typeof -j==="number")return j?function(e,d,c){return M(b,[4,a,aR(p,e,bD(g,d,c))],i)}:function(d,c){return M(b,[4,a,aR(p,d,bD(g,ff(g),c))],i)};var -aa=j[1];return function(d,c){return M(b,[4,a,aR(p,d,bD(g,aa,c))],i)}}case -9:return fh(b,a,d[2],d[1],m1);case +j==="number")return j?function(e,d,c){return M(b,[4,a,aS(p,e,bB(g,d,c))],h)}:function(d,c){return M(b,[4,a,aS(p,d,bB(g,fs(g),c))],h)};var +$=j[1];return function(d,c){return M(b,[4,a,aS(p,d,bB(g,$,c))],h)}}case +9:return fu(b,a,d[2],d[1],ni);case 10:var a=[7,a],d=d[1];continue;case 11:var @@ -2331,51 +2335,51 @@ a=[2,a,d[1]],d=d[2];continue;case 12:var a=[3,a,d[1]],d=d[2];continue;case 13:var -D=d[3],E=d[2],q=ho(16);fg(q,E);var -v=hq(q);return function(c){return M(b,[4,a,v],D)};case +D=d[3],E=d[2],q=hE(16);ft(q,E);var +v=hG(q);return function(c){return M(b,[4,a,v],D)};case 14:var -F=d[3],H=d[2];return function(d){var -e=d[1],c=T(e,$(ak(H)));if(typeof -c[2]==="number")return M(b,a,U(c[1],F));throw ar};case +F=d[3],G=d[2];return function(d){var +e=d[1],c=U(e,ac(an(G)));if(typeof +c[2]==="number")return M(b,a,W(c[1],F));throw as};case 15:var -I=d[1];return function(d,c){return M(b,[6,a,function(a){return h(d,a,c)}],I)};case +H=d[1];return function(d,c){return M(b,[6,a,function(a){return i(d,a,c)}],H)};case 16:var -K=d[1];return function(c){return M(b,[6,a,c],K)};case +J=d[1];return function(c){return M(b,[6,a,c],J)};case 17:var a=[0,a,d[1]],d=d[2];continue;case 18:var m=d[1];if(0===m[0]){var -L=d[2],N=m[1][1],O=0,b=function(b,c,d){return function(a){return M(c,[1,b,[0,a]],d)}}(a,b,L),a=O,d=N;continue}var -P=d[2],R=m[1][1],S=0,b=function(b,c,d){return function(a){return M(c,[1,b,[1,a]],d)}}(a,b,P),a=S,d=R;continue;case -19:throw[0,J,pi];case +K=d[2],N=m[1][1],O=0,b=function(b,c,d){return function(a){return M(c,[1,b,[0,a]],d)}}(a,b,K),a=O,d=N;continue}var +Q=d[2],R=m[1][1],S=0,b=function(b,c,d){return function(a){return M(c,[1,b,[1,a]],d)}}(a,b,Q),a=S,d=R;continue;case +19:throw[0,L,pC];case 20:var -V=d[3],W=[8,a,pj];return function(a){return M(b,W,V)};case +T=d[3],V=[8,a,pD];return function(a){return M(b,V,T)};case 21:var -X=d[2];return function(c){return M(b,[4,a,eV(pk,c)],X)};case +X=d[2];return function(c){return M(b,[4,a,e8(pE,c)],X)};case 22:var Y=d[1];return function(c){return M(b,[5,a,c],Y)};case 23:var f=d[2],l=d[1];if(typeof l==="number")switch(l){case -0:return e<50?Q(e+1|0,b,a,f):ao(Q,[0,b,a,f]);case -1:return e<50?Q(e+1|0,b,a,f):ao(Q,[0,b,a,f]);case -2:throw[0,J,pl];default:return e<50?Q(e+1|0,b,a,f):ao(Q,[0,b,a,f])}else +0:return e<50?P(e+1|0,b,a,f):ap(P,[0,b,a,f]);case +1:return e<50?P(e+1|0,b,a,f):ap(P,[0,b,a,f]);case +2:throw[0,L,pF];default:return e<50?P(e+1|0,b,a,f):ap(P,[0,b,a,f])}else switch(l[0]){case -0:return e<50?Q(e+1|0,b,a,f):ao(Q,[0,b,a,f]);case -1:return e<50?Q(e+1|0,b,a,f):ao(Q,[0,b,a,f]);case -2:return e<50?Q(e+1|0,b,a,f):ao(Q,[0,b,a,f]);case -3:return e<50?Q(e+1|0,b,a,f):ao(Q,[0,b,a,f]);case -4:return e<50?Q(e+1|0,b,a,f):ao(Q,[0,b,a,f]);case -5:return e<50?Q(e+1|0,b,a,f):ao(Q,[0,b,a,f]);case -6:return e<50?Q(e+1|0,b,a,f):ao(Q,[0,b,a,f]);case -7:return e<50?Q(e+1|0,b,a,f):ao(Q,[0,b,a,f]);case -8:return e<50?Q(e+1|0,b,a,f):ao(Q,[0,b,a,f]);case +0:return e<50?P(e+1|0,b,a,f):ap(P,[0,b,a,f]);case +1:return e<50?P(e+1|0,b,a,f):ap(P,[0,b,a,f]);case +2:return e<50?P(e+1|0,b,a,f):ap(P,[0,b,a,f]);case +3:return e<50?P(e+1|0,b,a,f):ap(P,[0,b,a,f]);case +4:return e<50?P(e+1|0,b,a,f):ap(P,[0,b,a,f]);case +5:return e<50?P(e+1|0,b,a,f):ap(P,[0,b,a,f]);case +6:return e<50?P(e+1|0,b,a,f):ap(P,[0,b,a,f]);case +7:return e<50?P(e+1|0,b,a,f):ap(P,[0,b,a,f]);case +8:return e<50?P(e+1|0,b,a,f):ap(P,[0,b,a,f]);case 9:var -u=l[2];return e<50?f1(e+1|0,b,a,u,f):ao(f1,[0,b,a,u,f]);case -10:return e<50?Q(e+1|0,b,a,f):ao(Q,[0,b,a,f]);default:return e<50?Q(e+1|0,b,a,f):ao(Q,[0,b,a,f])}default:var -r=d[3],s=d[1],t=c(d[2],0);return e<50?f0(e+1|0,b,a,r,s,t):ao(f0,[0,b,a,r,s,t])}}function -f1(e,d,c,a,b){if(typeof -a==="number")return e<50?Q(e+1|0,d,c,b):ao(Q,[0,d,c,b]);else +u=l[2];return e<50?gc(e+1|0,b,a,u,f):ap(gc,[0,b,a,u,f]);case +10:return e<50?P(e+1|0,b,a,f):ap(P,[0,b,a,f]);default:return e<50?P(e+1|0,b,a,f):ap(P,[0,b,a,f])}default:var +r=d[3],s=d[1],t=c(d[2],0);return e<50?gb(e+1|0,b,a,r,s,t):ap(gb,[0,b,a,r,s,t])}}function +gc(e,d,c,a,b){if(typeof +a==="number")return e<50?P(e+1|0,d,c,b):ap(P,[0,d,c,b]);else switch(a[0]){case 0:var f=a[1];return function(a){return aX(d,c,f,b)};case @@ -2396,516 +2400,513 @@ m=a[1];return function(a){return aX(d,c,m,b)};case 8:var n=a[2];return function(a){return aX(d,c,n,b)};case 9:var -o=a[3],p=a[2],q=ap(ak(a[1]),p);return function(a){return aX(d,c,aF(q,o),b)};case +o=a[3],p=a[2],q=aq(an(a[1]),p);return function(a){return aX(d,c,aG(q,o),b)};case 10:var r=a[1];return function(e,a){return aX(d,c,r,b)};case 11:var s=a[1];return function(a){return aX(d,c,s,b)};case 12:var t=a[1];return function(a){return aX(d,c,t,b)};case -13:throw[0,J,pm];default:throw[0,J,pn]}}function -Q(d,b,e,a){var -c=[8,e,po];return d<50?dn(d+1|0,b,c,a):ao(dn,[0,b,c,a])}function -f0(h,b,f,a,e,d){if(e){var -i=e[1];return function(e){return ph(b,f,a,i,c(d,e))}}var -g=[4,f,d];return h<50?dn(h+1|0,b,g,a):ao(dn,[0,b,g,a])}function -M(a,b,c){return dQ(dn(0,a,b,c))}function -aX(a,b,c,d){return dQ(f1(0,a,b,c,d))}function -ph(a,b,c,d,e){return dQ(f0(0,a,b,c,d,e))}function -fh(f,e,d,a,b){if(typeof +13:throw[0,L,pG];default:throw[0,L,pH]}}function +P(d,b,e,a){var +c=[8,e,pI];return d<50?dq(d+1|0,b,c,a):ap(dq,[0,b,c,a])}function +gb(h,b,f,a,e,d){if(e){var +i=e[1];return function(e){return pB(b,f,a,i,c(d,e))}}var +g=[4,f,d];return h<50?dq(h+1|0,b,g,a):ap(dq,[0,b,g,a])}function +M(a,b,c){return dT(dq(0,a,b,c))}function +aX(a,b,c,d){return dT(gc(0,a,b,c,d))}function +pB(a,b,c,d,e){return dT(gb(0,a,b,c,d,e))}function +fu(f,e,d,a,b){if(typeof a==="number")return function(a){return M(f,[4,e,c(b,a)],d)};else{if(0===a[0]){var -g=a[2],h=a[1];return function(a){return M(f,[4,e,aR(h,g,c(b,a))],d)}}var -i=a[1];return function(g,a){return M(f,[4,e,aR(i,g,c(b,a))],d)}}}function -d1(f,e,d,g,c,b,a){if(typeof +g=a[2],h=a[1];return function(a){return M(f,[4,e,aS(h,g,c(b,a))],d)}}var +i=a[1];return function(g,a){return M(f,[4,e,aS(i,g,c(b,a))],d)}}}function +d3(f,e,d,g,c,b,a){if(typeof g==="number"){if(typeof -c==="number")return c?function(g,c){return M(f,[4,e,cy(g,h(b,a,c))],d)}:function(c){return M(f,[4,e,h(b,a,c)],d)};var -l=c[1];return function(c){return M(f,[4,e,cy(l,h(b,a,c))],d)}}else{if(0===g[0]){var -i=g[2],j=g[1];if(typeof -c==="number")return c?function(g,c){return M(f,[4,e,aR(j,i,cy(g,h(b,a,c)))],d)}:function(c){return M(f,[4,e,aR(j,i,h(b,a,c))],d)};var -m=c[1];return function(c){return M(f,[4,e,aR(j,i,cy(m,h(b,a,c)))],d)}}var +c==="number")return c?function(g,c){return M(f,[4,e,cB(g,i(b,a,c))],d)}:function(c){return M(f,[4,e,i(b,a,c)],d)};var +l=c[1];return function(c){return M(f,[4,e,cB(l,i(b,a,c))],d)}}else{if(0===g[0]){var +h=g[2],j=g[1];if(typeof +c==="number")return c?function(g,c){return M(f,[4,e,aS(j,h,cB(g,i(b,a,c)))],d)}:function(c){return M(f,[4,e,aS(j,h,i(b,a,c))],d)};var +m=c[1];return function(c){return M(f,[4,e,aS(j,h,cB(m,i(b,a,c)))],d)}}var k=g[1];if(typeof -c==="number")return c?function(i,g,c){return M(f,[4,e,aR(k,i,cy(g,h(b,a,c)))],d)}:function(g,c){return M(f,[4,e,aR(k,g,h(b,a,c))],d)};var -n=c[1];return function(g,c){return M(f,[4,e,aR(k,g,cy(n,h(b,a,c)))],d)}}}function -bE(b,f){var +c==="number")return c?function(h,g,c){return M(f,[4,e,aS(k,h,cB(g,i(b,a,c)))],d)}:function(g,c){return M(f,[4,e,aS(k,g,i(b,a,c))],d)};var +n=c[1];return function(g,c){return M(f,[4,e,aS(k,g,cB(n,i(b,a,c)))],d)}}}function +bC(b,f){var a=f;for(;;)if(typeof a==="number")return 0;else switch(a[0]){case 0:var -g=a[1],h=hr(a[2]);bE(b,g);return c4(b,h);case +g=a[1],h=hH(a[2]);bC(b,g);return c7(b,h);case 1:var d=a[2],e=a[1];if(0===d[0]){var -i=d[1];bE(b,e);c4(b,pp);var +i=d[1];bC(b,e);c7(b,pJ);var a=i;continue}var -j=d[1];bE(b,e);c4(b,pq);var +j=d[1];bC(b,e);c7(b,pK);var a=j;continue;case 6:var -m=a[2];bE(b,a[1]);return c(m,b);case -7:bE(b,a[1]);return cm(b);case +m=a[2];bC(b,a[1]);return c(m,b);case +7:bC(b,a[1]);return cp(b);case 8:var -n=a[2];bE(b,a[1]);return ai(n);case +n=a[2];bC(b,a[1]);return ak(n);case 2:case 4:var -k=a[2];bE(b,a[1]);return c4(b,k);default:var -l=a[2];bE(b,a[1]);return mE(b,l)}}function +k=a[2];bC(b,a[1]);return c7(b,k);default:var +l=a[2];bC(b,a[1]);return mT(b,l)}}function bR(b,f){var a=f;for(;;)if(typeof a==="number")return 0;else switch(a[0]){case 0:var -g=a[1],h=hr(a[2]);bR(b,g);return c9(b,h);case +g=a[1],h=hH(a[2]);bR(b,g);return da(b,h);case 1:var d=a[2],e=a[1];if(0===d[0]){var -i=d[1];bR(b,e);c9(b,pr);var +i=d[1];bR(b,e);da(b,pL);var a=i;continue}var -j=d[1];bR(b,e);c9(b,ps);var +j=d[1];bR(b,e);da(b,pM);var a=j;continue;case 6:var -m=a[2];bR(b,a[1]);return c9(b,c(m,0));case +m=a[2];bR(b,a[1]);return da(b,c(m,0));case 7:var a=a[1];continue;case 8:var -n=a[2];bR(b,a[1]);return ai(n);case +n=a[2];bR(b,a[1]);return ak(n);case 2:case 4:var -k=a[2];bR(b,a[1]);return c9(b,k);default:var -l=a[2];bR(b,a[1]);return hn(b,l)}}function -fi(d,c){var -a=c[1],b=0;return M(function(a){bE(d,a);return 0},b,a)}function -fj(a){return fi(bg,a)}function +k=a[2];bR(b,a[1]);return da(b,k);default:var +l=a[2];bR(b,a[1]);return hD(b,l)}}function +hJ(d,c){var +a=c[1],b=0;return M(function(a){bC(d,a);return 0},b,a)}function +fv(a){return hJ(bd,a)}function aY(b){var a=b[1];return M(function(b){var -a=fd(64);bR(a,b);return hm(a)},0,a)}var -fk=[0,0];function -fm(i,h){var +a=fq(64);bR(a,b);return hC(a)},0,a)}var +fw=[0,0];function +fy(i,h){var a=i[1+h];if(1-(typeof -a==="number"?1:0)){if(dP(a)===ez)return c(aY(pt),a);if(dP(a)===lt){var -d=gI(m5,a),b=0,g=G(d);for(;;){if(g<=b)return bc(d,m4);var -e=E(d,b),f=0;if(48<=e){if(!(58<=e))f=1}else +a==="number"?1:0)){if(dS(a)===eG)return c(aY(pN),a);if(dS(a)===lH){var +d=gZ(nm,a),b=0,g=I(d);for(;;){if(g<=b)return a$(d,nl);var +e=H(d,b),f=0;if(48<=e){if(!(58<=e))f=1}else if(45===e)f=1;if(f){var -b=b+1|0;continue}return d}}return pu}return c(aY(pv),a)}function -hu(b,a){if(b.length-1<=a)return pw;var -c=hu(b,a+1|0),d=fm(b,a);return h(aY(px),d,c)}function -d2(a){function +b=b+1|0;continue}return d}}return pO}return c(aY(pP),a)}function +hK(b,a){if(b.length-1<=a)return pQ;var +c=hK(b,a+1|0),d=fy(b,a);return i(aY(pR),d,c)}function +d4(a){function p(f){var b=f;for(;;){if(b){var g=b[2],h=b[1];try{var e=0,d=c(h,a);e=1}catch(a){}if(e&&d)return[0,d[1]];var b=g;continue}return 0}}var -i=p(fk[1]);if(i)return i[1];if(a===e$)return pC;if(a===g5)return pD;if(a[1]===g4){var -d=a[2],j=d[3],q=d[2],r=d[1];return f4(aY(fl),r,q,j,j+5|0,pE)}if(a[1]===J){var -e=a[2],k=e[3],s=e[2],t=e[1];return f4(aY(fl),t,s,k,k+6|0,pF)}if(a[1]===g8){var -f=a[2],l=f[3],u=f[2],v=f[1];return f4(aY(fl),v,u,l,l+6|0,pG)}if(0===dP(a)){var +h=p(fw[1]);if(h)return h[1];if(a===fm)return pW;if(a===hk)return pX;if(a[1]===hj){var +d=a[2],j=d[3],q=d[2],r=d[1];return gf(aY(fx),r,q,j,j+5|0,pY)}if(a[1]===L){var +e=a[2],k=e[3],s=e[2],t=e[1];return gf(aY(fx),t,s,k,k+6|0,pZ)}if(a[1]===hn){var +f=a[2],l=f[3],u=f[2],v=f[1];return gf(aY(fx),v,u,l,l+6|0,p0)}if(0===dS(a)){var g=a.length-1,w=a[1][1];if(2>>0)var -m=hu(a,2),n=fm(a,1),b=h(aY(py),n,m);else +m=hK(a,2),n=fy(a,1),b=i(aY(pS),n,m);else switch(g){case 0:var -b=pz;break;case +b=pT;break;case 1:var -b=pA;break;default:var -o=fm(a,1),b=c(aY(pB),o)}return bc(w,b)}return a[1]}function -fn(h,t){var -e=GL(t);if([0,e]){var -g=e.length-1-1|0,q=0;if(!(g<0)){var -b=q;for(;;){var -a=ae(e,b)[1+b],f=function(a){return function(b){return b?0===a?pH:pI:0===a?pJ:pK}}(b);if(0===a[0])var -i=a[5],j=a[4],k=a[3],l=a[6]?pL:pN,m=a[2],n=a[7],o=f(a[1]),d=[0,GB(aY(pM),o,n,m,l,k,j,i)];else +b=pU;break;default:var +o=fy(a,1),b=c(aY(pV),o)}return a$(w,b)}return a[1]}function +fz(t,s){var +e=HQ(s),g=e.length-1-1|0,p=0;if(!(g<0)){var +b=p;for(;;){var +a=ah(e,b)[1+b],f=function(a){return function(b){return b?0===a?p1:p2:0===a?p3:p4}}(b);if(0===a[0])var +h=a[5],i=a[4],j=a[3],k=a[6]?p5:p7,l=a[2],m=a[7],n=f(a[1]),d=[0,HG(aY(p6),n,m,l,k,j,i,h)];else if(a[1])var d=0;else var -p=f(0),d=[0,c(aY(pO),p)];if(d){var -r=d[1];c(fi(h,pP),r)}var -s=b+1|0;if(g!==b){var -b=s;continue}break}}return 0}return fi(h,pQ)}function -d3(c){for(;;){var -a=fk[1],b=1-e_(fk,a,[0,c,a]);if(b)continue;return b}}var -pS=pR.slice();function -pT(e,d){var -f=d2(e);c(fj(pU),f);fn(bg,d);var -a=He(0);if(a<0){var -b=c3(a);g9(ae(pS,b)[1+b])}return cm(bg)}var -pV=[0];gV(a(kL),function(f,j){try{try{var -b=j?pV:my(0);try{fb(0)}catch(a){}try{var -a=pT(f,b),e=a}catch(a){a=d(a);var -h=d2(f);c(fj(pX),h);fn(bg,b);var -i=d2(a);c(fj(pY),i);fn(bg,my(0));var -e=cm(bg)}var -g=e}catch(a){a=d(a);if(a!==e$)throw a;var -g=g9(pW)}return g}catch(a){return 0}});var -p0=[O,pZ,aj(0)];d3(function(a){return a[1]===p0?[0,bc(p1,d2(a[2]))]:0});try{var -Gz=mK(Gy),hw=Gz}catch(a){a=d(a);if(a!==aL)throw a;try{var -Gx=mK(Gw),hv=Gx}catch(a){a=d(a);if(a!==aL)throw a;var -hv=p3}var -hw=hv}var -p4=nl(hw,82),d4=[jg,function(x){var -m=Hv(0),c=[0,bP(55,0),0],i=0===m.length-1?[0,0]:m,j=i.length-1,b=0;for(;;){ae(c[1],b)[1+b]=b;var +o=f(0),d=[0,c(aY(p8),o)];if(d){var +q=d[1];c(hJ(t,p9),q)}var +r=b+1|0;if(g!==b){var +b=r;continue}break}}return 0}function +d5(c){for(;;){var +a=fw[1],b=1-fl(fw,a,[0,c,a]);if(b)continue;return b}}var +p$=p_.slice();function +qa(e,d){var +f=d4(e);c(fv(qb),f);fz(bd,d);var +a=Ii(0);if(a<0){var +b=c6(a);ho(ah(p$,b)[1+b])}return cp(bd)}var +qc=[0];ha(a(k3),function(f,j){try{try{var +b=j?qc:mM(0);try{fo(0)}catch(a){}try{var +a=qa(f,b),e=a}catch(a){a=d(a);var +h=d4(f);c(fv(qe),h);fz(bd,b);var +i=d4(a);c(fv(qf),i);fz(bd,mM(0));var +e=cp(bd)}var +g=e}catch(a){a=d(a);if(a!==fm)throw a;var +g=ho(qd)}return g}catch(a){return 0}});var +qh=[N,qg,aE(0)];d5(function(a){return a[1]===qh?[0,a$(qi,d4(a[2]))]:0});try{var +HE=mZ(HD),hM=HE}catch(a){a=d(a);if(a!==aM)throw a;try{var +HC=mZ(HB),hL=HC}catch(a){a=d(a);if(a!==aM)throw a;var +hL=qk}var +hM=hL}var +ql=nE(hM,82),d6=[jy,function(x){var +n=Ix(0),c=[0,bP(55,0),0],i=0===n.length-1?[0,0]:n,j=i.length-1,b=0;for(;;){ah(c[1],b)[1+b]=b;var w=b+1|0;if(54!==b){var b=w;continue}var -g=[0,p2],k=54+dU(55,j)|0,s=0;if(!(k<0)){var +g=[0,qj],l=54+dW(55,j)|0,s=0;if(!(l<0)){var d=s;for(;;){var -e=d%55|0,l=Hi(d,j),t=ae(i,l)[1+l],h=bc(g[1],a(o+t));g[1]=Hd(h,0,G(h));var -f=g[1],n=E(f,3)<<24,p=E(f,2)<<16,q=E(f,1)<<8,r=((E(f,0)+q|0)+p|0)+n|0,u=(ae(c[1],e)[1+e]^r)&gq;ae(c[1],e)[1+e]=u;var -v=d+1|0;if(k!==d){var +e=d%55|0,m=Im(d,j),t=ah(i,m)[1+m],h=a$(g[1],a(k+t));g[1]=Ih(h,0,I(h));var +f=g[1],o=H(f,3)<<24,p=H(f,2)<<16,q=H(f,1)<<8,r=((H(f,0)+q|0)+p|0)+o|0,u=(ah(c[1],e)[1+e]^r)&gD;ah(c[1],e)[1+e]=u;var +v=d+1|0;if(l!==d){var d=v;continue}break}}c[2]=0;return c}}];function -p5(h,k){var -l=h?h[1]:p4,b=16;for(;;){if(!(k<=b)&&!(ha<(b*2|0))){var +qm(h,k){var +l=h?h[1]:ql,b=16;for(;;){if(!(k<=b)&&!(hq<(b*2|0))){var b=b*2|0;continue}if(l){var -i=dP(d4),a=ep===i?d4[1]:jg===i?nB(d4):d4;a[2]=(a[2]+1|0)%55|0;var -c=a[2],d=ae(a[1],c)[1+c],e=(a[2]+24|0)%55|0,f=(ae(a[1],e)[1+e]+(d^(d>>>25|0)&31)|0)&gq,g=a[2];ae(a[1],g)[1+g]=f;var +i=dS(d6),a=ev===i?d6[1]:jy===i?nU(d6):d6;a[2]=(a[2]+1|0)%55|0;var +c=a[2],d=ah(a[1],c)[1+c],e=(a[2]+24|0)%55|0,f=(ah(a[1],e)[1+e]+(d^(d>>>25|0)&31)|0)&gD,g=a[2];ah(a[1],g)[1+g]=f;var j=f}else var j=0;return[0,0,bP(b,0),j,b]}}function -bi(a){return GQ(10,aW,0,a)}var -hz=[O,p6,aj(0)],hx=0,hy=-1;function -d5(a,b){a[13]=a[13]+b[3]|0;return hl(b,a[28])}var -hA=1000000010;function -fo(b,a){return R(b[17],a,0,G(a))}function -fp(a){return c(a[19],0)}function -hB(a,c,b){a[9]=a[9]-c|0;fo(a,b);a[11]=0;return 0}function -d6(c,a){var -b=an(a,p7);return b?hB(c,G(a),a):b}function -cz(a,b,f){var -g=b[3],h=b[2];d6(a,b[1]);fp(a);a[11]=1;var -d=(a[6]-f|0)+h|0,e=a[8],i=Ha(e,d)?e:d;a[10]=i;a[9]=a[6]-a[10]|0;c(a[21],a[10]);return d6(a,g)}function -hC(b,a){return cz(b,p8,a)}function -c$(a,b){var -d=b[2],e=b[3];d6(a,b[1]);a[9]=a[9]-d|0;c(a[20],d);return d6(a,e)}function -hD(a){for(;;){var -r=a[28][2],O=r?[0,r[1]]:0;if(O){var -p=O[1],q=p[1],b=p[2],ac=0<=q?1:0,aa=p[3],ab=a[13]-a[12]|0,P=ac||(a[9]<=ab?1:0);if(P){var -g=a[28],m=g[2];if(m){if(m[2]){var -Q=m[2];g[1]=g[1]-1|0;g[2]=Q}else -fc(g);var -l=0<=q?q:hA;if(typeof +bf(a){return HV(10,aW,0,a)}var +hP=[N,qn,aE(0)],hN=0,hO=-1;function +d7(a,b){a[13]=a[13]+b[3]|0;return hB(b,a[28])}var +hQ=1000000010;function +fA(b,a){return Q(b[17],a,0,I(a))}function +fB(a){return c(a[19],0)}function +hR(a,c,b){a[9]=a[9]-c|0;fA(a,b);a[11]=0;return 0}function +d8(c,a){var +b=ao(a,qo);return b?hR(c,I(a),a):b}function +ce(a,b,f){var +g=b[3],h=b[2];d8(a,b[1]);fB(a);a[11]=1;var +d=(a[6]-f|0)+h|0,e=a[8],i=Ie(e,d)?e:d;a[10]=i;a[9]=a[6]-a[10]|0;c(a[21],a[10]);return d8(a,g)}function +hS(b,a){return ce(b,qp,a)}function +cC(a,b){var +d=b[2],e=b[3];d8(a,b[1]);a[9]=a[9]-d|0;c(a[20],d);return d8(a,e)}function +qq(a,j,b){if(typeof b==="number")switch(b){case 0:var -x=cw(a[3]);if(x){var -y=x[1][1],z=function(b,a){if(a){var -c=a[1],d=a[2];return gR(b,c)?[0,b,a]:[0,c,z(b,d)]}return[0,b,0]};y[1]=z(a[6]-a[9]|0,y[1])}break;case -1:cv(a[2]);break;case -2:cv(a[3]);break;case +s=cz(a[3]);if(s){var +t=s[1][1],u=function(b,a){if(a){var +c=a[1],d=a[2];return g8(b,c)?[0,b,a]:[0,c,u(b,d)]}return[0,b,0]};t[1]=u(a[6]-a[9]|0,t[1]);return 0}return 0;case +1:cy(a[2]);return 0;case +2:cy(a[3]);return 0;case 3:var -A=cw(a[2]);if(A)hC(a,A[1][2]);else -fp(a);break;case -4:if(a[10]!==(a[6]-a[9]|0)){var -e=a[28],h=e[2];if(h){var -s=h[1];if(h[2]){var -R=h[2];e[1]=e[1]-1|0;e[2]=R;var -i=[0,s]}else{fc(e);var -i=[0,s]}}else +v=cz(a[2]);return v?hS(a,v[1][2]):fB(a);case +4:var +w=a[10]!==(a[6]-a[9]|0)?1:0;if(w){var +f=a[28],h=f[2];if(h){var +n=h[1];if(h[2]){var +K=h[2];f[1]=f[1]-1|0;f[2]=K;var +i=[0,n]}else{fp(f);var +i=[0,n]}}else var i=0;if(i){var -w=i[1],T=w[1];a[12]=a[12]-w[3]|0;a[9]=a[9]+T|0}}break;default:var -B=cv(a[5]);if(B)fo(a,c(a[25],B[1]))}else +r=i[1],M=r[1];a[12]=a[12]-r[3]|0;a[9]=a[9]+M|0;return 0}return 0}return w;default:var +x=cy(a[5]);return x?fA(a,c(a[25],x[1])):0}else switch(b[0]){case -0:hB(a,l,b[1]);break;case +0:return hR(a,j,b[1]);case 1:var -d=b[2],j=b[1],C=d[1],U=d[2],D=cw(a[2]);if(D){var -E=D[1],f=E[2];switch(E[1]){case -0:c$(a,j);break;case -1:cz(a,d,f);break;case -2:cz(a,d,f);break;case -3:if(a[9]<(l+G(C)|0))cz(a,d,f);else -c$(a,j);break;case -4:if(a[11]||!(a[9]<(l+G(C)|0)||((a[6]-f|0)+U|0)>>0))hC(a,v)}else -fp(a)}var -_=a[9]-Z|0,$=1===M?1:a[9]>>0))hS(a,q)}else +fB(a)}var +T=a[9]-S|0,U=1===H?1:a[9]>>3|0,cs(b9(b,a>>>3|0)|1<<(a&7)))}function -d_(b){var -a=fv(0);da(a,b);return a}function -d$(c){var -b=af(32),a=0;for(;;){ba(b,a,cs(b9(c,a)^cN));var +h=d[1],a=c(aY(r5),h);return[0,Q(aY(q1),a,g,f)]}return 0});fk(r6);fk(r7);try{fk(HA)}catch(a){a=d(a);if(a[1]!==dV)throw a}try{fk(Hz)}catch(a){a=d(a);if(a[1]!==dV)throw a}qm(0,7);function +r8(b,a){return dZ(b,0,a)}function +r9(b,a){return dZ(b,a,I(b)-a|0)}var +bD=be(32,cR);function +fH(a){return be(32,0)}function +dc(b,a){return a9(b,a>>>3|0,cv(b$(b,a>>>3|0)|1<<(a&7)))}function +ea(b){var +a=fH(0);dc(a,b);return a}function +eb(c){var +b=ai(32),a=0;for(;;){a9(b,a,cv(b$(c,a)^cR));var d=a+1|0;if(31!==a){var a=d;continue}return b}}function -fw(d,c){var -b=af(32),a=0;for(;;){var -e=b9(c,a);ba(b,a,cs(b9(d,a)|e));var +fI(d,c){var +b=ai(32),a=0;for(;;){var +e=b$(c,a);a9(b,a,cv(b$(d,a)|e));var f=a+1|0;if(31!==a){var a=f;continue}return b}}function -rQ(c,b){try{var +r_(c,b){try{var a=0;for(;;){var -f=b9(b,a);if(0!==(b9(c,a)&f))throw g3;var +f=b$(b,a);if(0!==(b$(c,a)&f))throw hi;var g=a+1|0;if(31!==a){var a=g;continue}var -e=1;return e}}catch(a){a=d(a);if(a===g3)return 0;throw a}}function -hP(f,e){var +e=1;return e}}catch(a){a=d(a);if(a===hi)return 0;throw a}}function +h5(f,e){var a=0;for(;;){var -d=b9(e,a);if(0!==d){var -b=0;for(;;){if(0!==(d&1<>>0){if(!(25<(b+bd|0)>>>0))d=1}else +c=fH(0);h5(function(a){dc(c,hp(a));var +b=a-224|0,d=0;if(30>>0){if(!(25>>0))d=1}else if(23!==b)d=1;var -e=d?a+gA|0:a;return da(c,e)},b);var +e=d?a+gP|0:a;return dc(c,e)},b);var d=c}else var d=b;var -h=f?d$(d):d;return dW(h)}throw[0,J,r5]}var -hT=af(cR),dm=0;for(;;){ba(hT,dm,g$(cs(dm)));var -Gt=dm+1|0;if(cN!==dm){var -dm=Gt;continue}dW(hT);var -ec=dY([0,gW]),hU=function(a){var -b=hm(a[1]);a[1][2]=0;var -c=G(b);if(0===c)return 0;if(1===c){var -d=a[2];a[2]=[0,[0,E(b,0)],d];return 0}a[2]=[0,[1,b],a[2]];return 0},r9=d$(d_(10)),fB=A,fC=ms,sd=function(b){var -f=G(b),z=[0,1];function +h=f?eb(d):d;return dY(h)}throw[0,L,sn]}var +h9=ai(cV),dp=0;for(;;){a9(h9,dp,hp(cv(dp)));var +Hy=dp+1|0;if(cR!==dp){var +dp=Hy;continue}dY(h9);var +ee=d0([0,hb]),h_=function(a){var +b=hC(a[1]);a[1][2]=0;var +c=I(b);if(0===c)return 0;if(1===c){var +d=a[2];a[2]=[0,[0,H(b,0)],d];return 0}a[2]=[0,[1,b],a[2]];return 0},sr=eb(ea(10)),fN=E,fO=mI,sx=function(b){var +f=I(b),z=[0,1];function C(g){var -d=fv(0),a=g;for(;;){if(f<=a)bB(sb);if(93===E(b,a)&&g>>0)if(9<=r)var -j=[0,[9,k+eo|0],g+1|0];else +j=[0,[9,k+eu|0],g+1|0];else l=1;else if(r)l=2;else{var -H=z[1];z[1]++;var -t=A(g+1|0),o=t[2],y=0,I=t[1];if((o+1|0)>>0)){if(q){var +q=H(b,d)-42|0;if(!(1>>0)){if(q){var c=[6,c],d=d+1|0;continue}var c=[5,c],d=d+1|0;continue}if(21===q){var c=[7,c],d=d+1|0;continue}}var B=0;if(typeof -c!=="number"&&0===c[0]){hn(h[1],c[1]);B=1}if(!B){hU(h);h[2]=[0,c,h[2]]}var -a=d;continue a}}}hU(h);return[0,[3,dV(h[2])],a]}}function +c!=="number"&&0===c[0]){hD(h[1],c[1]);B=1}if(!B){h_(h);h[2]=[0,c,h[2]]}var +a=d;continue a}}}h_(h);return[0,[3,dX(h[2])],a]}}function A(g){var -d=B(g),c=d[1],a=d[2];for(;;){if((a+2|0)<=f&&92===E(b,a)&&dz===E(b,a+1|0)){var +d=B(g),c=d[1],a=d[2];for(;;){if((a+2|0)<=f&&92===H(b,a)&&dC===H(b,a+1|0)){var e=B(a+2|0),c=[4,c,e[1]],a=e[2];continue}return[0,c,a]}}var -D=A(0),O=D[1],F=D[2]===f?O:bB(sc),g=[0,bP(32,0)],c=[0,0],m=[0,ec[1]],n=[0,0],j=[0,1],o=[0,0],r=0;function +D=A(0),O=D[1],E=D[2]===f?O:bz(sw),g=[0,bP(32,0)],c=[0,0],m=[0,ee[1]],n=[0,0],j=[0,1],o=[0,0],r=0;function a(f,e){if(g[1].length-1<=c[1]){var a=[0,g[1].length-1];for(;;){if(a[1]<=c[1]){a[1]=a[1]*2|0;continue}var -b=bP(a[1],0);hk(g[1],0,b,0,g[1].length-1);g[1]=b;break}}var -h=hS(f,e),d=c[1];ae(g[1],d)[1+d]=h;c[1]++;return 0}function +b=bP(a[1],0);hA(g[1],0,b,0,g[1].length-1);g[1]=b;break}}var +h=h8(f,e),d=c[1];ah(g[1],d)[1+d]=h;c[1]++;return 0}function k(d){var -b=c[1];a(ea,0);return b}function +b=c[1];a(ec,0);return b}function l(a,c,b){var -d=hS(c,fy(b,a));ae(g[1],a)[1+a]=d;return 0}function -i(b){try{var -a=h(ec[28],b,m[1]);return a}catch(a){a=d(a);if(a===aL){var -c=n[1];m[1]=R(ec[4],b,c,m[1]);n[1]++;return c}throw a}}function -t(b){if(fz(b)){var -a=o[1];if(64<=a)bB(r6);o[1]++;return a}return-1}function -p(b,a){return rQ(b,a)}function +d=h8(c,fK(b,a));ah(g[1],a)[1+a]=d;return 0}function +h(b){try{var +a=i(ee[28],b,m[1]);return a}catch(a){a=d(a);if(a===aM){var +c=n[1];m[1]=Q(ee[4],b,c,m[1]);n[1]++;return c}throw a}}function +t(b){if(fL(b)){var +a=o[1];if(64<=a)bz(so);o[1]++;return a}return-1}function +p(b,a){return r_(b,a)}function e(b){if(typeof b==="number")switch(b){case -0:return a(rT,0);case -1:return a(rU,0);default:return a(rV,0)}else +0:return a(sb,0);case +1:return a(sc,0);default:return a(sd,0)}else switch(b[0]){case -0:return a(ea,b[1]);case +0:return a(ec,b[1]);case 1:var -f=b[1],n=G(f);if(0===n)return 0;if(1===n)return a(ea,E(f,0));try{var -o=hj(f,0);e([1,rO(f,o)]);a(ea,0);var -v=e([1,rP(f,o+1|0)]);return v}catch(b){b=d(b);if(b===aL)return a(rR,i(f));throw b}case +f=b[1],n=I(f);if(0===n)return 0;if(1===n)return a(ec,H(f,0));try{var +o=hz(f,0);e([1,r8(f,o)]);a(ec,0);var +v=e([1,r9(f,o+1|0)]);return v}catch(b){b=d(b);if(b===aM)return a(r$,h(f));throw b}case 2:var -p=b[1],w=b[2]?d$(p):p;return a(rS,i(dW(w)));case -3:return I(b[1]);case +p=b[1],w=b[2]?eb(p):p;return a(sa,h(dY(w)));case +3:return G(b[1]);case 4:var x=b[2],y=b[1],z=k(0);e(y);var A=k(0),B=c[1];e(x);var -C=c[1];l(z,eb,B);return l(A,fx,C);case +C=c[1];l(z,ed,B);return l(A,fJ,C);case 5:var -q=b[1],g=t(q),r=k(0);if(0<=g)a(hQ,g);e(q);if(0<=g)a(hR,g);a(fx,fy(r,c[1]));return l(r,eb,c[1]);case +q=b[1],g=t(q),r=k(0);if(0<=g)a(h6,g);e(q);if(0<=g)a(h7,g);a(fJ,fK(r,c[1]));return l(r,ed,c[1]);case 6:var -s=b[1],h=t(s),D=c[1];e(s);if(0<=h)a(hR,h);var -F=k(0);if(0<=h)a(hQ,h);a(fx,fy(D,c[1]));return l(F,eb,c[1]);case +s=b[1],i=t(s),D=c[1];e(s);if(0<=i)a(h7,i);var +E=k(0);if(0<=i)a(h6,i);a(fJ,fK(D,c[1]));return l(E,ed,c[1]);case 7:var -H=b[1],J=k(0);e(H);return l(J,eb,c[1]);case +F=b[1],J=k(0);e(F);return l(J,ed,c[1]);case 8:var -m=b[1],K=b[2];a(rW,m);e(K);a(rX,m);j[1]=dU(j[1],m+1|0);return 0;default:var -u=b[1];a(rY,u);j[1]=dU(j[1],u+1|0);return 0}}function -I(o){var +m=b[1],K=b[2];a(se,m);e(K);a(sf,m);j[1]=dW(j[1],m+1|0);return 0;default:var +u=b[1];a(sg,u);j[1]=dW(j[1],u+1|0);return 0}}function +G(o){var b=o;for(;;){if(b){var c=b[1];if(typeof c!=="number")switch(c[0]){case @@ -3079,15 +3080,15 @@ d==="number")l=1;else switch(d[0]){case 0:case 2:var -h=b[2],s=db(h);if(p(bS(d),s)){a(r1,i(fA(r,d)));var -b=h;continue}break;default:l=1}break;case +i=b[2],s=dd(i);if(p(bS(d),s)){a(sj,h(fM(r,d)));var +b=i;continue}break;default:l=1}break;case 6:var f=c[1],m=0;if(typeof f==="number")m=1;else switch(f[0]){case 0:case 2:var -j=b[2],t=db(j);if(p(bS(f),t)){a(r2,i(fA(r,f)));var +j=b[2],t=dd(j);if(p(bS(f),t)){a(sk,h(fM(r,f)));var b=j;continue}break;default:m=1}break;case 7:var g=c[1],n=0;if(typeof @@ -3095,147 +3096,147 @@ g==="number")n=1;else switch(g[0]){case 0:case 2:var -k=b[2],u=db(k);if(p(bS(g),u)){a(r0,i(fA(r,g)));var +k=b[2],u=dd(k);if(p(bS(g),u)){a(si,h(fM(r,g)));var b=k;continue}break;default:n=1}break}var q=b[2];e(c);var -b=q;continue}return 0}}e(F);a(rZ,0);var -u=bS(F);if(mq(u,bF))var +b=q;continue}return 0}}e(E);a(sh,0);var +u=bS(E);if(mG(u,bD))var v=-1;else{var -s=bh(cR,0);hP(function(a){return ba(s,a,1)},u);var -v=i(dW(s))}var -w=bP(n[1],r7),K=m[1];function -L(b,a){ae(w,a)[1+a]=b;return 0}h(ec[12],L,K);var -q=c[1],x=g[1],H=0,M=o[1],N=j[1];if(0<=q&&!((x.length-1-q|0)<0)){var -y=GF(x,0,q);H=1}if(!H)var -y=ai(nm);return[0,y,w,r8,N,M,v]},ed=function(b,a){return Math.abs(b-a)<0.001?1:0},fD=function(b,a){return ed(b,a)?0:b>a===b?c:m9(b,a)}return m9(b,a)},iz=function(a){return typeof +a==="number"?a:IX(a)},bF=0,f0=1,uZ=-1,iA=function(a){return cu(0,a,0,I(a))},u0=function(b,a){return cu(b,a,0,I(a))},f1=function(a){if(typeof a==="number")return a;var -d=gZ(a);if(63>>0))switch(b){case +e=he(a);if(63>g;f=1}if(!f)var +c=IV(a,b);var +i=IK(a,cF(c,b)),d=fi(c),h=i?d:H$(d,u1);return g7(e$(h),b)}return e$(fi(a))},dl=function(a,b){if(a!==0&&b!==1){var +c=IM(a,b);if(c===1)return[0,a,b];var +d=iy(b,c);return[0,iy(a,c),d]}return[0,a,f0]},iB=function(b,a){var +c=by(a);if(0===c)return[0,by(b),bF];if(0>>0))switch(b){case 0:return 2;case -1:break;default:return 1}return 3}return a[1]===aG?0:4},uJ=function(a){return[0,dR(a[1]),a[2]]},fR=function(b,a){if(b[2]!==aG&&a[2]!==aG)return dj(cb(b[1],a[1]),cb(b[2],a[2]));return[0,aE(by(bz(b[1]),bz(a[1]))),aG]},fS=function(a){switch(a){case +1:break;default:return 1}return 3}return a[1]===0?0:4},u2=function(a){var +b=a[2];return[0,cE(a[1]),b]},f4=function(b,a){if(b[2]!==0&&a[2]!==0){var +c=bY(b[2],a[2]);return dl(bY(b[1],a[1]),c)}return[0,bc(by(b[1]),by(a[1])),bF]},f5=function(a){switch(a){case 0:return 2;case 1:return 8;case -2:return 10;default:return 16}},fT=function(f,e,d,b){var -a=e;for(;;){if(d<=a)return 0;if(c(b,E(f,a)))return[0,a];var -a=a+1|0;continue}},uL=function(a){if(an(a,uM)){if(an(a,uN)){if(!an(a,uO))return il;if(an(a,uP)){if(an(a,uQ))try{var -l=hj(a,47),Z=cr(0,a,l+1|0,(G(a)-l|0)-1|0),_=ii(cr(0,a,0,l),Z);return _}catch(l){l=d(l);if(l===aL){var -j=G(a),x=0;if(j<1)var +2:return 10;default:return 16}},f6=function(f,e,d,b){var +a=e;for(;;){if(d<=a)return 0;if(c(b,H(f,a)))return[0,a];var +a=a+1|0;continue}},b=[N,va,aE(0)],o=[N,vh,aE(0)],u4=function(a){if(ao(a,u5)){if(ao(a,u6)){if(!ao(a,u7))return iE;if(ao(a,u8)){if(ao(a,u9))try{var +l=hz(a,47),Z=cu(0,a,l+1|0,(I(a)-l|0)-1|0),_=iB(cu(0,a,0,l),Z);return _}catch(l){l=d(l);if(l===aM){var +j=I(a),x=0;if(j<1)var s=[0,0,x];else{var -P=E(a,0)+l5|0,S=0;if(!(2

>>0)){var +P=H(a,0)+mj|0,S=0;if(!(2

>>0)){var T=0;switch(P){case 0:var R=[0,0,1];break;case @@ -3490,10 +3511,10 @@ Q=[0,0,x];var s=Q}var c=s[2];if(j<(c+2|0))var t=[0,2,c];else{var -Y=E(a,c),h=E(a,c+1|0),r=0;if(48===Y){var +Y=H(a,c),h=H(a,c+1|0),r=0;if(48===Y){var i=0;if(89<=h){if(98===h)i=2;else -if(gD===h)i=1;else -if(bY!==h){r=1;i=3}}else +if(gS===h)i=1;else +if(bZ!==h){r=1;i=3}}else if(66===h)i=2;else if(79===h)i=1;else if(!(88<=h)){r=1;i=3}switch(i){case @@ -3506,586 +3527,640 @@ q=[0,0,c+2|0]}}else r=1;if(r)var q=[0,2,c];var t=q}var -e=t[2],b=t[1],U=2===b?function(a){if(69!==a&&ev!==a)return 0;return 1}:3<=b?function(a){if(80!==a&&gC!==a)return 0;return 1}:function(a){return 0},y=fT(a,e,j,U);if(y)var -z=y[1],A=z+1|0,f=z,B=dS(cr(10,a,A,j-A|0));else +e=t[2],b=t[1],U=2===b?function(a){if(69!==a&&eC!==a)return 0;return 1}:3<=b?function(a){if(80!==a&&dK!==a)return 0;return 1}:function(a){return 0},y=f6(a,e,j,U);if(y)var +z=y[1],A=z+1|0,f=z,B=iz(cu(10,a,A,j-A|0));else var f=j,B=0;if(2<=b){var -C=fT(a,e,f,function(a){return 46===a?1:0});if(C){var +C=f6(a,e,f,function(a){return 46===a?1:0});if(C){var u=C[1];if(2===b)var -D=1;else{if(!(3<=b))throw[0,J,uS];var +D=1;else{if(!(3<=b))throw[0,L,u$];var D=4}var -H=u+1|0,I=f-1|0,F=0;if(I date = smic_in_3233.date_courante_in in - let residence_3235_ : unit -> collectivite = smic_in_3233.residence_in in - let brut_horaire_3236_ : unit -> money = smic_in_3233.brut_horaire_in in - let date_courante_3237_ : date = +let smic (smic_in : smic_in) = + let date_courante_3728_ : unit -> date = smic_in.date_courante_in in + let residence_3729_ : unit -> collectivite = smic_in.residence_in in + let brut_horaire_3730_ : unit -> money = smic_in.brut_horaire_in in + let date_courante_3731_ : date = log_variable_definition [ "Smic"; "date_courante" ] embed_date (try - try date_courante_3234_ () + try date_courante_3728_ () with EmptyError -> - if - log_decision_taken - { - filename = ""; - start_line = 0; - start_column = 1; - end_line = 0; - end_column = 1; - law_headings = []; - } - false - then raise EmptyError - else raise EmptyError + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = ""; + start_line = 0; + start_column = 1; + end_line = 0; + end_column = 1; + law_headings = []; + } + false) + (fun (_ : _) -> raise EmptyError) with EmptyError -> raise (NoValueProvided @@ -585,24 +585,24 @@ let smic_1356 (smic_in_3233 : smic_in) = law_headings = [ "Prologue" ]; })) in - let residence_3238_ : collectivite = + let residence_3734_ : collectivite = log_variable_definition [ "Smic"; "résidence" ] embed_collectivite (try - try residence_3235_ () + try residence_3729_ () with EmptyError -> - if - log_decision_taken - { - filename = ""; - start_line = 0; - start_column = 1; - end_line = 0; - end_column = 1; - law_headings = []; - } - false - then raise EmptyError - else raise EmptyError + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = ""; + start_line = 0; + start_column = 1; + end_line = 0; + end_column = 1; + law_headings = []; + } + false) + (fun (_ : _) -> raise EmptyError) with EmptyError -> raise (NoValueProvided @@ -615,168 +615,168 @@ let smic_1356 (smic_in_3233 : smic_in) = law_headings = [ "Prologue" ]; })) in - let brut_horaire_3239_ : money = + let brut_horaire_3737_ : money = log_variable_definition [ "Smic"; "brut_horaire" ] embed_money (try - try brut_horaire_3236_ () + try brut_horaire_3730_ () with EmptyError -> - handle_default_1_ + handle_default [| - (fun (__3240_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 315; - start_column = 5; - end_line = 317; - end_column = 6; - law_headings = - [ - "Article 1"; - "Décret n° 2020-1598 du 16 décembre 2020 portant relèvement du salaire \ - minimum de croissance"; - "Montant du salaire minimum de croissance"; - "Décrets divers"; - ]; - } - (date_courante_3237_ >=@ date_of_numbers 2021 1 1 - && date_courante_3237_ <=@ date_of_numbers 2021 12 31 - && residence_3238_ = Mayotte ()) - then money_of_cents_string "774" - else raise EmptyError); - (fun (__3241_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 297; - start_column = 5; - end_line = 306; - end_column = 6; - law_headings = - [ - "Article 1"; - "Décret n° 2020-1598 du 16 décembre 2020 portant relèvement du salaire \ - minimum de croissance"; - "Montant du salaire minimum de croissance"; - "Décrets divers"; - ]; - } - (date_courante_3237_ >=@ date_of_numbers 2021 1 1 - && date_courante_3237_ <=@ date_of_numbers 2021 12 31 - && (residence_3238_ = Metropole () || residence_3238_ = Guadeloupe () - || residence_3238_ = Guyane () || residence_3238_ = Martinique () - || residence_3238_ = LaReunion () - || residence_3238_ = SaintBarthelemy () - || residence_3238_ = SaintMartin () - || residence_3238_ = SaintPierreEtMiquelon ())) - then money_of_cents_string "1025" - else raise EmptyError); - (fun (__3242_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 276; - start_column = 5; - end_line = 278; - end_column = 6; - law_headings = - [ - "Article 1"; - "Décret n° 2019-1387 du 18 décembre 2019 portant relèvement du salaire \ - minimum de croissance"; - "Montant du salaire minimum de croissance"; - "Décrets divers"; - ]; - } - (date_courante_3237_ >=@ date_of_numbers 2020 1 1 - && date_courante_3237_ <=@ date_of_numbers 2020 12 31 - && residence_3238_ = Mayotte ()) - then money_of_cents_string "766" - else raise EmptyError); - (fun (__3243_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 258; - start_column = 5; - end_line = 267; - end_column = 6; - law_headings = - [ - "Article 1"; - "Décret n° 2019-1387 du 18 décembre 2019 portant relèvement du salaire \ - minimum de croissance"; - "Montant du salaire minimum de croissance"; - "Décrets divers"; - ]; - } - (date_courante_3237_ >=@ date_of_numbers 2020 1 1 - && date_courante_3237_ <=@ date_of_numbers 2020 12 31 - && (residence_3238_ = Metropole () || residence_3238_ = Guadeloupe () - || residence_3238_ = Guyane () || residence_3238_ = Martinique () - || residence_3238_ = LaReunion () - || residence_3238_ = SaintBarthelemy () - || residence_3238_ = SaintMartin () - || residence_3238_ = SaintPierreEtMiquelon ())) - then money_of_cents_string "1015" - else raise EmptyError); - (fun (__3244_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 237; - start_column = 5; - end_line = 239; - end_column = 6; - law_headings = - [ - "Article 1"; - "Décret n° 2018-1173 du 19 décembre 2018 portant relèvement du salaire \ - minimum de croissance"; - "Montant du salaire minimum de croissance"; - "Décrets divers"; - ]; - } - (date_courante_3237_ >=@ date_of_numbers 2019 1 1 - && date_courante_3237_ <=@ date_of_numbers 2019 12 31 - && residence_3238_ = Mayotte ()) - then money_of_cents_string "757" - else raise EmptyError); - (fun (__3245_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 219; - start_column = 5; - end_line = 228; - end_column = 6; - law_headings = - [ - "Article 1"; - "Décret n° 2018-1173 du 19 décembre 2018 portant relèvement du salaire \ - minimum de croissance"; - "Montant du salaire minimum de croissance"; - "Décrets divers"; - ]; - } - (date_courante_3237_ >=@ date_of_numbers 2019 1 1 - && date_courante_3237_ <=@ date_of_numbers 2019 12 31 - && (residence_3238_ = Metropole () || residence_3238_ = Guadeloupe () - || residence_3238_ = Guyane () || residence_3238_ = Martinique () - || residence_3238_ = LaReunion () - || residence_3238_ = SaintBarthelemy () - || residence_3238_ = SaintMartin () - || residence_3238_ = SaintPierreEtMiquelon ())) - then money_of_cents_string "1003" - else raise EmptyError); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 315; + start_column = 5; + end_line = 317; + end_column = 6; + law_headings = + [ + "Article 1"; + "Décret n° 2020-1598 du 16 décembre 2020 portant relèvement du \ + salaire minimum de croissance"; + "Montant du salaire minimum de croissance"; + "Décrets divers"; + ]; + } + (date_courante_3731_ >=@ date_of_numbers 2021 1 1 + && date_courante_3731_ <=@ date_of_numbers 2021 12 31 + && residence_3734_ = Mayotte ())) + (fun (_ : _) -> money_of_cents_string "774")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 297; + start_column = 5; + end_line = 306; + end_column = 6; + law_headings = + [ + "Article 1"; + "Décret n° 2020-1598 du 16 décembre 2020 portant relèvement du \ + salaire minimum de croissance"; + "Montant du salaire minimum de croissance"; + "Décrets divers"; + ]; + } + (date_courante_3731_ >=@ date_of_numbers 2021 1 1 + && date_courante_3731_ <=@ date_of_numbers 2021 12 31 + && (residence_3734_ = Metropole () || residence_3734_ = Guadeloupe () + || residence_3734_ = Guyane () || residence_3734_ = Martinique () + || residence_3734_ = LaReunion () + || residence_3734_ = SaintBarthelemy () + || residence_3734_ = SaintMartin () + || residence_3734_ = SaintPierreEtMiquelon ()))) + (fun (_ : _) -> money_of_cents_string "1025")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 276; + start_column = 5; + end_line = 278; + end_column = 6; + law_headings = + [ + "Article 1"; + "Décret n° 2019-1387 du 18 décembre 2019 portant relèvement du \ + salaire minimum de croissance"; + "Montant du salaire minimum de croissance"; + "Décrets divers"; + ]; + } + (date_courante_3731_ >=@ date_of_numbers 2020 1 1 + && date_courante_3731_ <=@ date_of_numbers 2020 12 31 + && residence_3734_ = Mayotte ())) + (fun (_ : _) -> money_of_cents_string "766")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 258; + start_column = 5; + end_line = 267; + end_column = 6; + law_headings = + [ + "Article 1"; + "Décret n° 2019-1387 du 18 décembre 2019 portant relèvement du \ + salaire minimum de croissance"; + "Montant du salaire minimum de croissance"; + "Décrets divers"; + ]; + } + (date_courante_3731_ >=@ date_of_numbers 2020 1 1 + && date_courante_3731_ <=@ date_of_numbers 2020 12 31 + && (residence_3734_ = Metropole () || residence_3734_ = Guadeloupe () + || residence_3734_ = Guyane () || residence_3734_ = Martinique () + || residence_3734_ = LaReunion () + || residence_3734_ = SaintBarthelemy () + || residence_3734_ = SaintMartin () + || residence_3734_ = SaintPierreEtMiquelon ()))) + (fun (_ : _) -> money_of_cents_string "1015")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 237; + start_column = 5; + end_line = 239; + end_column = 6; + law_headings = + [ + "Article 1"; + "Décret n° 2018-1173 du 19 décembre 2018 portant relèvement du \ + salaire minimum de croissance"; + "Montant du salaire minimum de croissance"; + "Décrets divers"; + ]; + } + (date_courante_3731_ >=@ date_of_numbers 2019 1 1 + && date_courante_3731_ <=@ date_of_numbers 2019 12 31 + && residence_3734_ = Mayotte ())) + (fun (_ : _) -> money_of_cents_string "757")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 219; + start_column = 5; + end_line = 228; + end_column = 6; + law_headings = + [ + "Article 1"; + "Décret n° 2018-1173 du 19 décembre 2018 portant relèvement du \ + salaire minimum de croissance"; + "Montant du salaire minimum de croissance"; + "Décrets divers"; + ]; + } + (date_courante_3731_ >=@ date_of_numbers 2019 1 1 + && date_courante_3731_ <=@ date_of_numbers 2019 12 31 + && (residence_3734_ = Metropole () || residence_3734_ = Guadeloupe () + || residence_3734_ = Guyane () || residence_3734_ = Martinique () + || residence_3734_ = LaReunion () + || residence_3734_ = SaintBarthelemy () + || residence_3734_ = SaintMartin () + || residence_3734_ = SaintPierreEtMiquelon ()))) + (fun (_ : _) -> money_of_cents_string "1003")); |] - (fun (__3246_ : _) -> + (fun (_ : _) -> log_decision_taken { filename = ""; @@ -787,7 +787,7 @@ let smic_1356 (smic_in_3233 : smic_in) = law_headings = []; } false) - (fun (__3247_ : _) -> raise EmptyError) + (fun (_ : _) -> raise EmptyError) with EmptyError -> raise (NoValueProvided @@ -801,23 +801,46 @@ let smic_1356 (smic_in_3233 : smic_in) = })) in { - date_courante_out = date_courante_3237_; - residence_out = residence_3238_; - brut_horaire_out = brut_horaire_3239_; + date_courante_out = date_courante_3731_; + residence_out = residence_3734_; + brut_horaire_out = brut_horaire_3737_; } -let allocation_familiales_avril2008_1379 - (allocation_familiales_avril2008_in_3248 : allocation_familiales_avril2008_in) = - let age_minimum_alinea_1_l521_3_3249_ : unit -> integer = - allocation_familiales_avril2008_in_3248.age_minimum_alinea_1_l521_3_in +let allocation_familiales_avril2008 + (allocation_familiales_avril2008_in : allocation_familiales_avril2008_in) = + let age_minimum_alinea_1_l521_3_3759_ : unit -> integer = + allocation_familiales_avril2008_in.age_minimum_alinea_1_l521_3_in in - let age_minimum_alinea_1_l521_3_3250_ : integer = + let age_minimum_alinea_1_l521_3_3760_ : integer = log_variable_definition [ "AllocationFamilialesAvril2008"; "âge_minimum_alinéa_1_l521_3" ] embed_integer (try - try age_minimum_alinea_1_l521_3_3249_ () - with EmptyError -> ( try integer_of_string "16" with EmptyError -> raise EmptyError) + try age_minimum_alinea_1_l521_3_3759_ () + with EmptyError -> ( + try + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_R.catala_fr"; + start_line = 78; + start_column = 14; + end_line = 78; + end_column = 41; + law_headings = + [ + "Article R521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets en Conseil d'Etat"; + "Code de la sécurité sociale"; + ]; + } + true) + (fun (_ : _) -> integer_of_string "16") + with EmptyError -> raise EmptyError) with EmptyError -> raise (NoValueProvided @@ -830,31 +853,31 @@ let allocation_familiales_avril2008_1379 law_headings = [ "Prologue" ]; })) in - { age_minimum_alinea_1_l521_3_out = age_minimum_alinea_1_l521_3_3250_ } + { age_minimum_alinea_1_l521_3_out = age_minimum_alinea_1_l521_3_3760_ } -let enfant_le_plus_age_1386 (enfant_le_plus_age_in_3251 : enfant_le_plus_age_in) = - let enfants_3252_ : unit -> enfant array = enfant_le_plus_age_in_3251.enfants_in in - let le_plus_age_3253_ : unit -> enfant = enfant_le_plus_age_in_3251.le_plus_age_in in - let enfants_3254_ : enfant array = +let enfant_le_plus_age (enfant_le_plus_age_in : enfant_le_plus_age_in) = + let enfants_3764_ : unit -> enfant array = enfant_le_plus_age_in.enfants_in in + let le_plus_age_3765_ : unit -> enfant = enfant_le_plus_age_in.le_plus_age_in in + let enfants_3766_ : enfant array = log_variable_definition [ "EnfantLePlusÂgé"; "enfants" ] (embed_array embed_enfant) (try - try enfants_3252_ () + try enfants_3764_ () with EmptyError -> - if - log_decision_taken - { - filename = ""; - start_line = 0; - start_column = 1; - end_line = 0; - end_column = 1; - law_headings = []; - } - false - then raise EmptyError - else raise EmptyError + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = ""; + start_line = 0; + start_column = 1; + end_line = 0; + end_column = 1; + law_headings = []; + } + false) + (fun (_ : _) -> raise EmptyError) with EmptyError -> raise (NoValueProvided @@ -867,31 +890,44 @@ let enfant_le_plus_age_1386 (enfant_le_plus_age_in_3251 : enfant_le_plus_age_in) law_headings = [ "Prologue" ]; })) in - let le_plus_age_3255_ : enfant = + let le_plus_age_3769_ : enfant = log_variable_definition [ "EnfantLePlusÂgé"; "le_plus_âgé" ] embed_enfant (try - try le_plus_age_3253_ () + try le_plus_age_3765_ () with EmptyError -> ( try - let predicate_3256_ : _ = - fun (potentiel_plus_age_3257_ : _) -> potentiel_plus_age_3257_.age - in - Array.fold_left - (fun (acc_3258_ : _) (item_3259_ : _) -> - if predicate_3256_ acc_3258_ >! predicate_3256_ item_3259_ then acc_3258_ - else item_3259_) - { - identifiant = ~-!(integer_of_string "1"); - obligation_scolaire = Pendant (); - remuneration_mensuelle = money_of_cents_string "0"; - date_de_naissance = date_of_numbers 1900 1 1; - age = integer_of_string "0"; - prise_en_charge = EffectiveEtPermanente (); - a_deja_ouvert_droit_aux_allocations_familiales = false; - } - enfants_3254_ + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./epilogue.catala_fr"; + start_line = 12; + start_column = 14; + end_line = 12; + end_column = 25; + law_headings = [ "Règles diverses"; "Épilogue"; "Décrets divers" ]; + } + true) + (fun (_ : _) -> + let predicate_3772_ : _ = + fun (potentiel_plus_age_3773_ : _) -> potentiel_plus_age_3773_.age + in + Array.fold_left + (fun (acc_3774_ : _) (item_3775_ : _) -> + if predicate_3772_ acc_3774_ >! predicate_3772_ item_3775_ then acc_3774_ + else item_3775_) + { + identifiant = ~-!(integer_of_string "1"); + obligation_scolaire = Pendant (); + remuneration_mensuelle = money_of_cents_string "0"; + date_de_naissance = date_of_numbers 1900 1 1; + age = integer_of_string "0"; + prise_en_charge = EffectiveEtPermanente (); + a_deja_ouvert_droit_aux_allocations_familiales = false; + } + enfants_3766_) with EmptyError -> raise EmptyError) with EmptyError -> raise @@ -905,33 +941,54 @@ let enfant_le_plus_age_1386 (enfant_le_plus_age_in_3251 : enfant_le_plus_age_in) law_headings = [ "Prologue" ]; })) in - { enfants_out = enfants_3254_; le_plus_age_out = le_plus_age_3255_ } + { enfants_out = enfants_3766_; le_plus_age_out = le_plus_age_3769_ } -let prestations_familiales_1405 (prestations_familiales_in_3260 : prestations_familiales_in) = - let droit_ouvert_3261_ : unit -> enfant -> bool = - prestations_familiales_in_3260.droit_ouvert_in - in - let conditions_hors_age_3262_ : unit -> enfant -> bool = - prestations_familiales_in_3260.conditions_hors_age_in - in - let plafond_l512_3_2_3263_ : unit -> money = prestations_familiales_in_3260.plafond_l512_3_2_in in - let age_l512_3_2_3264_ : unit -> integer = prestations_familiales_in_3260.age_l512_3_2_in in - let regime_outre_mer_l751_1_3265_ : unit -> bool = - prestations_familiales_in_3260.regime_outre_mer_l751_1_in - in - let date_courante_3266_ : unit -> date = prestations_familiales_in_3260.date_courante_in in - let prestation_courante_3267_ : unit -> element_prestations_familiales = - prestations_familiales_in_3260.prestation_courante_in - in - let residence_3268_ : unit -> collectivite = prestations_familiales_in_3260.residence_in in - let base_mensuelle_3269_ : unit -> money = prestations_familiales_in_3260.base_mensuelle_in in - let age_l512_3_2_3270_ : integer = +let prestations_familiales (prestations_familiales_in : prestations_familiales_in) = + let droit_ouvert_3777_ : unit -> enfant -> bool = prestations_familiales_in.droit_ouvert_in in + let conditions_hors_age_3778_ : unit -> enfant -> bool = + prestations_familiales_in.conditions_hors_age_in + in + let plafond_l512_3_2_3779_ : unit -> money = prestations_familiales_in.plafond_l512_3_2_in in + let age_l512_3_2_3780_ : unit -> integer = prestations_familiales_in.age_l512_3_2_in in + let regime_outre_mer_l751_1_3781_ : unit -> bool = + prestations_familiales_in.regime_outre_mer_l751_1_in + in + let date_courante_3782_ : unit -> date = prestations_familiales_in.date_courante_in in + let prestation_courante_3783_ : unit -> element_prestations_familiales = + prestations_familiales_in.prestation_courante_in + in + let residence_3784_ : unit -> collectivite = prestations_familiales_in.residence_in in + let base_mensuelle_3785_ : unit -> money = prestations_familiales_in.base_mensuelle_in in + let age_l512_3_2_3786_ : integer = log_variable_definition [ "PrestationsFamiliales"; "âge_l512_3_2" ] embed_integer (try - try age_l512_3_2_3264_ () - with EmptyError -> ( try integer_of_string "20" with EmptyError -> raise EmptyError) + try age_l512_3_2_3780_ () + with EmptyError -> ( + try + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_R.catala_fr"; + start_line = 21; + start_column = 14; + end_line = 21; + end_column = 26; + law_headings = + [ + "Article R512-2"; + "Chapitre 2 : Champ d'application."; + "Titre 1 : Champ d'application - Généralités"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets en Conseil d'Etat"; + "Code de la sécurité sociale"; + ]; + } + true) + (fun (_ : _) -> integer_of_string "20") + with EmptyError -> raise EmptyError) with EmptyError -> raise (NoValueProvided @@ -944,26 +1001,26 @@ let prestations_familiales_1405 (prestations_familiales_in_3260 : prestations_fa law_headings = [ "Prologue" ]; })) in - let date_courante_3271_ : date = + let date_courante_3789_ : date = log_variable_definition [ "PrestationsFamiliales"; "date_courante" ] embed_date (try - try date_courante_3266_ () + try date_courante_3782_ () with EmptyError -> - if - log_decision_taken - { - filename = ""; - start_line = 0; - start_column = 1; - end_line = 0; - end_column = 1; - law_headings = []; - } - false - then raise EmptyError - else raise EmptyError + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = ""; + start_line = 0; + start_column = 1; + end_line = 0; + end_column = 1; + law_headings = []; + } + false) + (fun (_ : _) -> raise EmptyError) with EmptyError -> raise (NoValueProvided @@ -976,26 +1033,26 @@ let prestations_familiales_1405 (prestations_familiales_in_3260 : prestations_fa law_headings = [ "Prologue" ]; })) in - let prestation_courante_3272_ : element_prestations_familiales = + let prestation_courante_3792_ : element_prestations_familiales = log_variable_definition [ "PrestationsFamiliales"; "prestation_courante" ] embed_element_prestations_familiales (try - try prestation_courante_3267_ () + try prestation_courante_3783_ () with EmptyError -> - if - log_decision_taken - { - filename = ""; - start_line = 0; - start_column = 1; - end_line = 0; - end_column = 1; - law_headings = []; - } - false - then raise EmptyError - else raise EmptyError + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = ""; + start_line = 0; + start_column = 1; + end_line = 0; + end_column = 1; + law_headings = []; + } + false) + (fun (_ : _) -> raise EmptyError) with EmptyError -> raise (NoValueProvided @@ -1008,26 +1065,26 @@ let prestations_familiales_1405 (prestations_familiales_in_3260 : prestations_fa law_headings = [ "Prologue" ]; })) in - let residence_3273_ : collectivite = + let residence_3795_ : collectivite = log_variable_definition [ "PrestationsFamiliales"; "résidence" ] embed_collectivite (try - try residence_3268_ () + try residence_3784_ () with EmptyError -> - if - log_decision_taken - { - filename = ""; - start_line = 0; - start_column = 1; - end_line = 0; - end_column = 1; - law_headings = []; - } - false - then raise EmptyError - else raise EmptyError + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = ""; + start_line = 0; + start_column = 1; + end_line = 0; + end_column = 1; + law_headings = []; + } + false) + (fun (_ : _) -> raise EmptyError) with EmptyError -> raise (NoValueProvided @@ -1040,87 +1097,87 @@ let prestations_familiales_1405 (prestations_familiales_in_3260 : prestations_fa law_headings = [ "Prologue" ]; })) in - let base_mensuelle_3274_ : money = + let base_mensuelle_3798_ : money = log_variable_definition [ "PrestationsFamiliales"; "base_mensuelle" ] embed_money (try - try base_mensuelle_3269_ () + try base_mensuelle_3785_ () with EmptyError -> - handle_default_1_ + handle_default [| - (fun (__3275_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 60; - start_column = 5; - end_line = 61; - end_column = 34; - law_headings = - [ - "Instruction interministérielle n°DSS/2B/2021/65 du 19 mars 2021 \ - relative à la revalorisation au 1er avril 2021 des prestations \ - familiales servies en métropole, en Guadeloupe, en Guyane, en \ - Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et dans \ - le département de Mayotte"; - "Montant de la base mensuelle des allocations familiales"; - "Décrets divers"; - ]; - } - (date_courante_3271_ >=@ date_of_numbers 2021 4 1 - && date_courante_3271_ <@ date_of_numbers 2022 4 1) - then money_of_cents_string "41481" - else raise EmptyError); - (fun (__3276_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 44; - start_column = 5; - end_line = 45; - end_column = 34; - law_headings = - [ - "Instruction interministérielle no DSS/SD2B/2020/33 du 18 février 2020 \ - relative à la revalorisation au 1er avril 2020 des prestations \ - familiales servies en métropole, en Guadeloupe, en Guyane, en \ - Martinique, à La Réunion, à Saint-Barthélemy, à Saint-Martin et dans \ - le département de Mayotte"; - "Montant de la base mensuelle des allocations familiales"; - "Décrets divers"; - ]; - } - (date_courante_3271_ >=@ date_of_numbers 2020 4 1 - && date_courante_3271_ <@ date_of_numbers 2021 4 1) - then money_of_cents_string "41404" - else raise EmptyError); - (fun (__3277_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 24; - start_column = 5; - end_line = 25; - end_column = 34; - law_headings = - [ - "Instruction ministérielle N°DSS/SD2B/2019/65 du 25 mars 2019 relative \ - à la revalorisation au 1er avril 2019 des prestations familiales \ - servies en métropole"; - "Montant de la base mensuelle des allocations familiales"; - "Décrets divers"; - ]; - } - (date_courante_3271_ >=@ date_of_numbers 2019 4 1 - && date_courante_3271_ <@ date_of_numbers 2020 4 1) - then money_of_cents_string "41316" - else raise EmptyError); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 60; + start_column = 5; + end_line = 61; + end_column = 34; + law_headings = + [ + "Instruction interministérielle n°DSS/2B/2021/65 du 19 mars 2021 \ + relative à la revalorisation au 1er avril 2021 des prestations \ + familiales servies en métropole, en Guadeloupe, en Guyane, en \ + Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et dans \ + le département de Mayotte"; + "Montant de la base mensuelle des allocations familiales"; + "Décrets divers"; + ]; + } + (date_courante_3789_ >=@ date_of_numbers 2021 4 1 + && date_courante_3789_ <@ date_of_numbers 2022 4 1)) + (fun (_ : _) -> money_of_cents_string "41481")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 44; + start_column = 5; + end_line = 45; + end_column = 34; + law_headings = + [ + "Instruction interministérielle no DSS/SD2B/2020/33 du 18 février \ + 2020 relative à la revalorisation au 1er avril 2020 des prestations \ + familiales servies en métropole, en Guadeloupe, en Guyane, en \ + Martinique, à La Réunion, à Saint-Barthélemy, à Saint-Martin et dans \ + le département de Mayotte"; + "Montant de la base mensuelle des allocations familiales"; + "Décrets divers"; + ]; + } + (date_courante_3789_ >=@ date_of_numbers 2020 4 1 + && date_courante_3789_ <@ date_of_numbers 2021 4 1)) + (fun (_ : _) -> money_of_cents_string "41404")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 24; + start_column = 5; + end_line = 25; + end_column = 34; + law_headings = + [ + "Instruction ministérielle N°DSS/SD2B/2019/65 du 25 mars 2019 \ + relative à la revalorisation au 1er avril 2019 des prestations \ + familiales servies en métropole"; + "Montant de la base mensuelle des allocations familiales"; + "Décrets divers"; + ]; + } + (date_courante_3789_ >=@ date_of_numbers 2019 4 1 + && date_courante_3789_ <@ date_of_numbers 2020 4 1)) + (fun (_ : _) -> money_of_cents_string "41316")); |] - (fun (__3278_ : _) -> + (fun (_ : _) -> log_decision_taken { filename = ""; @@ -1131,7 +1188,7 @@ let prestations_familiales_1405 (prestations_familiales_in_3260 : prestations_fa law_headings = []; } false) - (fun (__3279_ : _) -> raise EmptyError) + (fun (_ : _) -> raise EmptyError) with EmptyError -> raise (NoValueProvided @@ -1144,68 +1201,96 @@ let prestations_familiales_1405 (prestations_familiales_in_3260 : prestations_fa law_headings = [ "Prologue" ]; })) in - let smic_dot_date_courante_3280_ : unit -> date = - fun (__3281_ : unit) -> + let smic_dot_date_courante_3810_ : unit -> date = + fun (_ : unit) -> log_variable_definition [ "PrestationsFamiliales"; "smic.date_courante" ] embed_date - (try date_courante_3271_ with EmptyError -> raise EmptyError) + (try + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./prologue.catala_fr"; + start_line = 78; + start_column = 14; + end_line = 78; + end_column = 32; + law_headings = [ "Prologue" ]; + } + true) + (fun (_ : _) -> date_courante_3789_) + with EmptyError -> raise EmptyError) in - let smic_dot_residence_3282_ : unit -> collectivite = - fun (__3283_ : unit) -> + let smic_dot_residence_3814_ : unit -> collectivite = + fun (_ : unit) -> log_variable_definition [ "PrestationsFamiliales"; "smic.résidence" ] embed_collectivite - (try residence_3273_ with EmptyError -> raise EmptyError) + (try + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./prologue.catala_fr"; + start_line = 77; + start_column = 14; + end_line = 77; + end_column = 28; + law_headings = [ "Prologue" ]; + } + true) + (fun (_ : _) -> residence_3795_) + with EmptyError -> raise EmptyError) in - let result_3284_ : smic_out = + let result_3818_ : smic_out = log_end_call [ "PrestationsFamiliales"; "smic"; "Smic" ] (log_begin_call [ "PrestationsFamiliales"; "smic"; "Smic" ] - smic_1356 + smic { - date_courante_in = smic_dot_date_courante_3280_; - residence_in = smic_dot_residence_3282_; - brut_horaire_in = (fun (__3285_ : unit) -> raise EmptyError); + date_courante_in = smic_dot_date_courante_3810_; + residence_in = smic_dot_residence_3814_; + brut_horaire_in = (fun (_ : unit) -> raise EmptyError); }) in - let smic_dot_date_courante_3286_ : date = result_3284_.date_courante_out in - let smic_dot_residence_3287_ : collectivite = result_3284_.residence_out in - let smic_dot_brut_horaire_3288_ : money = result_3284_.brut_horaire_out in - let regime_outre_mer_l751_1_3289_ : bool = + let smic_dot_date_courante_3820_ : date = result_3818_.date_courante_out in + let smic_dot_residence_3821_ : collectivite = result_3818_.residence_out in + let smic_dot_brut_horaire_3822_ : money = result_3818_.brut_horaire_out in + let regime_outre_mer_l751_1_3823_ : bool = log_variable_definition [ "PrestationsFamiliales"; "régime_outre_mer_l751_1" ] embed_bool (try - try regime_outre_mer_l751_1_3265_ () + try regime_outre_mer_l751_1_3781_ () with EmptyError -> ( try - if - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 354; - start_column = 5; - end_line = 359; - end_column = 30; - law_headings = - [ - "Article L751-1"; - "Chapitre 1er : Généralités"; - "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la \ - Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin"; - "Livre 7 : Régimes divers - Dispositions diverses"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (residence_3273_ = Guadeloupe () || residence_3273_ = Guyane () - || residence_3273_ = Martinique () || residence_3273_ = LaReunion () - || residence_3273_ = SaintBarthelemy () - || residence_3273_ = SaintMartin ()) - then true - else raise EmptyError + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_L.catala_fr"; + start_line = 354; + start_column = 5; + end_line = 359; + end_column = 30; + law_headings = + [ + "Article L751-1"; + "Chapitre 1er : Généralités"; + "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la \ + Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin"; + "Livre 7 : Régimes divers - Dispositions diverses"; + "Partie législative"; + "Code de la sécurité sociale"; + ]; + } + (residence_3795_ = Guadeloupe () || residence_3795_ = Guyane () + || residence_3795_ = Martinique () || residence_3795_ = LaReunion () + || residence_3795_ = SaintBarthelemy () + || residence_3795_ = SaintMartin ())) + (fun (_ : _) -> true) with EmptyError -> false) with EmptyError -> raise @@ -1219,39 +1304,40 @@ let prestations_familiales_1405 (prestations_familiales_in_3260 : prestations_fa law_headings = [ "Prologue" ]; })) in - let plafond_l512_3_2_3290_ : money = + let plafond_l512_3_2_3826_ : money = log_variable_definition [ "PrestationsFamiliales"; "plafond_l512_3_2" ] embed_money (try - try plafond_l512_3_2_3263_ () + try plafond_l512_3_2_3779_ () with EmptyError -> ( try try - if - log_decision_taken - { - filename = "./securite_sociale_R.catala_fr"; - start_line = 216; - start_column = 18; - end_line = 216; - end_column = 41; - law_headings = - [ - "Article R755-0-2"; - "Chapitre 5 : Prestations familiales et prestations assimilées"; - "Titre 5 : Départements d'outre-mer"; - "Livre 7 : Régimes divers - Dispositions diverses"; - "Partie réglementaire - Décrets en Conseil d'Etat"; - "Code de la sécurité sociale"; - ]; - } - regime_outre_mer_l751_1_3289_ - then - smic_dot_brut_horaire_3288_ *$ decimal_of_string "0.55" *$ decimal_of_string "169." - else raise EmptyError + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_R.catala_fr"; + start_line = 216; + start_column = 18; + end_line = 216; + end_column = 41; + law_headings = + [ + "Article R755-0-2"; + "Chapitre 5 : Prestations familiales et prestations assimilées"; + "Titre 5 : Départements d'outre-mer"; + "Livre 7 : Régimes divers - Dispositions diverses"; + "Partie réglementaire - Décrets en Conseil d'Etat"; + "Code de la sécurité sociale"; + ]; + } + regime_outre_mer_l751_1_3823_) + (fun (_ : _) -> + smic_dot_brut_horaire_3822_ *$ decimal_of_string "0.55" + *$ decimal_of_string "169.") with EmptyError -> - smic_dot_brut_horaire_3288_ *$ decimal_of_string "0.55" *$ decimal_of_string "169." + smic_dot_brut_horaire_3822_ *$ decimal_of_string "0.55" *$ decimal_of_string "169." with EmptyError -> raise EmptyError) with EmptyError -> raise @@ -1265,49 +1351,50 @@ let prestations_familiales_1405 (prestations_familiales_in_3260 : prestations_fa law_headings = [ "Prologue" ]; })) in - let conditions_hors_age_3291_ : enfant -> bool = + let conditions_hors_age_3829_ : enfant -> bool = log_variable_definition [ "PrestationsFamiliales"; "conditions_hors_âge" ] unembeddable (try - try conditions_hors_age_3262_ () + try conditions_hors_age_3778_ () with EmptyError -> ( - fun (param_3292_ : enfant) -> + fun (param_3830_ : enfant) -> try try - if - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 68; - start_column = 5; - end_line = 71; - end_column = 57; - law_headings = - [ - "Article L512-3"; - "Chapitre 2 : Champ d'application"; - "Titre 1 : Champ d'application - Généralités"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - ((match param_3292_.obligation_scolaire with - | Avant __3293_ -> true - | Pendant __3294_ -> false - | Apres __3295_ -> false) - || (match param_3292_.obligation_scolaire with - | Avant __3296_ -> false - | Pendant __3297_ -> true - | Apres __3298_ -> false) - || (match param_3292_.obligation_scolaire with - | Avant __3299_ -> false - | Pendant __3300_ -> false - | Apres __3301_ -> true) - && param_3292_.remuneration_mensuelle <=$ plafond_l512_3_2_3290_) - then true - else raise EmptyError + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_L.catala_fr"; + start_line = 68; + start_column = 5; + end_line = 71; + end_column = 57; + law_headings = + [ + "Article L512-3"; + "Chapitre 2 : Champ d'application"; + "Titre 1 : Champ d'application - Généralités"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"; + ]; + } + (((match param_3830_.obligation_scolaire with + | Avant _ -> true + | Pendant _ -> false + | Apres _ -> false) + || (match param_3830_.obligation_scolaire with + | Avant _ -> false + | Pendant _ -> true + | Apres _ -> false) + || + match param_3830_.obligation_scolaire with + | Avant _ -> false + | Pendant _ -> false + | Apres _ -> true) + && param_3830_.remuneration_mensuelle <=$ plafond_l512_3_2_3826_)) + (fun (_ : _) -> true) with EmptyError -> false with EmptyError -> raise @@ -1332,76 +1419,76 @@ let prestations_familiales_1405 (prestations_familiales_in_3260 : prestations_fa law_headings = [ "Prologue" ]; })) in - let droit_ouvert_3302_ : enfant -> bool = + let droit_ouvert_3842_ : enfant -> bool = log_variable_definition [ "PrestationsFamiliales"; "droit_ouvert" ] unembeddable (try - try droit_ouvert_3261_ () + try droit_ouvert_3777_ () with EmptyError -> ( - fun (param_3303_ : enfant) -> + fun (param_3843_ : enfant) -> try - handle_default_1_ + handle_default [| - (fun (__3304_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 60; - start_column = 5; - end_line = 62; - end_column = 32; - law_headings = - [ - "Article L512-3"; - "Chapitre 2 : Champ d'application"; - "Titre 1 : Champ d'application - Généralités"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - ((match param_3303_.obligation_scolaire with - | Avant __3305_ -> false - | Pendant __3306_ -> false - | Apres __3307_ -> true) - && param_3303_.remuneration_mensuelle <=$ plafond_l512_3_2_3290_ - && param_3303_.age - if - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 49; - start_column = 5; - end_line = 50; - end_column = 50; - law_headings = - [ - "Article L512-3"; - "Chapitre 2 : Champ d'application"; - "Titre 1 : Champ d'application - Généralités"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - ((match param_3303_.obligation_scolaire with - | Avant __3309_ -> true - | Pendant __3310_ -> false - | Apres __3311_ -> false) - || - match param_3303_.obligation_scolaire with - | Avant __3312_ -> false - | Pendant __3313_ -> true - | Apres __3314_ -> false) - then true - else raise EmptyError); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_L.catala_fr"; + start_line = 60; + start_column = 5; + end_line = 62; + end_column = 32; + law_headings = + [ + "Article L512-3"; + "Chapitre 2 : Champ d'application"; + "Titre 1 : Champ d'application - Généralités"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"; + ]; + } + ((match param_3843_.obligation_scolaire with + | Avant _ -> false + | Pendant _ -> false + | Apres _ -> true) + && param_3843_.remuneration_mensuelle <=$ plafond_l512_3_2_3826_ + && param_3843_.age true)); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_L.catala_fr"; + start_line = 49; + start_column = 5; + end_line = 50; + end_column = 50; + law_headings = + [ + "Article L512-3"; + "Chapitre 2 : Champ d'application"; + "Titre 1 : Champ d'application - Généralités"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"; + ]; + } + ((match param_3843_.obligation_scolaire with + | Avant _ -> true + | Pendant _ -> false + | Apres _ -> false) + || + match param_3843_.obligation_scolaire with + | Avant _ -> false + | Pendant _ -> true + | Apres _ -> false)) + (fun (_ : _) -> true)); |] - (fun (__3315_ : _) -> + (fun (_ : _) -> log_decision_taken { filename = ""; @@ -1412,7 +1499,7 @@ let prestations_familiales_1405 (prestations_familiales_in_3260 : prestations_fa law_headings = []; } true) - (fun (__3316_ : _) -> false) + (fun (_ : _) -> false) with EmptyError -> raise (NoValueProvided @@ -1437,164 +1524,154 @@ let prestations_familiales_1405 (prestations_familiales_in_3260 : prestations_fa })) in { - droit_ouvert_out = droit_ouvert_3302_; - conditions_hors_age_out = conditions_hors_age_3291_; - plafond_l512_3_2_out = plafond_l512_3_2_3290_; - age_l512_3_2_out = age_l512_3_2_3270_; - regime_outre_mer_l751_1_out = regime_outre_mer_l751_1_3289_; - date_courante_out = date_courante_3271_; - prestation_courante_out = prestation_courante_3272_; - residence_out = residence_3273_; - base_mensuelle_out = base_mensuelle_3274_; + droit_ouvert_out = droit_ouvert_3842_; + conditions_hors_age_out = conditions_hors_age_3829_; + plafond_l512_3_2_out = plafond_l512_3_2_3826_; + age_l512_3_2_out = age_l512_3_2_3786_; + regime_outre_mer_l751_1_out = regime_outre_mer_l751_1_3823_; + date_courante_out = date_courante_3789_; + prestation_courante_out = prestation_courante_3792_; + residence_out = residence_3795_; + base_mensuelle_out = base_mensuelle_3798_; } -let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_familiales_in) = - let personne_charge_effective_permanente_est_parent_3318_ : unit -> bool = - allocations_familiales_in_3317.personne_charge_effective_permanente_est_parent_in - in - let personne_charge_effective_permanente_remplit_titre__i_3319_ : unit -> bool = - allocations_familiales_in_3317.personne_charge_effective_permanente_remplit_titre_I_in - in - let ressources_menage_3320_ : unit -> money = - allocations_familiales_in_3317.ressources_menage_in +let allocations_familiales (allocations_familiales_in : allocations_familiales_in) = + let personne_charge_effective_permanente_est_parent_3862_ : unit -> bool = + allocations_familiales_in.personne_charge_effective_permanente_est_parent_in in - let residence_3321_ : unit -> collectivite = allocations_familiales_in_3317.residence_in in - let date_courante_3322_ : unit -> date = allocations_familiales_in_3317.date_courante_in in - let enfants_a_charge_3323_ : unit -> enfant array = - allocations_familiales_in_3317.enfants_a_charge_in + let personne_charge_effective_permanente_remplit_titre__i_3863_ : unit -> bool = + allocations_familiales_in.personne_charge_effective_permanente_remplit_titre_I_in in - let enfants_a_charge_droit_ouvert_prestation_familiale_3324_ : unit -> enfant array = - allocations_familiales_in_3317.enfants_a_charge_droit_ouvert_prestation_familiale_in + let ressources_menage_3864_ : unit -> money = allocations_familiales_in.ressources_menage_in in + let residence_3865_ : unit -> collectivite = allocations_familiales_in.residence_in in + let date_courante_3866_ : unit -> date = allocations_familiales_in.date_courante_in in + let enfants_a_charge_3867_ : unit -> enfant array = + allocations_familiales_in.enfants_a_charge_in in - let prise_en_compte_3325_ : unit -> enfant -> prise_en_compte = - allocations_familiales_in_3317.prise_en_compte_in + let enfants_a_charge_droit_ouvert_prestation_familiale_3868_ : unit -> enfant array = + allocations_familiales_in.enfants_a_charge_droit_ouvert_prestation_familiale_in in - let versement_3326_ : unit -> enfant -> versement_allocations = - allocations_familiales_in_3317.versement_in + let prise_en_compte_3869_ : unit -> enfant -> prise_en_compte = + allocations_familiales_in.prise_en_compte_in in - let montant_verse_3327_ : unit -> money = allocations_familiales_in_3317.montant_verse_in in - let droit_ouvert_base_3328_ : unit -> bool = - allocations_familiales_in_3317.droit_ouvert_base_in + let versement_3870_ : unit -> enfant -> versement_allocations = + allocations_familiales_in.versement_in in - let montant_initial_base_3329_ : unit -> money = - allocations_familiales_in_3317.montant_initial_base_in + let montant_verse_3871_ : unit -> money = allocations_familiales_in.montant_verse_in in + let droit_ouvert_base_3872_ : unit -> bool = allocations_familiales_in.droit_ouvert_base_in in + let montant_initial_base_3873_ : unit -> money = + allocations_familiales_in.montant_initial_base_in in - let montant_initial_base_premier_enfant_3330_ : unit -> money = - allocations_familiales_in_3317.montant_initial_base_premier_enfant_in + let montant_initial_base_premier_enfant_3874_ : unit -> money = + allocations_familiales_in.montant_initial_base_premier_enfant_in in - let montant_initial_base_deuxieme_enfant_3331_ : unit -> money = - allocations_familiales_in_3317.montant_initial_base_deuxieme_enfant_in + let montant_initial_base_deuxieme_enfant_3875_ : unit -> money = + allocations_familiales_in.montant_initial_base_deuxieme_enfant_in in - let montant_initial_base_troisieme_enfant_et_plus_3332_ : unit -> money = - allocations_familiales_in_3317.montant_initial_base_troisieme_enfant_et_plus_in + let montant_initial_base_troisieme_enfant_et_plus_3876_ : unit -> money = + allocations_familiales_in.montant_initial_base_troisieme_enfant_et_plus_in in - let rapport_enfants_total_moyen_3333_ : unit -> decimal = - allocations_familiales_in_3317.rapport_enfants_total_moyen_in + let rapport_enfants_total_moyen_3877_ : unit -> decimal = + allocations_familiales_in.rapport_enfants_total_moyen_in in - let nombre_moyen_enfants_3334_ : unit -> decimal = - allocations_familiales_in_3317.nombre_moyen_enfants_in + let nombre_moyen_enfants_3878_ : unit -> decimal = + allocations_familiales_in.nombre_moyen_enfants_in in - let nombre_total_enfants_3335_ : unit -> decimal = - allocations_familiales_in_3317.nombre_total_enfants_in + let nombre_total_enfants_3879_ : unit -> decimal = + allocations_familiales_in.nombre_total_enfants_in in - let montant_avec_garde_alternee_base_3336_ : unit -> money = - allocations_familiales_in_3317.montant_avec_garde_alternee_base_in + let montant_avec_garde_alternee_base_3880_ : unit -> money = + allocations_familiales_in.montant_avec_garde_alternee_base_in in - let montant_verse_base_3337_ : unit -> money = - allocations_familiales_in_3317.montant_verse_base_in + let montant_verse_base_3881_ : unit -> money = allocations_familiales_in.montant_verse_base_in in + let avait_enfant_a_charge_avant_1er_janvier_2012_3882_ : unit -> bool = + allocations_familiales_in.avait_enfant_a_charge_avant_1er_janvier_2012_in in - let avait_enfant_a_charge_avant_1er_janvier_2012_3338_ : unit -> bool = - allocations_familiales_in_3317.avait_enfant_a_charge_avant_1er_janvier_2012_in + let montant_initial_base_premier_enfant_mayotte_3883_ : unit -> money = + allocations_familiales_in.montant_initial_base_premier_enfant_mayotte_in in - let montant_initial_base_premier_enfant_mayotte_3339_ : unit -> money = - allocations_familiales_in_3317.montant_initial_base_premier_enfant_mayotte_in + let montant_initial_base_deuxieme_enfant_mayotte_3884_ : unit -> money = + allocations_familiales_in.montant_initial_base_deuxieme_enfant_mayotte_in in - let montant_initial_base_deuxieme_enfant_mayotte_3340_ : unit -> money = - allocations_familiales_in_3317.montant_initial_base_deuxieme_enfant_mayotte_in + let montant_initial_base_troisieme_enfant_mayotte_3885_ : unit -> money = + allocations_familiales_in.montant_initial_base_troisieme_enfant_mayotte_in in - let montant_initial_base_troisieme_enfant_mayotte_3341_ : unit -> money = - allocations_familiales_in_3317.montant_initial_base_troisieme_enfant_mayotte_in + let montant_initial_base_quatrieme_enfant_et_plus_mayotte_3886_ : unit -> money = + allocations_familiales_in.montant_initial_base_quatrieme_enfant_et_plus_mayotte_in in - let montant_initial_base_quatrieme_enfant_et_plus_mayotte_3342_ : unit -> money = - allocations_familiales_in_3317.montant_initial_base_quatrieme_enfant_et_plus_mayotte_in + let droit_ouvert_forfaitaire_3887_ : unit -> enfant -> bool = + allocations_familiales_in.droit_ouvert_forfaitaire_in in - let droit_ouvert_forfaitaire_3343_ : unit -> enfant -> bool = - allocations_familiales_in_3317.droit_ouvert_forfaitaire_in + let montant_verse_forfaitaire_par_enfant_3888_ : unit -> money = + allocations_familiales_in.montant_verse_forfaitaire_par_enfant_in in - let montant_verse_forfaitaire_par_enfant_3344_ : unit -> money = - allocations_familiales_in_3317.montant_verse_forfaitaire_par_enfant_in + let montant_verse_forfaitaire_3889_ : unit -> money = + allocations_familiales_in.montant_verse_forfaitaire_in in - let montant_verse_forfaitaire_3345_ : unit -> money = - allocations_familiales_in_3317.montant_verse_forfaitaire_in + let droit_ouvert_majoration_3890_ : unit -> enfant -> bool = + allocations_familiales_in.droit_ouvert_majoration_in in - let droit_ouvert_majoration_3346_ : unit -> enfant -> bool = - allocations_familiales_in_3317.droit_ouvert_majoration_in + let montant_initial_metropole_majoration_3891_ : unit -> enfant -> money = + allocations_familiales_in.montant_initial_metropole_majoration_in in - let montant_initial_metropole_majoration_3347_ : unit -> enfant -> money = - allocations_familiales_in_3317.montant_initial_metropole_majoration_in + let montant_initial_majoration_3892_ : unit -> enfant -> money = + allocations_familiales_in.montant_initial_majoration_in in - let montant_initial_majoration_3348_ : unit -> enfant -> money = - allocations_familiales_in_3317.montant_initial_majoration_in + let montant_avec_garde_alternee_majoration_3893_ : unit -> enfant -> money = + allocations_familiales_in.montant_avec_garde_alternee_majoration_in in - let montant_avec_garde_alternee_majoration_3349_ : unit -> enfant -> money = - allocations_familiales_in_3317.montant_avec_garde_alternee_majoration_in + let montant_verse_majoration_3894_ : unit -> money = + allocations_familiales_in.montant_verse_majoration_in in - let montant_verse_majoration_3350_ : unit -> money = - allocations_familiales_in_3317.montant_verse_majoration_in + let droit_ouvert_complement_3895_ : unit -> bool = + allocations_familiales_in.droit_ouvert_complement_in in - let droit_ouvert_complement_3351_ : unit -> bool = - allocations_familiales_in_3317.droit_ouvert_complement_in + let montant_base_complement_pour_base_et_majoration_3896_ : unit -> money = + allocations_familiales_in.montant_base_complement_pour_base_et_majoration_in in - let montant_base_complement_pour_base_et_majoration_3352_ : unit -> money = - allocations_familiales_in_3317.montant_base_complement_pour_base_et_majoration_in + let complement_degressif_3897_ : unit -> money -> money = + allocations_familiales_in.complement_degressif_in in - let complement_degressif_3353_ : unit -> money -> money = - allocations_familiales_in_3317.complement_degressif_in + let montant_verse_complement_pour_base_et_majoration_3898_ : unit -> money = + allocations_familiales_in.montant_verse_complement_pour_base_et_majoration_in in - let montant_verse_complement_pour_base_et_majoration_3354_ : unit -> money = - allocations_familiales_in_3317.montant_verse_complement_pour_base_et_majoration_in + let montant_verse_complement_pour_forfaitaire_3899_ : unit -> money = + allocations_familiales_in.montant_verse_complement_pour_forfaitaire_in in - let montant_verse_complement_pour_forfaitaire_3355_ : unit -> money = - allocations_familiales_in_3317.montant_verse_complement_pour_forfaitaire_in + let nombre_enfants_l521_1_3900_ : unit -> integer = + allocations_familiales_in.nombre_enfants_l521_1_in in - let nombre_enfants_l521_1_3356_ : unit -> integer = - allocations_familiales_in_3317.nombre_enfants_l521_1_in + let age_minimum_alinea_1_l521_3_3901_ : unit -> enfant -> integer = + allocations_familiales_in.age_minimum_alinea_1_l521_3_in in - let age_minimum_alinea_1_l521_3_3357_ : unit -> enfant -> integer = - allocations_familiales_in_3317.age_minimum_alinea_1_l521_3_in + let nombre_enfants_alinea_2_l521_3_3902_ : unit -> integer = + allocations_familiales_in.nombre_enfants_alinea_2_l521_3_in in - let nombre_enfants_alinea_2_l521_3_3358_ : unit -> integer = - allocations_familiales_in_3317.nombre_enfants_alinea_2_l521_3_in + let est_enfant_le_plus_age_3903_ : unit -> enfant -> bool = + allocations_familiales_in.est_enfant_le_plus_age_in in - let est_enfant_le_plus_age_3359_ : unit -> enfant -> bool = - allocations_familiales_in_3317.est_enfant_le_plus_age_in - in - let plafond__i_d521_3_3360_ : unit -> money = - allocations_familiales_in_3317.plafond_I_d521_3_in - in - let plafond__i_i_d521_3_3361_ : unit -> money = - allocations_familiales_in_3317.plafond_II_d521_3_in - in - let personne_charge_effective_permanente_est_parent_3362_ : bool = + let plafond__i_d521_3_3904_ : unit -> money = allocations_familiales_in.plafond_I_d521_3_in in + let plafond__i_i_d521_3_3905_ : unit -> money = allocations_familiales_in.plafond_II_d521_3_in in + let personne_charge_effective_permanente_est_parent_3906_ : bool = log_variable_definition [ "AllocationsFamiliales"; "personne_charge_effective_permanente_est_parent" ] embed_bool (try - try personne_charge_effective_permanente_est_parent_3318_ () + try personne_charge_effective_permanente_est_parent_3862_ () with EmptyError -> - if - log_decision_taken - { - filename = ""; - start_line = 0; - start_column = 1; - end_line = 0; - end_column = 1; - law_headings = []; - } - true - then false - else raise EmptyError + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = ""; + start_line = 0; + start_column = 1; + end_line = 0; + end_column = 1; + law_headings = []; + } + true) + (fun (_ : _) -> false) with EmptyError -> raise (NoValueProvided @@ -1607,26 +1684,26 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = [ "Prologue" ]; })) in - let personne_charge_effective_permanente_remplit_titre__i_3363_ : bool = + let personne_charge_effective_permanente_remplit_titre__i_3909_ : bool = log_variable_definition [ "AllocationsFamiliales"; "personne_charge_effective_permanente_remplit_titre_I" ] embed_bool (try - try personne_charge_effective_permanente_remplit_titre__i_3319_ () + try personne_charge_effective_permanente_remplit_titre__i_3863_ () with EmptyError -> - if - log_decision_taken - { - filename = ""; - start_line = 0; - start_column = 1; - end_line = 0; - end_column = 1; - law_headings = []; - } - true - then false - else raise EmptyError + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = ""; + start_line = 0; + start_column = 1; + end_line = 0; + end_column = 1; + law_headings = []; + } + true) + (fun (_ : _) -> false) with EmptyError -> raise (NoValueProvided @@ -1639,26 +1716,26 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = [ "Prologue" ]; })) in - let ressources_menage_3364_ : money = + let ressources_menage_3912_ : money = log_variable_definition [ "AllocationsFamiliales"; "ressources_ménage" ] embed_money (try - try ressources_menage_3320_ () + try ressources_menage_3864_ () with EmptyError -> - if - log_decision_taken - { - filename = ""; - start_line = 0; - start_column = 1; - end_line = 0; - end_column = 1; - law_headings = []; - } - false - then raise EmptyError - else raise EmptyError + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = ""; + start_line = 0; + start_column = 1; + end_line = 0; + end_column = 1; + law_headings = []; + } + false) + (fun (_ : _) -> raise EmptyError) with EmptyError -> raise (NoValueProvided @@ -1671,26 +1748,26 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = [ "Prologue" ]; })) in - let residence_3365_ : collectivite = + let residence_3915_ : collectivite = log_variable_definition [ "AllocationsFamiliales"; "résidence" ] embed_collectivite (try - try residence_3321_ () + try residence_3865_ () with EmptyError -> - if - log_decision_taken - { - filename = ""; - start_line = 0; - start_column = 1; - end_line = 0; - end_column = 1; - law_headings = []; - } - false - then raise EmptyError - else raise EmptyError + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = ""; + start_line = 0; + start_column = 1; + end_line = 0; + end_column = 1; + law_headings = []; + } + false) + (fun (_ : _) -> raise EmptyError) with EmptyError -> raise (NoValueProvided @@ -1703,26 +1780,26 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = [ "Prologue" ]; })) in - let date_courante_3366_ : date = + let date_courante_3918_ : date = log_variable_definition [ "AllocationsFamiliales"; "date_courante" ] embed_date (try - try date_courante_3322_ () + try date_courante_3866_ () with EmptyError -> - if - log_decision_taken - { - filename = ""; - start_line = 0; - start_column = 1; - end_line = 0; - end_column = 1; - law_headings = []; - } - false - then raise EmptyError - else raise EmptyError + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = ""; + start_line = 0; + start_column = 1; + end_line = 0; + end_column = 1; + law_headings = []; + } + false) + (fun (_ : _) -> raise EmptyError) with EmptyError -> raise (NoValueProvided @@ -1735,26 +1812,26 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = [ "Prologue" ]; })) in - let enfants_a_charge_3367_ : enfant array = + let enfants_a_charge_3921_ : enfant array = log_variable_definition [ "AllocationsFamiliales"; "enfants_à_charge" ] (embed_array embed_enfant) (try - try enfants_a_charge_3323_ () + try enfants_a_charge_3867_ () with EmptyError -> - if - log_decision_taken - { - filename = ""; - start_line = 0; - start_column = 1; - end_line = 0; - end_column = 1; - law_headings = []; - } - false - then raise EmptyError - else raise EmptyError + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = ""; + start_line = 0; + start_column = 1; + end_line = 0; + end_column = 1; + law_headings = []; + } + false) + (fun (_ : _) -> raise EmptyError) with EmptyError -> raise (NoValueProvided @@ -1767,154 +1844,154 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = [ "Prologue" ]; })) in - let prise_en_compte_3368_ : enfant -> prise_en_compte = + let prise_en_compte_3924_ : enfant -> prise_en_compte = log_variable_definition [ "AllocationsFamiliales"; "prise_en_compte" ] unembeddable (try - try prise_en_compte_3325_ () + try prise_en_compte_3869_ () with EmptyError -> ( - fun (param_3369_ : enfant) -> + fun (param_3925_ : enfant) -> try - handle_default_1_ + handle_default [| - (fun (__3370_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 263; - start_column = 5; - end_line = 264; - end_column = 48; - law_headings = - [ - "Article L521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (match param_3369_.prise_en_charge with - | GardeAlterneePartageAllocations __3371_ -> false - | GardeAlterneeAllocataireUnique __3372_ -> false - | EffectiveEtPermanente __3373_ -> false - | ServicesSociauxAllocationVerseeALaFamille __3374_ -> true - | ServicesSociauxAllocationVerseeAuxServicesSociaux __3375_ -> false) - then Complete () - else raise EmptyError); - (fun (__3376_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 253; - start_column = 5; - end_line = 254; - end_column = 56; - law_headings = - [ - "Article L521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (match param_3369_.prise_en_charge with - | GardeAlterneePartageAllocations __3377_ -> false - | GardeAlterneeAllocataireUnique __3378_ -> false - | EffectiveEtPermanente __3379_ -> false - | ServicesSociauxAllocationVerseeALaFamille __3380_ -> false - | ServicesSociauxAllocationVerseeAuxServicesSociaux __3381_ -> true) - then Zero () - else raise EmptyError); - (fun (__3382_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 214; - start_column = 5; - end_line = 214; - end_column = 70; - law_headings = - [ - "Article L521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (match param_3369_.prise_en_charge with - | GardeAlterneePartageAllocations __3383_ -> true - | GardeAlterneeAllocataireUnique __3384_ -> false - | EffectiveEtPermanente __3385_ -> false - | ServicesSociauxAllocationVerseeALaFamille __3386_ -> false - | ServicesSociauxAllocationVerseeAuxServicesSociaux __3387_ -> false) - then Partagee () - else raise EmptyError); - (fun (__3388_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 204; - start_column = 5; - end_line = 204; - end_column = 69; - law_headings = - [ - "Article L521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (match param_3369_.prise_en_charge with - | GardeAlterneePartageAllocations __3389_ -> false - | GardeAlterneeAllocataireUnique __3390_ -> true - | EffectiveEtPermanente __3391_ -> false - | ServicesSociauxAllocationVerseeALaFamille __3392_ -> false - | ServicesSociauxAllocationVerseeAuxServicesSociaux __3393_ -> false) - then Complete () - else raise EmptyError); - (fun (__3394_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 184; - start_column = 5; - end_line = 184; - end_column = 60; - law_headings = - [ - "Article L521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (match param_3369_.prise_en_charge with - | GardeAlterneePartageAllocations __3395_ -> false - | GardeAlterneeAllocataireUnique __3396_ -> false - | EffectiveEtPermanente __3397_ -> true - | ServicesSociauxAllocationVerseeALaFamille __3398_ -> false - | ServicesSociauxAllocationVerseeAuxServicesSociaux __3399_ -> false) - then Complete () - else raise EmptyError); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_L.catala_fr"; + start_line = 263; + start_column = 5; + end_line = 264; + end_column = 48; + law_headings = + [ + "Article L521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"; + ]; + } + (match param_3925_.prise_en_charge with + | GardeAlterneePartageAllocations _ -> false + | GardeAlterneeAllocataireUnique _ -> false + | EffectiveEtPermanente _ -> false + | ServicesSociauxAllocationVerseeALaFamille _ -> true + | ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> false)) + (fun (_ : _) -> Complete ())); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_L.catala_fr"; + start_line = 253; + start_column = 5; + end_line = 254; + end_column = 56; + law_headings = + [ + "Article L521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"; + ]; + } + (match param_3925_.prise_en_charge with + | GardeAlterneePartageAllocations _ -> false + | GardeAlterneeAllocataireUnique _ -> false + | EffectiveEtPermanente _ -> false + | ServicesSociauxAllocationVerseeALaFamille _ -> false + | ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> true)) + (fun (_ : _) -> Zero ())); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_L.catala_fr"; + start_line = 214; + start_column = 5; + end_line = 214; + end_column = 70; + law_headings = + [ + "Article L521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"; + ]; + } + (match param_3925_.prise_en_charge with + | GardeAlterneePartageAllocations _ -> true + | GardeAlterneeAllocataireUnique _ -> false + | EffectiveEtPermanente _ -> false + | ServicesSociauxAllocationVerseeALaFamille _ -> false + | ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> false)) + (fun (_ : _) -> Partagee ())); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_L.catala_fr"; + start_line = 204; + start_column = 5; + end_line = 204; + end_column = 69; + law_headings = + [ + "Article L521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"; + ]; + } + (match param_3925_.prise_en_charge with + | GardeAlterneePartageAllocations _ -> false + | GardeAlterneeAllocataireUnique _ -> true + | EffectiveEtPermanente _ -> false + | ServicesSociauxAllocationVerseeALaFamille _ -> false + | ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> false)) + (fun (_ : _) -> Complete ())); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_L.catala_fr"; + start_line = 184; + start_column = 5; + end_line = 184; + end_column = 60; + law_headings = + [ + "Article L521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"; + ]; + } + (match param_3925_.prise_en_charge with + | GardeAlterneePartageAllocations _ -> false + | GardeAlterneeAllocataireUnique _ -> false + | EffectiveEtPermanente _ -> true + | ServicesSociauxAllocationVerseeALaFamille _ -> false + | ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> false)) + (fun (_ : _) -> Complete ())); |] - (fun (__3400_ : _) -> + (fun (_ : _) -> log_decision_taken { filename = ""; @@ -1925,7 +2002,7 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = []; } false) - (fun (__3401_ : _) -> raise EmptyError) + (fun (_ : _) -> raise EmptyError) with EmptyError -> raise (NoValueProvided @@ -1949,154 +2026,154 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = [ "Prologue" ]; })) in - let versement_3402_ : enfant -> versement_allocations = + let versement_3968_ : enfant -> versement_allocations = log_variable_definition [ "AllocationsFamiliales"; "versement" ] unembeddable (try - try versement_3326_ () + try versement_3870_ () with EmptyError -> ( - fun (param_3403_ : enfant) -> + fun (param_3969_ : enfant) -> try - handle_default_1_ + handle_default [| - (fun (__3404_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 269; - start_column = 5; - end_line = 270; - end_column = 48; - law_headings = - [ - "Article L521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (match param_3403_.prise_en_charge with - | GardeAlterneePartageAllocations __3405_ -> false - | GardeAlterneeAllocataireUnique __3406_ -> false - | EffectiveEtPermanente __3407_ -> false - | ServicesSociauxAllocationVerseeALaFamille __3408_ -> true - | ServicesSociauxAllocationVerseeAuxServicesSociaux __3409_ -> false) - then Normal () - else raise EmptyError); - (fun (__3410_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 258; - start_column = 5; - end_line = 259; - end_column = 56; - law_headings = - [ - "Article L521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (match param_3403_.prise_en_charge with - | GardeAlterneePartageAllocations __3411_ -> false - | GardeAlterneeAllocataireUnique __3412_ -> false - | EffectiveEtPermanente __3413_ -> false - | ServicesSociauxAllocationVerseeALaFamille __3414_ -> false - | ServicesSociauxAllocationVerseeAuxServicesSociaux __3415_ -> true) - then AllocationVerseeAuxServicesSociaux () - else raise EmptyError); - (fun (__3416_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 218; - start_column = 5; - end_line = 218; - end_column = 70; - law_headings = - [ - "Article L521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (match param_3403_.prise_en_charge with - | GardeAlterneePartageAllocations __3417_ -> true - | GardeAlterneeAllocataireUnique __3418_ -> false - | EffectiveEtPermanente __3419_ -> false - | ServicesSociauxAllocationVerseeALaFamille __3420_ -> false - | ServicesSociauxAllocationVerseeAuxServicesSociaux __3421_ -> false) - then Normal () - else raise EmptyError); - (fun (__3422_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 208; - start_column = 5; - end_line = 208; - end_column = 69; - law_headings = - [ - "Article L521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (match param_3403_.prise_en_charge with - | GardeAlterneePartageAllocations __3423_ -> false - | GardeAlterneeAllocataireUnique __3424_ -> true - | EffectiveEtPermanente __3425_ -> false - | ServicesSociauxAllocationVerseeALaFamille __3426_ -> false - | ServicesSociauxAllocationVerseeAuxServicesSociaux __3427_ -> false) - then Normal () - else raise EmptyError); - (fun (__3428_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 188; - start_column = 5; - end_line = 188; - end_column = 60; - law_headings = - [ - "Article L521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (match param_3403_.prise_en_charge with - | GardeAlterneePartageAllocations __3429_ -> false - | GardeAlterneeAllocataireUnique __3430_ -> false - | EffectiveEtPermanente __3431_ -> true - | ServicesSociauxAllocationVerseeALaFamille __3432_ -> false - | ServicesSociauxAllocationVerseeAuxServicesSociaux __3433_ -> false) - then Normal () - else raise EmptyError); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_L.catala_fr"; + start_line = 269; + start_column = 5; + end_line = 270; + end_column = 48; + law_headings = + [ + "Article L521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"; + ]; + } + (match param_3969_.prise_en_charge with + | GardeAlterneePartageAllocations _ -> false + | GardeAlterneeAllocataireUnique _ -> false + | EffectiveEtPermanente _ -> false + | ServicesSociauxAllocationVerseeALaFamille _ -> true + | ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> false)) + (fun (_ : _) -> Normal ())); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_L.catala_fr"; + start_line = 258; + start_column = 5; + end_line = 259; + end_column = 56; + law_headings = + [ + "Article L521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"; + ]; + } + (match param_3969_.prise_en_charge with + | GardeAlterneePartageAllocations _ -> false + | GardeAlterneeAllocataireUnique _ -> false + | EffectiveEtPermanente _ -> false + | ServicesSociauxAllocationVerseeALaFamille _ -> false + | ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> true)) + (fun (_ : _) -> AllocationVerseeAuxServicesSociaux ())); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_L.catala_fr"; + start_line = 218; + start_column = 5; + end_line = 218; + end_column = 70; + law_headings = + [ + "Article L521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"; + ]; + } + (match param_3969_.prise_en_charge with + | GardeAlterneePartageAllocations _ -> true + | GardeAlterneeAllocataireUnique _ -> false + | EffectiveEtPermanente _ -> false + | ServicesSociauxAllocationVerseeALaFamille _ -> false + | ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> false)) + (fun (_ : _) -> Normal ())); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_L.catala_fr"; + start_line = 208; + start_column = 5; + end_line = 208; + end_column = 69; + law_headings = + [ + "Article L521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"; + ]; + } + (match param_3969_.prise_en_charge with + | GardeAlterneePartageAllocations _ -> false + | GardeAlterneeAllocataireUnique _ -> true + | EffectiveEtPermanente _ -> false + | ServicesSociauxAllocationVerseeALaFamille _ -> false + | ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> false)) + (fun (_ : _) -> Normal ())); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_L.catala_fr"; + start_line = 188; + start_column = 5; + end_line = 188; + end_column = 60; + law_headings = + [ + "Article L521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"; + ]; + } + (match param_3969_.prise_en_charge with + | GardeAlterneePartageAllocations _ -> false + | GardeAlterneeAllocataireUnique _ -> false + | EffectiveEtPermanente _ -> true + | ServicesSociauxAllocationVerseeALaFamille _ -> false + | ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> false)) + (fun (_ : _) -> Normal ())); |] - (fun (__3434_ : _) -> + (fun (_ : _) -> log_decision_taken { filename = ""; @@ -2107,7 +2184,7 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = []; } false) - (fun (__3435_ : _) -> raise EmptyError) + (fun (_ : _) -> raise EmptyError) with EmptyError -> raise (NoValueProvided @@ -2131,26 +2208,26 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = [ "Prologue" ]; })) in - let avait_enfant_a_charge_avant_1er_janvier_2012_3436_ : bool = + let avait_enfant_a_charge_avant_1er_janvier_2012_4012_ : bool = log_variable_definition [ "AllocationsFamiliales"; "avait_enfant_à_charge_avant_1er_janvier_2012" ] embed_bool (try - try avait_enfant_a_charge_avant_1er_janvier_2012_3338_ () + try avait_enfant_a_charge_avant_1er_janvier_2012_3882_ () with EmptyError -> - if - log_decision_taken - { - filename = ""; - start_line = 0; - start_column = 1; - end_line = 0; - end_column = 1; - law_headings = []; - } - true - then false - else raise EmptyError + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = ""; + start_line = 0; + start_column = 1; + end_line = 0; + end_column = 1; + law_headings = []; + } + true) + (fun (_ : _) -> false) with EmptyError -> raise (NoValueProvided @@ -2163,13 +2240,36 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = [ "Prologue" ]; })) in - let nombre_enfants_l521_1_3437_ : integer = + let nombre_enfants_l521_1_4015_ : integer = log_variable_definition [ "AllocationsFamiliales"; "nombre_enfants_l521_1" ] embed_integer (try - try nombre_enfants_l521_1_3356_ () - with EmptyError -> ( try integer_of_string "3" with EmptyError -> raise EmptyError) + try nombre_enfants_l521_1_3900_ () + with EmptyError -> ( + try + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 288; + start_column = 14; + end_line = 288; + end_column = 35; + law_headings = + [ + "Article D521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + true) + (fun (_ : _) -> integer_of_string "3") + with EmptyError -> raise EmptyError) with EmptyError -> raise (NoValueProvided @@ -2182,148 +2282,227 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = [ "Prologue" ]; })) in - let nombre_enfants_alinea_2_l521_3_3438_ : integer = + let nombre_enfants_alinea_2_l521_3_4018_ : integer = log_variable_definition [ "AllocationsFamiliales"; "nombre_enfants_alinéa_2_l521_3" ] embed_integer (try - try nombre_enfants_alinea_2_l521_3_3358_ () - with EmptyError -> ( try integer_of_string "3" with EmptyError -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 153; - start_column = 12; - end_line = 153; - end_column = 42; - law_headings = [ "Prologue" ]; + try nombre_enfants_alinea_2_l521_3_3902_ () + with EmptyError -> ( + try + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_R.catala_fr"; + start_line = 64; + start_column = 14; + end_line = 64; + end_column = 44; + law_headings = + [ + "Article R521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets en Conseil d'Etat"; + "Code de la sécurité sociale"; + ]; + } + true) + (fun (_ : _) -> integer_of_string "3") + with EmptyError -> raise EmptyError) + with EmptyError -> + raise + (NoValueProvided + { + filename = "./prologue.catala_fr"; + start_line = 153; + start_column = 12; + end_line = 153; + end_column = 42; + law_headings = [ "Prologue" ]; })) in - let result_3439_ : allocation_familiales_avril2008_out = + let result_4021_ : allocation_familiales_avril2008_out = log_end_call [ "AllocationsFamiliales"; "version_avril_2008"; "AllocationFamilialesAvril2008" ] (log_begin_call [ "AllocationsFamiliales"; "version_avril_2008"; "AllocationFamilialesAvril2008" ] - allocation_familiales_avril2008_1379 - { age_minimum_alinea_1_l521_3_in = (fun (__3440_ : unit) -> raise EmptyError) }) + allocation_familiales_avril2008 + { age_minimum_alinea_1_l521_3_in = (fun (_ : unit) -> raise EmptyError) }) in - let version_avril_2008_dot_age_minimum_alinea_1_l521_3_3441_ : integer = - result_3439_.age_minimum_alinea_1_l521_3_out + let version_avril_2008_dot_age_minimum_alinea_1_l521_3_4023_ : integer = + result_4021_.age_minimum_alinea_1_l521_3_out in - let prestations_familiales_dot_date_courante_3442_ : unit -> date = - fun (__3443_ : unit) -> + let prestations_familiales_dot_date_courante_4024_ : unit -> date = + fun (_ : unit) -> log_variable_definition [ "AllocationsFamiliales"; "prestations_familiales.date_courante" ] embed_date - (try date_courante_3366_ with EmptyError -> raise EmptyError) + (try + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./prologue.catala_fr"; + start_line = 161; + start_column = 14; + end_line = 161; + end_column = 50; + law_headings = [ "Prologue" ]; + } + true) + (fun (_ : _) -> date_courante_3918_) + with EmptyError -> raise EmptyError) in - let prestations_familiales_dot_prestation_courante_3444_ : unit -> element_prestations_familiales + let prestations_familiales_dot_prestation_courante_4028_ : unit -> element_prestations_familiales = - fun (__3445_ : unit) -> + fun (_ : unit) -> log_variable_definition [ "AllocationsFamiliales"; "prestations_familiales.prestation_courante" ] embed_element_prestations_familiales - (try AllocationsFamiliales () with EmptyError -> raise EmptyError) + (try + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./prologue.catala_fr"; + start_line = 159; + start_column = 14; + end_line = 159; + end_column = 56; + law_headings = [ "Prologue" ]; + } + true) + (fun (_ : _) -> AllocationsFamiliales ()) + with EmptyError -> raise EmptyError) in - let prestations_familiales_dot_residence_3446_ : unit -> collectivite = - fun (__3447_ : unit) -> + let prestations_familiales_dot_residence_4032_ : unit -> collectivite = + fun (_ : unit) -> log_variable_definition [ "AllocationsFamiliales"; "prestations_familiales.résidence" ] embed_collectivite - (try residence_3365_ with EmptyError -> raise EmptyError) + (try + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./prologue.catala_fr"; + start_line = 163; + start_column = 14; + end_line = 163; + end_column = 46; + law_headings = [ "Prologue" ]; + } + true) + (fun (_ : _) -> residence_3915_) + with EmptyError -> raise EmptyError) in - let result_3448_ : prestations_familiales_out = + let result_4036_ : prestations_familiales_out = log_end_call [ "AllocationsFamiliales"; "prestations_familiales"; "PrestationsFamiliales" ] (log_begin_call [ "AllocationsFamiliales"; "prestations_familiales"; "PrestationsFamiliales" ] - prestations_familiales_1405 + prestations_familiales { - droit_ouvert_in = (fun (__3449_ : unit) -> raise EmptyError); - conditions_hors_age_in = (fun (__3450_ : unit) -> raise EmptyError); - plafond_l512_3_2_in = (fun (__3451_ : unit) -> raise EmptyError); - age_l512_3_2_in = (fun (__3452_ : unit) -> raise EmptyError); - regime_outre_mer_l751_1_in = (fun (__3453_ : unit) -> raise EmptyError); - date_courante_in = prestations_familiales_dot_date_courante_3442_; - prestation_courante_in = prestations_familiales_dot_prestation_courante_3444_; - residence_in = prestations_familiales_dot_residence_3446_; - base_mensuelle_in = (fun (__3454_ : unit) -> raise EmptyError); + droit_ouvert_in = (fun (_ : unit) -> raise EmptyError); + conditions_hors_age_in = (fun (_ : unit) -> raise EmptyError); + plafond_l512_3_2_in = (fun (_ : unit) -> raise EmptyError); + age_l512_3_2_in = (fun (_ : unit) -> raise EmptyError); + regime_outre_mer_l751_1_in = (fun (_ : unit) -> raise EmptyError); + date_courante_in = prestations_familiales_dot_date_courante_4024_; + prestation_courante_in = prestations_familiales_dot_prestation_courante_4028_; + residence_in = prestations_familiales_dot_residence_4032_; + base_mensuelle_in = (fun (_ : unit) -> raise EmptyError); }) in - let prestations_familiales_dot_droit_ouvert_3455_ : enfant -> bool = - result_3448_.droit_ouvert_out + let prestations_familiales_dot_droit_ouvert_4043_ : enfant -> bool = + result_4036_.droit_ouvert_out in - let prestations_familiales_dot_conditions_hors_age_3456_ : enfant -> bool = - result_3448_.conditions_hors_age_out + let prestations_familiales_dot_conditions_hors_age_4044_ : enfant -> bool = + result_4036_.conditions_hors_age_out in - let prestations_familiales_dot_plafond_l512_3_2_3457_ : money = - result_3448_.plafond_l512_3_2_out + let prestations_familiales_dot_plafond_l512_3_2_4045_ : money = + result_4036_.plafond_l512_3_2_out in - let prestations_familiales_dot_age_l512_3_2_3458_ : integer = result_3448_.age_l512_3_2_out in - let prestations_familiales_dot_regime_outre_mer_l751_1_3459_ : bool = - result_3448_.regime_outre_mer_l751_1_out + let prestations_familiales_dot_age_l512_3_2_4046_ : integer = result_4036_.age_l512_3_2_out in + let prestations_familiales_dot_regime_outre_mer_l751_1_4047_ : bool = + result_4036_.regime_outre_mer_l751_1_out in - let prestations_familiales_dot_date_courante_3460_ : date = result_3448_.date_courante_out in - let prestations_familiales_dot_prestation_courante_3461_ : element_prestations_familiales = - result_3448_.prestation_courante_out + let prestations_familiales_dot_date_courante_4048_ : date = result_4036_.date_courante_out in + let prestations_familiales_dot_prestation_courante_4049_ : element_prestations_familiales = + result_4036_.prestation_courante_out in - let prestations_familiales_dot_residence_3462_ : collectivite = result_3448_.residence_out in - let prestations_familiales_dot_base_mensuelle_3463_ : money = result_3448_.base_mensuelle_out in - let enfant_le_plus_age_dot_enfants_3464_ : unit -> enfant array = - fun (__3465_ : unit) -> + let prestations_familiales_dot_residence_4050_ : collectivite = result_4036_.residence_out in + let prestations_familiales_dot_base_mensuelle_4051_ : money = result_4036_.base_mensuelle_out in + let enfant_le_plus_age_dot_enfants_4052_ : unit -> enfant array = + fun (_ : unit) -> log_variable_definition [ "AllocationsFamiliales"; "enfant_le_plus_âgé.enfants" ] (embed_array embed_enfant) - (try enfants_a_charge_3367_ with EmptyError -> raise EmptyError) + (try + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./epilogue.catala_fr"; + start_line = 32; + start_column = 14; + end_line = 32; + end_column = 40; + law_headings = [ "Règles diverses"; "Épilogue"; "Décrets divers" ]; + } + true) + (fun (_ : _) -> enfants_a_charge_3921_) + with EmptyError -> raise EmptyError) in - let result_3466_ : enfant_le_plus_age_out = + let result_4056_ : enfant_le_plus_age_out = log_end_call [ "AllocationsFamiliales"; "enfant_le_plus_âgé"; "EnfantLePlusÂgé" ] (log_begin_call [ "AllocationsFamiliales"; "enfant_le_plus_âgé"; "EnfantLePlusÂgé" ] - enfant_le_plus_age_1386 + enfant_le_plus_age { - enfants_in = enfant_le_plus_age_dot_enfants_3464_; - le_plus_age_in = (fun (__3467_ : unit) -> raise EmptyError); + enfants_in = enfant_le_plus_age_dot_enfants_4052_; + le_plus_age_in = (fun (_ : unit) -> raise EmptyError); }) in - let enfant_le_plus_age_dot_enfants_3468_ : enfant array = result_3466_.enfants_out in - let enfant_le_plus_age_dot_le_plus_age_3469_ : enfant = result_3466_.le_plus_age_out in - let age_minimum_alinea_1_l521_3_3470_ : enfant -> integer = + let enfant_le_plus_age_dot_enfants_4058_ : enfant array = result_4056_.enfants_out in + let enfant_le_plus_age_dot_le_plus_age_4059_ : enfant = result_4056_.le_plus_age_out in + let age_minimum_alinea_1_l521_3_4060_ : enfant -> integer = log_variable_definition [ "AllocationsFamiliales"; "âge_minimum_alinéa_1_l521_3" ] unembeddable (try - try age_minimum_alinea_1_l521_3_3357_ () + try age_minimum_alinea_1_l521_3_3901_ () with EmptyError -> ( - fun (param_3471_ : enfant) -> + fun (param_4061_ : enfant) -> try try try - if - log_decision_taken - { - filename = "./securite_sociale_R.catala_fr"; - start_line = 83; - start_column = 19; - end_line = 83; - end_column = 69; - law_headings = - [ - "Article R521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie réglementaire - Décrets en Conseil d'Etat"; - "Code de la sécurité sociale"; - ]; - } - (param_3471_.date_de_naissance +@ duration_of_numbers 11 0 0 - <=@ date_of_numbers 2008 4 30) - then version_avril_2008_dot_age_minimum_alinea_1_l521_3_3441_ - else raise EmptyError + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_R.catala_fr"; + start_line = 83; + start_column = 19; + end_line = 83; + end_column = 69; + law_headings = + [ + "Article R521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets en Conseil d'Etat"; + "Code de la sécurité sociale"; + ]; + } + (param_4061_.date_de_naissance +@ duration_of_numbers 11 0 0 + <=@ date_of_numbers 2008 4 30)) + (fun (_ : _) -> version_avril_2008_dot_age_minimum_alinea_1_l521_3_4023_) with EmptyError -> integer_of_string "14" with EmptyError -> raise EmptyError with EmptyError -> @@ -2349,28 +2528,49 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = [ "Prologue" ]; })) in - let enfants_a_charge_droit_ouvert_prestation_familiale_3472_ : enfant array = + let enfants_a_charge_droit_ouvert_prestation_familiale_4064_ : enfant array = log_variable_definition [ "AllocationsFamiliales"; "enfants_à_charge_droit_ouvert_prestation_familiale" ] (embed_array embed_enfant) (try - try enfants_a_charge_droit_ouvert_prestation_familiale_3324_ () + try enfants_a_charge_droit_ouvert_prestation_familiale_3868_ () with EmptyError -> ( try - array_filter - (fun (enfant_3473_ : _) -> - log_end_call - [ "PrestationsFamiliales"; "droit_ouvert" ] - (log_variable_definition - [ "PrestationsFamiliales"; "droit_ouvert"; "output" ] - unembeddable - (log_begin_call - [ "PrestationsFamiliales"; "droit_ouvert" ] - prestations_familiales_dot_droit_ouvert_3455_ - (log_variable_definition - [ "PrestationsFamiliales"; "droit_ouvert"; "input" ] - unembeddable enfant_3473_)))) - enfants_a_charge_3367_ + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_L.catala_fr"; + start_line = 75; + start_column = 14; + end_line = 75; + end_column = 64; + law_headings = + [ + "Article L512-3"; + "Chapitre 2 : Champ d'application"; + "Titre 1 : Champ d'application - Généralités"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"; + ]; + } + true) + (fun (_ : _) -> + array_filter + (fun (enfant_4067_ : _) -> + log_end_call + [ "PrestationsFamiliales"; "droit_ouvert" ] + (log_variable_definition + [ "PrestationsFamiliales"; "droit_ouvert"; "output" ] + unembeddable + (log_begin_call + [ "PrestationsFamiliales"; "droit_ouvert" ] + prestations_familiales_dot_droit_ouvert_4043_ + (log_variable_definition + [ "PrestationsFamiliales"; "droit_ouvert"; "input" ] + unembeddable enfant_4067_)))) + enfants_a_charge_3921_) with EmptyError -> raise EmptyError) with EmptyError -> raise @@ -2384,16 +2584,29 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = [ "Prologue" ]; })) in - let est_enfant_le_plus_age_3474_ : enfant -> bool = + let est_enfant_le_plus_age_4068_ : enfant -> bool = log_variable_definition [ "AllocationsFamiliales"; "est_enfant_le_plus_âgé" ] unembeddable (try - try est_enfant_le_plus_age_3359_ () + try est_enfant_le_plus_age_3903_ () with EmptyError -> ( - fun (param_3475_ : enfant) -> + fun (param_4069_ : enfant) -> try - try enfant_le_plus_age_dot_le_plus_age_3469_ = param_3475_ + try + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./epilogue.catala_fr"; + start_line = 33; + start_column = 14; + end_line = 33; + end_column = 36; + law_headings = [ "Règles diverses"; "Épilogue"; "Décrets divers" ]; + } + true) + (fun (_ : _) -> enfant_le_plus_age_dot_le_plus_age_4059_ = param_4069_) with EmptyError -> raise EmptyError with EmptyError -> raise @@ -2418,130 +2631,134 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = [ "Prologue" ]; })) in - let plafond__i_i_d521_3_3476_ : money = + let plafond__i_i_d521_3_4072_ : money = log_variable_definition [ "AllocationsFamiliales"; "plafond_II_d521_3" ] embed_money (try - try plafond__i_i_d521_3_3361_ () + try plafond__i_i_d521_3_3905_ () with EmptyError -> ( try - handle_default_1_ + handle_default [| - (fun (__3477_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 196; - start_column = 5; - end_line = 196; - end_column = 69; - law_headings = - [ - "Article 1"; - "Arrêté du 14 décembre 2020 relatif au montant des plafonds de \ - ressources de certaines prestations familiales et aux tranches du \ - barème applicable au recouvrement des indus et à la saisie des \ - prestations"; - "Montant des plafonds de ressources"; - "Décrets divers"; - ]; - } - (date_courante_3366_ >=@ date_of_numbers 2021 1 1 - && date_courante_3366_ <=@ date_of_numbers 2021 12 31) - then - money_of_cents_string "8155800" - +$ money_of_cents_string "582700" - *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_) - else raise EmptyError); - (fun (__3478_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 160; - start_column = 5; - end_line = 160; - end_column = 69; - law_headings = - [ - "Instruction interministerielle no DSS/SD2B/2019/261 du 18 décembre \ - 2019 relative à la revalorisation au 1er janvier 2020 des plafonds \ - de ressources d’attribution de certaines prestations familiales \ - servies en métropole, en Guadeloupe, en Guyane, en Martinique, à La \ - Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte"; - "Montant des plafonds de ressources"; - "Décrets divers"; - ]; - } - (date_courante_3366_ >=@ date_of_numbers 2020 1 1 - && date_courante_3366_ <=@ date_of_numbers 2020 12 31) - then - money_of_cents_string "8083100" - +$ money_of_cents_string "577500" - *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_) - else raise EmptyError); - (fun (__3479_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 127; - start_column = 5; - end_line = 127; - end_column = 69; - law_headings = - [ - "Instruction interministérielle n° DSS/SD2B/2018/279 du 17 décembre \ - 2018 relative à la revalorisation au 1er janvier 2019 des plafonds \ - de ressources d’attribution de certaines prestations familiales \ - servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la \ - Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte"; - "Montant des plafonds de ressources"; - "Décrets divers"; - ]; - } - (date_courante_3366_ >=@ date_of_numbers 2019 1 1 - && date_courante_3366_ <=@ date_of_numbers 2019 12 31) - then - money_of_cents_string "7955800" - +$ money_of_cents_string "568400" - *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_) - else raise EmptyError); - (fun (__3480_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 94; - start_column = 5; - end_line = 94; - end_column = 69; - law_headings = - [ - "Circulaire interministérielle N° DSS/SD2B/2017/352 du 22 décembre \ - 2017 relative à la revalorisation au 1er janvier 2018 des plafonds \ - de ressources d’attribution de certaines prestations familiales \ - servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la \ - Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte"; - "Montant des plafonds de ressources"; - "Décrets divers"; - ]; - } - (date_courante_3366_ >=@ date_of_numbers 2018 1 1 - && date_courante_3366_ <=@ date_of_numbers 2018 12 31) - then - money_of_cents_string "7877000" - +$ money_of_cents_string "562800" - *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_) - else raise EmptyError); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 196; + start_column = 5; + end_line = 196; + end_column = 69; + law_headings = + [ + "Article 1"; + "Arrêté du 14 décembre 2020 relatif au montant des plafonds de \ + ressources de certaines prestations familiales et aux tranches du \ + barème applicable au recouvrement des indus et à la saisie des \ + prestations"; + "Montant des plafonds de ressources"; + "Décrets divers"; + ]; + } + (date_courante_3918_ >=@ date_of_numbers 2021 1 1 + && date_courante_3918_ <=@ date_of_numbers 2021 12 31)) + (fun (_ : _) -> + money_of_cents_string "8155800" + +$ money_of_cents_string "582700" + *$ decimal_of_integer + (array_length + enfants_a_charge_droit_ouvert_prestation_familiale_4064_))); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 160; + start_column = 5; + end_line = 160; + end_column = 69; + law_headings = + [ + "Instruction interministerielle no DSS/SD2B/2019/261 du 18 décembre \ + 2019 relative à la revalorisation au 1er janvier 2020 des plafonds \ + de ressources d’attribution de certaines prestations familiales \ + servies en métropole, en Guadeloupe, en Guyane, en Martinique, à \ + La Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte"; + "Montant des plafonds de ressources"; + "Décrets divers"; + ]; + } + (date_courante_3918_ >=@ date_of_numbers 2020 1 1 + && date_courante_3918_ <=@ date_of_numbers 2020 12 31)) + (fun (_ : _) -> + money_of_cents_string "8083100" + +$ money_of_cents_string "577500" + *$ decimal_of_integer + (array_length + enfants_a_charge_droit_ouvert_prestation_familiale_4064_))); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 127; + start_column = 5; + end_line = 127; + end_column = 69; + law_headings = + [ + "Instruction interministérielle n° DSS/SD2B/2018/279 du 17 décembre \ + 2018 relative à la revalorisation au 1er janvier 2019 des plafonds \ + de ressources d’attribution de certaines prestations familiales \ + servies en métropole, en Guadeloupe, en Guyane, en Martinique, à \ + la Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte"; + "Montant des plafonds de ressources"; + "Décrets divers"; + ]; + } + (date_courante_3918_ >=@ date_of_numbers 2019 1 1 + && date_courante_3918_ <=@ date_of_numbers 2019 12 31)) + (fun (_ : _) -> + money_of_cents_string "7955800" + +$ money_of_cents_string "568400" + *$ decimal_of_integer + (array_length + enfants_a_charge_droit_ouvert_prestation_familiale_4064_))); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 94; + start_column = 5; + end_line = 94; + end_column = 69; + law_headings = + [ + "Circulaire interministérielle N° DSS/SD2B/2017/352 du 22 décembre \ + 2017 relative à la revalorisation au 1er janvier 2018 des plafonds \ + de ressources d’attribution de certaines prestations familiales \ + servies en métropole, en Guadeloupe, en Guyane, en Martinique, à \ + la Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte"; + "Montant des plafonds de ressources"; + "Décrets divers"; + ]; + } + (date_courante_3918_ >=@ date_of_numbers 2018 1 1 + && date_courante_3918_ <=@ date_of_numbers 2018 12 31)) + (fun (_ : _) -> + money_of_cents_string "7877000" + +$ money_of_cents_string "562800" + *$ decimal_of_integer + (array_length + enfants_a_charge_droit_ouvert_prestation_familiale_4064_))); |] - (fun (__3481_ : _) -> + (fun (_ : _) -> log_decision_taken { filename = "./securite_sociale_D.catala_fr"; @@ -2560,11 +2777,11 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa ]; } true) - (fun (__3482_ : _) -> + (fun (_ : _) -> money_of_cents_string "7830000" +$ money_of_cents_string "559500" *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_)) + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_)) with EmptyError -> raise EmptyError) with EmptyError -> raise @@ -2578,130 +2795,134 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = [ "Prologue" ]; })) in - let plafond__i_d521_3_3483_ : money = + let plafond__i_d521_3_4087_ : money = log_variable_definition [ "AllocationsFamiliales"; "plafond_I_d521_3" ] embed_money (try - try plafond__i_d521_3_3360_ () + try plafond__i_d521_3_3904_ () with EmptyError -> ( try - handle_default_1_ + handle_default [| - (fun (__3484_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 180; - start_column = 5; - end_line = 180; - end_column = 69; - law_headings = - [ - "Article 1"; - "Arrêté du 14 décembre 2020 relatif au montant des plafonds de \ - ressources de certaines prestations familiales et aux tranches du \ - barème applicable au recouvrement des indus et à la saisie des \ - prestations"; - "Montant des plafonds de ressources"; - "Décrets divers"; - ]; - } - (date_courante_3366_ >=@ date_of_numbers 2021 1 1 - && date_courante_3366_ <=@ date_of_numbers 2021 12 31) - then - money_of_cents_string "5827900" - +$ money_of_cents_string "582700" - *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_) - else raise EmptyError); - (fun (__3485_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 153; - start_column = 5; - end_line = 153; - end_column = 69; - law_headings = - [ - "Instruction interministerielle no DSS/SD2B/2019/261 du 18 décembre \ - 2019 relative à la revalorisation au 1er janvier 2020 des plafonds \ - de ressources d’attribution de certaines prestations familiales \ - servies en métropole, en Guadeloupe, en Guyane, en Martinique, à La \ - Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte"; - "Montant des plafonds de ressources"; - "Décrets divers"; - ]; - } - (date_courante_3366_ >=@ date_of_numbers 2020 1 1 - && date_courante_3366_ <=@ date_of_numbers 2020 12 31) - then - money_of_cents_string "5775900" - +$ money_of_cents_string "577500" - *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_) - else raise EmptyError); - (fun (__3486_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 120; - start_column = 5; - end_line = 120; - end_column = 69; - law_headings = - [ - "Instruction interministérielle n° DSS/SD2B/2018/279 du 17 décembre \ - 2018 relative à la revalorisation au 1er janvier 2019 des plafonds \ - de ressources d’attribution de certaines prestations familiales \ - servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la \ - Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte"; - "Montant des plafonds de ressources"; - "Décrets divers"; - ]; - } - (date_courante_3366_ >=@ date_of_numbers 2019 1 1 - && date_courante_3366_ <=@ date_of_numbers 2019 12 31) - then - money_of_cents_string "5684900" - +$ money_of_cents_string "568400" - *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_) - else raise EmptyError); - (fun (__3487_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 87; - start_column = 5; - end_line = 87; - end_column = 69; - law_headings = - [ - "Circulaire interministérielle N° DSS/SD2B/2017/352 du 22 décembre \ - 2017 relative à la revalorisation au 1er janvier 2018 des plafonds \ - de ressources d’attribution de certaines prestations familiales \ - servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la \ - Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte"; - "Montant des plafonds de ressources"; - "Décrets divers"; - ]; - } - (date_courante_3366_ >=@ date_of_numbers 2018 1 1 - && date_courante_3366_ <=@ date_of_numbers 2018 12 31) - then - money_of_cents_string "5628600" - +$ money_of_cents_string "562800" - *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_) - else raise EmptyError); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 180; + start_column = 5; + end_line = 180; + end_column = 69; + law_headings = + [ + "Article 1"; + "Arrêté du 14 décembre 2020 relatif au montant des plafonds de \ + ressources de certaines prestations familiales et aux tranches du \ + barème applicable au recouvrement des indus et à la saisie des \ + prestations"; + "Montant des plafonds de ressources"; + "Décrets divers"; + ]; + } + (date_courante_3918_ >=@ date_of_numbers 2021 1 1 + && date_courante_3918_ <=@ date_of_numbers 2021 12 31)) + (fun (_ : _) -> + money_of_cents_string "5827900" + +$ money_of_cents_string "582700" + *$ decimal_of_integer + (array_length + enfants_a_charge_droit_ouvert_prestation_familiale_4064_))); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 153; + start_column = 5; + end_line = 153; + end_column = 69; + law_headings = + [ + "Instruction interministerielle no DSS/SD2B/2019/261 du 18 décembre \ + 2019 relative à la revalorisation au 1er janvier 2020 des plafonds \ + de ressources d’attribution de certaines prestations familiales \ + servies en métropole, en Guadeloupe, en Guyane, en Martinique, à \ + La Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte"; + "Montant des plafonds de ressources"; + "Décrets divers"; + ]; + } + (date_courante_3918_ >=@ date_of_numbers 2020 1 1 + && date_courante_3918_ <=@ date_of_numbers 2020 12 31)) + (fun (_ : _) -> + money_of_cents_string "5775900" + +$ money_of_cents_string "577500" + *$ decimal_of_integer + (array_length + enfants_a_charge_droit_ouvert_prestation_familiale_4064_))); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 120; + start_column = 5; + end_line = 120; + end_column = 69; + law_headings = + [ + "Instruction interministérielle n° DSS/SD2B/2018/279 du 17 décembre \ + 2018 relative à la revalorisation au 1er janvier 2019 des plafonds \ + de ressources d’attribution de certaines prestations familiales \ + servies en métropole, en Guadeloupe, en Guyane, en Martinique, à \ + la Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte"; + "Montant des plafonds de ressources"; + "Décrets divers"; + ]; + } + (date_courante_3918_ >=@ date_of_numbers 2019 1 1 + && date_courante_3918_ <=@ date_of_numbers 2019 12 31)) + (fun (_ : _) -> + money_of_cents_string "5684900" + +$ money_of_cents_string "568400" + *$ decimal_of_integer + (array_length + enfants_a_charge_droit_ouvert_prestation_familiale_4064_))); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 87; + start_column = 5; + end_line = 87; + end_column = 69; + law_headings = + [ + "Circulaire interministérielle N° DSS/SD2B/2017/352 du 22 décembre \ + 2017 relative à la revalorisation au 1er janvier 2018 des plafonds \ + de ressources d’attribution de certaines prestations familiales \ + servies en métropole, en Guadeloupe, en Guyane, en Martinique, à \ + la Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte"; + "Montant des plafonds de ressources"; + "Décrets divers"; + ]; + } + (date_courante_3918_ >=@ date_of_numbers 2018 1 1 + && date_courante_3918_ <=@ date_of_numbers 2018 12 31)) + (fun (_ : _) -> + money_of_cents_string "5628600" + +$ money_of_cents_string "562800" + *$ decimal_of_integer + (array_length + enfants_a_charge_droit_ouvert_prestation_familiale_4064_))); |] - (fun (__3488_ : _) -> + (fun (_ : _) -> log_decision_taken { filename = "./securite_sociale_D.catala_fr"; @@ -2720,11 +2941,11 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa ]; } true) - (fun (__3489_ : _) -> + (fun (_ : _) -> money_of_cents_string "5595000" +$ money_of_cents_string "559500" *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_)) + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_)) with EmptyError -> raise EmptyError) with EmptyError -> raise @@ -2738,44 +2959,44 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = [ "Prologue" ]; })) in - let droit_ouvert_complement_3490_ : bool = + let droit_ouvert_complement_4102_ : bool = log_variable_definition [ "AllocationsFamiliales"; "droit_ouvert_complément" ] embed_bool (try - try droit_ouvert_complement_3351_ () + try droit_ouvert_complement_3895_ () with EmptyError -> ( try try - if - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 426; - start_column = 5; - end_line = 427; - end_column = 71; - law_headings = - [ - "Article L755-12"; - "Chapitre 5 : Prestations familiales et prestations assimilées"; - "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la \ - Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin"; - "Livre 7 : Régimes divers - Dispositions diverses"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (prestations_familiales_dot_regime_outre_mer_l751_1_3459_ - && array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - = integer_of_string "1") - then false - else raise EmptyError - with EmptyError -> true - with EmptyError -> false) - with EmptyError -> - raise - (NoValueProvided + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_L.catala_fr"; + start_line = 426; + start_column = 5; + end_line = 427; + end_column = 71; + law_headings = + [ + "Article L755-12"; + "Chapitre 5 : Prestations familiales et prestations assimilées"; + "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à \ + la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin"; + "Livre 7 : Régimes divers - Dispositions diverses"; + "Partie législative"; + "Code de la sécurité sociale"; + ]; + } + (prestations_familiales_dot_regime_outre_mer_l751_1_4047_ + && array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + = integer_of_string "1")) + (fun (_ : _) -> false) + with EmptyError -> true + with EmptyError -> false) + with EmptyError -> + raise + (NoValueProvided { filename = "./prologue.catala_fr"; start_line = 139; @@ -2785,41 +3006,42 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = [ "Prologue" ]; })) in - let droit_ouvert_forfaitaire_3491_ : enfant -> bool = + let droit_ouvert_forfaitaire_4105_ : enfant -> bool = log_variable_definition [ "AllocationsFamiliales"; "droit_ouvert_forfaitaire" ] unembeddable (try - try droit_ouvert_forfaitaire_3343_ () + try droit_ouvert_forfaitaire_3887_ () with EmptyError -> ( - fun (param_3492_ : enfant) -> + fun (param_4106_ : enfant) -> try try try - if - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 420; - start_column = 6; - end_line = 421; - end_column = 72; - law_headings = - [ - "Article L755-12"; - "Chapitre 5 : Prestations familiales et prestations assimilées"; - "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à \ - la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin"; - "Livre 7 : Régimes divers - Dispositions diverses"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (prestations_familiales_dot_regime_outre_mer_l751_1_3459_ - && array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - = integer_of_string "1") - then false - else raise EmptyError + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_L.catala_fr"; + start_line = 420; + start_column = 6; + end_line = 421; + end_column = 72; + law_headings = + [ + "Article L755-12"; + "Chapitre 5 : Prestations familiales et prestations assimilées"; + "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, \ + à la Martinique, à La Réunion, à Saint-Barthélemy et à \ + Saint-Martin"; + "Livre 7 : Régimes divers - Dispositions diverses"; + "Partie législative"; + "Code de la sécurité sociale"; + ]; + } + (prestations_familiales_dot_regime_outre_mer_l751_1_4047_ + && array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + = integer_of_string "1")) + (fun (_ : _) -> false) with EmptyError -> if log_decision_taken @@ -2839,9 +3061,9 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa "Code de la sécurité sociale"; ]; } - (array_length enfants_a_charge_3367_ >=! nombre_enfants_alinea_2_l521_3_3438_ - && param_3492_.age = prestations_familiales_dot_age_l512_3_2_3458_ - && param_3492_.a_deja_ouvert_droit_aux_allocations_familiales + (array_length enfants_a_charge_3921_ >=! nombre_enfants_alinea_2_l521_3_4018_ + && param_4106_.age = prestations_familiales_dot_age_l512_3_2_4046_ + && param_4106_.a_deja_ouvert_droit_aux_allocations_familiales && log_end_call [ "PrestationsFamiliales"; "conditions_hors_âge" ] (log_variable_definition @@ -2849,10 +3071,10 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa unembeddable (log_begin_call [ "PrestationsFamiliales"; "conditions_hors_âge" ] - prestations_familiales_dot_conditions_hors_age_3456_ + prestations_familiales_dot_conditions_hors_age_4044_ (log_variable_definition [ "PrestationsFamiliales"; "conditions_hors_âge"; "input" ] - unembeddable param_3492_)))) + unembeddable param_4106_)))) then true else raise EmptyError with EmptyError -> false @@ -2879,335 +3101,23 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = [ "Prologue" ]; })) in - let montant_initial_base_quatrieme_enfant_et_plus_mayotte_3493_ : money = + let montant_initial_base_quatrieme_enfant_et_plus_mayotte_4109_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_initial_base_quatrième_enfant_et_plus_mayotte" ] embed_money (try - try montant_initial_base_quatrieme_enfant_et_plus_mayotte_3342_ () - with EmptyError -> ( - try - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >! integer_of_string "3" - then - prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.0463" - *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - -! integer_of_string "3") - else money_of_cents_string "0" - with EmptyError -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 124; - start_column = 12; - end_line = 124; - end_column = 65; - law_headings = [ "Prologue" ]; - })) - in - let montant_initial_base_troisieme_enfant_mayotte_3494_ : money = - log_variable_definition - [ "AllocationsFamiliales"; "montant_initial_base_troisième_enfant_mayotte" ] - embed_money - (try - try montant_initial_base_troisieme_enfant_mayotte_3341_ () + try montant_initial_base_quatrieme_enfant_et_plus_mayotte_3886_ () with EmptyError -> ( try - handle_default_1_ - [| - (fun (__3495_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 647; - start_column = 5; - end_line = 647; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ - à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_3366_ >=@ date_of_numbers 2020 1 1 - && date_courante_3366_ <=@ date_of_numbers 2020 12 31) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >! integer_of_string "2" - then - prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.143" - else money_of_cents_string "0" - else raise EmptyError); - (fun (__3496_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 640; - start_column = 5; - end_line = 640; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ - à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_3366_ >=@ date_of_numbers 2019 1 1 - && date_courante_3366_ <=@ date_of_numbers 2019 12 31) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >! integer_of_string "2" - then - prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.1259" - else money_of_cents_string "0" - else raise EmptyError); - (fun (__3497_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 633; - start_column = 5; - end_line = 633; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ - à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_3366_ >=@ date_of_numbers 2018 1 1 - && date_courante_3366_ <=@ date_of_numbers 2018 12 31) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >! integer_of_string "2" - then - prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.1089" - else money_of_cents_string "0" - else raise EmptyError); - (fun (__3498_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 626; - start_column = 5; - end_line = 626; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ - à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_3366_ >=@ date_of_numbers 2017 1 1 - && date_courante_3366_ <=@ date_of_numbers 2017 12 31) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >! integer_of_string "2" - then - prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.0918" - else money_of_cents_string "0" - else raise EmptyError); - (fun (__3499_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 619; - start_column = 5; - end_line = 619; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ - à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_3366_ >=@ date_of_numbers 2016 1 1 - && date_courante_3366_ <=@ date_of_numbers 2016 12 31) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >! integer_of_string "2" - then - prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.0842" - else money_of_cents_string "0" - else raise EmptyError); - (fun (__3500_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 612; - start_column = 5; - end_line = 612; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ - à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_3366_ >=@ date_of_numbers 2015 1 1 - && date_courante_3366_ <=@ date_of_numbers 2015 12 31) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >! integer_of_string "2" - then - prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.0766" - else money_of_cents_string "0" - else raise EmptyError); - (fun (__3501_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 605; - start_column = 5; - end_line = 605; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ - à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_3366_ >=@ date_of_numbers 2014 1 1 - && date_courante_3366_ <=@ date_of_numbers 2014 12 31) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >! integer_of_string "2" - then - prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.069" - else money_of_cents_string "0" - else raise EmptyError); - (fun (__3502_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 598; - start_column = 5; - end_line = 598; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ - à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_3366_ >=@ date_of_numbers 2013 1 1 - && date_courante_3366_ <=@ date_of_numbers 2013 12 31) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >! integer_of_string "2" - then - prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.075" - else money_of_cents_string "0" - else raise EmptyError); - (fun (__3503_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 591; - start_column = 5; - end_line = 591; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ - à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_3366_ >=@ date_of_numbers 2012 1 1 - && date_courante_3366_ <=@ date_of_numbers 2012 12 31) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >! integer_of_string "2" - then - prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.0539" - else money_of_cents_string "0" - else raise EmptyError); - (fun (__3504_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 584; - start_column = 5; - end_line = 584; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ - à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_3366_ >=@ date_of_numbers 2011 1 1 - && date_courante_3366_ <=@ date_of_numbers 2011 12 31) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >! integer_of_string "2" - then - prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.0463" - else money_of_cents_string "0" - else raise EmptyError); - |] - (fun (__3505_ : _) -> + handle_default [||] + (fun (_ : _) -> log_decision_taken { filename = "./decrets_divers.catala_fr"; - start_line = 376; + start_line = 385; start_column = 14; - end_line = 376; - end_column = 59; + end_line = 385; + end_column = 67; law_headings = [ "Article 7"; @@ -3218,11 +3128,15 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa ]; } true) - (fun (__3506_ : _) -> + (fun (_ : _) -> if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >! integer_of_string "2" - then prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.16" + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >! integer_of_string "3" + then + prestations_familiales_dot_base_mensuelle_4051_ *$ decimal_of_string "0.0463" + *$ decimal_of_integer + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + -! integer_of_string "3") else money_of_cents_string "0") with EmptyError -> raise EmptyError) with EmptyError -> @@ -3230,312 +3144,322 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa (NoValueProvided { filename = "./prologue.catala_fr"; - start_line = 123; + start_line = 124; start_column = 12; - end_line = 123; - end_column = 57; + end_line = 124; + end_column = 65; law_headings = [ "Prologue" ]; })) in - let montant_initial_base_deuxieme_enfant_mayotte_3507_ : money = + let montant_initial_base_troisieme_enfant_mayotte_4112_ : money = log_variable_definition - [ "AllocationsFamiliales"; "montant_initial_base_deuxième_enfant_mayotte" ] + [ "AllocationsFamiliales"; "montant_initial_base_troisième_enfant_mayotte" ] embed_money (try - try montant_initial_base_deuxieme_enfant_mayotte_3340_ () + try montant_initial_base_troisieme_enfant_mayotte_3885_ () with EmptyError -> ( try - handle_default_1_ + handle_default [| - (fun (__3508_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 576; - start_column = 5; - end_line = 576; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ - à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_3366_ >=@ date_of_numbers 2020 1 1 - && date_courante_3366_ <=@ date_of_numbers 2020 12 31) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >! integer_of_string "1" - then - prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.3068" - else money_of_cents_string "0" - else raise EmptyError); - (fun (__3509_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 569; - start_column = 5; - end_line = 569; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ - à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_3366_ >=@ date_of_numbers 2019 1 1 - && date_courante_3366_ <=@ date_of_numbers 2019 12 31) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >! integer_of_string "1" - then - prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.2936" - else money_of_cents_string "0" - else raise EmptyError); - (fun (__3510_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 562; - start_column = 5; - end_line = 562; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ - à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_3366_ >=@ date_of_numbers 2018 1 1 - && date_courante_3366_ <=@ date_of_numbers 2018 12 31) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >! integer_of_string "1" - then - prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.284" - else money_of_cents_string "0" - else raise EmptyError); - (fun (__3511_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 555; - start_column = 5; - end_line = 555; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ - à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_3366_ >=@ date_of_numbers 2017 1 1 - && date_courante_3366_ <=@ date_of_numbers 2017 12 31) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >! integer_of_string "1" - then - prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.2672" - else money_of_cents_string "0" - else raise EmptyError); - (fun (__3512_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 548; - start_column = 5; - end_line = 548; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ - à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_3366_ >=@ date_of_numbers 2016 1 1 - && date_courante_3366_ <=@ date_of_numbers 2016 12 31) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >! integer_of_string "1" - then - prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.273" - else money_of_cents_string "0" - else raise EmptyError); - (fun (__3513_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 541; - start_column = 5; - end_line = 541; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ - à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_3366_ >=@ date_of_numbers 2015 1 1 - && date_courante_3366_ <=@ date_of_numbers 2015 12 31) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >! integer_of_string "1" - then - prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.2555" - else money_of_cents_string "0" - else raise EmptyError); - (fun (__3514_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 534; - start_column = 5; - end_line = 534; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ - à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_3366_ >=@ date_of_numbers 2014 1 1 - && date_courante_3366_ <=@ date_of_numbers 2014 12 31) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >! integer_of_string "1" - then - prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.2496" - else money_of_cents_string "0" - else raise EmptyError); - (fun (__3515_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 527; - start_column = 5; - end_line = 527; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ - à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_3366_ >=@ date_of_numbers 2013 1 1 - && date_courante_3366_ <=@ date_of_numbers 2013 12 31) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >! integer_of_string "1" - then - prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.2437" - else money_of_cents_string "0" - else raise EmptyError); - (fun (__3516_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 520; - start_column = 5; - end_line = 520; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ - à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_3366_ >=@ date_of_numbers 2012 1 1 - && date_courante_3366_ <=@ date_of_numbers 2012 12 31) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >! integer_of_string "1" - then - prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.2379" - else money_of_cents_string "0" - else raise EmptyError); - (fun (__3517_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 513; - start_column = 5; - end_line = 513; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ - à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_3366_ >=@ date_of_numbers 2011 1 1 - && date_courante_3366_ <=@ date_of_numbers 2011 12 31) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >! integer_of_string "1" - then - prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.232" - else money_of_cents_string "0" - else raise EmptyError); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 647; + start_column = 5; + end_line = 647; + end_column = 69; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations \ + familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_3918_ >=@ date_of_numbers 2020 1 1 + && date_courante_3918_ <=@ date_of_numbers 2020 12 31)) + (fun (_ : _) -> + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >! integer_of_string "2" + then + prestations_familiales_dot_base_mensuelle_4051_ + *$ decimal_of_string "0.143" + else money_of_cents_string "0")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 640; + start_column = 5; + end_line = 640; + end_column = 69; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations \ + familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_3918_ >=@ date_of_numbers 2019 1 1 + && date_courante_3918_ <=@ date_of_numbers 2019 12 31)) + (fun (_ : _) -> + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >! integer_of_string "2" + then + prestations_familiales_dot_base_mensuelle_4051_ + *$ decimal_of_string "0.1259" + else money_of_cents_string "0")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 633; + start_column = 5; + end_line = 633; + end_column = 69; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations \ + familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_3918_ >=@ date_of_numbers 2018 1 1 + && date_courante_3918_ <=@ date_of_numbers 2018 12 31)) + (fun (_ : _) -> + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >! integer_of_string "2" + then + prestations_familiales_dot_base_mensuelle_4051_ + *$ decimal_of_string "0.1089" + else money_of_cents_string "0")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 626; + start_column = 5; + end_line = 626; + end_column = 69; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations \ + familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_3918_ >=@ date_of_numbers 2017 1 1 + && date_courante_3918_ <=@ date_of_numbers 2017 12 31)) + (fun (_ : _) -> + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >! integer_of_string "2" + then + prestations_familiales_dot_base_mensuelle_4051_ + *$ decimal_of_string "0.0918" + else money_of_cents_string "0")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 619; + start_column = 5; + end_line = 619; + end_column = 69; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations \ + familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_3918_ >=@ date_of_numbers 2016 1 1 + && date_courante_3918_ <=@ date_of_numbers 2016 12 31)) + (fun (_ : _) -> + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >! integer_of_string "2" + then + prestations_familiales_dot_base_mensuelle_4051_ + *$ decimal_of_string "0.0842" + else money_of_cents_string "0")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 612; + start_column = 5; + end_line = 612; + end_column = 69; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations \ + familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_3918_ >=@ date_of_numbers 2015 1 1 + && date_courante_3918_ <=@ date_of_numbers 2015 12 31)) + (fun (_ : _) -> + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >! integer_of_string "2" + then + prestations_familiales_dot_base_mensuelle_4051_ + *$ decimal_of_string "0.0766" + else money_of_cents_string "0")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 605; + start_column = 5; + end_line = 605; + end_column = 69; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations \ + familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_3918_ >=@ date_of_numbers 2014 1 1 + && date_courante_3918_ <=@ date_of_numbers 2014 12 31)) + (fun (_ : _) -> + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >! integer_of_string "2" + then + prestations_familiales_dot_base_mensuelle_4051_ + *$ decimal_of_string "0.069" + else money_of_cents_string "0")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 598; + start_column = 5; + end_line = 598; + end_column = 69; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations \ + familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_3918_ >=@ date_of_numbers 2013 1 1 + && date_courante_3918_ <=@ date_of_numbers 2013 12 31)) + (fun (_ : _) -> + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >! integer_of_string "2" + then + prestations_familiales_dot_base_mensuelle_4051_ + *$ decimal_of_string "0.075" + else money_of_cents_string "0")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 591; + start_column = 5; + end_line = 591; + end_column = 69; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations \ + familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_3918_ >=@ date_of_numbers 2012 1 1 + && date_courante_3918_ <=@ date_of_numbers 2012 12 31)) + (fun (_ : _) -> + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >! integer_of_string "2" + then + prestations_familiales_dot_base_mensuelle_4051_ + *$ decimal_of_string "0.0539" + else money_of_cents_string "0")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 584; + start_column = 5; + end_line = 584; + end_column = 69; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations \ + familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_3918_ >=@ date_of_numbers 2011 1 1 + && date_courante_3918_ <=@ date_of_numbers 2011 12 31)) + (fun (_ : _) -> + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >! integer_of_string "2" + then + prestations_familiales_dot_base_mensuelle_4051_ + *$ decimal_of_string "0.0463" + else money_of_cents_string "0")); |] - (fun (__3518_ : _) -> + (fun (_ : _) -> log_decision_taken { filename = "./decrets_divers.catala_fr"; - start_line = 367; + start_line = 376; start_column = 14; - end_line = 367; - end_column = 58; + end_line = 376; + end_column = 59; law_headings = [ "Article 7"; @@ -3546,11 +3470,11 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa ]; } true) - (fun (__3519_ : _) -> + (fun (_ : _) -> if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >! integer_of_string "1" - then prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.32" + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >! integer_of_string "2" + then prestations_familiales_dot_base_mensuelle_4051_ *$ decimal_of_string "0.16" else money_of_cents_string "0") with EmptyError -> raise EmptyError) with EmptyError -> @@ -3558,341 +3482,689 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa (NoValueProvided { filename = "./prologue.catala_fr"; - start_line = 122; + start_line = 123; start_column = 12; - end_line = 122; - end_column = 56; + end_line = 123; + end_column = 57; law_headings = [ "Prologue" ]; })) in - let montant_initial_base_premier_enfant_mayotte_3520_ : money = + let montant_initial_base_deuxieme_enfant_mayotte_4145_ : money = log_variable_definition - [ "AllocationsFamiliales"; "montant_initial_base_premier_enfant_mayotte" ] + [ "AllocationsFamiliales"; "montant_initial_base_deuxième_enfant_mayotte" ] embed_money (try - try montant_initial_base_premier_enfant_mayotte_3339_ () + try montant_initial_base_deuxieme_enfant_mayotte_3884_ () with EmptyError -> ( try - handle_default_1_ + handle_default [| - (fun (__3521_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 505; - start_column = 5; - end_line = 505; - end_column = 49; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ - à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - avait_enfant_a_charge_avant_1er_janvier_2012_3436_ - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >! integer_of_string "0" - then money_of_cents_string "5728" - else money_of_cents_string "0" - else raise EmptyError); - (fun (__3522_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 497; - start_column = 5; - end_line = 498; - end_column = 53; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ - à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_3366_ >=@ date_of_numbers 2020 1 1 - && date_courante_3366_ <=@ date_of_numbers 2020 12 31 - && not avait_enfant_a_charge_avant_1er_janvier_2012_3436_) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >! integer_of_string "0" - then - prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.0717" - else money_of_cents_string "0" - else raise EmptyError); - (fun (__3523_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 489; - start_column = 5; - end_line = 490; - end_column = 53; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ - à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_3366_ >=@ date_of_numbers 2019 1 1 - && date_courante_3366_ <=@ date_of_numbers 2019 12 31 - && not avait_enfant_a_charge_avant_1er_janvier_2012_3436_) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >! integer_of_string "0" - then - prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.0847" - else money_of_cents_string "0" - else raise EmptyError); - (fun (__3524_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 481; - start_column = 5; - end_line = 482; - end_column = 53; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ - à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_3366_ >=@ date_of_numbers 2018 1 1 - && date_courante_3366_ <=@ date_of_numbers 2018 12 31 - && not avait_enfant_a_charge_avant_1er_janvier_2012_3436_) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >! integer_of_string "0" - then - prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.0976" - else money_of_cents_string "0" - else raise EmptyError); - (fun (__3525_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 473; - start_column = 5; - end_line = 474; - end_column = 53; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ - à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_3366_ >=@ date_of_numbers 2017 1 1 - && date_courante_3366_ <=@ date_of_numbers 2017 12 31 - && not avait_enfant_a_charge_avant_1er_janvier_2012_3436_) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >! integer_of_string "0" - then - prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.115" - else money_of_cents_string "0" - else raise EmptyError); - (fun (__3526_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 465; - start_column = 5; - end_line = 466; - end_column = 53; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ - à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_3366_ >=@ date_of_numbers 2016 1 1 - && date_courante_3366_ <=@ date_of_numbers 2016 12 31 - && not avait_enfant_a_charge_avant_1er_janvier_2012_3436_) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >! integer_of_string "0" - then - prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.1163" - else money_of_cents_string "0" - else raise EmptyError); - (fun (__3527_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 457; - start_column = 5; - end_line = 458; - end_column = 53; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ - à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_3366_ >=@ date_of_numbers 2015 1 1 - && date_courante_3366_ <=@ date_of_numbers 2015 12 31 - && not avait_enfant_a_charge_avant_1er_janvier_2012_3436_) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >! integer_of_string "0" - then - prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.122" - else money_of_cents_string "0" - else raise EmptyError); - (fun (__3528_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 449; - start_column = 5; - end_line = 450; - end_column = 53; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ - à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_3366_ >=@ date_of_numbers 2014 1 1 - && date_courante_3366_ <=@ date_of_numbers 2014 12 31 - && not avait_enfant_a_charge_avant_1er_janvier_2012_3436_) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >! integer_of_string "0" - then - prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.1278" - else money_of_cents_string "0" - else raise EmptyError); - (fun (__3529_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 441; - start_column = 5; - end_line = 442; - end_column = 53; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ - à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_3366_ >=@ date_of_numbers 2013 1 1 - && date_courante_3366_ <=@ date_of_numbers 2013 12 31 - && not avait_enfant_a_charge_avant_1er_janvier_2012_3436_) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >! integer_of_string "0" - then - prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.1335" - else money_of_cents_string "0" - else raise EmptyError); - (fun (__3530_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 433; - start_column = 5; - end_line = 434; - end_column = 53; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ - à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_3366_ >=@ date_of_numbers 2012 1 1 - && date_courante_3366_ <=@ date_of_numbers 2012 12 31 - && not avait_enfant_a_charge_avant_1er_janvier_2012_3436_) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >! integer_of_string "0" - then - prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.1393" - else money_of_cents_string "0" - else raise EmptyError); - (fun (__3531_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 425; - start_column = 5; - end_line = 426; - end_column = 53; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ - à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_3366_ >=@ date_of_numbers 2011 1 1 - && date_courante_3366_ <=@ date_of_numbers 2011 12 31 - && not avait_enfant_a_charge_avant_1er_janvier_2012_3436_) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >! integer_of_string "0" - then - prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.145" - else money_of_cents_string "0" - else raise EmptyError); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 576; + start_column = 5; + end_line = 576; + end_column = 69; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations \ + familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_3918_ >=@ date_of_numbers 2020 1 1 + && date_courante_3918_ <=@ date_of_numbers 2020 12 31)) + (fun (_ : _) -> + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >! integer_of_string "1" + then + prestations_familiales_dot_base_mensuelle_4051_ + *$ decimal_of_string "0.3068" + else money_of_cents_string "0")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 569; + start_column = 5; + end_line = 569; + end_column = 69; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations \ + familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_3918_ >=@ date_of_numbers 2019 1 1 + && date_courante_3918_ <=@ date_of_numbers 2019 12 31)) + (fun (_ : _) -> + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >! integer_of_string "1" + then + prestations_familiales_dot_base_mensuelle_4051_ + *$ decimal_of_string "0.2936" + else money_of_cents_string "0")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 562; + start_column = 5; + end_line = 562; + end_column = 69; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations \ + familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_3918_ >=@ date_of_numbers 2018 1 1 + && date_courante_3918_ <=@ date_of_numbers 2018 12 31)) + (fun (_ : _) -> + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >! integer_of_string "1" + then + prestations_familiales_dot_base_mensuelle_4051_ + *$ decimal_of_string "0.284" + else money_of_cents_string "0")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 555; + start_column = 5; + end_line = 555; + end_column = 69; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations \ + familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_3918_ >=@ date_of_numbers 2017 1 1 + && date_courante_3918_ <=@ date_of_numbers 2017 12 31)) + (fun (_ : _) -> + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >! integer_of_string "1" + then + prestations_familiales_dot_base_mensuelle_4051_ + *$ decimal_of_string "0.2672" + else money_of_cents_string "0")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 548; + start_column = 5; + end_line = 548; + end_column = 69; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations \ + familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_3918_ >=@ date_of_numbers 2016 1 1 + && date_courante_3918_ <=@ date_of_numbers 2016 12 31)) + (fun (_ : _) -> + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >! integer_of_string "1" + then + prestations_familiales_dot_base_mensuelle_4051_ + *$ decimal_of_string "0.273" + else money_of_cents_string "0")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 541; + start_column = 5; + end_line = 541; + end_column = 69; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations \ + familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_3918_ >=@ date_of_numbers 2015 1 1 + && date_courante_3918_ <=@ date_of_numbers 2015 12 31)) + (fun (_ : _) -> + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >! integer_of_string "1" + then + prestations_familiales_dot_base_mensuelle_4051_ + *$ decimal_of_string "0.2555" + else money_of_cents_string "0")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 534; + start_column = 5; + end_line = 534; + end_column = 69; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations \ + familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_3918_ >=@ date_of_numbers 2014 1 1 + && date_courante_3918_ <=@ date_of_numbers 2014 12 31)) + (fun (_ : _) -> + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >! integer_of_string "1" + then + prestations_familiales_dot_base_mensuelle_4051_ + *$ decimal_of_string "0.2496" + else money_of_cents_string "0")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 527; + start_column = 5; + end_line = 527; + end_column = 69; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations \ + familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_3918_ >=@ date_of_numbers 2013 1 1 + && date_courante_3918_ <=@ date_of_numbers 2013 12 31)) + (fun (_ : _) -> + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >! integer_of_string "1" + then + prestations_familiales_dot_base_mensuelle_4051_ + *$ decimal_of_string "0.2437" + else money_of_cents_string "0")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 520; + start_column = 5; + end_line = 520; + end_column = 69; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations \ + familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_3918_ >=@ date_of_numbers 2012 1 1 + && date_courante_3918_ <=@ date_of_numbers 2012 12 31)) + (fun (_ : _) -> + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >! integer_of_string "1" + then + prestations_familiales_dot_base_mensuelle_4051_ + *$ decimal_of_string "0.2379" + else money_of_cents_string "0")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 513; + start_column = 5; + end_line = 513; + end_column = 69; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations \ + familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_3918_ >=@ date_of_numbers 2011 1 1 + && date_courante_3918_ <=@ date_of_numbers 2011 12 31)) + (fun (_ : _) -> + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >! integer_of_string "1" + then + prestations_familiales_dot_base_mensuelle_4051_ + *$ decimal_of_string "0.232" + else money_of_cents_string "0")); + |] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 367; + start_column = 14; + end_line = 367; + end_column = 58; + law_headings = + [ + "Article 7"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à \ + Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + true) + (fun (_ : _) -> + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >! integer_of_string "1" + then prestations_familiales_dot_base_mensuelle_4051_ *$ decimal_of_string "0.32" + else money_of_cents_string "0") + with EmptyError -> raise EmptyError) + with EmptyError -> + raise + (NoValueProvided + { + filename = "./prologue.catala_fr"; + start_line = 122; + start_column = 12; + end_line = 122; + end_column = 56; + law_headings = [ "Prologue" ]; + })) + in + let montant_initial_base_premier_enfant_mayotte_4178_ : money = + log_variable_definition + [ "AllocationsFamiliales"; "montant_initial_base_premier_enfant_mayotte" ] + embed_money + (try + try montant_initial_base_premier_enfant_mayotte_3883_ () + with EmptyError -> ( + try + handle_default + [| + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 505; + start_column = 5; + end_line = 505; + end_column = 49; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations \ + familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + avait_enfant_a_charge_avant_1er_janvier_2012_4012_) + (fun (_ : _) -> + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >! integer_of_string "0" + then money_of_cents_string "5728" + else money_of_cents_string "0")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 497; + start_column = 5; + end_line = 498; + end_column = 53; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations \ + familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_3918_ >=@ date_of_numbers 2020 1 1 + && date_courante_3918_ <=@ date_of_numbers 2020 12 31 + && not avait_enfant_a_charge_avant_1er_janvier_2012_4012_)) + (fun (_ : _) -> + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >! integer_of_string "0" + then + prestations_familiales_dot_base_mensuelle_4051_ + *$ decimal_of_string "0.0717" + else money_of_cents_string "0")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 489; + start_column = 5; + end_line = 490; + end_column = 53; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations \ + familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_3918_ >=@ date_of_numbers 2019 1 1 + && date_courante_3918_ <=@ date_of_numbers 2019 12 31 + && not avait_enfant_a_charge_avant_1er_janvier_2012_4012_)) + (fun (_ : _) -> + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >! integer_of_string "0" + then + prestations_familiales_dot_base_mensuelle_4051_ + *$ decimal_of_string "0.0847" + else money_of_cents_string "0")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 481; + start_column = 5; + end_line = 482; + end_column = 53; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations \ + familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_3918_ >=@ date_of_numbers 2018 1 1 + && date_courante_3918_ <=@ date_of_numbers 2018 12 31 + && not avait_enfant_a_charge_avant_1er_janvier_2012_4012_)) + (fun (_ : _) -> + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >! integer_of_string "0" + then + prestations_familiales_dot_base_mensuelle_4051_ + *$ decimal_of_string "0.0976" + else money_of_cents_string "0")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 473; + start_column = 5; + end_line = 474; + end_column = 53; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations \ + familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_3918_ >=@ date_of_numbers 2017 1 1 + && date_courante_3918_ <=@ date_of_numbers 2017 12 31 + && not avait_enfant_a_charge_avant_1er_janvier_2012_4012_)) + (fun (_ : _) -> + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >! integer_of_string "0" + then + prestations_familiales_dot_base_mensuelle_4051_ + *$ decimal_of_string "0.115" + else money_of_cents_string "0")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 465; + start_column = 5; + end_line = 466; + end_column = 53; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations \ + familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_3918_ >=@ date_of_numbers 2016 1 1 + && date_courante_3918_ <=@ date_of_numbers 2016 12 31 + && not avait_enfant_a_charge_avant_1er_janvier_2012_4012_)) + (fun (_ : _) -> + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >! integer_of_string "0" + then + prestations_familiales_dot_base_mensuelle_4051_ + *$ decimal_of_string "0.1163" + else money_of_cents_string "0")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 457; + start_column = 5; + end_line = 458; + end_column = 53; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations \ + familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_3918_ >=@ date_of_numbers 2015 1 1 + && date_courante_3918_ <=@ date_of_numbers 2015 12 31 + && not avait_enfant_a_charge_avant_1er_janvier_2012_4012_)) + (fun (_ : _) -> + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >! integer_of_string "0" + then + prestations_familiales_dot_base_mensuelle_4051_ + *$ decimal_of_string "0.122" + else money_of_cents_string "0")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 449; + start_column = 5; + end_line = 450; + end_column = 53; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations \ + familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_3918_ >=@ date_of_numbers 2014 1 1 + && date_courante_3918_ <=@ date_of_numbers 2014 12 31 + && not avait_enfant_a_charge_avant_1er_janvier_2012_4012_)) + (fun (_ : _) -> + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >! integer_of_string "0" + then + prestations_familiales_dot_base_mensuelle_4051_ + *$ decimal_of_string "0.1278" + else money_of_cents_string "0")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 441; + start_column = 5; + end_line = 442; + end_column = 53; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations \ + familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_3918_ >=@ date_of_numbers 2013 1 1 + && date_courante_3918_ <=@ date_of_numbers 2013 12 31 + && not avait_enfant_a_charge_avant_1er_janvier_2012_4012_)) + (fun (_ : _) -> + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >! integer_of_string "0" + then + prestations_familiales_dot_base_mensuelle_4051_ + *$ decimal_of_string "0.1335" + else money_of_cents_string "0")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 433; + start_column = 5; + end_line = 434; + end_column = 53; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations \ + familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_3918_ >=@ date_of_numbers 2012 1 1 + && date_courante_3918_ <=@ date_of_numbers 2012 12 31 + && not avait_enfant_a_charge_avant_1er_janvier_2012_4012_)) + (fun (_ : _) -> + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >! integer_of_string "0" + then + prestations_familiales_dot_base_mensuelle_4051_ + *$ decimal_of_string "0.1393" + else money_of_cents_string "0")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 425; + start_column = 5; + end_line = 426; + end_column = 53; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations \ + familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_3918_ >=@ date_of_numbers 2011 1 1 + && date_courante_3918_ <=@ date_of_numbers 2011 12 31 + && not avait_enfant_a_charge_avant_1er_janvier_2012_4012_)) + (fun (_ : _) -> + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >! integer_of_string "0" + then + prestations_familiales_dot_base_mensuelle_4051_ + *$ decimal_of_string "0.145" + else money_of_cents_string "0")); |] - (fun (__3532_ : _) -> + (fun (_ : _) -> log_decision_taken { filename = "./decrets_divers.catala_fr"; @@ -3910,11 +4182,11 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa ]; } true) - (fun (__3533_ : _) -> + (fun (_ : _) -> if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ >! integer_of_string "0" - then prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.0588" + then prestations_familiales_dot_base_mensuelle_4051_ *$ decimal_of_string "0.0588" else money_of_cents_string "0") with EmptyError -> raise EmptyError) with EmptyError -> @@ -3929,16 +4201,37 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = [ "Prologue" ]; })) in - let nombre_total_enfants_3534_ : decimal = + let nombre_total_enfants_4214_ : decimal = log_variable_definition [ "AllocationsFamiliales"; "nombre_total_enfants" ] embed_decimal (try - try nombre_total_enfants_3335_ () + try nombre_total_enfants_3879_ () with EmptyError -> ( try - decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_) + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_R.catala_fr"; + start_line = 162; + start_column = 14; + end_line = 162; + end_column = 34; + law_headings = + [ + "Article R521-3"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets en Conseil d'Etat"; + "Code de la sécurité sociale"; + ]; + } + true) + (fun (_ : _) -> + decimal_of_integer + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_)) with EmptyError -> raise EmptyError) with EmptyError -> raise @@ -3952,35 +4245,56 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = [ "Prologue" ]; })) in - let nombre_moyen_enfants_3535_ : decimal = + let nombre_moyen_enfants_4217_ : decimal = log_variable_definition [ "AllocationsFamiliales"; "nombre_moyen_enfants" ] embed_decimal (try - try nombre_moyen_enfants_3334_ () + try nombre_moyen_enfants_3878_ () with EmptyError -> ( try - Array.fold_left - (fun (acc_3536_ : decimal) (enfant_3537_ : _) -> - acc_3536_ - +& - match - log_end_call - [ "AllocationsFamiliales"; "prise_en_compte" ] - (log_variable_definition - [ "AllocationsFamiliales"; "prise_en_compte"; "output" ] - unembeddable - (log_begin_call - [ "AllocationsFamiliales"; "prise_en_compte" ] - prise_en_compte_3368_ - (log_variable_definition - [ "AllocationsFamiliales"; "prise_en_compte"; "input" ] - unembeddable enfant_3537_))) - with - | Complete __3538_ -> decimal_of_string "1." - | Partagee __3539_ -> decimal_of_string "0.5" - | Zero __3540_ -> decimal_of_string "0.") - (decimal_of_string "0.") enfants_a_charge_droit_ouvert_prestation_familiale_3472_ + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_R.catala_fr"; + start_line = 142; + start_column = 14; + end_line = 142; + end_column = 34; + law_headings = + [ + "Article R521-3"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets en Conseil d'Etat"; + "Code de la sécurité sociale"; + ]; + } + true) + (fun (_ : _) -> + Array.fold_left + (fun (acc_4220_ : decimal) (enfant_4221_ : _) -> + acc_4220_ + +& + match + log_end_call + [ "AllocationsFamiliales"; "prise_en_compte" ] + (log_variable_definition + [ "AllocationsFamiliales"; "prise_en_compte"; "output" ] + unembeddable + (log_begin_call + [ "AllocationsFamiliales"; "prise_en_compte" ] + prise_en_compte_3924_ + (log_variable_definition + [ "AllocationsFamiliales"; "prise_en_compte"; "input" ] + unembeddable enfant_4221_))) + with + | Complete _ -> decimal_of_string "1." + | Partagee _ -> decimal_of_string "0.5" + | Zero _ -> decimal_of_string "0.") + (decimal_of_string "0.") enfants_a_charge_droit_ouvert_prestation_familiale_4064_) with EmptyError -> raise EmptyError) with EmptyError -> raise @@ -3994,38 +4308,39 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = [ "Prologue" ]; })) in - let montant_initial_base_premier_enfant_3541_ : money = + let montant_initial_base_premier_enfant_4225_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_initial_base_premier_enfant" ] embed_money (try - try montant_initial_base_premier_enfant_3330_ () + try montant_initial_base_premier_enfant_3874_ () with EmptyError -> ( try try - if - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 359; - start_column = 5; - end_line = 360; - end_column = 71; - law_headings = - [ - "Article D755-5"; - "Chapitre 5 : Prestations familiales et prestations assimilées"; - "Titre 5 : Départements d'outre-mer"; - "Livre 7 : Régimes divers - Dispositions diverses"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (prestations_familiales_dot_regime_outre_mer_l751_1_3459_ - && array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - = integer_of_string "1") - then prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.0588" - else raise EmptyError + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 359; + start_column = 5; + end_line = 360; + end_column = 71; + law_headings = + [ + "Article D755-5"; + "Chapitre 5 : Prestations familiales et prestations assimilées"; + "Titre 5 : Départements d'outre-mer"; + "Livre 7 : Régimes divers - Dispositions diverses"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + (prestations_familiales_dot_regime_outre_mer_l751_1_4047_ + && array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + = integer_of_string "1")) + (fun (_ : _) -> + prestations_familiales_dot_base_mensuelle_4051_ *$ decimal_of_string "0.0588") with EmptyError -> money_of_cents_string "0" with EmptyError -> raise EmptyError) with EmptyError -> @@ -4040,66 +4355,67 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = [ "Prologue" ]; })) in - let droit_ouvert_base_3542_ : bool = + let droit_ouvert_base_4228_ : bool = log_variable_definition [ "AllocationsFamiliales"; "droit_ouvert_base" ] embed_bool (try - try droit_ouvert_base_3328_ () + try droit_ouvert_base_3872_ () with EmptyError -> ( try - handle_default_1_ + handle_default [| - (fun (__3543_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 344; - start_column = 5; - end_line = 345; - end_column = 72; - law_headings = - [ - "Article 7"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ - à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (residence_3365_ = Mayotte () - && array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >=! integer_of_string "1") - then true - else raise EmptyError); - (fun (__3544_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 406; - start_column = 5; - end_line = 407; - end_column = 72; - law_headings = - [ - "Article L755-12"; - "Chapitre 5 : Prestations familiales et prestations assimilées"; - "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à \ - la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin"; - "Livre 7 : Régimes divers - Dispositions diverses"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (prestations_familiales_dot_regime_outre_mer_l751_1_3459_ - && array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >=! integer_of_string "1") - then true - else raise EmptyError); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 344; + start_column = 5; + end_line = 345; + end_column = 72; + law_headings = + [ + "Article 7"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations \ + familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (residence_3915_ = Mayotte () + && array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >=! integer_of_string "1")) + (fun (_ : _) -> true)); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_L.catala_fr"; + start_line = 406; + start_column = 5; + end_line = 407; + end_column = 72; + law_headings = + [ + "Article L755-12"; + "Chapitre 5 : Prestations familiales et prestations assimilées"; + "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, \ + à la Martinique, à La Réunion, à Saint-Barthélemy et à \ + Saint-Martin"; + "Livre 7 : Régimes divers - Dispositions diverses"; + "Partie législative"; + "Code de la sécurité sociale"; + ]; + } + (prestations_familiales_dot_regime_outre_mer_l751_1_4047_ + && array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >=! integer_of_string "1")) + (fun (_ : _) -> true)); |] - (fun (__3545_ : _) -> + (fun (_ : _) -> log_decision_taken { filename = "./securite_sociale_L.catala_fr"; @@ -4117,9 +4433,9 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa "Code de la sécurité sociale"; ]; } - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ >=! integer_of_string "2")) - (fun (__3546_ : _) -> true) + (fun (_ : _) -> true) with EmptyError -> false) with EmptyError -> raise @@ -4133,59 +4449,59 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = [ "Prologue" ]; })) in - let droit_ouvert_majoration_3547_ : enfant -> bool = + let droit_ouvert_majoration_4237_ : enfant -> bool = log_variable_definition [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] unembeddable (try - try droit_ouvert_majoration_3346_ () + try droit_ouvert_majoration_3890_ () with EmptyError -> ( - fun (param_3548_ : enfant) -> + fun (param_4238_ : enfant) -> try try try - if - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 313; - start_column = 5; - end_line = 315; - end_column = 58; - law_headings = - [ - "Article L521-3"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >=! nombre_enfants_alinea_2_l521_3_3438_ - && param_3548_.age - >=! log_end_call - [ "AllocationsFamiliales"; "âge_minimum_alinéa_1_l521_3" ] - (log_variable_definition - [ - "AllocationsFamiliales"; - "âge_minimum_alinéa_1_l521_3"; - "output"; - ] - unembeddable - (log_begin_call - [ "AllocationsFamiliales"; "âge_minimum_alinéa_1_l521_3" ] - age_minimum_alinea_1_l521_3_3470_ - (log_variable_definition - [ - "AllocationsFamiliales"; - "âge_minimum_alinéa_1_l521_3"; - "input"; - ] - unembeddable param_3548_)))) - then true - else raise EmptyError + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_L.catala_fr"; + start_line = 313; + start_column = 5; + end_line = 315; + end_column = 58; + law_headings = + [ + "Article L521-3"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"; + ]; + } + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >=! nombre_enfants_alinea_2_l521_3_4018_ + && param_4238_.age + >=! log_end_call + [ "AllocationsFamiliales"; "âge_minimum_alinéa_1_l521_3" ] + (log_variable_definition + [ + "AllocationsFamiliales"; + "âge_minimum_alinéa_1_l521_3"; + "output"; + ] + unembeddable + (log_begin_call + [ "AllocationsFamiliales"; "âge_minimum_alinéa_1_l521_3" ] + age_minimum_alinea_1_l521_3_4060_ + (log_variable_definition + [ + "AllocationsFamiliales"; + "âge_minimum_alinéa_1_l521_3"; + "input"; + ] + unembeddable param_4238_))))) + (fun (_ : _) -> true) with EmptyError -> if log_decision_taken @@ -4213,13 +4529,13 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa unembeddable (log_begin_call [ "AllocationsFamiliales"; "est_enfant_le_plus_âgé" ] - est_enfant_le_plus_age_3474_ + est_enfant_le_plus_age_4068_ (log_variable_definition [ "AllocationsFamiliales"; "est_enfant_le_plus_âgé"; "input"; ] - unembeddable param_3548_))))) - && param_3548_.age + unembeddable param_4238_))))) + && param_4238_.age >=! log_end_call [ "AllocationsFamiliales"; "âge_minimum_alinéa_1_l521_3" ] (log_variable_definition @@ -4231,14 +4547,14 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa unembeddable (log_begin_call [ "AllocationsFamiliales"; "âge_minimum_alinéa_1_l521_3" ] - age_minimum_alinea_1_l521_3_3470_ + age_minimum_alinea_1_l521_3_4060_ (log_variable_definition [ "AllocationsFamiliales"; "âge_minimum_alinéa_1_l521_3"; "input"; ] - unembeddable param_3548_)))) + unembeddable param_4238_)))) then true else raise EmptyError with EmptyError -> false @@ -4265,76 +4581,78 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = [ "Prologue" ]; })) in - let complement_degressif_3549_ : money -> money = + let complement_degressif_4241_ : money -> money = log_variable_definition [ "AllocationsFamiliales"; "complément_dégressif" ] unembeddable (try - try complement_degressif_3353_ () + try complement_degressif_3897_ () with EmptyError -> ( - fun (param_3550_ : money) -> + fun (param_4242_ : money) -> try try - handle_default_1_ + handle_default [| - (fun (__3551_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 170; - start_column = 5; - end_line = 171; - end_column = 68; - law_headings = - [ - "Article D521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_3364_ >$ plafond__i_i_d521_3_3476_ - && ressources_menage_3364_ - <=$ plafond__i_i_d521_3_3476_ - +$ (param_3550_ *$ decimal_of_string "12.")) - then - (plafond__i_i_d521_3_3476_ - +$ ((param_3550_ *$ decimal_of_string "12.") -$ ressources_menage_3364_)) - *$ (decimal_of_string "1." /& decimal_of_string "12.") - else raise EmptyError); - (fun (__3552_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 162; - start_column = 5; - end_line = 163; - end_column = 68; - law_headings = - [ - "Article D521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_3364_ >$ plafond__i_d521_3_3483_ - && ressources_menage_3364_ - <=$ plafond__i_d521_3_3483_ +$ (param_3550_ *$ decimal_of_string "12.") + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 170; + start_column = 5; + end_line = 171; + end_column = 68; + law_headings = + [ + "Article D521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + (ressources_menage_3912_ >$ plafond__i_i_d521_3_4072_ + && ressources_menage_3912_ + <=$ plafond__i_i_d521_3_4072_ + +$ (param_4242_ *$ decimal_of_string "12."))) + (fun (_ : _) -> + (plafond__i_i_d521_3_4072_ + +$ ((param_4242_ *$ decimal_of_string "12.") -$ ressources_menage_3912_) ) - then - (plafond__i_d521_3_3483_ - +$ ((param_3550_ *$ decimal_of_string "12.") -$ ressources_menage_3364_)) - *$ (decimal_of_string "1." /& decimal_of_string "12.") - else raise EmptyError); + *$ (decimal_of_string "1." /& decimal_of_string "12."))); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 162; + start_column = 5; + end_line = 163; + end_column = 68; + law_headings = + [ + "Article D521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + (ressources_menage_3912_ >$ plafond__i_d521_3_4087_ + && ressources_menage_3912_ + <=$ plafond__i_d521_3_4087_ + +$ (param_4242_ *$ decimal_of_string "12."))) + (fun (_ : _) -> + (plafond__i_d521_3_4087_ + +$ ((param_4242_ *$ decimal_of_string "12.") -$ ressources_menage_3912_) + ) + *$ (decimal_of_string "1." /& decimal_of_string "12."))); |] - (fun (__3553_ : _) -> + (fun (_ : _) -> log_decision_taken { filename = "./securite_sociale_D.catala_fr"; @@ -4353,7 +4671,7 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa ]; } true) - (fun (__3554_ : _) -> money_of_cents_string "0") + (fun (_ : _) -> money_of_cents_string "0") with EmptyError -> raise EmptyError with EmptyError -> raise @@ -4378,84 +4696,87 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = [ "Prologue" ]; })) in - let montant_verse_forfaitaire_par_enfant_3555_ : money = + let montant_verse_forfaitaire_par_enfant_4251_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_versé_forfaitaire_par_enfant" ] embed_money (try - try montant_verse_forfaitaire_par_enfant_3344_ () + try montant_verse_forfaitaire_par_enfant_3888_ () with EmptyError -> - handle_default_1_ + handle_default [| - (fun (__3556_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 243; - start_column = 5; - end_line = 243; - end_column = 43; - law_headings = - [ - "Article D521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_3364_ >$ plafond__i_i_d521_3_3476_) - then prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.0559" - else raise EmptyError); - (fun (__3557_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 229; - start_column = 5; - end_line = 230; - end_column = 46; - law_headings = - [ - "Article D521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_3364_ >$ plafond__i_d521_3_3483_ - && ressources_menage_3364_ <=$ plafond__i_i_d521_3_3476_) - then prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.1117" - else raise EmptyError); - (fun (__3558_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 215; - start_column = 5; - end_line = 215; - end_column = 43; - law_headings = - [ - "Article D521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_3364_ <=$ plafond__i_d521_3_3483_) - then prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.20234" - else raise EmptyError); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 243; + start_column = 5; + end_line = 243; + end_column = 43; + law_headings = + [ + "Article D521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + (ressources_menage_3912_ >$ plafond__i_i_d521_3_4072_)) + (fun (_ : _) -> + prestations_familiales_dot_base_mensuelle_4051_ *$ decimal_of_string "0.0559")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 229; + start_column = 5; + end_line = 230; + end_column = 46; + law_headings = + [ + "Article D521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + (ressources_menage_3912_ >$ plafond__i_d521_3_4087_ + && ressources_menage_3912_ <=$ plafond__i_i_d521_3_4072_)) + (fun (_ : _) -> + prestations_familiales_dot_base_mensuelle_4051_ *$ decimal_of_string "0.1117")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 215; + start_column = 5; + end_line = 215; + end_column = 43; + law_headings = + [ + "Article D521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + (ressources_menage_3912_ <=$ plafond__i_d521_3_4087_)) + (fun (_ : _) -> + prestations_familiales_dot_base_mensuelle_4051_ *$ decimal_of_string "0.20234")); |] - (fun (__3559_ : _) -> + (fun (_ : _) -> log_decision_taken { filename = ""; @@ -4466,124 +4787,124 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = []; } false) - (fun (__3560_ : _) -> raise EmptyError) + (fun (_ : _) -> raise EmptyError) with EmptyError -> raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 128; - start_column = 12; - end_line = 128; - end_column = 48; - law_headings = [ "Prologue" ]; - })) - in - let montant_initial_base_troisieme_enfant_et_plus_3561_ : money = - log_variable_definition - [ "AllocationsFamiliales"; "montant_initial_base_troisième_enfant_et_plus" ] - embed_money - (try - try montant_initial_base_troisieme_enfant_et_plus_3332_ () - with EmptyError -> - handle_default_1_ - [| - (fun (__3562_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 113; - start_column = 3; - end_line = 113; - end_column = 41; - law_headings = - [ - "Article D521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_3364_ >$ plafond__i_i_d521_3_3476_) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >! integer_of_string "2" - then - prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.1025" - *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - -! integer_of_string "2") - else money_of_cents_string "0" - else raise EmptyError); - (fun (__3563_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 74; - start_column = 3; - end_line = 75; - end_column = 44; - law_headings = - [ - "Article D521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_3364_ >$ plafond__i_d521_3_3483_ - && ressources_menage_3364_ <=$ plafond__i_i_d521_3_3476_) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >! integer_of_string "2" - then - prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.205" - *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - -! integer_of_string "2") - else money_of_cents_string "0" - else raise EmptyError); - (fun (__3564_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 35; - start_column = 3; - end_line = 35; - end_column = 41; - law_headings = - [ - "Article D521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_3364_ <=$ plafond__i_d521_3_3483_) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >! integer_of_string "2" - then - prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.41" - *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - -! integer_of_string "2") - else money_of_cents_string "0" - else raise EmptyError); + (NoValueProvided + { + filename = "./prologue.catala_fr"; + start_line = 128; + start_column = 12; + end_line = 128; + end_column = 48; + law_headings = [ "Prologue" ]; + })) + in + let montant_initial_base_troisieme_enfant_et_plus_4263_ : money = + log_variable_definition + [ "AllocationsFamiliales"; "montant_initial_base_troisième_enfant_et_plus" ] + embed_money + (try + try montant_initial_base_troisieme_enfant_et_plus_3876_ () + with EmptyError -> + handle_default + [| + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 113; + start_column = 3; + end_line = 113; + end_column = 41; + law_headings = + [ + "Article D521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + (ressources_menage_3912_ >$ plafond__i_i_d521_3_4072_)) + (fun (_ : _) -> + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >! integer_of_string "2" + then + prestations_familiales_dot_base_mensuelle_4051_ *$ decimal_of_string "0.1025" + *$ decimal_of_integer + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + -! integer_of_string "2") + else money_of_cents_string "0")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 74; + start_column = 3; + end_line = 75; + end_column = 44; + law_headings = + [ + "Article D521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + (ressources_menage_3912_ >$ plafond__i_d521_3_4087_ + && ressources_menage_3912_ <=$ plafond__i_i_d521_3_4072_)) + (fun (_ : _) -> + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >! integer_of_string "2" + then + prestations_familiales_dot_base_mensuelle_4051_ *$ decimal_of_string "0.205" + *$ decimal_of_integer + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + -! integer_of_string "2") + else money_of_cents_string "0")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 35; + start_column = 3; + end_line = 35; + end_column = 41; + law_headings = + [ + "Article D521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + (ressources_menage_3912_ <=$ plafond__i_d521_3_4087_)) + (fun (_ : _) -> + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >! integer_of_string "2" + then + prestations_familiales_dot_base_mensuelle_4051_ *$ decimal_of_string "0.41" + *$ decimal_of_integer + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + -! integer_of_string "2") + else money_of_cents_string "0")); |] - (fun (__3565_ : _) -> + (fun (_ : _) -> log_decision_taken { filename = ""; @@ -4594,7 +4915,7 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = []; } false) - (fun (__3566_ : _) -> raise EmptyError) + (fun (_ : _) -> raise EmptyError) with EmptyError -> raise (NoValueProvided @@ -4607,99 +4928,102 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = [ "Prologue" ]; })) in - let montant_initial_base_deuxieme_enfant_3567_ : money = + let montant_initial_base_deuxieme_enfant_4275_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_initial_base_deuxième_enfant" ] embed_money (try - try montant_initial_base_deuxieme_enfant_3331_ () + try montant_initial_base_deuxieme_enfant_3875_ () with EmptyError -> - handle_default_1_ + handle_default [| - (fun (__3568_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 113; - start_column = 3; - end_line = 113; - end_column = 41; - law_headings = - [ - "Article D521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_3364_ >$ plafond__i_i_d521_3_3476_) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >! integer_of_string "1" - then prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.08" - else money_of_cents_string "0" - else raise EmptyError); - (fun (__3569_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 74; - start_column = 3; - end_line = 75; - end_column = 44; - law_headings = - [ - "Article D521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_3364_ >$ plafond__i_d521_3_3483_ - && ressources_menage_3364_ <=$ plafond__i_i_d521_3_3476_) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >! integer_of_string "1" - then prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.16" - else money_of_cents_string "0" - else raise EmptyError); - (fun (__3570_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 35; - start_column = 3; - end_line = 35; - end_column = 41; - law_headings = - [ - "Article D521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_3364_ <=$ plafond__i_d521_3_3483_) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - >! integer_of_string "1" - then prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.32" - else money_of_cents_string "0" - else raise EmptyError); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 113; + start_column = 3; + end_line = 113; + end_column = 41; + law_headings = + [ + "Article D521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + (ressources_menage_3912_ >$ plafond__i_i_d521_3_4072_)) + (fun (_ : _) -> + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >! integer_of_string "1" + then + prestations_familiales_dot_base_mensuelle_4051_ *$ decimal_of_string "0.08" + else money_of_cents_string "0")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 74; + start_column = 3; + end_line = 75; + end_column = 44; + law_headings = + [ + "Article D521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + (ressources_menage_3912_ >$ plafond__i_d521_3_4087_ + && ressources_menage_3912_ <=$ plafond__i_i_d521_3_4072_)) + (fun (_ : _) -> + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >! integer_of_string "1" + then + prestations_familiales_dot_base_mensuelle_4051_ *$ decimal_of_string "0.16" + else money_of_cents_string "0")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 35; + start_column = 3; + end_line = 35; + end_column = 41; + law_headings = + [ + "Article D521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + (ressources_menage_3912_ <=$ plafond__i_d521_3_4087_)) + (fun (_ : _) -> + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + >! integer_of_string "1" + then + prestations_familiales_dot_base_mensuelle_4051_ *$ decimal_of_string "0.32" + else money_of_cents_string "0")); |] - (fun (__3571_ : _) -> + (fun (_ : _) -> log_decision_taken { filename = ""; @@ -4710,7 +5034,7 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = []; } false) - (fun (__3572_ : _) -> raise EmptyError) + (fun (_ : _) -> raise EmptyError) with EmptyError -> raise (NoValueProvided @@ -4723,180 +5047,207 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = [ "Prologue" ]; })) in - let rapport_enfants_total_moyen_3573_ : decimal = + let rapport_enfants_total_moyen_4287_ : decimal = log_variable_definition [ "AllocationsFamiliales"; "rapport_enfants_total_moyen" ] embed_decimal (try - try rapport_enfants_total_moyen_3333_ () + try rapport_enfants_total_moyen_3877_ () with EmptyError -> ( try - if nombre_total_enfants_3534_ = decimal_of_string "0." then decimal_of_string "0." - else nombre_moyen_enfants_3535_ /& nombre_total_enfants_3534_ - with EmptyError -> raise EmptyError) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 113; - start_column = 12; - end_line = 113; - end_column = 39; - law_headings = [ "Prologue" ]; - })) - in - let montant_initial_metropole_majoration_3574_ : enfant -> money = - log_variable_definition - [ "AllocationsFamiliales"; "montant_initial_métropole_majoration" ] - unembeddable - (try - try montant_initial_metropole_majoration_3347_ () - with EmptyError -> ( - fun (param_3575_ : enfant) -> - try - handle_default_1_ - [| - (fun (__3576_ : _) -> - if - log_decision_taken - { - filename = "./epilogue.catala_fr"; - start_line = 27; - start_column = 5; - end_line = 27; - end_column = 44; - law_headings = [ "Règles diverses"; "Épilogue"; "Décrets divers" ]; - } - (not - (log_end_call - [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - (log_variable_definition - [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "output" ] - unembeddable - (log_begin_call - [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - droit_ouvert_majoration_3547_ - (log_variable_definition - [ - "AllocationsFamiliales"; - "droit_ouvert_majoration"; - "input"; - ] - unembeddable param_3575_))))) - then money_of_cents_string "0" - else raise EmptyError); - (fun (__3577_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 132; - start_column = 3; - end_line = 132; - end_column = 41; - law_headings = - [ - "Article D521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_3364_ >$ plafond__i_i_d521_3_3476_ - && log_end_call - [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - (log_variable_definition - [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "output" ] - unembeddable - (log_begin_call - [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - droit_ouvert_majoration_3547_ - (log_variable_definition - [ - "AllocationsFamiliales"; "droit_ouvert_majoration"; "input"; - ] - unembeddable param_3575_)))) - then - prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.04" - else raise EmptyError); - (fun (__3578_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 95; - start_column = 3; - end_line = 96; - end_column = 44; - law_headings = - [ - "Article D521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - ((ressources_menage_3364_ >$ plafond__i_d521_3_3483_ - && ressources_menage_3364_ <=$ plafond__i_i_d521_3_3476_) - && log_end_call - [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - (log_variable_definition - [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "output" ] - unembeddable - (log_begin_call - [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - droit_ouvert_majoration_3547_ - (log_variable_definition - [ - "AllocationsFamiliales"; "droit_ouvert_majoration"; "input"; - ] - unembeddable param_3575_)))) - then - prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.08" - else raise EmptyError); - (fun (__3579_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 55; - start_column = 3; - end_line = 55; - end_column = 41; - law_headings = - [ - "Article D521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_3364_ <=$ plafond__i_d521_3_3483_ - && log_end_call - [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - (log_variable_definition - [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "output" ] - unembeddable - (log_begin_call - [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - droit_ouvert_majoration_3547_ - (log_variable_definition - [ - "AllocationsFamiliales"; "droit_ouvert_majoration"; "input"; - ] - unembeddable param_3575_)))) - then - prestations_familiales_dot_base_mensuelle_3463_ *$ decimal_of_string "0.16" - else raise EmptyError); + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_R.catala_fr"; + start_line = 128; + start_column = 14; + end_line = 128; + end_column = 41; + law_headings = + [ + "Article R521-3"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets en Conseil d'Etat"; + "Code de la sécurité sociale"; + ]; + } + true) + (fun (_ : _) -> + if nombre_total_enfants_4214_ = decimal_of_string "0." then decimal_of_string "0." + else nombre_moyen_enfants_4217_ /& nombre_total_enfants_4214_) + with EmptyError -> raise EmptyError) + with EmptyError -> + raise + (NoValueProvided + { + filename = "./prologue.catala_fr"; + start_line = 113; + start_column = 12; + end_line = 113; + end_column = 39; + law_headings = [ "Prologue" ]; + })) + in + let montant_initial_metropole_majoration_4290_ : enfant -> money = + log_variable_definition + [ "AllocationsFamiliales"; "montant_initial_métropole_majoration" ] + unembeddable + (try + try montant_initial_metropole_majoration_3891_ () + with EmptyError -> ( + fun (param_4291_ : enfant) -> + try + handle_default + [| + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./epilogue.catala_fr"; + start_line = 27; + start_column = 5; + end_line = 27; + end_column = 44; + law_headings = [ "Règles diverses"; "Épilogue"; "Décrets divers" ]; + } + (not + (log_end_call + [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] + (log_variable_definition + [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "output" ] + unembeddable + (log_begin_call + [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] + droit_ouvert_majoration_4237_ + (log_variable_definition + [ + "AllocationsFamiliales"; + "droit_ouvert_majoration"; + "input"; + ] + unembeddable param_4291_)))))) + (fun (_ : _) -> money_of_cents_string "0")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 132; + start_column = 3; + end_line = 132; + end_column = 41; + law_headings = + [ + "Article D521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + (ressources_menage_3912_ >$ plafond__i_i_d521_3_4072_ + && log_end_call + [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] + (log_variable_definition + [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "output" ] + unembeddable + (log_begin_call + [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] + droit_ouvert_majoration_4237_ + (log_variable_definition + [ + "AllocationsFamiliales"; + "droit_ouvert_majoration"; + "input"; + ] + unembeddable param_4291_))))) + (fun (_ : _) -> + prestations_familiales_dot_base_mensuelle_4051_ *$ decimal_of_string "0.04")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 95; + start_column = 3; + end_line = 96; + end_column = 44; + law_headings = + [ + "Article D521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + ((ressources_menage_3912_ >$ plafond__i_d521_3_4087_ + && ressources_menage_3912_ <=$ plafond__i_i_d521_3_4072_) + && log_end_call + [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] + (log_variable_definition + [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "output" ] + unembeddable + (log_begin_call + [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] + droit_ouvert_majoration_4237_ + (log_variable_definition + [ + "AllocationsFamiliales"; + "droit_ouvert_majoration"; + "input"; + ] + unembeddable param_4291_))))) + (fun (_ : _) -> + prestations_familiales_dot_base_mensuelle_4051_ *$ decimal_of_string "0.08")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 55; + start_column = 3; + end_line = 55; + end_column = 41; + law_headings = + [ + "Article D521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + (ressources_menage_3912_ <=$ plafond__i_d521_3_4087_ + && log_end_call + [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] + (log_variable_definition + [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "output" ] + unembeddable + (log_begin_call + [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] + droit_ouvert_majoration_4237_ + (log_variable_definition + [ + "AllocationsFamiliales"; + "droit_ouvert_majoration"; + "input"; + ] + unembeddable param_4291_))))) + (fun (_ : _) -> + prestations_familiales_dot_base_mensuelle_4051_ *$ decimal_of_string "0.16")); |] - (fun (__3580_ : _) -> + (fun (_ : _) -> log_decision_taken { filename = ""; @@ -4907,7 +5258,7 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = []; } false) - (fun (__3581_ : _) -> raise EmptyError) + (fun (_ : _) -> raise EmptyError) with EmptyError -> raise (NoValueProvided @@ -4931,33 +5282,58 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = [ "Prologue" ]; })) in - let montant_verse_forfaitaire_3582_ : money = + let montant_verse_forfaitaire_4306_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_versé_forfaitaire" ] embed_money (try - try montant_verse_forfaitaire_3345_ () + try montant_verse_forfaitaire_3889_ () with EmptyError -> ( try - montant_verse_forfaitaire_par_enfant_3555_ - *$ decimal_of_integer - (Array.fold_left - (fun (acc_3583_ : integer) (enfant_3584_ : _) -> - if - log_end_call - [ "AllocationsFamiliales"; "droit_ouvert_forfaitaire" ] - (log_variable_definition - [ "AllocationsFamiliales"; "droit_ouvert_forfaitaire"; "output" ] - unembeddable - (log_begin_call - [ "AllocationsFamiliales"; "droit_ouvert_forfaitaire" ] - droit_ouvert_forfaitaire_3491_ - (log_variable_definition - [ "AllocationsFamiliales"; "droit_ouvert_forfaitaire"; "input" ] - unembeddable enfant_3584_))) - then acc_3583_ +! integer_of_string "1" - else acc_3583_) - (integer_of_string "0") enfants_a_charge_3367_) + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 194; + start_column = 14; + end_line = 194; + end_column = 39; + law_headings = + [ + "Article D521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + true) + (fun (_ : _) -> + montant_verse_forfaitaire_par_enfant_4251_ + *$ decimal_of_integer + (Array.fold_left + (fun (acc_4309_ : integer) (enfant_4310_ : _) -> + if + log_end_call + [ "AllocationsFamiliales"; "droit_ouvert_forfaitaire" ] + (log_variable_definition + [ "AllocationsFamiliales"; "droit_ouvert_forfaitaire"; "output" ] + unembeddable + (log_begin_call + [ "AllocationsFamiliales"; "droit_ouvert_forfaitaire" ] + droit_ouvert_forfaitaire_4105_ + (log_variable_definition + [ + "AllocationsFamiliales"; + "droit_ouvert_forfaitaire"; + "input"; + ] + unembeddable enfant_4310_))) + then acc_4309_ +! integer_of_string "1" + else acc_4309_) + (integer_of_string "0") enfants_a_charge_3921_)) with EmptyError -> raise EmptyError) with EmptyError -> raise @@ -4971,67 +5347,67 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = [ "Prologue" ]; })) in - let montant_initial_base_3585_ : money = + let montant_initial_base_4311_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_initial_base" ] embed_money (try - try montant_initial_base_3329_ () + try montant_initial_base_3873_ () with EmptyError -> ( try - handle_default_1_ + handle_default [| - (fun (__3586_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 335; - start_column = 5; - end_line = 335; - end_column = 24; - law_headings = - [ - "Article 7"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ - à Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (residence_3365_ = Mayotte ()) - then - montant_initial_base_premier_enfant_mayotte_3520_ - +$ (montant_initial_base_deuxieme_enfant_mayotte_3507_ - +$ (montant_initial_base_troisieme_enfant_mayotte_3494_ - +$ montant_initial_base_quatrieme_enfant_et_plus_mayotte_3493_)) - else raise EmptyError); - (fun (__3587_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 350; - start_column = 5; - end_line = 351; - end_column = 69; - law_headings = - [ - "Article D755-5"; - "Chapitre 5 : Prestations familiales et prestations assimilées"; - "Titre 5 : Départements d'outre-mer"; - "Livre 7 : Régimes divers - Dispositions diverses"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (prestations_familiales_dot_regime_outre_mer_l751_1_3459_ - && array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - = integer_of_string "1") - then montant_initial_base_premier_enfant_3541_ - else raise EmptyError); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 335; + start_column = 5; + end_line = 335; + end_column = 24; + law_headings = + [ + "Article 7"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations \ + familiales à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (residence_3915_ = Mayotte ())) + (fun (_ : _) -> + montant_initial_base_premier_enfant_mayotte_4178_ + +$ (montant_initial_base_deuxieme_enfant_mayotte_4145_ + +$ (montant_initial_base_troisieme_enfant_mayotte_4112_ + +$ montant_initial_base_quatrieme_enfant_et_plus_mayotte_4109_)))); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 350; + start_column = 5; + end_line = 351; + end_column = 69; + law_headings = + [ + "Article D755-5"; + "Chapitre 5 : Prestations familiales et prestations assimilées"; + "Titre 5 : Départements d'outre-mer"; + "Livre 7 : Régimes divers - Dispositions diverses"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + (prestations_familiales_dot_regime_outre_mer_l751_1_4047_ + && array_length enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + = integer_of_string "1")) + (fun (_ : _) -> montant_initial_base_premier_enfant_4225_)); |] - (fun (__3588_ : _) -> + (fun (_ : _) -> log_decision_taken { filename = "./securite_sociale_D.catala_fr"; @@ -5050,9 +5426,9 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa ]; } true) - (fun (__3589_ : _) -> - montant_initial_base_deuxieme_enfant_3567_ - +$ montant_initial_base_troisieme_enfant_et_plus_3561_) + (fun (_ : _) -> + montant_initial_base_deuxieme_enfant_4275_ + +$ montant_initial_base_troisieme_enfant_et_plus_4263_) with EmptyError -> raise EmptyError) with EmptyError -> raise @@ -5066,101 +5442,107 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = [ "Prologue" ]; })) in - let montant_initial_majoration_3590_ : enfant -> money = + let montant_initial_majoration_4320_ : enfant -> money = log_variable_definition [ "AllocationsFamiliales"; "montant_initial_majoration" ] unembeddable (try - try montant_initial_majoration_3348_ () + try montant_initial_majoration_3892_ () with EmptyError -> ( - fun (param_3591_ : enfant) -> + fun (param_4321_ : enfant) -> try try - handle_default_1_ + handle_default [| - (fun (__3592_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 382; - start_column = 5; - end_line = 385; - end_column = 23; - law_headings = - [ - "Article D755-5"; - "Chapitre 5 : Prestations familiales et prestations assimilées"; - "Titre 5 : Départements d'outre-mer"; - "Livre 7 : Régimes divers - Dispositions diverses"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (log_end_call - [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - (log_variable_definition - [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "output" ] - unembeddable - (log_begin_call - [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - droit_ouvert_majoration_3547_ - (log_variable_definition - [ - "AllocationsFamiliales"; "droit_ouvert_majoration"; "input"; - ] - unembeddable param_3591_))) - && prestations_familiales_dot_regime_outre_mer_l751_1_3459_ - && array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - = integer_of_string "1" - && param_3591_.age >=! integer_of_string "16") - then - prestations_familiales_dot_base_mensuelle_3463_ - *$ decimal_of_string "0.0567" - else raise EmptyError); - (fun (__3593_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 373; - start_column = 5; - end_line = 376; - end_column = 42; - law_headings = - [ - "Article D755-5"; - "Chapitre 5 : Prestations familiales et prestations assimilées"; - "Titre 5 : Départements d'outre-mer"; - "Livre 7 : Régimes divers - Dispositions diverses"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (log_end_call - [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - (log_variable_definition - [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "output" ] - unembeddable - (log_begin_call - [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - droit_ouvert_majoration_3547_ - (log_variable_definition - [ - "AllocationsFamiliales"; "droit_ouvert_majoration"; "input"; - ] - unembeddable param_3591_))) - && prestations_familiales_dot_regime_outre_mer_l751_1_3459_ - && array_length enfants_a_charge_droit_ouvert_prestation_familiale_3472_ - = integer_of_string "1" - && param_3591_.age >=! integer_of_string "11" - && param_3591_.age + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 382; + start_column = 5; + end_line = 385; + end_column = 23; + law_headings = + [ + "Article D755-5"; + "Chapitre 5 : Prestations familiales et prestations assimilées"; + "Titre 5 : Départements d'outre-mer"; + "Livre 7 : Régimes divers - Dispositions diverses"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + (log_end_call + [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] + (log_variable_definition + [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "output" ] + unembeddable + (log_begin_call + [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] + droit_ouvert_majoration_4237_ + (log_variable_definition + [ + "AllocationsFamiliales"; + "droit_ouvert_majoration"; + "input"; + ] + unembeddable param_4321_))) + && prestations_familiales_dot_regime_outre_mer_l751_1_4047_ + && array_length + enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + = integer_of_string "1" + && param_4321_.age >=! integer_of_string "16")) + (fun (_ : _) -> + prestations_familiales_dot_base_mensuelle_4051_ + *$ decimal_of_string "0.0567")); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 373; + start_column = 5; + end_line = 376; + end_column = 42; + law_headings = + [ + "Article D755-5"; + "Chapitre 5 : Prestations familiales et prestations assimilées"; + "Titre 5 : Départements d'outre-mer"; + "Livre 7 : Régimes divers - Dispositions diverses"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + (log_end_call + [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] + (log_variable_definition + [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "output" ] + unembeddable + (log_begin_call + [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] + droit_ouvert_majoration_4237_ + (log_variable_definition + [ + "AllocationsFamiliales"; + "droit_ouvert_majoration"; + "input"; + ] + unembeddable param_4321_))) + && prestations_familiales_dot_regime_outre_mer_l751_1_4047_ + && array_length + enfants_a_charge_droit_ouvert_prestation_familiale_4064_ + = integer_of_string "1" + && param_4321_.age >=! integer_of_string "11" + && param_4321_.age + prestations_familiales_dot_base_mensuelle_4051_ + *$ decimal_of_string "0.0369")); |] - (fun (__3594_ : _) -> + (fun (_ : _) -> log_decision_taken { filename = "./securite_sociale_D.catala_fr"; @@ -5179,7 +5561,7 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa ]; } true) - (fun (__3595_ : _) -> + (fun (_ : _) -> log_end_call [ "AllocationsFamiliales"; "montant_initial_métropole_majoration" ] (log_variable_definition @@ -5191,14 +5573,14 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa unembeddable (log_begin_call [ "AllocationsFamiliales"; "montant_initial_métropole_majoration" ] - montant_initial_metropole_majoration_3574_ + montant_initial_metropole_majoration_4290_ (log_variable_definition [ "AllocationsFamiliales"; "montant_initial_métropole_majoration"; "input"; ] - unembeddable param_3591_)))) + unembeddable param_4321_)))) with EmptyError -> raise EmptyError with EmptyError -> raise @@ -5223,76 +5605,76 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = [ "Prologue" ]; })) in - let montant_verse_complement_pour_forfaitaire_3596_ : money = + let montant_verse_complement_pour_forfaitaire_4330_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_versé_complément_pour_forfaitaire" ] embed_money (try - try montant_verse_complement_pour_forfaitaire_3355_ () + try montant_verse_complement_pour_forfaitaire_3899_ () with EmptyError -> ( try - handle_default_1_ + handle_default [| - (fun (__3597_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 272; - start_column = 5; - end_line = 274; - end_column = 41; - law_headings = - [ - "Article D521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_3364_ >$ plafond__i_i_d521_3_3476_ - && ressources_menage_3364_ - <=$ plafond__i_i_d521_3_3476_ - +$ (montant_verse_forfaitaire_3582_ *$ decimal_of_string "12.")) - then - (plafond__i_i_d521_3_3476_ - +$ ((montant_verse_forfaitaire_3582_ *$ decimal_of_string "12.") - -$ ressources_menage_3364_)) - *$ (decimal_of_string "1." /& decimal_of_string "12.") - else raise EmptyError); - (fun (__3598_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 262; - start_column = 5; - end_line = 264; - end_column = 42; - law_headings = - [ - "Article D521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_3364_ >$ plafond__i_d521_3_3483_ - && ressources_menage_3364_ - <=$ plafond__i_d521_3_3483_ - +$ (montant_verse_forfaitaire_3582_ *$ decimal_of_string "12.")) - then - (plafond__i_d521_3_3483_ - +$ ((montant_verse_forfaitaire_3582_ *$ decimal_of_string "12.") - -$ ressources_menage_3364_)) - *$ (decimal_of_string "1." /& decimal_of_string "12.") - else raise EmptyError); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 272; + start_column = 5; + end_line = 274; + end_column = 41; + law_headings = + [ + "Article D521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + (ressources_menage_3912_ >$ plafond__i_i_d521_3_4072_ + && ressources_menage_3912_ + <=$ plafond__i_i_d521_3_4072_ + +$ (montant_verse_forfaitaire_4306_ *$ decimal_of_string "12."))) + (fun (_ : _) -> + (plafond__i_i_d521_3_4072_ + +$ ((montant_verse_forfaitaire_4306_ *$ decimal_of_string "12.") + -$ ressources_menage_3912_)) + *$ (decimal_of_string "1." /& decimal_of_string "12."))); + (fun (_ : _) -> + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 262; + start_column = 5; + end_line = 264; + end_column = 42; + law_headings = + [ + "Article D521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + (ressources_menage_3912_ >$ plafond__i_d521_3_4087_ + && ressources_menage_3912_ + <=$ plafond__i_d521_3_4087_ + +$ (montant_verse_forfaitaire_4306_ *$ decimal_of_string "12."))) + (fun (_ : _) -> + (plafond__i_d521_3_4087_ + +$ ((montant_verse_forfaitaire_4306_ *$ decimal_of_string "12.") + -$ ressources_menage_3912_)) + *$ (decimal_of_string "1." /& decimal_of_string "12."))); |] - (fun (__3599_ : _) -> + (fun (_ : _) -> log_decision_taken { filename = "./securite_sociale_D.catala_fr"; @@ -5311,7 +5693,7 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa ]; } true) - (fun (__3600_ : _) -> money_of_cents_string "0") + (fun (_ : _) -> money_of_cents_string "0") with EmptyError -> raise EmptyError) with EmptyError -> raise @@ -5325,14 +5707,35 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = [ "Prologue" ]; })) in - let montant_avec_garde_alternee_base_3601_ : money = + let montant_avec_garde_alternee_base_4339_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_avec_garde_alternée_base" ] embed_money (try - try montant_avec_garde_alternee_base_3336_ () + try montant_avec_garde_alternee_base_3880_ () with EmptyError -> ( - try montant_initial_base_3585_ *$ rapport_enfants_total_moyen_3573_ + try + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_R.catala_fr"; + start_line = 125; + start_column = 14; + end_line = 125; + end_column = 46; + law_headings = + [ + "Article R521-3"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets en Conseil d'Etat"; + "Code de la sécurité sociale"; + ]; + } + true) + (fun (_ : _) -> montant_initial_base_4311_ *$ rapport_enfants_total_moyen_4287_) with EmptyError -> raise EmptyError) with EmptyError -> raise @@ -5346,44 +5749,65 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = [ "Prologue" ]; })) in - let montant_avec_garde_alternee_majoration_3602_ : enfant -> money = + let montant_avec_garde_alternee_majoration_4342_ : enfant -> money = log_variable_definition [ "AllocationsFamiliales"; "montant_avec_garde_alternée_majoration" ] unembeddable (try - try montant_avec_garde_alternee_majoration_3349_ () + try montant_avec_garde_alternee_majoration_3893_ () with EmptyError -> ( - fun (param_3603_ : enfant) -> + fun (param_4343_ : enfant) -> try try - log_end_call - [ "AllocationsFamiliales"; "montant_initial_majoration" ] - (log_variable_definition - [ "AllocationsFamiliales"; "montant_initial_majoration"; "output" ] - unembeddable - (log_begin_call - [ "AllocationsFamiliales"; "montant_initial_majoration" ] - montant_initial_majoration_3590_ + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_R.catala_fr"; + start_line = 187; + start_column = 5; + end_line = 187; + end_column = 43; + law_headings = + [ + "Article R521-4"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets en Conseil d'Etat"; + "Code de la sécurité sociale"; + ]; + } + true) + (fun (_ : _) -> + log_end_call + [ "AllocationsFamiliales"; "montant_initial_majoration" ] + (log_variable_definition + [ "AllocationsFamiliales"; "montant_initial_majoration"; "output" ] + unembeddable + (log_begin_call + [ "AllocationsFamiliales"; "montant_initial_majoration" ] + montant_initial_majoration_4320_ + (log_variable_definition + [ "AllocationsFamiliales"; "montant_initial_majoration"; "input" ] + unembeddable param_4343_))) + *$ + match + log_end_call + [ "AllocationsFamiliales"; "prise_en_compte" ] (log_variable_definition - [ "AllocationsFamiliales"; "montant_initial_majoration"; "input" ] - unembeddable param_3603_))) - *$ - match - log_end_call - [ "AllocationsFamiliales"; "prise_en_compte" ] - (log_variable_definition - [ "AllocationsFamiliales"; "prise_en_compte"; "output" ] - unembeddable - (log_begin_call - [ "AllocationsFamiliales"; "prise_en_compte" ] - prise_en_compte_3368_ - (log_variable_definition - [ "AllocationsFamiliales"; "prise_en_compte"; "input" ] - unembeddable param_3603_))) - with - | Complete __3604_ -> decimal_of_string "1." - | Partagee __3605_ -> decimal_of_string "0.5" - | Zero __3606_ -> decimal_of_string "0." + [ "AllocationsFamiliales"; "prise_en_compte"; "output" ] + unembeddable + (log_begin_call + [ "AllocationsFamiliales"; "prise_en_compte" ] + prise_en_compte_3924_ + (log_variable_definition + [ "AllocationsFamiliales"; "prise_en_compte"; "input" ] + unembeddable param_4343_))) + with + | Complete _ -> decimal_of_string "1." + | Partagee _ -> decimal_of_string "0.5" + | Zero _ -> decimal_of_string "0.") with EmptyError -> raise EmptyError with EmptyError -> raise @@ -5408,16 +5832,29 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = [ "Prologue" ]; })) in - let montant_verse_base_3607_ : money = + let montant_verse_base_4349_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_versé_base" ] embed_money (try - try montant_verse_base_3337_ () + try montant_verse_base_3881_ () with EmptyError -> ( try - if droit_ouvert_base_3542_ then montant_avec_garde_alternee_base_3601_ - else money_of_cents_string "0" + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./epilogue.catala_fr"; + start_line = 36; + start_column = 14; + end_line = 36; + end_column = 32; + law_headings = [ "Règles diverses"; "Épilogue"; "Décrets divers" ]; + } + true) + (fun (_ : _) -> + if droit_ouvert_base_4228_ then montant_avec_garde_alternee_base_4339_ + else money_of_cents_string "0") with EmptyError -> raise EmptyError) with EmptyError -> raise @@ -5431,39 +5868,55 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = [ "Prologue" ]; })) in - let montant_verse_majoration_3608_ : money = + let montant_verse_majoration_4352_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_versé_majoration" ] embed_money (try - try montant_verse_majoration_3350_ () + try montant_verse_majoration_3894_ () with EmptyError -> ( try - if droit_ouvert_base_3542_ then - Array.fold_left - (fun (acc_3609_ : money) (enfant_3610_ : _) -> - acc_3609_ - +$ log_end_call - [ "AllocationsFamiliales"; "montant_avec_garde_alternée_majoration" ] - (log_variable_definition - [ - "AllocationsFamiliales"; - "montant_avec_garde_alternée_majoration"; - "output"; - ] - unembeddable - (log_begin_call - [ "AllocationsFamiliales"; "montant_avec_garde_alternée_majoration" ] - montant_avec_garde_alternee_majoration_3602_ - (log_variable_definition - [ - "AllocationsFamiliales"; - "montant_avec_garde_alternée_majoration"; - "input"; - ] - unembeddable enfant_3610_)))) - (money_of_cents_string "0") enfants_a_charge_3367_ - else money_of_cents_string "0" + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./epilogue.catala_fr"; + start_line = 38; + start_column = 14; + end_line = 38; + end_column = 38; + law_headings = [ "Règles diverses"; "Épilogue"; "Décrets divers" ]; + } + true) + (fun (_ : _) -> + if droit_ouvert_base_4228_ then + Array.fold_left + (fun (acc_4355_ : money) (enfant_4356_ : _) -> + acc_4355_ + +$ log_end_call + [ "AllocationsFamiliales"; "montant_avec_garde_alternée_majoration" ] + (log_variable_definition + [ + "AllocationsFamiliales"; + "montant_avec_garde_alternée_majoration"; + "output"; + ] + unembeddable + (log_begin_call + [ + "AllocationsFamiliales"; + "montant_avec_garde_alternée_majoration"; + ] + montant_avec_garde_alternee_majoration_4342_ + (log_variable_definition + [ + "AllocationsFamiliales"; + "montant_avec_garde_alternée_majoration"; + "input"; + ] + unembeddable enfant_4356_)))) + (money_of_cents_string "0") enfants_a_charge_3921_ + else money_of_cents_string "0") with EmptyError -> raise EmptyError) with EmptyError -> raise @@ -5477,14 +5930,35 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = [ "Prologue" ]; })) in - let montant_base_complement_pour_base_et_majoration_3611_ : money = + let montant_base_complement_pour_base_et_majoration_4357_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_base_complément_pour_base_et_majoration" ] embed_money (try - try montant_base_complement_pour_base_et_majoration_3352_ () + try montant_base_complement_pour_base_et_majoration_3896_ () with EmptyError -> ( - try montant_verse_base_3607_ +$ montant_verse_majoration_3608_ + try + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 184; + start_column = 14; + end_line = 184; + end_column = 61; + law_headings = + [ + "Article D521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + true) + (fun (_ : _) -> montant_verse_base_4349_ +$ montant_verse_majoration_4352_) with EmptyError -> raise EmptyError) with EmptyError -> raise @@ -5498,27 +5972,48 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = [ "Prologue" ]; })) in - let montant_verse_complement_pour_base_et_majoration_3612_ : money = + let montant_verse_complement_pour_base_et_majoration_4360_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_versé_complément_pour_base_et_majoration" ] embed_money (try - try montant_verse_complement_pour_base_et_majoration_3354_ () + try montant_verse_complement_pour_base_et_majoration_3898_ () with EmptyError -> ( try - if droit_ouvert_complement_3490_ then - log_end_call - [ "AllocationsFamiliales"; "complément_dégressif" ] - (log_variable_definition - [ "AllocationsFamiliales"; "complément_dégressif"; "output" ] - unembeddable - (log_begin_call - [ "AllocationsFamiliales"; "complément_dégressif" ] - complement_degressif_3549_ - (log_variable_definition - [ "AllocationsFamiliales"; "complément_dégressif"; "input" ] - unembeddable montant_base_complement_pour_base_et_majoration_3611_))) - else money_of_cents_string "0" + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 178; + start_column = 14; + end_line = 178; + end_column = 62; + law_headings = + [ + "Article D521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + true) + (fun (_ : _) -> + if droit_ouvert_complement_4102_ then + log_end_call + [ "AllocationsFamiliales"; "complément_dégressif" ] + (log_variable_definition + [ "AllocationsFamiliales"; "complément_dégressif"; "output" ] + unembeddable + (log_begin_call + [ "AllocationsFamiliales"; "complément_dégressif" ] + complement_degressif_4241_ + (log_variable_definition + [ "AllocationsFamiliales"; "complément_dégressif"; "input" ] + unembeddable montant_base_complement_pour_base_et_majoration_4357_))) + else money_of_cents_string "0") with EmptyError -> raise EmptyError) with EmptyError -> raise @@ -5532,21 +6027,34 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = [ "Prologue" ]; })) in - let montant_verse_3613_ : money = + let montant_verse_4363_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_versé" ] embed_money (try - try montant_verse_3327_ () + try montant_verse_3871_ () with EmptyError -> ( try - if droit_ouvert_base_3542_ then - montant_verse_base_3607_ - +$ (montant_verse_majoration_3608_ - +$ (montant_verse_forfaitaire_3582_ - +$ (montant_verse_complement_pour_base_et_majoration_3612_ - +$ montant_verse_complement_pour_forfaitaire_3596_))) - else money_of_cents_string "0" + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./epilogue.catala_fr"; + start_line = 44; + start_column = 14; + end_line = 44; + end_column = 27; + law_headings = [ "Règles diverses"; "Épilogue"; "Décrets divers" ]; + } + true) + (fun (_ : _) -> + if droit_ouvert_base_4228_ then + montant_verse_base_4349_ + +$ (montant_verse_majoration_4352_ + +$ (montant_verse_forfaitaire_4306_ + +$ (montant_verse_complement_pour_base_et_majoration_4360_ + +$ montant_verse_complement_pour_forfaitaire_4330_))) + else money_of_cents_string "0") with EmptyError -> raise EmptyError) with EmptyError -> raise @@ -5560,121 +6068,115 @@ let allocations_familiales_1511 (allocations_familiales_in_3317 : allocations_fa law_headings = [ "Prologue" ]; })) in - let __3614_ : unit = + let (_ : unit) = if - personne_charge_effective_permanente_est_parent_3362_ - || (not personne_charge_effective_permanente_est_parent_3362_) - && personne_charge_effective_permanente_remplit_titre__i_3363_ + personne_charge_effective_permanente_est_parent_3906_ + || (not personne_charge_effective_permanente_est_parent_3906_) + && personne_charge_effective_permanente_remplit_titre__i_3909_ then () else raise AssertionFailed in { personne_charge_effective_permanente_est_parent_out = - personne_charge_effective_permanente_est_parent_3362_; + personne_charge_effective_permanente_est_parent_3906_; personne_charge_effective_permanente_remplit_titre_I_out = - personne_charge_effective_permanente_remplit_titre__i_3363_; - ressources_menage_out = ressources_menage_3364_; - residence_out = residence_3365_; - date_courante_out = date_courante_3366_; - enfants_a_charge_out = enfants_a_charge_3367_; + personne_charge_effective_permanente_remplit_titre__i_3909_; + ressources_menage_out = ressources_menage_3912_; + residence_out = residence_3915_; + date_courante_out = date_courante_3918_; + enfants_a_charge_out = enfants_a_charge_3921_; enfants_a_charge_droit_ouvert_prestation_familiale_out = - enfants_a_charge_droit_ouvert_prestation_familiale_3472_; - prise_en_compte_out = prise_en_compte_3368_; - versement_out = versement_3402_; - montant_verse_out = montant_verse_3613_; - droit_ouvert_base_out = droit_ouvert_base_3542_; - montant_initial_base_out = montant_initial_base_3585_; - montant_initial_base_premier_enfant_out = montant_initial_base_premier_enfant_3541_; - montant_initial_base_deuxieme_enfant_out = montant_initial_base_deuxieme_enfant_3567_; + enfants_a_charge_droit_ouvert_prestation_familiale_4064_; + prise_en_compte_out = prise_en_compte_3924_; + versement_out = versement_3968_; + montant_verse_out = montant_verse_4363_; + droit_ouvert_base_out = droit_ouvert_base_4228_; + montant_initial_base_out = montant_initial_base_4311_; + montant_initial_base_premier_enfant_out = montant_initial_base_premier_enfant_4225_; + montant_initial_base_deuxieme_enfant_out = montant_initial_base_deuxieme_enfant_4275_; montant_initial_base_troisieme_enfant_et_plus_out = - montant_initial_base_troisieme_enfant_et_plus_3561_; - rapport_enfants_total_moyen_out = rapport_enfants_total_moyen_3573_; - nombre_moyen_enfants_out = nombre_moyen_enfants_3535_; - nombre_total_enfants_out = nombre_total_enfants_3534_; - montant_avec_garde_alternee_base_out = montant_avec_garde_alternee_base_3601_; - montant_verse_base_out = montant_verse_base_3607_; + montant_initial_base_troisieme_enfant_et_plus_4263_; + rapport_enfants_total_moyen_out = rapport_enfants_total_moyen_4287_; + nombre_moyen_enfants_out = nombre_moyen_enfants_4217_; + nombre_total_enfants_out = nombre_total_enfants_4214_; + montant_avec_garde_alternee_base_out = montant_avec_garde_alternee_base_4339_; + montant_verse_base_out = montant_verse_base_4349_; avait_enfant_a_charge_avant_1er_janvier_2012_out = - avait_enfant_a_charge_avant_1er_janvier_2012_3436_; + avait_enfant_a_charge_avant_1er_janvier_2012_4012_; montant_initial_base_premier_enfant_mayotte_out = - montant_initial_base_premier_enfant_mayotte_3520_; + montant_initial_base_premier_enfant_mayotte_4178_; montant_initial_base_deuxieme_enfant_mayotte_out = - montant_initial_base_deuxieme_enfant_mayotte_3507_; + montant_initial_base_deuxieme_enfant_mayotte_4145_; montant_initial_base_troisieme_enfant_mayotte_out = - montant_initial_base_troisieme_enfant_mayotte_3494_; + montant_initial_base_troisieme_enfant_mayotte_4112_; montant_initial_base_quatrieme_enfant_et_plus_mayotte_out = - montant_initial_base_quatrieme_enfant_et_plus_mayotte_3493_; - droit_ouvert_forfaitaire_out = droit_ouvert_forfaitaire_3491_; - montant_verse_forfaitaire_par_enfant_out = montant_verse_forfaitaire_par_enfant_3555_; - montant_verse_forfaitaire_out = montant_verse_forfaitaire_3582_; - droit_ouvert_majoration_out = droit_ouvert_majoration_3547_; - montant_initial_metropole_majoration_out = montant_initial_metropole_majoration_3574_; - montant_initial_majoration_out = montant_initial_majoration_3590_; - montant_avec_garde_alternee_majoration_out = montant_avec_garde_alternee_majoration_3602_; - montant_verse_majoration_out = montant_verse_majoration_3608_; - droit_ouvert_complement_out = droit_ouvert_complement_3490_; + montant_initial_base_quatrieme_enfant_et_plus_mayotte_4109_; + droit_ouvert_forfaitaire_out = droit_ouvert_forfaitaire_4105_; + montant_verse_forfaitaire_par_enfant_out = montant_verse_forfaitaire_par_enfant_4251_; + montant_verse_forfaitaire_out = montant_verse_forfaitaire_4306_; + droit_ouvert_majoration_out = droit_ouvert_majoration_4237_; + montant_initial_metropole_majoration_out = montant_initial_metropole_majoration_4290_; + montant_initial_majoration_out = montant_initial_majoration_4320_; + montant_avec_garde_alternee_majoration_out = montant_avec_garde_alternee_majoration_4342_; + montant_verse_majoration_out = montant_verse_majoration_4352_; + droit_ouvert_complement_out = droit_ouvert_complement_4102_; montant_base_complement_pour_base_et_majoration_out = - montant_base_complement_pour_base_et_majoration_3611_; - complement_degressif_out = complement_degressif_3549_; + montant_base_complement_pour_base_et_majoration_4357_; + complement_degressif_out = complement_degressif_4241_; montant_verse_complement_pour_base_et_majoration_out = - montant_verse_complement_pour_base_et_majoration_3612_; - montant_verse_complement_pour_forfaitaire_out = montant_verse_complement_pour_forfaitaire_3596_; - nombre_enfants_l521_1_out = nombre_enfants_l521_1_3437_; - age_minimum_alinea_1_l521_3_out = age_minimum_alinea_1_l521_3_3470_; - nombre_enfants_alinea_2_l521_3_out = nombre_enfants_alinea_2_l521_3_3438_; - est_enfant_le_plus_age_out = est_enfant_le_plus_age_3474_; - plafond_I_d521_3_out = plafond__i_d521_3_3483_; - plafond_II_d521_3_out = plafond__i_i_d521_3_3476_; + montant_verse_complement_pour_base_et_majoration_4360_; + montant_verse_complement_pour_forfaitaire_out = montant_verse_complement_pour_forfaitaire_4330_; + nombre_enfants_l521_1_out = nombre_enfants_l521_1_4015_; + age_minimum_alinea_1_l521_3_out = age_minimum_alinea_1_l521_3_4060_; + nombre_enfants_alinea_2_l521_3_out = nombre_enfants_alinea_2_l521_3_4018_; + est_enfant_le_plus_age_out = est_enfant_le_plus_age_4068_; + plafond_I_d521_3_out = plafond__i_d521_3_4087_; + plafond_II_d521_3_out = plafond__i_i_d521_3_4072_; } -let interface_allocations_familiales_2004 - (interface_allocations_familiales_in_3615 : interface_allocations_familiales_in) = - let date_courante_3616_ : unit -> date = - interface_allocations_familiales_in_3615.date_courante_in +let interface_allocations_familiales + (interface_allocations_familiales_in : interface_allocations_familiales_in) = + let date_courante_4368_ : unit -> date = interface_allocations_familiales_in.date_courante_in in + let enfants_4369_ : unit -> enfant_entree array = + interface_allocations_familiales_in.enfants_in in - let enfants_3617_ : unit -> enfant_entree array = - interface_allocations_familiales_in_3615.enfants_in + let enfants_a_charge_4370_ : unit -> enfant array = + interface_allocations_familiales_in.enfants_a_charge_in in - let enfants_a_charge_3618_ : unit -> enfant array = - interface_allocations_familiales_in_3615.enfants_a_charge_in + let ressources_menage_4371_ : unit -> money = + interface_allocations_familiales_in.ressources_menage_in in - let ressources_menage_3619_ : unit -> money = - interface_allocations_familiales_in_3615.ressources_menage_in + let residence_4372_ : unit -> collectivite = interface_allocations_familiales_in.residence_in in + let montant_verse_4373_ : unit -> money = interface_allocations_familiales_in.montant_verse_in in + let personne_charge_effective_permanente_est_parent_4374_ : unit -> bool = + interface_allocations_familiales_in.personne_charge_effective_permanente_est_parent_in in - let residence_3620_ : unit -> collectivite = - interface_allocations_familiales_in_3615.residence_in + let personne_charge_effective_permanente_remplit_titre__i_4375_ : unit -> bool = + interface_allocations_familiales_in.personne_charge_effective_permanente_remplit_titre_I_in in - let montant_verse_3621_ : unit -> money = - interface_allocations_familiales_in_3615.montant_verse_in + let avait_enfant_a_charge_avant_1er_janvier_2012_4376_ : unit -> bool = + interface_allocations_familiales_in.avait_enfant_a_charge_avant_1er_janvier_2012_in in - let personne_charge_effective_permanente_est_parent_3622_ : unit -> bool = - interface_allocations_familiales_in_3615.personne_charge_effective_permanente_est_parent_in - in - let personne_charge_effective_permanente_remplit_titre__i_3623_ : unit -> bool = - interface_allocations_familiales_in_3615.personne_charge_effective_permanente_remplit_titre_I_in - in - let avait_enfant_a_charge_avant_1er_janvier_2012_3624_ : unit -> bool = - interface_allocations_familiales_in_3615.avait_enfant_a_charge_avant_1er_janvier_2012_in - in - let date_courante_3625_ : date = + let date_courante_4377_ : date = log_variable_definition [ "InterfaceAllocationsFamiliales"; "date_courante" ] embed_date (try - try date_courante_3616_ () + try date_courante_4368_ () with EmptyError -> - if - log_decision_taken - { - filename = ""; - start_line = 0; - start_column = 1; - end_line = 0; - end_column = 1; - law_headings = []; - } - false - then raise EmptyError - else raise EmptyError + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = ""; + start_line = 0; + start_column = 1; + end_line = 0; + end_column = 1; + law_headings = []; + } + false) + (fun (_ : _) -> raise EmptyError) with EmptyError -> raise (NoValueProvided @@ -5687,26 +6189,26 @@ let interface_allocations_familiales_2004 law_headings = [ "Interface du programme"; "Épilogue"; "Décrets divers" ]; })) in - let enfants_3626_ : enfant_entree array = + let enfants_4380_ : enfant_entree array = log_variable_definition [ "InterfaceAllocationsFamiliales"; "enfants" ] (embed_array embed_enfant_entree) (try - try enfants_3617_ () + try enfants_4369_ () with EmptyError -> - if - log_decision_taken - { - filename = ""; - start_line = 0; - start_column = 1; - end_line = 0; - end_column = 1; - law_headings = []; - } - false - then raise EmptyError - else raise EmptyError + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = ""; + start_line = 0; + start_column = 1; + end_line = 0; + end_column = 1; + law_headings = []; + } + false) + (fun (_ : _) -> raise EmptyError) with EmptyError -> raise (NoValueProvided @@ -5719,26 +6221,26 @@ let interface_allocations_familiales_2004 law_headings = [ "Interface du programme"; "Épilogue"; "Décrets divers" ]; })) in - let ressources_menage_3627_ : money = + let ressources_menage_4383_ : money = log_variable_definition [ "InterfaceAllocationsFamiliales"; "ressources_ménage" ] embed_money (try - try ressources_menage_3619_ () + try ressources_menage_4371_ () with EmptyError -> - if - log_decision_taken - { - filename = ""; - start_line = 0; - start_column = 1; - end_line = 0; - end_column = 1; - law_headings = []; - } - false - then raise EmptyError - else raise EmptyError + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = ""; + start_line = 0; + start_column = 1; + end_line = 0; + end_column = 1; + law_headings = []; + } + false) + (fun (_ : _) -> raise EmptyError) with EmptyError -> raise (NoValueProvided @@ -5751,26 +6253,26 @@ let interface_allocations_familiales_2004 law_headings = [ "Interface du programme"; "Épilogue"; "Décrets divers" ]; })) in - let residence_3628_ : collectivite = + let residence_4386_ : collectivite = log_variable_definition [ "InterfaceAllocationsFamiliales"; "résidence" ] embed_collectivite (try - try residence_3620_ () + try residence_4372_ () with EmptyError -> - if - log_decision_taken - { - filename = ""; - start_line = 0; - start_column = 1; - end_line = 0; - end_column = 1; - law_headings = []; - } - false - then raise EmptyError - else raise EmptyError + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = ""; + start_line = 0; + start_column = 1; + end_line = 0; + end_column = 1; + law_headings = []; + } + false) + (fun (_ : _) -> raise EmptyError) with EmptyError -> raise (NoValueProvided @@ -5783,26 +6285,26 @@ let interface_allocations_familiales_2004 law_headings = [ "Interface du programme"; "Épilogue"; "Décrets divers" ]; })) in - let personne_charge_effective_permanente_est_parent_3629_ : bool = + let personne_charge_effective_permanente_est_parent_4389_ : bool = log_variable_definition [ "InterfaceAllocationsFamiliales"; "personne_charge_effective_permanente_est_parent" ] embed_bool (try - try personne_charge_effective_permanente_est_parent_3622_ () + try personne_charge_effective_permanente_est_parent_4374_ () with EmptyError -> - if - log_decision_taken - { - filename = ""; - start_line = 0; - start_column = 1; - end_line = 0; - end_column = 1; - law_headings = []; - } - true - then false - else raise EmptyError + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = ""; + start_line = 0; + start_column = 1; + end_line = 0; + end_column = 1; + law_headings = []; + } + true) + (fun (_ : _) -> false) with EmptyError -> raise (NoValueProvided @@ -5815,26 +6317,26 @@ let interface_allocations_familiales_2004 law_headings = [ "Interface du programme"; "Épilogue"; "Décrets divers" ]; })) in - let personne_charge_effective_permanente_remplit_titre__i_3630_ : bool = + let personne_charge_effective_permanente_remplit_titre__i_4392_ : bool = log_variable_definition [ "InterfaceAllocationsFamiliales"; "personne_charge_effective_permanente_remplit_titre_I" ] embed_bool (try - try personne_charge_effective_permanente_remplit_titre__i_3623_ () + try personne_charge_effective_permanente_remplit_titre__i_4375_ () with EmptyError -> - if - log_decision_taken - { - filename = ""; - start_line = 0; - start_column = 1; - end_line = 0; - end_column = 1; - law_headings = []; - } - true - then false - else raise EmptyError + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = ""; + start_line = 0; + start_column = 1; + end_line = 0; + end_column = 1; + law_headings = []; + } + true) + (fun (_ : _) -> false) with EmptyError -> raise (NoValueProvided @@ -5847,26 +6349,26 @@ let interface_allocations_familiales_2004 law_headings = [ "Interface du programme"; "Épilogue"; "Décrets divers" ]; })) in - let avait_enfant_a_charge_avant_1er_janvier_2012_3631_ : bool = + let avait_enfant_a_charge_avant_1er_janvier_2012_4395_ : bool = log_variable_definition [ "InterfaceAllocationsFamiliales"; "avait_enfant_à_charge_avant_1er_janvier_2012" ] embed_bool (try - try avait_enfant_a_charge_avant_1er_janvier_2012_3624_ () + try avait_enfant_a_charge_avant_1er_janvier_2012_4376_ () with EmptyError -> - if - log_decision_taken - { - filename = ""; - start_line = 0; - start_column = 1; - end_line = 0; - end_column = 1; - law_headings = []; - } - true - then false - else raise EmptyError + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = ""; + start_line = 0; + start_column = 1; + end_line = 0; + end_column = 1; + law_headings = []; + } + true) + (fun (_ : _) -> false) with EmptyError -> raise (NoValueProvided @@ -5879,39 +6381,53 @@ let interface_allocations_familiales_2004 law_headings = [ "Interface du programme"; "Épilogue"; "Décrets divers" ]; })) in - let enfants_a_charge_3632_ : enfant array = + let enfants_a_charge_4398_ : enfant array = log_variable_definition [ "InterfaceAllocationsFamiliales"; "enfants_à_charge" ] (embed_array embed_enfant) (try - try enfants_a_charge_3618_ () + try enfants_a_charge_4370_ () with EmptyError -> ( try - Array.map - (fun (enfant_3633_ : _) -> - { - identifiant = enfant_3633_.d_identifiant; - obligation_scolaire = - (if - enfant_3633_.d_date_de_naissance +@ duration_of_numbers 3 0 0 - >=@ date_courante_3625_ - then Avant () - else if - enfant_3633_.d_date_de_naissance +@ duration_of_numbers 16 0 0 - >=@ date_courante_3625_ - then Pendant () - else Apres ()); - remuneration_mensuelle = enfant_3633_.d_remuneration_mensuelle; - date_de_naissance = enfant_3633_.d_date_de_naissance; - age = - year_of_date - (date_of_numbers 0 1 1 - +@ (date_courante_3625_ -@ enfant_3633_.d_date_de_naissance)); - prise_en_charge = enfant_3633_.d_prise_en_charge; - a_deja_ouvert_droit_aux_allocations_familiales = - enfant_3633_.d_a_deja_ouvert_droit_aux_allocations_familiales; - }) - enfants_3626_ + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./epilogue.catala_fr"; + start_line = 112; + start_column = 14; + end_line = 112; + end_column = 30; + law_headings = + [ "Article L131-1"; "Interface du programme"; "Épilogue"; "Décrets divers" ]; + } + true) + (fun (_ : _) -> + Array.map + (fun (enfant_4401_ : _) -> + { + identifiant = enfant_4401_.d_identifiant; + obligation_scolaire = + (if + enfant_4401_.d_date_de_naissance +@ duration_of_numbers 3 0 0 + >=@ date_courante_4377_ + then Avant () + else if + enfant_4401_.d_date_de_naissance +@ duration_of_numbers 16 0 0 + >=@ date_courante_4377_ + then Pendant () + else Apres ()); + remuneration_mensuelle = enfant_4401_.d_remuneration_mensuelle; + date_de_naissance = enfant_4401_.d_date_de_naissance; + age = + year_of_date + (date_of_numbers 0 1 1 + +@ (date_courante_4377_ -@ enfant_4401_.d_date_de_naissance)); + prise_en_charge = enfant_4401_.d_prise_en_charge; + a_deja_ouvert_droit_aux_allocations_familiales = + enfant_4401_.d_a_deja_ouvert_droit_aux_allocations_familiales; + }) + enfants_4380_) with EmptyError -> raise EmptyError) with EmptyError -> raise @@ -5925,9 +6441,9 @@ let interface_allocations_familiales_2004 law_headings = [ "Interface du programme"; "Épilogue"; "Décrets divers" ]; })) in - let allocations_familiales_dot_personne_charge_effective_permanente_est_parent_3634_ : + let allocations_familiales_dot_personne_charge_effective_permanente_est_parent_4402_ : unit -> bool = - fun (__3635_ : unit) -> + fun (_ : unit) -> log_variable_definition [ "InterfaceAllocationsFamiliales"; @@ -5935,24 +6451,24 @@ let interface_allocations_familiales_2004 ] embed_bool (try - if - log_decision_taken - { - filename = "./epilogue.catala_fr"; - start_line = 90; - start_column = 20; - end_line = 90; - end_column = 67; - law_headings = [ "Interface du programme"; "Épilogue"; "Décrets divers" ]; - } - personne_charge_effective_permanente_est_parent_3629_ - then true - else raise EmptyError + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./epilogue.catala_fr"; + start_line = 90; + start_column = 20; + end_line = 90; + end_column = 67; + law_headings = [ "Interface du programme"; "Épilogue"; "Décrets divers" ]; + } + personne_charge_effective_permanente_est_parent_4389_) + (fun (_ : _) -> true) with EmptyError -> false) in - let allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i_3636_ : + let allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i_4406_ : unit -> bool = - fun (__3637_ : unit) -> + fun (_ : unit) -> log_variable_definition [ "InterfaceAllocationsFamiliales"; @@ -5960,51 +6476,107 @@ let interface_allocations_familiales_2004 ] embed_bool (try - if - log_decision_taken - { - filename = "./epilogue.catala_fr"; - start_line = 93; - start_column = 20; - end_line = 93; - end_column = 72; - law_headings = [ "Interface du programme"; "Épilogue"; "Décrets divers" ]; - } - personne_charge_effective_permanente_remplit_titre__i_3630_ - then true - else raise EmptyError + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./epilogue.catala_fr"; + start_line = 93; + start_column = 20; + end_line = 93; + end_column = 72; + law_headings = [ "Interface du programme"; "Épilogue"; "Décrets divers" ]; + } + personne_charge_effective_permanente_remplit_titre__i_4392_) + (fun (_ : _) -> true) with EmptyError -> false) in - let allocations_familiales_dot_ressources_menage_3638_ : unit -> money = - fun (__3639_ : unit) -> + let allocations_familiales_dot_ressources_menage_4410_ : unit -> money = + fun (_ : unit) -> log_variable_definition [ "InterfaceAllocationsFamiliales"; "allocations_familiales.ressources_ménage" ] embed_money - (try ressources_menage_3627_ with EmptyError -> raise EmptyError) + (try + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./epilogue.catala_fr"; + start_line = 86; + start_column = 14; + end_line = 86; + end_column = 54; + law_headings = [ "Interface du programme"; "Épilogue"; "Décrets divers" ]; + } + true) + (fun (_ : _) -> ressources_menage_4383_) + with EmptyError -> raise EmptyError) in - let allocations_familiales_dot_residence_3640_ : unit -> collectivite = - fun (__3641_ : unit) -> + let allocations_familiales_dot_residence_4414_ : unit -> collectivite = + fun (_ : unit) -> log_variable_definition [ "InterfaceAllocationsFamiliales"; "allocations_familiales.résidence" ] embed_collectivite - (try residence_3628_ with EmptyError -> raise EmptyError) + (try + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./epilogue.catala_fr"; + start_line = 87; + start_column = 14; + end_line = 87; + end_column = 46; + law_headings = [ "Interface du programme"; "Épilogue"; "Décrets divers" ]; + } + true) + (fun (_ : _) -> residence_4386_) + with EmptyError -> raise EmptyError) in - let allocations_familiales_dot_date_courante_3642_ : unit -> date = - fun (__3643_ : unit) -> + let allocations_familiales_dot_date_courante_4418_ : unit -> date = + fun (_ : unit) -> log_variable_definition [ "InterfaceAllocationsFamiliales"; "allocations_familiales.date_courante" ] embed_date - (try date_courante_3625_ with EmptyError -> raise EmptyError) + (try + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./epilogue.catala_fr"; + start_line = 84; + start_column = 14; + end_line = 84; + end_column = 50; + law_headings = [ "Interface du programme"; "Épilogue"; "Décrets divers" ]; + } + true) + (fun (_ : _) -> date_courante_4377_) + with EmptyError -> raise EmptyError) in - let allocations_familiales_dot_enfants_a_charge_3644_ : unit -> enfant array = - fun (__3645_ : unit) -> + let allocations_familiales_dot_enfants_a_charge_4422_ : unit -> enfant array = + fun (_ : unit) -> log_variable_definition [ "InterfaceAllocationsFamiliales"; "allocations_familiales.enfants_à_charge" ] (embed_array embed_enfant) - (try enfants_a_charge_3632_ with EmptyError -> raise EmptyError) + (try + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./epilogue.catala_fr"; + start_line = 85; + start_column = 14; + end_line = 85; + end_column = 53; + law_headings = [ "Interface du programme"; "Épilogue"; "Décrets divers" ]; + } + true) + (fun (_ : _) -> enfants_a_charge_4398_) + with EmptyError -> raise EmptyError) in - let allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012_3646_ : unit -> bool = - fun (__3647_ : unit) -> + let allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012_4426_ : unit -> bool = + fun (_ : unit) -> log_variable_definition [ "InterfaceAllocationsFamiliales"; @@ -6012,222 +6584,231 @@ let interface_allocations_familiales_2004 ] embed_bool (try - if - log_decision_taken - { - filename = "./epilogue.catala_fr"; - start_line = 96; - start_column = 20; - end_line = 96; - end_column = 64; - law_headings = [ "Interface du programme"; "Épilogue"; "Décrets divers" ]; - } - avait_enfant_a_charge_avant_1er_janvier_2012_3631_ - then true - else raise EmptyError + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./epilogue.catala_fr"; + start_line = 96; + start_column = 20; + end_line = 96; + end_column = 64; + law_headings = [ "Interface du programme"; "Épilogue"; "Décrets divers" ]; + } + avait_enfant_a_charge_avant_1er_janvier_2012_4395_) + (fun (_ : _) -> true) with EmptyError -> false) in - let result_3648_ : allocations_familiales_out = + let result_4430_ : allocations_familiales_out = log_end_call [ "InterfaceAllocationsFamiliales"; "allocations_familiales"; "AllocationsFamiliales" ] (log_begin_call [ "InterfaceAllocationsFamiliales"; "allocations_familiales"; "AllocationsFamiliales" ] - allocations_familiales_1511 + allocations_familiales { personne_charge_effective_permanente_est_parent_in = - allocations_familiales_dot_personne_charge_effective_permanente_est_parent_3634_; + allocations_familiales_dot_personne_charge_effective_permanente_est_parent_4402_; personne_charge_effective_permanente_remplit_titre_I_in = - allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i_3636_; - ressources_menage_in = allocations_familiales_dot_ressources_menage_3638_; - residence_in = allocations_familiales_dot_residence_3640_; - date_courante_in = allocations_familiales_dot_date_courante_3642_; - enfants_a_charge_in = allocations_familiales_dot_enfants_a_charge_3644_; + allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i_4406_; + ressources_menage_in = allocations_familiales_dot_ressources_menage_4410_; + residence_in = allocations_familiales_dot_residence_4414_; + date_courante_in = allocations_familiales_dot_date_courante_4418_; + enfants_a_charge_in = allocations_familiales_dot_enfants_a_charge_4422_; enfants_a_charge_droit_ouvert_prestation_familiale_in = - (fun (__3649_ : unit) -> raise EmptyError); - prise_en_compte_in = (fun (__3650_ : unit) -> raise EmptyError); - versement_in = (fun (__3651_ : unit) -> raise EmptyError); - montant_verse_in = (fun (__3652_ : unit) -> raise EmptyError); - droit_ouvert_base_in = (fun (__3653_ : unit) -> raise EmptyError); - montant_initial_base_in = (fun (__3654_ : unit) -> raise EmptyError); - montant_initial_base_premier_enfant_in = (fun (__3655_ : unit) -> raise EmptyError); - montant_initial_base_deuxieme_enfant_in = (fun (__3656_ : unit) -> raise EmptyError); - montant_initial_base_troisieme_enfant_et_plus_in = - (fun (__3657_ : unit) -> raise EmptyError); - rapport_enfants_total_moyen_in = (fun (__3658_ : unit) -> raise EmptyError); - nombre_moyen_enfants_in = (fun (__3659_ : unit) -> raise EmptyError); - nombre_total_enfants_in = (fun (__3660_ : unit) -> raise EmptyError); - montant_avec_garde_alternee_base_in = (fun (__3661_ : unit) -> raise EmptyError); - montant_verse_base_in = (fun (__3662_ : unit) -> raise EmptyError); + (fun (_ : unit) -> raise EmptyError); + prise_en_compte_in = (fun (_ : unit) -> raise EmptyError); + versement_in = (fun (_ : unit) -> raise EmptyError); + montant_verse_in = (fun (_ : unit) -> raise EmptyError); + droit_ouvert_base_in = (fun (_ : unit) -> raise EmptyError); + montant_initial_base_in = (fun (_ : unit) -> raise EmptyError); + montant_initial_base_premier_enfant_in = (fun (_ : unit) -> raise EmptyError); + montant_initial_base_deuxieme_enfant_in = (fun (_ : unit) -> raise EmptyError); + montant_initial_base_troisieme_enfant_et_plus_in = (fun (_ : unit) -> raise EmptyError); + rapport_enfants_total_moyen_in = (fun (_ : unit) -> raise EmptyError); + nombre_moyen_enfants_in = (fun (_ : unit) -> raise EmptyError); + nombre_total_enfants_in = (fun (_ : unit) -> raise EmptyError); + montant_avec_garde_alternee_base_in = (fun (_ : unit) -> raise EmptyError); + montant_verse_base_in = (fun (_ : unit) -> raise EmptyError); avait_enfant_a_charge_avant_1er_janvier_2012_in = - allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012_3646_; - montant_initial_base_premier_enfant_mayotte_in = - (fun (__3663_ : unit) -> raise EmptyError); - montant_initial_base_deuxieme_enfant_mayotte_in = - (fun (__3664_ : unit) -> raise EmptyError); - montant_initial_base_troisieme_enfant_mayotte_in = - (fun (__3665_ : unit) -> raise EmptyError); + allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012_4426_; + montant_initial_base_premier_enfant_mayotte_in = (fun (_ : unit) -> raise EmptyError); + montant_initial_base_deuxieme_enfant_mayotte_in = (fun (_ : unit) -> raise EmptyError); + montant_initial_base_troisieme_enfant_mayotte_in = (fun (_ : unit) -> raise EmptyError); montant_initial_base_quatrieme_enfant_et_plus_mayotte_in = - (fun (__3666_ : unit) -> raise EmptyError); - droit_ouvert_forfaitaire_in = (fun (__3667_ : unit) -> raise EmptyError); - montant_verse_forfaitaire_par_enfant_in = (fun (__3668_ : unit) -> raise EmptyError); - montant_verse_forfaitaire_in = (fun (__3669_ : unit) -> raise EmptyError); - droit_ouvert_majoration_in = (fun (__3670_ : unit) -> raise EmptyError); - montant_initial_metropole_majoration_in = (fun (__3671_ : unit) -> raise EmptyError); - montant_initial_majoration_in = (fun (__3672_ : unit) -> raise EmptyError); - montant_avec_garde_alternee_majoration_in = (fun (__3673_ : unit) -> raise EmptyError); - montant_verse_majoration_in = (fun (__3674_ : unit) -> raise EmptyError); - droit_ouvert_complement_in = (fun (__3675_ : unit) -> raise EmptyError); - montant_base_complement_pour_base_et_majoration_in = - (fun (__3676_ : unit) -> raise EmptyError); - complement_degressif_in = (fun (__3677_ : unit) -> raise EmptyError); + (fun (_ : unit) -> raise EmptyError); + droit_ouvert_forfaitaire_in = (fun (_ : unit) -> raise EmptyError); + montant_verse_forfaitaire_par_enfant_in = (fun (_ : unit) -> raise EmptyError); + montant_verse_forfaitaire_in = (fun (_ : unit) -> raise EmptyError); + droit_ouvert_majoration_in = (fun (_ : unit) -> raise EmptyError); + montant_initial_metropole_majoration_in = (fun (_ : unit) -> raise EmptyError); + montant_initial_majoration_in = (fun (_ : unit) -> raise EmptyError); + montant_avec_garde_alternee_majoration_in = (fun (_ : unit) -> raise EmptyError); + montant_verse_majoration_in = (fun (_ : unit) -> raise EmptyError); + droit_ouvert_complement_in = (fun (_ : unit) -> raise EmptyError); + montant_base_complement_pour_base_et_majoration_in = (fun (_ : unit) -> raise EmptyError); + complement_degressif_in = (fun (_ : unit) -> raise EmptyError); montant_verse_complement_pour_base_et_majoration_in = - (fun (__3678_ : unit) -> raise EmptyError); - montant_verse_complement_pour_forfaitaire_in = (fun (__3679_ : unit) -> raise EmptyError); - nombre_enfants_l521_1_in = (fun (__3680_ : unit) -> raise EmptyError); - age_minimum_alinea_1_l521_3_in = (fun (__3681_ : unit) -> raise EmptyError); - nombre_enfants_alinea_2_l521_3_in = (fun (__3682_ : unit) -> raise EmptyError); - est_enfant_le_plus_age_in = (fun (__3683_ : unit) -> raise EmptyError); - plafond_I_d521_3_in = (fun (__3684_ : unit) -> raise EmptyError); - plafond_II_d521_3_in = (fun (__3685_ : unit) -> raise EmptyError); + (fun (_ : unit) -> raise EmptyError); + montant_verse_complement_pour_forfaitaire_in = (fun (_ : unit) -> raise EmptyError); + nombre_enfants_l521_1_in = (fun (_ : unit) -> raise EmptyError); + age_minimum_alinea_1_l521_3_in = (fun (_ : unit) -> raise EmptyError); + nombre_enfants_alinea_2_l521_3_in = (fun (_ : unit) -> raise EmptyError); + est_enfant_le_plus_age_in = (fun (_ : unit) -> raise EmptyError); + plafond_I_d521_3_in = (fun (_ : unit) -> raise EmptyError); + plafond_II_d521_3_in = (fun (_ : unit) -> raise EmptyError); }) in - let allocations_familiales_dot_personne_charge_effective_permanente_est_parent_3686_ : bool = - result_3648_.personne_charge_effective_permanente_est_parent_out + let allocations_familiales_dot_personne_charge_effective_permanente_est_parent_4468_ : bool = + result_4430_.personne_charge_effective_permanente_est_parent_out in - let allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i_3687_ : bool + let allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i_4469_ : bool = - result_3648_.personne_charge_effective_permanente_remplit_titre_I_out + result_4430_.personne_charge_effective_permanente_remplit_titre_I_out in - let allocations_familiales_dot_ressources_menage_3688_ : money = - result_3648_.ressources_menage_out + let allocations_familiales_dot_ressources_menage_4470_ : money = + result_4430_.ressources_menage_out in - let allocations_familiales_dot_residence_3689_ : collectivite = result_3648_.residence_out in - let allocations_familiales_dot_date_courante_3690_ : date = result_3648_.date_courante_out in - let allocations_familiales_dot_enfants_a_charge_3691_ : enfant array = - result_3648_.enfants_a_charge_out + let allocations_familiales_dot_residence_4471_ : collectivite = result_4430_.residence_out in + let allocations_familiales_dot_date_courante_4472_ : date = result_4430_.date_courante_out in + let allocations_familiales_dot_enfants_a_charge_4473_ : enfant array = + result_4430_.enfants_a_charge_out in - let allocations_familiales_dot_enfants_a_charge_droit_ouvert_prestation_familiale_3692_ : + let allocations_familiales_dot_enfants_a_charge_droit_ouvert_prestation_familiale_4474_ : enfant array = - result_3648_.enfants_a_charge_droit_ouvert_prestation_familiale_out + result_4430_.enfants_a_charge_droit_ouvert_prestation_familiale_out in - let allocations_familiales_dot_prise_en_compte_3693_ : enfant -> prise_en_compte = - result_3648_.prise_en_compte_out + let allocations_familiales_dot_prise_en_compte_4475_ : enfant -> prise_en_compte = + result_4430_.prise_en_compte_out in - let allocations_familiales_dot_versement_3694_ : enfant -> versement_allocations = - result_3648_.versement_out + let allocations_familiales_dot_versement_4476_ : enfant -> versement_allocations = + result_4430_.versement_out in - let allocations_familiales_dot_montant_verse_3695_ : money = result_3648_.montant_verse_out in - let allocations_familiales_dot_droit_ouvert_base_3696_ : bool = - result_3648_.droit_ouvert_base_out + let allocations_familiales_dot_montant_verse_4477_ : money = result_4430_.montant_verse_out in + let allocations_familiales_dot_droit_ouvert_base_4478_ : bool = + result_4430_.droit_ouvert_base_out in - let allocations_familiales_dot_montant_initial_base_3697_ : money = - result_3648_.montant_initial_base_out + let allocations_familiales_dot_montant_initial_base_4479_ : money = + result_4430_.montant_initial_base_out in - let allocations_familiales_dot_montant_initial_base_premier_enfant_3698_ : money = - result_3648_.montant_initial_base_premier_enfant_out + let allocations_familiales_dot_montant_initial_base_premier_enfant_4480_ : money = + result_4430_.montant_initial_base_premier_enfant_out in - let allocations_familiales_dot_montant_initial_base_deuxieme_enfant_3699_ : money = - result_3648_.montant_initial_base_deuxieme_enfant_out + let allocations_familiales_dot_montant_initial_base_deuxieme_enfant_4481_ : money = + result_4430_.montant_initial_base_deuxieme_enfant_out in - let allocations_familiales_dot_montant_initial_base_troisieme_enfant_et_plus_3700_ : money = - result_3648_.montant_initial_base_troisieme_enfant_et_plus_out + let allocations_familiales_dot_montant_initial_base_troisieme_enfant_et_plus_4482_ : money = + result_4430_.montant_initial_base_troisieme_enfant_et_plus_out in - let allocations_familiales_dot_rapport_enfants_total_moyen_3701_ : decimal = - result_3648_.rapport_enfants_total_moyen_out + let allocations_familiales_dot_rapport_enfants_total_moyen_4483_ : decimal = + result_4430_.rapport_enfants_total_moyen_out in - let allocations_familiales_dot_nombre_moyen_enfants_3702_ : decimal = - result_3648_.nombre_moyen_enfants_out + let allocations_familiales_dot_nombre_moyen_enfants_4484_ : decimal = + result_4430_.nombre_moyen_enfants_out in - let allocations_familiales_dot_nombre_total_enfants_3703_ : decimal = - result_3648_.nombre_total_enfants_out + let allocations_familiales_dot_nombre_total_enfants_4485_ : decimal = + result_4430_.nombre_total_enfants_out in - let allocations_familiales_dot_montant_avec_garde_alternee_base_3704_ : money = - result_3648_.montant_avec_garde_alternee_base_out + let allocations_familiales_dot_montant_avec_garde_alternee_base_4486_ : money = + result_4430_.montant_avec_garde_alternee_base_out in - let allocations_familiales_dot_montant_verse_base_3705_ : money = - result_3648_.montant_verse_base_out + let allocations_familiales_dot_montant_verse_base_4487_ : money = + result_4430_.montant_verse_base_out in - let allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012_3706_ : bool = - result_3648_.avait_enfant_a_charge_avant_1er_janvier_2012_out + let allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012_4488_ : bool = + result_4430_.avait_enfant_a_charge_avant_1er_janvier_2012_out in - let allocations_familiales_dot_montant_initial_base_premier_enfant_mayotte_3707_ : money = - result_3648_.montant_initial_base_premier_enfant_mayotte_out + let allocations_familiales_dot_montant_initial_base_premier_enfant_mayotte_4489_ : money = + result_4430_.montant_initial_base_premier_enfant_mayotte_out in - let allocations_familiales_dot_montant_initial_base_deuxieme_enfant_mayotte_3708_ : money = - result_3648_.montant_initial_base_deuxieme_enfant_mayotte_out + let allocations_familiales_dot_montant_initial_base_deuxieme_enfant_mayotte_4490_ : money = + result_4430_.montant_initial_base_deuxieme_enfant_mayotte_out in - let allocations_familiales_dot_montant_initial_base_troisieme_enfant_mayotte_3709_ : money = - result_3648_.montant_initial_base_troisieme_enfant_mayotte_out + let allocations_familiales_dot_montant_initial_base_troisieme_enfant_mayotte_4491_ : money = + result_4430_.montant_initial_base_troisieme_enfant_mayotte_out in - let allocations_familiales_dot_montant_initial_base_quatrieme_enfant_et_plus_mayotte_3710_ : money + let allocations_familiales_dot_montant_initial_base_quatrieme_enfant_et_plus_mayotte_4492_ : money = - result_3648_.montant_initial_base_quatrieme_enfant_et_plus_mayotte_out + result_4430_.montant_initial_base_quatrieme_enfant_et_plus_mayotte_out in - let allocations_familiales_dot_droit_ouvert_forfaitaire_3711_ : enfant -> bool = - result_3648_.droit_ouvert_forfaitaire_out + let allocations_familiales_dot_droit_ouvert_forfaitaire_4493_ : enfant -> bool = + result_4430_.droit_ouvert_forfaitaire_out in - let allocations_familiales_dot_montant_verse_forfaitaire_par_enfant_3712_ : money = - result_3648_.montant_verse_forfaitaire_par_enfant_out + let allocations_familiales_dot_montant_verse_forfaitaire_par_enfant_4494_ : money = + result_4430_.montant_verse_forfaitaire_par_enfant_out in - let allocations_familiales_dot_montant_verse_forfaitaire_3713_ : money = - result_3648_.montant_verse_forfaitaire_out + let allocations_familiales_dot_montant_verse_forfaitaire_4495_ : money = + result_4430_.montant_verse_forfaitaire_out in - let allocations_familiales_dot_droit_ouvert_majoration_3714_ : enfant -> bool = - result_3648_.droit_ouvert_majoration_out + let allocations_familiales_dot_droit_ouvert_majoration_4496_ : enfant -> bool = + result_4430_.droit_ouvert_majoration_out in - let allocations_familiales_dot_montant_initial_metropole_majoration_3715_ : enfant -> money = - result_3648_.montant_initial_metropole_majoration_out + let allocations_familiales_dot_montant_initial_metropole_majoration_4497_ : enfant -> money = + result_4430_.montant_initial_metropole_majoration_out in - let allocations_familiales_dot_montant_initial_majoration_3716_ : enfant -> money = - result_3648_.montant_initial_majoration_out + let allocations_familiales_dot_montant_initial_majoration_4498_ : enfant -> money = + result_4430_.montant_initial_majoration_out in - let allocations_familiales_dot_montant_avec_garde_alternee_majoration_3717_ : enfant -> money = - result_3648_.montant_avec_garde_alternee_majoration_out + let allocations_familiales_dot_montant_avec_garde_alternee_majoration_4499_ : enfant -> money = + result_4430_.montant_avec_garde_alternee_majoration_out in - let allocations_familiales_dot_montant_verse_majoration_3718_ : money = - result_3648_.montant_verse_majoration_out + let allocations_familiales_dot_montant_verse_majoration_4500_ : money = + result_4430_.montant_verse_majoration_out in - let allocations_familiales_dot_droit_ouvert_complement_3719_ : bool = - result_3648_.droit_ouvert_complement_out + let allocations_familiales_dot_droit_ouvert_complement_4501_ : bool = + result_4430_.droit_ouvert_complement_out in - let allocations_familiales_dot_montant_base_complement_pour_base_et_majoration_3720_ : money = - result_3648_.montant_base_complement_pour_base_et_majoration_out + let allocations_familiales_dot_montant_base_complement_pour_base_et_majoration_4502_ : money = + result_4430_.montant_base_complement_pour_base_et_majoration_out in - let allocations_familiales_dot_complement_degressif_3721_ : money -> money = - result_3648_.complement_degressif_out + let allocations_familiales_dot_complement_degressif_4503_ : money -> money = + result_4430_.complement_degressif_out in - let allocations_familiales_dot_montant_verse_complement_pour_base_et_majoration_3722_ : money = - result_3648_.montant_verse_complement_pour_base_et_majoration_out + let allocations_familiales_dot_montant_verse_complement_pour_base_et_majoration_4504_ : money = + result_4430_.montant_verse_complement_pour_base_et_majoration_out in - let allocations_familiales_dot_montant_verse_complement_pour_forfaitaire_3723_ : money = - result_3648_.montant_verse_complement_pour_forfaitaire_out + let allocations_familiales_dot_montant_verse_complement_pour_forfaitaire_4505_ : money = + result_4430_.montant_verse_complement_pour_forfaitaire_out in - let allocations_familiales_dot_nombre_enfants_l521_1_3724_ : integer = - result_3648_.nombre_enfants_l521_1_out + let allocations_familiales_dot_nombre_enfants_l521_1_4506_ : integer = + result_4430_.nombre_enfants_l521_1_out in - let allocations_familiales_dot_age_minimum_alinea_1_l521_3_3725_ : enfant -> integer = - result_3648_.age_minimum_alinea_1_l521_3_out + let allocations_familiales_dot_age_minimum_alinea_1_l521_3_4507_ : enfant -> integer = + result_4430_.age_minimum_alinea_1_l521_3_out in - let allocations_familiales_dot_nombre_enfants_alinea_2_l521_3_3726_ : integer = - result_3648_.nombre_enfants_alinea_2_l521_3_out + let allocations_familiales_dot_nombre_enfants_alinea_2_l521_3_4508_ : integer = + result_4430_.nombre_enfants_alinea_2_l521_3_out in - let allocations_familiales_dot_est_enfant_le_plus_age_3727_ : enfant -> bool = - result_3648_.est_enfant_le_plus_age_out + let allocations_familiales_dot_est_enfant_le_plus_age_4509_ : enfant -> bool = + result_4430_.est_enfant_le_plus_age_out in - let allocations_familiales_dot_plafond__i_d521_3_3728_ : money = - result_3648_.plafond_I_d521_3_out + let allocations_familiales_dot_plafond__i_d521_3_4510_ : money = + result_4430_.plafond_I_d521_3_out in - let allocations_familiales_dot_plafond__i_i_d521_3_3729_ : money = - result_3648_.plafond_II_d521_3_out + let allocations_familiales_dot_plafond__i_i_d521_3_4511_ : money = + result_4430_.plafond_II_d521_3_out in - let montant_verse_3730_ : money = + let montant_verse_4512_ : money = log_variable_definition [ "InterfaceAllocationsFamiliales"; "montant_versé" ] embed_money (try - try montant_verse_3621_ () + try montant_verse_4373_ () with EmptyError -> ( - try allocations_familiales_dot_montant_verse_3695_ with EmptyError -> raise EmptyError) + try + handle_default [||] + (fun (_ : _) -> + log_decision_taken + { + filename = "./epilogue.catala_fr"; + start_line = 88; + start_column = 14; + end_line = 88; + end_column = 27; + law_headings = [ "Interface du programme"; "Épilogue"; "Décrets divers" ]; + } + true) + (fun (_ : _) -> allocations_familiales_dot_montant_verse_4477_) + with EmptyError -> raise EmptyError) with EmptyError -> raise (NoValueProvided @@ -6241,16 +6822,16 @@ let interface_allocations_familiales_2004 })) in { - date_courante_out = date_courante_3625_; - enfants_out = enfants_3626_; - enfants_a_charge_out = enfants_a_charge_3632_; - ressources_menage_out = ressources_menage_3627_; - residence_out = residence_3628_; - montant_verse_out = montant_verse_3730_; + date_courante_out = date_courante_4377_; + enfants_out = enfants_4380_; + enfants_a_charge_out = enfants_a_charge_4398_; + ressources_menage_out = ressources_menage_4383_; + residence_out = residence_4386_; + montant_verse_out = montant_verse_4512_; personne_charge_effective_permanente_est_parent_out = - personne_charge_effective_permanente_est_parent_3629_; + personne_charge_effective_permanente_est_parent_4389_; personne_charge_effective_permanente_remplit_titre_I_out = - personne_charge_effective_permanente_remplit_titre__i_3630_; + personne_charge_effective_permanente_remplit_titre__i_4392_; avait_enfant_a_charge_avant_1er_janvier_2012_out = - avait_enfant_a_charge_avant_1er_janvier_2012_3631_; + avait_enfant_a_charge_avant_1er_janvier_2012_4395_; } diff --git a/french_law/python/src/allocations_familiales.py b/french_law/python/src/allocations_familiales.py index b162982f5..20ff38e51 100644 --- a/french_law/python/src/allocations_familiales.py +++ b/french_law/python/src/allocations_familiales.py @@ -4,6 +4,7 @@ from typing import Any, List, Callable, Tuple from enum import Enum + class PriseEnCharge_Code(Enum): GardeAlterneePartageAllocations = 0 GardeAlterneeAllocataireUnique = 1 @@ -11,48 +12,48 @@ class PriseEnCharge_Code(Enum): ServicesSociauxAllocationVerseeALaFamille = 3 ServicesSociauxAllocationVerseeAuxServicesSociaux = 4 -class PriseEnCharge: - def __init__(self, code: PriseEnCharge_Code, value: Any) -> None: - self.code = code - self.value = value +class PriseEnCharge: + def __init__(self, code: PriseEnCharge_Code, value: Any) -> None: + self.code = code + self.value = value - def __eq__(self, other: object) -> bool: - if isinstance(other, PriseEnCharge): - return self.code == other.code and self.value == other.value - else: - return False + def __eq__(self, other: object) -> bool: + if isinstance(other, PriseEnCharge): + return self.code == other.code and self.value == other.value + else: + return False + def __ne__(self, other: object) -> bool: + return not (self == other) - def __ne__(self, other: object) -> bool: - return not (self == other) + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) - def __str__(self) -> str: - return "{}({})".format(self.code, self.value) class SituationObligationScolaire_Code(Enum): Avant = 0 Pendant = 1 Apres = 2 -class SituationObligationScolaire: - def __init__(self, code: SituationObligationScolaire_Code, value: Any) -> None: - self.code = code - self.value = value +class SituationObligationScolaire: + def __init__(self, code: SituationObligationScolaire_Code, value: Any) -> None: + self.code = code + self.value = value - def __eq__(self, other: object) -> bool: - if isinstance(other, SituationObligationScolaire): - return self.code == other.code and self.value == other.value - else: - return False + def __eq__(self, other: object) -> bool: + if isinstance(other, SituationObligationScolaire): + return self.code == other.code and self.value == other.value + else: + return False + def __ne__(self, other: object) -> bool: + return not (self == other) - def __ne__(self, other: object) -> bool: - return not (self == other) + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) - def __str__(self) -> str: - return "{}({})".format(self.code, self.value) class Collectivite_Code(Enum): Guadeloupe = 0 @@ -65,71 +66,71 @@ class Collectivite_Code(Enum): SaintPierreEtMiquelon = 7 Mayotte = 8 -class Collectivite: - def __init__(self, code: Collectivite_Code, value: Any) -> None: - self.code = code - self.value = value +class Collectivite: + def __init__(self, code: Collectivite_Code, value: Any) -> None: + self.code = code + self.value = value - def __eq__(self, other: object) -> bool: - if isinstance(other, Collectivite): - return self.code == other.code and self.value == other.value - else: - return False + def __eq__(self, other: object) -> bool: + if isinstance(other, Collectivite): + return self.code == other.code and self.value == other.value + else: + return False + def __ne__(self, other: object) -> bool: + return not (self == other) - def __ne__(self, other: object) -> bool: - return not (self == other) + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) - def __str__(self) -> str: - return "{}({})".format(self.code, self.value) class PriseEnCompte_Code(Enum): Complete = 0 Partagee = 1 Zero = 2 -class PriseEnCompte: - def __init__(self, code: PriseEnCompte_Code, value: Any) -> None: - self.code = code - self.value = value +class PriseEnCompte: + def __init__(self, code: PriseEnCompte_Code, value: Any) -> None: + self.code = code + self.value = value - def __eq__(self, other: object) -> bool: - if isinstance(other, PriseEnCompte): - return self.code == other.code and self.value == other.value - else: - return False + def __eq__(self, other: object) -> bool: + if isinstance(other, PriseEnCompte): + return self.code == other.code and self.value == other.value + else: + return False + def __ne__(self, other: object) -> bool: + return not (self == other) - def __ne__(self, other: object) -> bool: - return not (self == other) + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) - def __str__(self) -> str: - return "{}({})".format(self.code, self.value) class VersementAllocations_Code(Enum): Normal = 0 AllocationVerseeAuxServicesSociaux = 1 -class VersementAllocations: - def __init__(self, code: VersementAllocations_Code, value: Any) -> None: - self.code = code - self.value = value +class VersementAllocations: + def __init__(self, code: VersementAllocations_Code, value: Any) -> None: + self.code = code + self.value = value - def __eq__(self, other: object) -> bool: - if isinstance(other, VersementAllocations): - return self.code == other.code and self.value == other.value - else: - return False + def __eq__(self, other: object) -> bool: + if isinstance(other, VersementAllocations): + return self.code == other.code and self.value == other.value + else: + return False + def __ne__(self, other: object) -> bool: + return not (self == other) - def __ne__(self, other: object) -> bool: - return not (self == other) + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) - def __str__(self) -> str: - return "{}({})".format(self.code, self.value) class ElementPrestationsFamiliales_Code(Enum): PrestationAccueilJeuneEnfant = 0 @@ -141,611 +142,623 @@ class ElementPrestationsFamiliales_Code(Enum): AllocationRentreeScolaire = 6 AllocationJournalierePresenceParentale = 7 -class ElementPrestationsFamiliales: - def __init__(self, code: ElementPrestationsFamiliales_Code, value: Any) -> None: - self.code = code - self.value = value +class ElementPrestationsFamiliales: + def __init__(self, code: ElementPrestationsFamiliales_Code, value: Any) -> None: + self.code = code + self.value = value - def __eq__(self, other: object) -> bool: - if isinstance(other, ElementPrestationsFamiliales): - return self.code == other.code and self.value == other.value - else: - return False + def __eq__(self, other: object) -> bool: + if isinstance(other, ElementPrestationsFamiliales): + return self.code == other.code and self.value == other.value + else: + return False + def __ne__(self, other: object) -> bool: + return not (self == other) - def __ne__(self, other: object) -> bool: - return not (self == other) + def __str__(self) -> str: + return "{}({})".format(self.code, self.value) - def __str__(self) -> str: - return "{}({})".format(self.code, self.value) class EnfantEntree: - def __init__(self, d_identifiant: Integer, d_remuneration_mensuelle: Money, d_date_de_naissance: Date, d_prise_en_charge: PriseEnCharge, d_a_deja_ouvert_droit_aux_allocations_familiales: bool) -> None: - self.d_identifiant = d_identifiant - self.d_remuneration_mensuelle = d_remuneration_mensuelle - self.d_date_de_naissance = d_date_de_naissance - self.d_prise_en_charge = d_prise_en_charge - self.d_a_deja_ouvert_droit_aux_allocations_familiales = d_a_deja_ouvert_droit_aux_allocations_familiales - - def __eq__(self, other: object) -> bool: - if isinstance(other, EnfantEntree): - return (self.d_identifiant == other.d_identifiant and - self.d_remuneration_mensuelle == other.d_remuneration_mensuelle and - self.d_date_de_naissance == other.d_date_de_naissance and - self.d_prise_en_charge == other.d_prise_en_charge and - self.d_a_deja_ouvert_droit_aux_allocations_familiales == other.d_a_deja_ouvert_droit_aux_allocations_familiales) - else: - return False - - def __ne__(self, other: object) -> bool: - return not (self == other) - - def __str__(self) -> str: - return "EnfantEntree(d_identifiant={},d_remuneration_mensuelle={},d_date_de_naissance={},d_prise_en_charge={},d_a_deja_ouvert_droit_aux_allocations_familiales={})".format(self.d_identifiant, - self.d_remuneration_mensuelle, self.d_date_de_naissance, - self.d_prise_en_charge, - self.d_a_deja_ouvert_droit_aux_allocations_familiales) + def __init__(self, d_identifiant: Integer, d_remuneration_mensuelle: Money, d_date_de_naissance: Date, d_prise_en_charge: PriseEnCharge, d_a_deja_ouvert_droit_aux_allocations_familiales: bool) -> None: + self.d_identifiant = d_identifiant + self.d_remuneration_mensuelle = d_remuneration_mensuelle + self.d_date_de_naissance = d_date_de_naissance + self.d_prise_en_charge = d_prise_en_charge + self.d_a_deja_ouvert_droit_aux_allocations_familiales = d_a_deja_ouvert_droit_aux_allocations_familiales + + def __eq__(self, other: object) -> bool: + if isinstance(other, EnfantEntree): + return (self.d_identifiant == other.d_identifiant and + self.d_remuneration_mensuelle == other.d_remuneration_mensuelle and + self.d_date_de_naissance == other.d_date_de_naissance and + self.d_prise_en_charge == other.d_prise_en_charge and + self.d_a_deja_ouvert_droit_aux_allocations_familiales == other.d_a_deja_ouvert_droit_aux_allocations_familiales) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "EnfantEntree(d_identifiant={},d_remuneration_mensuelle={},d_date_de_naissance={},d_prise_en_charge={},d_a_deja_ouvert_droit_aux_allocations_familiales={})".format(self.d_identifiant, + self.d_remuneration_mensuelle, self.d_date_de_naissance, + self.d_prise_en_charge, + self.d_a_deja_ouvert_droit_aux_allocations_familiales) + class Enfant: - def __init__(self, identifiant: Integer, obligation_scolaire: SituationObligationScolaire, remuneration_mensuelle: Money, date_de_naissance: Date, age: Integer, prise_en_charge: PriseEnCharge, a_deja_ouvert_droit_aux_allocations_familiales: bool) -> None: - self.identifiant = identifiant - self.obligation_scolaire = obligation_scolaire - self.remuneration_mensuelle = remuneration_mensuelle - self.date_de_naissance = date_de_naissance - self.age = age - self.prise_en_charge = prise_en_charge - self.a_deja_ouvert_droit_aux_allocations_familiales = a_deja_ouvert_droit_aux_allocations_familiales - - def __eq__(self, other: object) -> bool: - if isinstance(other, Enfant): - return (self.identifiant == other.identifiant and - self.obligation_scolaire == other.obligation_scolaire and - self.remuneration_mensuelle == other.remuneration_mensuelle and - self.date_de_naissance == other.date_de_naissance and - self.age == other.age and - self.prise_en_charge == other.prise_en_charge and - self.a_deja_ouvert_droit_aux_allocations_familiales == other.a_deja_ouvert_droit_aux_allocations_familiales) - else: - return False - - def __ne__(self, other: object) -> bool: - return not (self == other) - - def __str__(self) -> str: - return "Enfant(identifiant={},obligation_scolaire={},remuneration_mensuelle={},date_de_naissance={},age={},prise_en_charge={},a_deja_ouvert_droit_aux_allocations_familiales={})".format(self.identifiant, - self.obligation_scolaire, self.remuneration_mensuelle, - self.date_de_naissance, self.age, self.prise_en_charge, - self.a_deja_ouvert_droit_aux_allocations_familiales) + def __init__(self, identifiant: Integer, obligation_scolaire: SituationObligationScolaire, remuneration_mensuelle: Money, date_de_naissance: Date, age: Integer, prise_en_charge: PriseEnCharge, a_deja_ouvert_droit_aux_allocations_familiales: bool) -> None: + self.identifiant = identifiant + self.obligation_scolaire = obligation_scolaire + self.remuneration_mensuelle = remuneration_mensuelle + self.date_de_naissance = date_de_naissance + self.age = age + self.prise_en_charge = prise_en_charge + self.a_deja_ouvert_droit_aux_allocations_familiales = a_deja_ouvert_droit_aux_allocations_familiales + + def __eq__(self, other: object) -> bool: + if isinstance(other, Enfant): + return (self.identifiant == other.identifiant and + self.obligation_scolaire == other.obligation_scolaire and + self.remuneration_mensuelle == other.remuneration_mensuelle and + self.date_de_naissance == other.date_de_naissance and + self.age == other.age and + self.prise_en_charge == other.prise_en_charge and + self.a_deja_ouvert_droit_aux_allocations_familiales == other.a_deja_ouvert_droit_aux_allocations_familiales) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "Enfant(identifiant={},obligation_scolaire={},remuneration_mensuelle={},date_de_naissance={},age={},prise_en_charge={},a_deja_ouvert_droit_aux_allocations_familiales={})".format(self.identifiant, + self.obligation_scolaire, self.remuneration_mensuelle, + self.date_de_naissance, self.age, self.prise_en_charge, + self.a_deja_ouvert_droit_aux_allocations_familiales) + class SmicOut: - def __init__(self, date_courante_out: Date, residence_out: Collectivite, brut_horaire_out: Money) -> None: - self.date_courante_out = date_courante_out - self.residence_out = residence_out - self.brut_horaire_out = brut_horaire_out - - def __eq__(self, other: object) -> bool: - if isinstance(other, SmicOut): - return (self.date_courante_out == other.date_courante_out and - self.residence_out == other.residence_out and - self.brut_horaire_out == other.brut_horaire_out) - else: - return False - - def __ne__(self, other: object) -> bool: - return not (self == other) - - def __str__(self) -> str: - return "SmicOut(date_courante_out={},residence_out={},brut_horaire_out={})".format(self.date_courante_out, - self.residence_out, self.brut_horaire_out) + def __init__(self, date_courante_out: Date, residence_out: Collectivite, brut_horaire_out: Money) -> None: + self.date_courante_out = date_courante_out + self.residence_out = residence_out + self.brut_horaire_out = brut_horaire_out + + def __eq__(self, other: object) -> bool: + if isinstance(other, SmicOut): + return (self.date_courante_out == other.date_courante_out and + self.residence_out == other.residence_out and + self.brut_horaire_out == other.brut_horaire_out) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "SmicOut(date_courante_out={},residence_out={},brut_horaire_out={})".format(self.date_courante_out, + self.residence_out, self.brut_horaire_out) + class SmicIn: - def __init__(self, date_courante_in: Callable[[Unit], Date], residence_in: Callable[[Unit], Collectivite], brut_horaire_in: Callable[[Unit], Money]) -> None: - self.date_courante_in = date_courante_in - self.residence_in = residence_in - self.brut_horaire_in = brut_horaire_in - - def __eq__(self, other: object) -> bool: - if isinstance(other, SmicIn): - return (self.date_courante_in == other.date_courante_in and - self.residence_in == other.residence_in and - self.brut_horaire_in == other.brut_horaire_in) - else: - return False - - def __ne__(self, other: object) -> bool: - return not (self == other) - - def __str__(self) -> str: - return "SmicIn(date_courante_in={},residence_in={},brut_horaire_in={})".format(self.date_courante_in, - self.residence_in, self.brut_horaire_in) + def __init__(self, date_courante_in: Callable[[Unit], Date], residence_in: Callable[[Unit], Collectivite], brut_horaire_in: Callable[[Unit], Money]) -> None: + self.date_courante_in = date_courante_in + self.residence_in = residence_in + self.brut_horaire_in = brut_horaire_in + + def __eq__(self, other: object) -> bool: + if isinstance(other, SmicIn): + return (self.date_courante_in == other.date_courante_in and + self.residence_in == other.residence_in and + self.brut_horaire_in == other.brut_horaire_in) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "SmicIn(date_courante_in={},residence_in={},brut_horaire_in={})".format(self.date_courante_in, + self.residence_in, self.brut_horaire_in) + class PrestationsFamilialesOut: - def __init__(self, droit_ouvert_out: Callable[[Enfant], bool], conditions_hors_age_out: Callable[[Enfant], bool], plafond_l512_3_2_out: Money, age_l512_3_2_out: Integer, regime_outre_mer_l751_1_out: bool, date_courante_out: Date, prestation_courante_out: ElementPrestationsFamiliales, residence_out: Collectivite, base_mensuelle_out: Money) -> None: - self.droit_ouvert_out = droit_ouvert_out - self.conditions_hors_age_out = conditions_hors_age_out - self.plafond_l512_3_2_out = plafond_l512_3_2_out - self.age_l512_3_2_out = age_l512_3_2_out - self.regime_outre_mer_l751_1_out = regime_outre_mer_l751_1_out - self.date_courante_out = date_courante_out - self.prestation_courante_out = prestation_courante_out - self.residence_out = residence_out - self.base_mensuelle_out = base_mensuelle_out - - def __eq__(self, other: object) -> bool: - if isinstance(other, PrestationsFamilialesOut): - return (self.droit_ouvert_out == other.droit_ouvert_out and - self.conditions_hors_age_out == other.conditions_hors_age_out and - self.plafond_l512_3_2_out == other.plafond_l512_3_2_out and - self.age_l512_3_2_out == other.age_l512_3_2_out and - self.regime_outre_mer_l751_1_out == other.regime_outre_mer_l751_1_out and - self.date_courante_out == other.date_courante_out and - self.prestation_courante_out == other.prestation_courante_out and - self.residence_out == other.residence_out and - self.base_mensuelle_out == other.base_mensuelle_out) - else: - return False - - def __ne__(self, other: object) -> bool: - return not (self == other) - - def __str__(self) -> str: - return "PrestationsFamilialesOut(droit_ouvert_out={},conditions_hors_age_out={},plafond_l512_3_2_out={},age_l512_3_2_out={},regime_outre_mer_l751_1_out={},date_courante_out={},prestation_courante_out={},residence_out={},base_mensuelle_out={})".format(self.droit_ouvert_out, - self.conditions_hors_age_out, self.plafond_l512_3_2_out, - self.age_l512_3_2_out, self.regime_outre_mer_l751_1_out, - self.date_courante_out, self.prestation_courante_out, - self.residence_out, self.base_mensuelle_out) + def __init__(self, droit_ouvert_out: Callable[[Enfant], bool], conditions_hors_age_out: Callable[[Enfant], bool], plafond_l512_3_2_out: Money, age_l512_3_2_out: Integer, regime_outre_mer_l751_1_out: bool, date_courante_out: Date, prestation_courante_out: ElementPrestationsFamiliales, residence_out: Collectivite, base_mensuelle_out: Money) -> None: + self.droit_ouvert_out = droit_ouvert_out + self.conditions_hors_age_out = conditions_hors_age_out + self.plafond_l512_3_2_out = plafond_l512_3_2_out + self.age_l512_3_2_out = age_l512_3_2_out + self.regime_outre_mer_l751_1_out = regime_outre_mer_l751_1_out + self.date_courante_out = date_courante_out + self.prestation_courante_out = prestation_courante_out + self.residence_out = residence_out + self.base_mensuelle_out = base_mensuelle_out + + def __eq__(self, other: object) -> bool: + if isinstance(other, PrestationsFamilialesOut): + return (self.droit_ouvert_out == other.droit_ouvert_out and + self.conditions_hors_age_out == other.conditions_hors_age_out and + self.plafond_l512_3_2_out == other.plafond_l512_3_2_out and + self.age_l512_3_2_out == other.age_l512_3_2_out and + self.regime_outre_mer_l751_1_out == other.regime_outre_mer_l751_1_out and + self.date_courante_out == other.date_courante_out and + self.prestation_courante_out == other.prestation_courante_out and + self.residence_out == other.residence_out and + self.base_mensuelle_out == other.base_mensuelle_out) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "PrestationsFamilialesOut(droit_ouvert_out={},conditions_hors_age_out={},plafond_l512_3_2_out={},age_l512_3_2_out={},regime_outre_mer_l751_1_out={},date_courante_out={},prestation_courante_out={},residence_out={},base_mensuelle_out={})".format(self.droit_ouvert_out, + self.conditions_hors_age_out, self.plafond_l512_3_2_out, + self.age_l512_3_2_out, self.regime_outre_mer_l751_1_out, + self.date_courante_out, self.prestation_courante_out, + self.residence_out, self.base_mensuelle_out) + class PrestationsFamilialesIn: - def __init__(self, droit_ouvert_in: Callable[[Unit], (Callable[[Enfant], bool])], conditions_hors_age_in: Callable[[Unit], (Callable[[Enfant], bool])], plafond_l512_3_2_in: Callable[[Unit], Money], age_l512_3_2_in: Callable[[Unit], Integer], regime_outre_mer_l751_1_in: Callable[[Unit], bool], date_courante_in: Callable[[Unit], Date], prestation_courante_in: Callable[[Unit], ElementPrestationsFamiliales], residence_in: Callable[[Unit], Collectivite], base_mensuelle_in: Callable[[Unit], Money]) -> None: - self.droit_ouvert_in = droit_ouvert_in - self.conditions_hors_age_in = conditions_hors_age_in - self.plafond_l512_3_2_in = plafond_l512_3_2_in - self.age_l512_3_2_in = age_l512_3_2_in - self.regime_outre_mer_l751_1_in = regime_outre_mer_l751_1_in - self.date_courante_in = date_courante_in - self.prestation_courante_in = prestation_courante_in - self.residence_in = residence_in - self.base_mensuelle_in = base_mensuelle_in - - def __eq__(self, other: object) -> bool: - if isinstance(other, PrestationsFamilialesIn): - return (self.droit_ouvert_in == other.droit_ouvert_in and - self.conditions_hors_age_in == other.conditions_hors_age_in and - self.plafond_l512_3_2_in == other.plafond_l512_3_2_in and - self.age_l512_3_2_in == other.age_l512_3_2_in and - self.regime_outre_mer_l751_1_in == other.regime_outre_mer_l751_1_in and - self.date_courante_in == other.date_courante_in and - self.prestation_courante_in == other.prestation_courante_in and - self.residence_in == other.residence_in and - self.base_mensuelle_in == other.base_mensuelle_in) - else: - return False - - def __ne__(self, other: object) -> bool: - return not (self == other) - - def __str__(self) -> str: - return "PrestationsFamilialesIn(droit_ouvert_in={},conditions_hors_age_in={},plafond_l512_3_2_in={},age_l512_3_2_in={},regime_outre_mer_l751_1_in={},date_courante_in={},prestation_courante_in={},residence_in={},base_mensuelle_in={})".format(self.droit_ouvert_in, - self.conditions_hors_age_in, self.plafond_l512_3_2_in, - self.age_l512_3_2_in, self.regime_outre_mer_l751_1_in, - self.date_courante_in, self.prestation_courante_in, self.residence_in, - self.base_mensuelle_in) + def __init__(self, droit_ouvert_in: Callable[[Unit], (Callable[[Enfant], bool])], conditions_hors_age_in: Callable[[Unit], (Callable[[Enfant], bool])], plafond_l512_3_2_in: Callable[[Unit], Money], age_l512_3_2_in: Callable[[Unit], Integer], regime_outre_mer_l751_1_in: Callable[[Unit], bool], date_courante_in: Callable[[Unit], Date], prestation_courante_in: Callable[[Unit], ElementPrestationsFamiliales], residence_in: Callable[[Unit], Collectivite], base_mensuelle_in: Callable[[Unit], Money]) -> None: + self.droit_ouvert_in = droit_ouvert_in + self.conditions_hors_age_in = conditions_hors_age_in + self.plafond_l512_3_2_in = plafond_l512_3_2_in + self.age_l512_3_2_in = age_l512_3_2_in + self.regime_outre_mer_l751_1_in = regime_outre_mer_l751_1_in + self.date_courante_in = date_courante_in + self.prestation_courante_in = prestation_courante_in + self.residence_in = residence_in + self.base_mensuelle_in = base_mensuelle_in + + def __eq__(self, other: object) -> bool: + if isinstance(other, PrestationsFamilialesIn): + return (self.droit_ouvert_in == other.droit_ouvert_in and + self.conditions_hors_age_in == other.conditions_hors_age_in and + self.plafond_l512_3_2_in == other.plafond_l512_3_2_in and + self.age_l512_3_2_in == other.age_l512_3_2_in and + self.regime_outre_mer_l751_1_in == other.regime_outre_mer_l751_1_in and + self.date_courante_in == other.date_courante_in and + self.prestation_courante_in == other.prestation_courante_in and + self.residence_in == other.residence_in and + self.base_mensuelle_in == other.base_mensuelle_in) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "PrestationsFamilialesIn(droit_ouvert_in={},conditions_hors_age_in={},plafond_l512_3_2_in={},age_l512_3_2_in={},regime_outre_mer_l751_1_in={},date_courante_in={},prestation_courante_in={},residence_in={},base_mensuelle_in={})".format(self.droit_ouvert_in, + self.conditions_hors_age_in, self.plafond_l512_3_2_in, + self.age_l512_3_2_in, self.regime_outre_mer_l751_1_in, + self.date_courante_in, self.prestation_courante_in, self.residence_in, + self.base_mensuelle_in) + class AllocationFamilialesAvril2008Out: - def __init__(self, age_minimum_alinea_1_l521_3_out: Integer) -> None: - self.age_minimum_alinea_1_l521_3_out = age_minimum_alinea_1_l521_3_out + def __init__(self, age_minimum_alinea_1_l521_3_out: Integer) -> None: + self.age_minimum_alinea_1_l521_3_out = age_minimum_alinea_1_l521_3_out + + def __eq__(self, other: object) -> bool: + if isinstance(other, AllocationFamilialesAvril2008Out): + return (self.age_minimum_alinea_1_l521_3_out == other.age_minimum_alinea_1_l521_3_out) + else: + return False - def __eq__(self, other: object) -> bool: - if isinstance(other, AllocationFamilialesAvril2008Out): - return (self.age_minimum_alinea_1_l521_3_out == other.age_minimum_alinea_1_l521_3_out) - else: - return False + def __ne__(self, other: object) -> bool: + return not (self == other) - def __ne__(self, other: object) -> bool: - return not (self == other) + def __str__(self) -> str: + return "AllocationFamilialesAvril2008Out(age_minimum_alinea_1_l521_3_out={})".format(self.age_minimum_alinea_1_l521_3_out) - def __str__(self) -> str: - return "AllocationFamilialesAvril2008Out(age_minimum_alinea_1_l521_3_out={})".format(self.age_minimum_alinea_1_l521_3_out) class AllocationFamilialesAvril2008In: - def __init__(self, age_minimum_alinea_1_l521_3_in: Callable[[Unit], Integer]) -> None: - self.age_minimum_alinea_1_l521_3_in = age_minimum_alinea_1_l521_3_in + def __init__(self, age_minimum_alinea_1_l521_3_in: Callable[[Unit], Integer]) -> None: + self.age_minimum_alinea_1_l521_3_in = age_minimum_alinea_1_l521_3_in - def __eq__(self, other: object) -> bool: - if isinstance(other, AllocationFamilialesAvril2008In): - return (self.age_minimum_alinea_1_l521_3_in == other.age_minimum_alinea_1_l521_3_in) - else: - return False + def __eq__(self, other: object) -> bool: + if isinstance(other, AllocationFamilialesAvril2008In): + return (self.age_minimum_alinea_1_l521_3_in == other.age_minimum_alinea_1_l521_3_in) + else: + return False - def __ne__(self, other: object) -> bool: - return not (self == other) + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "AllocationFamilialesAvril2008In(age_minimum_alinea_1_l521_3_in={})".format(self.age_minimum_alinea_1_l521_3_in) - def __str__(self) -> str: - return "AllocationFamilialesAvril2008In(age_minimum_alinea_1_l521_3_in={})".format(self.age_minimum_alinea_1_l521_3_in) class EnfantLePlusAgeOut: - def __init__(self, enfants_out: List[Enfant], le_plus_age_out: Enfant) -> None: - self.enfants_out = enfants_out - self.le_plus_age_out = le_plus_age_out + def __init__(self, enfants_out: List[Enfant], le_plus_age_out: Enfant) -> None: + self.enfants_out = enfants_out + self.le_plus_age_out = le_plus_age_out + + def __eq__(self, other: object) -> bool: + if isinstance(other, EnfantLePlusAgeOut): + return (self.enfants_out == other.enfants_out and + self.le_plus_age_out == other.le_plus_age_out) + else: + return False - def __eq__(self, other: object) -> bool: - if isinstance(other, EnfantLePlusAgeOut): - return (self.enfants_out == other.enfants_out and - self.le_plus_age_out == other.le_plus_age_out) - else: - return False + def __ne__(self, other: object) -> bool: + return not (self == other) - def __ne__(self, other: object) -> bool: - return not (self == other) + def __str__(self) -> str: + return "EnfantLePlusAgeOut(enfants_out={},le_plus_age_out={})".format(self.enfants_out, + self.le_plus_age_out) - def __str__(self) -> str: - return "EnfantLePlusAgeOut(enfants_out={},le_plus_age_out={})".format(self.enfants_out, - self.le_plus_age_out) class EnfantLePlusAgeIn: - def __init__(self, enfants_in: Callable[[Unit], (List[Enfant])], le_plus_age_in: Callable[[Unit], Enfant]) -> None: - self.enfants_in = enfants_in - self.le_plus_age_in = le_plus_age_in + def __init__(self, enfants_in: Callable[[Unit], (List[Enfant])], le_plus_age_in: Callable[[Unit], Enfant]) -> None: + self.enfants_in = enfants_in + self.le_plus_age_in = le_plus_age_in - def __eq__(self, other: object) -> bool: - if isinstance(other, EnfantLePlusAgeIn): - return (self.enfants_in == other.enfants_in and - self.le_plus_age_in == other.le_plus_age_in) - else: - return False + def __eq__(self, other: object) -> bool: + if isinstance(other, EnfantLePlusAgeIn): + return (self.enfants_in == other.enfants_in and + self.le_plus_age_in == other.le_plus_age_in) + else: + return False - def __ne__(self, other: object) -> bool: - return not (self == other) + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "EnfantLePlusAgeIn(enfants_in={},le_plus_age_in={})".format(self.enfants_in, + self.le_plus_age_in) - def __str__(self) -> str: - return "EnfantLePlusAgeIn(enfants_in={},le_plus_age_in={})".format(self.enfants_in, - self.le_plus_age_in) class AllocationsFamilialesOut: - def __init__(self, personne_charge_effective_permanente_est_parent_out: bool, personne_charge_effective_permanente_remplit_titre_I_out: bool, ressources_menage_out: Money, residence_out: Collectivite, date_courante_out: Date, enfants_a_charge_out: List[Enfant], enfants_a_charge_droit_ouvert_prestation_familiale_out: List[Enfant], prise_en_compte_out: Callable[[Enfant], PriseEnCompte], versement_out: Callable[[Enfant], VersementAllocations], montant_verse_out: Money, droit_ouvert_base_out: bool, montant_initial_base_out: Money, montant_initial_base_premier_enfant_out: Money, montant_initial_base_deuxieme_enfant_out: Money, montant_initial_base_troisieme_enfant_et_plus_out: Money, rapport_enfants_total_moyen_out: Decimal, nombre_moyen_enfants_out: Decimal, nombre_total_enfants_out: Decimal, montant_avec_garde_alternee_base_out: Money, montant_verse_base_out: Money, avait_enfant_a_charge_avant_1er_janvier_2012_out: bool, montant_initial_base_premier_enfant_mayotte_out: Money, montant_initial_base_deuxieme_enfant_mayotte_out: Money, montant_initial_base_troisieme_enfant_mayotte_out: Money, montant_initial_base_quatrieme_enfant_et_plus_mayotte_out: Money, droit_ouvert_forfaitaire_out: Callable[[Enfant], bool], montant_verse_forfaitaire_par_enfant_out: Money, montant_verse_forfaitaire_out: Money, droit_ouvert_majoration_out: Callable[[Enfant], bool], montant_initial_metropole_majoration_out: Callable[[Enfant], Money], montant_initial_majoration_out: Callable[[Enfant], Money], montant_avec_garde_alternee_majoration_out: Callable[[Enfant], Money], montant_verse_majoration_out: Money, droit_ouvert_complement_out: bool, montant_base_complement_pour_base_et_majoration_out: Money, complement_degressif_out: Callable[[Money], Money], montant_verse_complement_pour_base_et_majoration_out: Money, montant_verse_complement_pour_forfaitaire_out: Money, nombre_enfants_l521_1_out: Integer, age_minimum_alinea_1_l521_3_out: Callable[[Enfant], Integer], nombre_enfants_alinea_2_l521_3_out: Integer, est_enfant_le_plus_age_out: Callable[[Enfant], bool], plafond_I_d521_3_out: Money, plafond_II_d521_3_out: Money) -> None: - self.personne_charge_effective_permanente_est_parent_out = personne_charge_effective_permanente_est_parent_out - self.personne_charge_effective_permanente_remplit_titre_I_out = personne_charge_effective_permanente_remplit_titre_I_out - self.ressources_menage_out = ressources_menage_out - self.residence_out = residence_out - self.date_courante_out = date_courante_out - self.enfants_a_charge_out = enfants_a_charge_out - self.enfants_a_charge_droit_ouvert_prestation_familiale_out = enfants_a_charge_droit_ouvert_prestation_familiale_out - self.prise_en_compte_out = prise_en_compte_out - self.versement_out = versement_out - self.montant_verse_out = montant_verse_out - self.droit_ouvert_base_out = droit_ouvert_base_out - self.montant_initial_base_out = montant_initial_base_out - self.montant_initial_base_premier_enfant_out = montant_initial_base_premier_enfant_out - self.montant_initial_base_deuxieme_enfant_out = montant_initial_base_deuxieme_enfant_out - self.montant_initial_base_troisieme_enfant_et_plus_out = montant_initial_base_troisieme_enfant_et_plus_out - self.rapport_enfants_total_moyen_out = rapport_enfants_total_moyen_out - self.nombre_moyen_enfants_out = nombre_moyen_enfants_out - self.nombre_total_enfants_out = nombre_total_enfants_out - self.montant_avec_garde_alternee_base_out = montant_avec_garde_alternee_base_out - self.montant_verse_base_out = montant_verse_base_out - self.avait_enfant_a_charge_avant_1er_janvier_2012_out = avait_enfant_a_charge_avant_1er_janvier_2012_out - self.montant_initial_base_premier_enfant_mayotte_out = montant_initial_base_premier_enfant_mayotte_out - self.montant_initial_base_deuxieme_enfant_mayotte_out = montant_initial_base_deuxieme_enfant_mayotte_out - self.montant_initial_base_troisieme_enfant_mayotte_out = montant_initial_base_troisieme_enfant_mayotte_out - self.montant_initial_base_quatrieme_enfant_et_plus_mayotte_out = montant_initial_base_quatrieme_enfant_et_plus_mayotte_out - self.droit_ouvert_forfaitaire_out = droit_ouvert_forfaitaire_out - self.montant_verse_forfaitaire_par_enfant_out = montant_verse_forfaitaire_par_enfant_out - self.montant_verse_forfaitaire_out = montant_verse_forfaitaire_out - self.droit_ouvert_majoration_out = droit_ouvert_majoration_out - self.montant_initial_metropole_majoration_out = montant_initial_metropole_majoration_out - self.montant_initial_majoration_out = montant_initial_majoration_out - self.montant_avec_garde_alternee_majoration_out = montant_avec_garde_alternee_majoration_out - self.montant_verse_majoration_out = montant_verse_majoration_out - self.droit_ouvert_complement_out = droit_ouvert_complement_out - self.montant_base_complement_pour_base_et_majoration_out = montant_base_complement_pour_base_et_majoration_out - self.complement_degressif_out = complement_degressif_out - self.montant_verse_complement_pour_base_et_majoration_out = montant_verse_complement_pour_base_et_majoration_out - self.montant_verse_complement_pour_forfaitaire_out = montant_verse_complement_pour_forfaitaire_out - self.nombre_enfants_l521_1_out = nombre_enfants_l521_1_out - self.age_minimum_alinea_1_l521_3_out = age_minimum_alinea_1_l521_3_out - self.nombre_enfants_alinea_2_l521_3_out = nombre_enfants_alinea_2_l521_3_out - self.est_enfant_le_plus_age_out = est_enfant_le_plus_age_out - self.plafond_I_d521_3_out = plafond_I_d521_3_out - self.plafond_II_d521_3_out = plafond_II_d521_3_out - - def __eq__(self, other: object) -> bool: - if isinstance(other, AllocationsFamilialesOut): - return (self.personne_charge_effective_permanente_est_parent_out == other.personne_charge_effective_permanente_est_parent_out and - self.personne_charge_effective_permanente_remplit_titre_I_out == other.personne_charge_effective_permanente_remplit_titre_I_out and - self.ressources_menage_out == other.ressources_menage_out and - self.residence_out == other.residence_out and - self.date_courante_out == other.date_courante_out and - self.enfants_a_charge_out == other.enfants_a_charge_out and - self.enfants_a_charge_droit_ouvert_prestation_familiale_out == other.enfants_a_charge_droit_ouvert_prestation_familiale_out and - self.prise_en_compte_out == other.prise_en_compte_out and - self.versement_out == other.versement_out and - self.montant_verse_out == other.montant_verse_out and - self.droit_ouvert_base_out == other.droit_ouvert_base_out and - self.montant_initial_base_out == other.montant_initial_base_out and - self.montant_initial_base_premier_enfant_out == other.montant_initial_base_premier_enfant_out and - self.montant_initial_base_deuxieme_enfant_out == other.montant_initial_base_deuxieme_enfant_out and - self.montant_initial_base_troisieme_enfant_et_plus_out == other.montant_initial_base_troisieme_enfant_et_plus_out and - self.rapport_enfants_total_moyen_out == other.rapport_enfants_total_moyen_out and - self.nombre_moyen_enfants_out == other.nombre_moyen_enfants_out and - self.nombre_total_enfants_out == other.nombre_total_enfants_out and - self.montant_avec_garde_alternee_base_out == other.montant_avec_garde_alternee_base_out and - self.montant_verse_base_out == other.montant_verse_base_out and - self.avait_enfant_a_charge_avant_1er_janvier_2012_out == other.avait_enfant_a_charge_avant_1er_janvier_2012_out and - self.montant_initial_base_premier_enfant_mayotte_out == other.montant_initial_base_premier_enfant_mayotte_out and - self.montant_initial_base_deuxieme_enfant_mayotte_out == other.montant_initial_base_deuxieme_enfant_mayotte_out and - self.montant_initial_base_troisieme_enfant_mayotte_out == other.montant_initial_base_troisieme_enfant_mayotte_out and - self.montant_initial_base_quatrieme_enfant_et_plus_mayotte_out == other.montant_initial_base_quatrieme_enfant_et_plus_mayotte_out and - self.droit_ouvert_forfaitaire_out == other.droit_ouvert_forfaitaire_out and - self.montant_verse_forfaitaire_par_enfant_out == other.montant_verse_forfaitaire_par_enfant_out and - self.montant_verse_forfaitaire_out == other.montant_verse_forfaitaire_out and - self.droit_ouvert_majoration_out == other.droit_ouvert_majoration_out and - self.montant_initial_metropole_majoration_out == other.montant_initial_metropole_majoration_out and - self.montant_initial_majoration_out == other.montant_initial_majoration_out and - self.montant_avec_garde_alternee_majoration_out == other.montant_avec_garde_alternee_majoration_out and - self.montant_verse_majoration_out == other.montant_verse_majoration_out and - self.droit_ouvert_complement_out == other.droit_ouvert_complement_out and - self.montant_base_complement_pour_base_et_majoration_out == other.montant_base_complement_pour_base_et_majoration_out and - self.complement_degressif_out == other.complement_degressif_out and - self.montant_verse_complement_pour_base_et_majoration_out == other.montant_verse_complement_pour_base_et_majoration_out and - self.montant_verse_complement_pour_forfaitaire_out == other.montant_verse_complement_pour_forfaitaire_out and - self.nombre_enfants_l521_1_out == other.nombre_enfants_l521_1_out and - self.age_minimum_alinea_1_l521_3_out == other.age_minimum_alinea_1_l521_3_out and - self.nombre_enfants_alinea_2_l521_3_out == other.nombre_enfants_alinea_2_l521_3_out and - self.est_enfant_le_plus_age_out == other.est_enfant_le_plus_age_out and - self.plafond_I_d521_3_out == other.plafond_I_d521_3_out and - self.plafond_II_d521_3_out == other.plafond_II_d521_3_out) - else: - return False - - def __ne__(self, other: object) -> bool: - return not (self == other) - - def __str__(self) -> str: - return "AllocationsFamilialesOut(personne_charge_effective_permanente_est_parent_out={},personne_charge_effective_permanente_remplit_titre_I_out={},ressources_menage_out={},residence_out={},date_courante_out={},enfants_a_charge_out={},enfants_a_charge_droit_ouvert_prestation_familiale_out={},prise_en_compte_out={},versement_out={},montant_verse_out={},droit_ouvert_base_out={},montant_initial_base_out={},montant_initial_base_premier_enfant_out={},montant_initial_base_deuxieme_enfant_out={},montant_initial_base_troisieme_enfant_et_plus_out={},rapport_enfants_total_moyen_out={},nombre_moyen_enfants_out={},nombre_total_enfants_out={},montant_avec_garde_alternee_base_out={},montant_verse_base_out={},avait_enfant_a_charge_avant_1er_janvier_2012_out={},montant_initial_base_premier_enfant_mayotte_out={},montant_initial_base_deuxieme_enfant_mayotte_out={},montant_initial_base_troisieme_enfant_mayotte_out={},montant_initial_base_quatrieme_enfant_et_plus_mayotte_out={},droit_ouvert_forfaitaire_out={},montant_verse_forfaitaire_par_enfant_out={},montant_verse_forfaitaire_out={},droit_ouvert_majoration_out={},montant_initial_metropole_majoration_out={},montant_initial_majoration_out={},montant_avec_garde_alternee_majoration_out={},montant_verse_majoration_out={},droit_ouvert_complement_out={},montant_base_complement_pour_base_et_majoration_out={},complement_degressif_out={},montant_verse_complement_pour_base_et_majoration_out={},montant_verse_complement_pour_forfaitaire_out={},nombre_enfants_l521_1_out={},age_minimum_alinea_1_l521_3_out={},nombre_enfants_alinea_2_l521_3_out={},est_enfant_le_plus_age_out={},plafond_I_d521_3_out={},plafond_II_d521_3_out={})".format(self.personne_charge_effective_permanente_est_parent_out, - self.personne_charge_effective_permanente_remplit_titre_I_out, - self.ressources_menage_out, self.residence_out, self.date_courante_out, - self.enfants_a_charge_out, - self.enfants_a_charge_droit_ouvert_prestation_familiale_out, - self.prise_en_compte_out, self.versement_out, self.montant_verse_out, - self.droit_ouvert_base_out, self.montant_initial_base_out, - self.montant_initial_base_premier_enfant_out, - self.montant_initial_base_deuxieme_enfant_out, - self.montant_initial_base_troisieme_enfant_et_plus_out, - self.rapport_enfants_total_moyen_out, self.nombre_moyen_enfants_out, - self.nombre_total_enfants_out, - self.montant_avec_garde_alternee_base_out, self.montant_verse_base_out, - self.avait_enfant_a_charge_avant_1er_janvier_2012_out, - self.montant_initial_base_premier_enfant_mayotte_out, - self.montant_initial_base_deuxieme_enfant_mayotte_out, - self.montant_initial_base_troisieme_enfant_mayotte_out, - self.montant_initial_base_quatrieme_enfant_et_plus_mayotte_out, - self.droit_ouvert_forfaitaire_out, - self.montant_verse_forfaitaire_par_enfant_out, - self.montant_verse_forfaitaire_out, self.droit_ouvert_majoration_out, - self.montant_initial_metropole_majoration_out, - self.montant_initial_majoration_out, - self.montant_avec_garde_alternee_majoration_out, - self.montant_verse_majoration_out, self.droit_ouvert_complement_out, - self.montant_base_complement_pour_base_et_majoration_out, - self.complement_degressif_out, - self.montant_verse_complement_pour_base_et_majoration_out, - self.montant_verse_complement_pour_forfaitaire_out, - self.nombre_enfants_l521_1_out, self.age_minimum_alinea_1_l521_3_out, - self.nombre_enfants_alinea_2_l521_3_out, - self.est_enfant_le_plus_age_out, self.plafond_I_d521_3_out, - self.plafond_II_d521_3_out) + def __init__(self, personne_charge_effective_permanente_est_parent_out: bool, personne_charge_effective_permanente_remplit_titre_I_out: bool, ressources_menage_out: Money, residence_out: Collectivite, date_courante_out: Date, enfants_a_charge_out: List[Enfant], enfants_a_charge_droit_ouvert_prestation_familiale_out: List[Enfant], prise_en_compte_out: Callable[[Enfant], PriseEnCompte], versement_out: Callable[[Enfant], VersementAllocations], montant_verse_out: Money, droit_ouvert_base_out: bool, montant_initial_base_out: Money, montant_initial_base_premier_enfant_out: Money, montant_initial_base_deuxieme_enfant_out: Money, montant_initial_base_troisieme_enfant_et_plus_out: Money, rapport_enfants_total_moyen_out: Decimal, nombre_moyen_enfants_out: Decimal, nombre_total_enfants_out: Decimal, montant_avec_garde_alternee_base_out: Money, montant_verse_base_out: Money, avait_enfant_a_charge_avant_1er_janvier_2012_out: bool, montant_initial_base_premier_enfant_mayotte_out: Money, montant_initial_base_deuxieme_enfant_mayotte_out: Money, montant_initial_base_troisieme_enfant_mayotte_out: Money, montant_initial_base_quatrieme_enfant_et_plus_mayotte_out: Money, droit_ouvert_forfaitaire_out: Callable[[Enfant], bool], montant_verse_forfaitaire_par_enfant_out: Money, montant_verse_forfaitaire_out: Money, droit_ouvert_majoration_out: Callable[[Enfant], bool], montant_initial_metropole_majoration_out: Callable[[Enfant], Money], montant_initial_majoration_out: Callable[[Enfant], Money], montant_avec_garde_alternee_majoration_out: Callable[[Enfant], Money], montant_verse_majoration_out: Money, droit_ouvert_complement_out: bool, montant_base_complement_pour_base_et_majoration_out: Money, complement_degressif_out: Callable[[Money], Money], montant_verse_complement_pour_base_et_majoration_out: Money, montant_verse_complement_pour_forfaitaire_out: Money, nombre_enfants_l521_1_out: Integer, age_minimum_alinea_1_l521_3_out: Callable[[Enfant], Integer], nombre_enfants_alinea_2_l521_3_out: Integer, est_enfant_le_plus_age_out: Callable[[Enfant], bool], plafond_I_d521_3_out: Money, plafond_II_d521_3_out: Money) -> None: + self.personne_charge_effective_permanente_est_parent_out = personne_charge_effective_permanente_est_parent_out + self.personne_charge_effective_permanente_remplit_titre_I_out = personne_charge_effective_permanente_remplit_titre_I_out + self.ressources_menage_out = ressources_menage_out + self.residence_out = residence_out + self.date_courante_out = date_courante_out + self.enfants_a_charge_out = enfants_a_charge_out + self.enfants_a_charge_droit_ouvert_prestation_familiale_out = enfants_a_charge_droit_ouvert_prestation_familiale_out + self.prise_en_compte_out = prise_en_compte_out + self.versement_out = versement_out + self.montant_verse_out = montant_verse_out + self.droit_ouvert_base_out = droit_ouvert_base_out + self.montant_initial_base_out = montant_initial_base_out + self.montant_initial_base_premier_enfant_out = montant_initial_base_premier_enfant_out + self.montant_initial_base_deuxieme_enfant_out = montant_initial_base_deuxieme_enfant_out + self.montant_initial_base_troisieme_enfant_et_plus_out = montant_initial_base_troisieme_enfant_et_plus_out + self.rapport_enfants_total_moyen_out = rapport_enfants_total_moyen_out + self.nombre_moyen_enfants_out = nombre_moyen_enfants_out + self.nombre_total_enfants_out = nombre_total_enfants_out + self.montant_avec_garde_alternee_base_out = montant_avec_garde_alternee_base_out + self.montant_verse_base_out = montant_verse_base_out + self.avait_enfant_a_charge_avant_1er_janvier_2012_out = avait_enfant_a_charge_avant_1er_janvier_2012_out + self.montant_initial_base_premier_enfant_mayotte_out = montant_initial_base_premier_enfant_mayotte_out + self.montant_initial_base_deuxieme_enfant_mayotte_out = montant_initial_base_deuxieme_enfant_mayotte_out + self.montant_initial_base_troisieme_enfant_mayotte_out = montant_initial_base_troisieme_enfant_mayotte_out + self.montant_initial_base_quatrieme_enfant_et_plus_mayotte_out = montant_initial_base_quatrieme_enfant_et_plus_mayotte_out + self.droit_ouvert_forfaitaire_out = droit_ouvert_forfaitaire_out + self.montant_verse_forfaitaire_par_enfant_out = montant_verse_forfaitaire_par_enfant_out + self.montant_verse_forfaitaire_out = montant_verse_forfaitaire_out + self.droit_ouvert_majoration_out = droit_ouvert_majoration_out + self.montant_initial_metropole_majoration_out = montant_initial_metropole_majoration_out + self.montant_initial_majoration_out = montant_initial_majoration_out + self.montant_avec_garde_alternee_majoration_out = montant_avec_garde_alternee_majoration_out + self.montant_verse_majoration_out = montant_verse_majoration_out + self.droit_ouvert_complement_out = droit_ouvert_complement_out + self.montant_base_complement_pour_base_et_majoration_out = montant_base_complement_pour_base_et_majoration_out + self.complement_degressif_out = complement_degressif_out + self.montant_verse_complement_pour_base_et_majoration_out = montant_verse_complement_pour_base_et_majoration_out + self.montant_verse_complement_pour_forfaitaire_out = montant_verse_complement_pour_forfaitaire_out + self.nombre_enfants_l521_1_out = nombre_enfants_l521_1_out + self.age_minimum_alinea_1_l521_3_out = age_minimum_alinea_1_l521_3_out + self.nombre_enfants_alinea_2_l521_3_out = nombre_enfants_alinea_2_l521_3_out + self.est_enfant_le_plus_age_out = est_enfant_le_plus_age_out + self.plafond_I_d521_3_out = plafond_I_d521_3_out + self.plafond_II_d521_3_out = plafond_II_d521_3_out + + def __eq__(self, other: object) -> bool: + if isinstance(other, AllocationsFamilialesOut): + return (self.personne_charge_effective_permanente_est_parent_out == other.personne_charge_effective_permanente_est_parent_out and + self.personne_charge_effective_permanente_remplit_titre_I_out == other.personne_charge_effective_permanente_remplit_titre_I_out and + self.ressources_menage_out == other.ressources_menage_out and + self.residence_out == other.residence_out and + self.date_courante_out == other.date_courante_out and + self.enfants_a_charge_out == other.enfants_a_charge_out and + self.enfants_a_charge_droit_ouvert_prestation_familiale_out == other.enfants_a_charge_droit_ouvert_prestation_familiale_out and + self.prise_en_compte_out == other.prise_en_compte_out and + self.versement_out == other.versement_out and + self.montant_verse_out == other.montant_verse_out and + self.droit_ouvert_base_out == other.droit_ouvert_base_out and + self.montant_initial_base_out == other.montant_initial_base_out and + self.montant_initial_base_premier_enfant_out == other.montant_initial_base_premier_enfant_out and + self.montant_initial_base_deuxieme_enfant_out == other.montant_initial_base_deuxieme_enfant_out and + self.montant_initial_base_troisieme_enfant_et_plus_out == other.montant_initial_base_troisieme_enfant_et_plus_out and + self.rapport_enfants_total_moyen_out == other.rapport_enfants_total_moyen_out and + self.nombre_moyen_enfants_out == other.nombre_moyen_enfants_out and + self.nombre_total_enfants_out == other.nombre_total_enfants_out and + self.montant_avec_garde_alternee_base_out == other.montant_avec_garde_alternee_base_out and + self.montant_verse_base_out == other.montant_verse_base_out and + self.avait_enfant_a_charge_avant_1er_janvier_2012_out == other.avait_enfant_a_charge_avant_1er_janvier_2012_out and + self.montant_initial_base_premier_enfant_mayotte_out == other.montant_initial_base_premier_enfant_mayotte_out and + self.montant_initial_base_deuxieme_enfant_mayotte_out == other.montant_initial_base_deuxieme_enfant_mayotte_out and + self.montant_initial_base_troisieme_enfant_mayotte_out == other.montant_initial_base_troisieme_enfant_mayotte_out and + self.montant_initial_base_quatrieme_enfant_et_plus_mayotte_out == other.montant_initial_base_quatrieme_enfant_et_plus_mayotte_out and + self.droit_ouvert_forfaitaire_out == other.droit_ouvert_forfaitaire_out and + self.montant_verse_forfaitaire_par_enfant_out == other.montant_verse_forfaitaire_par_enfant_out and + self.montant_verse_forfaitaire_out == other.montant_verse_forfaitaire_out and + self.droit_ouvert_majoration_out == other.droit_ouvert_majoration_out and + self.montant_initial_metropole_majoration_out == other.montant_initial_metropole_majoration_out and + self.montant_initial_majoration_out == other.montant_initial_majoration_out and + self.montant_avec_garde_alternee_majoration_out == other.montant_avec_garde_alternee_majoration_out and + self.montant_verse_majoration_out == other.montant_verse_majoration_out and + self.droit_ouvert_complement_out == other.droit_ouvert_complement_out and + self.montant_base_complement_pour_base_et_majoration_out == other.montant_base_complement_pour_base_et_majoration_out and + self.complement_degressif_out == other.complement_degressif_out and + self.montant_verse_complement_pour_base_et_majoration_out == other.montant_verse_complement_pour_base_et_majoration_out and + self.montant_verse_complement_pour_forfaitaire_out == other.montant_verse_complement_pour_forfaitaire_out and + self.nombre_enfants_l521_1_out == other.nombre_enfants_l521_1_out and + self.age_minimum_alinea_1_l521_3_out == other.age_minimum_alinea_1_l521_3_out and + self.nombre_enfants_alinea_2_l521_3_out == other.nombre_enfants_alinea_2_l521_3_out and + self.est_enfant_le_plus_age_out == other.est_enfant_le_plus_age_out and + self.plafond_I_d521_3_out == other.plafond_I_d521_3_out and + self.plafond_II_d521_3_out == other.plafond_II_d521_3_out) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "AllocationsFamilialesOut(personne_charge_effective_permanente_est_parent_out={},personne_charge_effective_permanente_remplit_titre_I_out={},ressources_menage_out={},residence_out={},date_courante_out={},enfants_a_charge_out={},enfants_a_charge_droit_ouvert_prestation_familiale_out={},prise_en_compte_out={},versement_out={},montant_verse_out={},droit_ouvert_base_out={},montant_initial_base_out={},montant_initial_base_premier_enfant_out={},montant_initial_base_deuxieme_enfant_out={},montant_initial_base_troisieme_enfant_et_plus_out={},rapport_enfants_total_moyen_out={},nombre_moyen_enfants_out={},nombre_total_enfants_out={},montant_avec_garde_alternee_base_out={},montant_verse_base_out={},avait_enfant_a_charge_avant_1er_janvier_2012_out={},montant_initial_base_premier_enfant_mayotte_out={},montant_initial_base_deuxieme_enfant_mayotte_out={},montant_initial_base_troisieme_enfant_mayotte_out={},montant_initial_base_quatrieme_enfant_et_plus_mayotte_out={},droit_ouvert_forfaitaire_out={},montant_verse_forfaitaire_par_enfant_out={},montant_verse_forfaitaire_out={},droit_ouvert_majoration_out={},montant_initial_metropole_majoration_out={},montant_initial_majoration_out={},montant_avec_garde_alternee_majoration_out={},montant_verse_majoration_out={},droit_ouvert_complement_out={},montant_base_complement_pour_base_et_majoration_out={},complement_degressif_out={},montant_verse_complement_pour_base_et_majoration_out={},montant_verse_complement_pour_forfaitaire_out={},nombre_enfants_l521_1_out={},age_minimum_alinea_1_l521_3_out={},nombre_enfants_alinea_2_l521_3_out={},est_enfant_le_plus_age_out={},plafond_I_d521_3_out={},plafond_II_d521_3_out={})".format(self.personne_charge_effective_permanente_est_parent_out, + self.personne_charge_effective_permanente_remplit_titre_I_out, + self.ressources_menage_out, self.residence_out, self.date_courante_out, + self.enfants_a_charge_out, + self.enfants_a_charge_droit_ouvert_prestation_familiale_out, + self.prise_en_compte_out, self.versement_out, self.montant_verse_out, + self.droit_ouvert_base_out, self.montant_initial_base_out, + self.montant_initial_base_premier_enfant_out, + self.montant_initial_base_deuxieme_enfant_out, + self.montant_initial_base_troisieme_enfant_et_plus_out, + self.rapport_enfants_total_moyen_out, self.nombre_moyen_enfants_out, + self.nombre_total_enfants_out, + self.montant_avec_garde_alternee_base_out, self.montant_verse_base_out, + self.avait_enfant_a_charge_avant_1er_janvier_2012_out, + self.montant_initial_base_premier_enfant_mayotte_out, + self.montant_initial_base_deuxieme_enfant_mayotte_out, + self.montant_initial_base_troisieme_enfant_mayotte_out, + self.montant_initial_base_quatrieme_enfant_et_plus_mayotte_out, + self.droit_ouvert_forfaitaire_out, + self.montant_verse_forfaitaire_par_enfant_out, + self.montant_verse_forfaitaire_out, self.droit_ouvert_majoration_out, + self.montant_initial_metropole_majoration_out, + self.montant_initial_majoration_out, + self.montant_avec_garde_alternee_majoration_out, + self.montant_verse_majoration_out, self.droit_ouvert_complement_out, + self.montant_base_complement_pour_base_et_majoration_out, + self.complement_degressif_out, + self.montant_verse_complement_pour_base_et_majoration_out, + self.montant_verse_complement_pour_forfaitaire_out, + self.nombre_enfants_l521_1_out, self.age_minimum_alinea_1_l521_3_out, + self.nombre_enfants_alinea_2_l521_3_out, + self.est_enfant_le_plus_age_out, self.plafond_I_d521_3_out, + self.plafond_II_d521_3_out) + class AllocationsFamilialesIn: - def __init__(self, personne_charge_effective_permanente_est_parent_in: Callable[[Unit], bool], personne_charge_effective_permanente_remplit_titre_I_in: Callable[[Unit], bool], ressources_menage_in: Callable[[Unit], Money], residence_in: Callable[[Unit], Collectivite], date_courante_in: Callable[[Unit], Date], enfants_a_charge_in: Callable[[Unit], (List[Enfant])], enfants_a_charge_droit_ouvert_prestation_familiale_in: Callable[[Unit], (List[Enfant])], prise_en_compte_in: Callable[[Unit], (Callable[[Enfant], PriseEnCompte])], versement_in: Callable[[Unit], (Callable[[Enfant], VersementAllocations])], montant_verse_in: Callable[[Unit], Money], droit_ouvert_base_in: Callable[[Unit], bool], montant_initial_base_in: Callable[[Unit], Money], montant_initial_base_premier_enfant_in: Callable[[Unit], Money], montant_initial_base_deuxieme_enfant_in: Callable[[Unit], Money], montant_initial_base_troisieme_enfant_et_plus_in: Callable[[Unit], Money], rapport_enfants_total_moyen_in: Callable[[Unit], Decimal], nombre_moyen_enfants_in: Callable[[Unit], Decimal], nombre_total_enfants_in: Callable[[Unit], Decimal], montant_avec_garde_alternee_base_in: Callable[[Unit], Money], montant_verse_base_in: Callable[[Unit], Money], avait_enfant_a_charge_avant_1er_janvier_2012_in: Callable[[Unit], bool], montant_initial_base_premier_enfant_mayotte_in: Callable[[Unit], Money], montant_initial_base_deuxieme_enfant_mayotte_in: Callable[[Unit], Money], montant_initial_base_troisieme_enfant_mayotte_in: Callable[[Unit], Money], montant_initial_base_quatrieme_enfant_et_plus_mayotte_in: Callable[[Unit], Money], droit_ouvert_forfaitaire_in: Callable[[Unit], (Callable[[Enfant], bool])], montant_verse_forfaitaire_par_enfant_in: Callable[[Unit], Money], montant_verse_forfaitaire_in: Callable[[Unit], Money], droit_ouvert_majoration_in: Callable[[Unit], (Callable[[Enfant], bool])], montant_initial_metropole_majoration_in: Callable[[Unit], (Callable[[Enfant], Money])], montant_initial_majoration_in: Callable[[Unit], (Callable[[Enfant], Money])], montant_avec_garde_alternee_majoration_in: Callable[[Unit], (Callable[[Enfant], Money])], montant_verse_majoration_in: Callable[[Unit], Money], droit_ouvert_complement_in: Callable[[Unit], bool], montant_base_complement_pour_base_et_majoration_in: Callable[[Unit], Money], complement_degressif_in: Callable[[Unit], (Callable[[Money], Money])], montant_verse_complement_pour_base_et_majoration_in: Callable[[Unit], Money], montant_verse_complement_pour_forfaitaire_in: Callable[[Unit], Money], nombre_enfants_l521_1_in: Callable[[Unit], Integer], age_minimum_alinea_1_l521_3_in: Callable[[Unit], (Callable[[Enfant], Integer])], nombre_enfants_alinea_2_l521_3_in: Callable[[Unit], Integer], est_enfant_le_plus_age_in: Callable[[Unit], (Callable[[Enfant], bool])], plafond_I_d521_3_in: Callable[[Unit], Money], plafond_II_d521_3_in: Callable[[Unit], Money]) -> None: - self.personne_charge_effective_permanente_est_parent_in = personne_charge_effective_permanente_est_parent_in - self.personne_charge_effective_permanente_remplit_titre_I_in = personne_charge_effective_permanente_remplit_titre_I_in - self.ressources_menage_in = ressources_menage_in - self.residence_in = residence_in - self.date_courante_in = date_courante_in - self.enfants_a_charge_in = enfants_a_charge_in - self.enfants_a_charge_droit_ouvert_prestation_familiale_in = enfants_a_charge_droit_ouvert_prestation_familiale_in - self.prise_en_compte_in = prise_en_compte_in - self.versement_in = versement_in - self.montant_verse_in = montant_verse_in - self.droit_ouvert_base_in = droit_ouvert_base_in - self.montant_initial_base_in = montant_initial_base_in - self.montant_initial_base_premier_enfant_in = montant_initial_base_premier_enfant_in - self.montant_initial_base_deuxieme_enfant_in = montant_initial_base_deuxieme_enfant_in - self.montant_initial_base_troisieme_enfant_et_plus_in = montant_initial_base_troisieme_enfant_et_plus_in - self.rapport_enfants_total_moyen_in = rapport_enfants_total_moyen_in - self.nombre_moyen_enfants_in = nombre_moyen_enfants_in - self.nombre_total_enfants_in = nombre_total_enfants_in - self.montant_avec_garde_alternee_base_in = montant_avec_garde_alternee_base_in - self.montant_verse_base_in = montant_verse_base_in - self.avait_enfant_a_charge_avant_1er_janvier_2012_in = avait_enfant_a_charge_avant_1er_janvier_2012_in - self.montant_initial_base_premier_enfant_mayotte_in = montant_initial_base_premier_enfant_mayotte_in - self.montant_initial_base_deuxieme_enfant_mayotte_in = montant_initial_base_deuxieme_enfant_mayotte_in - self.montant_initial_base_troisieme_enfant_mayotte_in = montant_initial_base_troisieme_enfant_mayotte_in - self.montant_initial_base_quatrieme_enfant_et_plus_mayotte_in = montant_initial_base_quatrieme_enfant_et_plus_mayotte_in - self.droit_ouvert_forfaitaire_in = droit_ouvert_forfaitaire_in - self.montant_verse_forfaitaire_par_enfant_in = montant_verse_forfaitaire_par_enfant_in - self.montant_verse_forfaitaire_in = montant_verse_forfaitaire_in - self.droit_ouvert_majoration_in = droit_ouvert_majoration_in - self.montant_initial_metropole_majoration_in = montant_initial_metropole_majoration_in - self.montant_initial_majoration_in = montant_initial_majoration_in - self.montant_avec_garde_alternee_majoration_in = montant_avec_garde_alternee_majoration_in - self.montant_verse_majoration_in = montant_verse_majoration_in - self.droit_ouvert_complement_in = droit_ouvert_complement_in - self.montant_base_complement_pour_base_et_majoration_in = montant_base_complement_pour_base_et_majoration_in - self.complement_degressif_in = complement_degressif_in - self.montant_verse_complement_pour_base_et_majoration_in = montant_verse_complement_pour_base_et_majoration_in - self.montant_verse_complement_pour_forfaitaire_in = montant_verse_complement_pour_forfaitaire_in - self.nombre_enfants_l521_1_in = nombre_enfants_l521_1_in - self.age_minimum_alinea_1_l521_3_in = age_minimum_alinea_1_l521_3_in - self.nombre_enfants_alinea_2_l521_3_in = nombre_enfants_alinea_2_l521_3_in - self.est_enfant_le_plus_age_in = est_enfant_le_plus_age_in - self.plafond_I_d521_3_in = plafond_I_d521_3_in - self.plafond_II_d521_3_in = plafond_II_d521_3_in - - def __eq__(self, other: object) -> bool: - if isinstance(other, AllocationsFamilialesIn): - return (self.personne_charge_effective_permanente_est_parent_in == other.personne_charge_effective_permanente_est_parent_in and - self.personne_charge_effective_permanente_remplit_titre_I_in == other.personne_charge_effective_permanente_remplit_titre_I_in and - self.ressources_menage_in == other.ressources_menage_in and - self.residence_in == other.residence_in and - self.date_courante_in == other.date_courante_in and - self.enfants_a_charge_in == other.enfants_a_charge_in and - self.enfants_a_charge_droit_ouvert_prestation_familiale_in == other.enfants_a_charge_droit_ouvert_prestation_familiale_in and - self.prise_en_compte_in == other.prise_en_compte_in and - self.versement_in == other.versement_in and - self.montant_verse_in == other.montant_verse_in and - self.droit_ouvert_base_in == other.droit_ouvert_base_in and - self.montant_initial_base_in == other.montant_initial_base_in and - self.montant_initial_base_premier_enfant_in == other.montant_initial_base_premier_enfant_in and - self.montant_initial_base_deuxieme_enfant_in == other.montant_initial_base_deuxieme_enfant_in and - self.montant_initial_base_troisieme_enfant_et_plus_in == other.montant_initial_base_troisieme_enfant_et_plus_in and - self.rapport_enfants_total_moyen_in == other.rapport_enfants_total_moyen_in and - self.nombre_moyen_enfants_in == other.nombre_moyen_enfants_in and - self.nombre_total_enfants_in == other.nombre_total_enfants_in and - self.montant_avec_garde_alternee_base_in == other.montant_avec_garde_alternee_base_in and - self.montant_verse_base_in == other.montant_verse_base_in and - self.avait_enfant_a_charge_avant_1er_janvier_2012_in == other.avait_enfant_a_charge_avant_1er_janvier_2012_in and - self.montant_initial_base_premier_enfant_mayotte_in == other.montant_initial_base_premier_enfant_mayotte_in and - self.montant_initial_base_deuxieme_enfant_mayotte_in == other.montant_initial_base_deuxieme_enfant_mayotte_in and - self.montant_initial_base_troisieme_enfant_mayotte_in == other.montant_initial_base_troisieme_enfant_mayotte_in and - self.montant_initial_base_quatrieme_enfant_et_plus_mayotte_in == other.montant_initial_base_quatrieme_enfant_et_plus_mayotte_in and - self.droit_ouvert_forfaitaire_in == other.droit_ouvert_forfaitaire_in and - self.montant_verse_forfaitaire_par_enfant_in == other.montant_verse_forfaitaire_par_enfant_in and - self.montant_verse_forfaitaire_in == other.montant_verse_forfaitaire_in and - self.droit_ouvert_majoration_in == other.droit_ouvert_majoration_in and - self.montant_initial_metropole_majoration_in == other.montant_initial_metropole_majoration_in and - self.montant_initial_majoration_in == other.montant_initial_majoration_in and - self.montant_avec_garde_alternee_majoration_in == other.montant_avec_garde_alternee_majoration_in and - self.montant_verse_majoration_in == other.montant_verse_majoration_in and - self.droit_ouvert_complement_in == other.droit_ouvert_complement_in and - self.montant_base_complement_pour_base_et_majoration_in == other.montant_base_complement_pour_base_et_majoration_in and - self.complement_degressif_in == other.complement_degressif_in and - self.montant_verse_complement_pour_base_et_majoration_in == other.montant_verse_complement_pour_base_et_majoration_in and - self.montant_verse_complement_pour_forfaitaire_in == other.montant_verse_complement_pour_forfaitaire_in and - self.nombre_enfants_l521_1_in == other.nombre_enfants_l521_1_in and - self.age_minimum_alinea_1_l521_3_in == other.age_minimum_alinea_1_l521_3_in and - self.nombre_enfants_alinea_2_l521_3_in == other.nombre_enfants_alinea_2_l521_3_in and - self.est_enfant_le_plus_age_in == other.est_enfant_le_plus_age_in and - self.plafond_I_d521_3_in == other.plafond_I_d521_3_in and - self.plafond_II_d521_3_in == other.plafond_II_d521_3_in) - else: - return False - - def __ne__(self, other: object) -> bool: - return not (self == other) - - def __str__(self) -> str: - return "AllocationsFamilialesIn(personne_charge_effective_permanente_est_parent_in={},personne_charge_effective_permanente_remplit_titre_I_in={},ressources_menage_in={},residence_in={},date_courante_in={},enfants_a_charge_in={},enfants_a_charge_droit_ouvert_prestation_familiale_in={},prise_en_compte_in={},versement_in={},montant_verse_in={},droit_ouvert_base_in={},montant_initial_base_in={},montant_initial_base_premier_enfant_in={},montant_initial_base_deuxieme_enfant_in={},montant_initial_base_troisieme_enfant_et_plus_in={},rapport_enfants_total_moyen_in={},nombre_moyen_enfants_in={},nombre_total_enfants_in={},montant_avec_garde_alternee_base_in={},montant_verse_base_in={},avait_enfant_a_charge_avant_1er_janvier_2012_in={},montant_initial_base_premier_enfant_mayotte_in={},montant_initial_base_deuxieme_enfant_mayotte_in={},montant_initial_base_troisieme_enfant_mayotte_in={},montant_initial_base_quatrieme_enfant_et_plus_mayotte_in={},droit_ouvert_forfaitaire_in={},montant_verse_forfaitaire_par_enfant_in={},montant_verse_forfaitaire_in={},droit_ouvert_majoration_in={},montant_initial_metropole_majoration_in={},montant_initial_majoration_in={},montant_avec_garde_alternee_majoration_in={},montant_verse_majoration_in={},droit_ouvert_complement_in={},montant_base_complement_pour_base_et_majoration_in={},complement_degressif_in={},montant_verse_complement_pour_base_et_majoration_in={},montant_verse_complement_pour_forfaitaire_in={},nombre_enfants_l521_1_in={},age_minimum_alinea_1_l521_3_in={},nombre_enfants_alinea_2_l521_3_in={},est_enfant_le_plus_age_in={},plafond_I_d521_3_in={},plafond_II_d521_3_in={})".format(self.personne_charge_effective_permanente_est_parent_in, - self.personne_charge_effective_permanente_remplit_titre_I_in, - self.ressources_menage_in, self.residence_in, self.date_courante_in, - self.enfants_a_charge_in, - self.enfants_a_charge_droit_ouvert_prestation_familiale_in, - self.prise_en_compte_in, self.versement_in, self.montant_verse_in, - self.droit_ouvert_base_in, self.montant_initial_base_in, - self.montant_initial_base_premier_enfant_in, - self.montant_initial_base_deuxieme_enfant_in, - self.montant_initial_base_troisieme_enfant_et_plus_in, - self.rapport_enfants_total_moyen_in, self.nombre_moyen_enfants_in, - self.nombre_total_enfants_in, self.montant_avec_garde_alternee_base_in, - self.montant_verse_base_in, - self.avait_enfant_a_charge_avant_1er_janvier_2012_in, - self.montant_initial_base_premier_enfant_mayotte_in, - self.montant_initial_base_deuxieme_enfant_mayotte_in, - self.montant_initial_base_troisieme_enfant_mayotte_in, - self.montant_initial_base_quatrieme_enfant_et_plus_mayotte_in, - self.droit_ouvert_forfaitaire_in, - self.montant_verse_forfaitaire_par_enfant_in, - self.montant_verse_forfaitaire_in, self.droit_ouvert_majoration_in, - self.montant_initial_metropole_majoration_in, - self.montant_initial_majoration_in, - self.montant_avec_garde_alternee_majoration_in, - self.montant_verse_majoration_in, self.droit_ouvert_complement_in, - self.montant_base_complement_pour_base_et_majoration_in, - self.complement_degressif_in, - self.montant_verse_complement_pour_base_et_majoration_in, - self.montant_verse_complement_pour_forfaitaire_in, - self.nombre_enfants_l521_1_in, self.age_minimum_alinea_1_l521_3_in, - self.nombre_enfants_alinea_2_l521_3_in, self.est_enfant_le_plus_age_in, - self.plafond_I_d521_3_in, self.plafond_II_d521_3_in) + def __init__(self, personne_charge_effective_permanente_est_parent_in: Callable[[Unit], bool], personne_charge_effective_permanente_remplit_titre_I_in: Callable[[Unit], bool], ressources_menage_in: Callable[[Unit], Money], residence_in: Callable[[Unit], Collectivite], date_courante_in: Callable[[Unit], Date], enfants_a_charge_in: Callable[[Unit], (List[Enfant])], enfants_a_charge_droit_ouvert_prestation_familiale_in: Callable[[Unit], (List[Enfant])], prise_en_compte_in: Callable[[Unit], (Callable[[Enfant], PriseEnCompte])], versement_in: Callable[[Unit], (Callable[[Enfant], VersementAllocations])], montant_verse_in: Callable[[Unit], Money], droit_ouvert_base_in: Callable[[Unit], bool], montant_initial_base_in: Callable[[Unit], Money], montant_initial_base_premier_enfant_in: Callable[[Unit], Money], montant_initial_base_deuxieme_enfant_in: Callable[[Unit], Money], montant_initial_base_troisieme_enfant_et_plus_in: Callable[[Unit], Money], rapport_enfants_total_moyen_in: Callable[[Unit], Decimal], nombre_moyen_enfants_in: Callable[[Unit], Decimal], nombre_total_enfants_in: Callable[[Unit], Decimal], montant_avec_garde_alternee_base_in: Callable[[Unit], Money], montant_verse_base_in: Callable[[Unit], Money], avait_enfant_a_charge_avant_1er_janvier_2012_in: Callable[[Unit], bool], montant_initial_base_premier_enfant_mayotte_in: Callable[[Unit], Money], montant_initial_base_deuxieme_enfant_mayotte_in: Callable[[Unit], Money], montant_initial_base_troisieme_enfant_mayotte_in: Callable[[Unit], Money], montant_initial_base_quatrieme_enfant_et_plus_mayotte_in: Callable[[Unit], Money], droit_ouvert_forfaitaire_in: Callable[[Unit], (Callable[[Enfant], bool])], montant_verse_forfaitaire_par_enfant_in: Callable[[Unit], Money], montant_verse_forfaitaire_in: Callable[[Unit], Money], droit_ouvert_majoration_in: Callable[[Unit], (Callable[[Enfant], bool])], montant_initial_metropole_majoration_in: Callable[[Unit], (Callable[[Enfant], Money])], montant_initial_majoration_in: Callable[[Unit], (Callable[[Enfant], Money])], montant_avec_garde_alternee_majoration_in: Callable[[Unit], (Callable[[Enfant], Money])], montant_verse_majoration_in: Callable[[Unit], Money], droit_ouvert_complement_in: Callable[[Unit], bool], montant_base_complement_pour_base_et_majoration_in: Callable[[Unit], Money], complement_degressif_in: Callable[[Unit], (Callable[[Money], Money])], montant_verse_complement_pour_base_et_majoration_in: Callable[[Unit], Money], montant_verse_complement_pour_forfaitaire_in: Callable[[Unit], Money], nombre_enfants_l521_1_in: Callable[[Unit], Integer], age_minimum_alinea_1_l521_3_in: Callable[[Unit], (Callable[[Enfant], Integer])], nombre_enfants_alinea_2_l521_3_in: Callable[[Unit], Integer], est_enfant_le_plus_age_in: Callable[[Unit], (Callable[[Enfant], bool])], plafond_I_d521_3_in: Callable[[Unit], Money], plafond_II_d521_3_in: Callable[[Unit], Money]) -> None: + self.personne_charge_effective_permanente_est_parent_in = personne_charge_effective_permanente_est_parent_in + self.personne_charge_effective_permanente_remplit_titre_I_in = personne_charge_effective_permanente_remplit_titre_I_in + self.ressources_menage_in = ressources_menage_in + self.residence_in = residence_in + self.date_courante_in = date_courante_in + self.enfants_a_charge_in = enfants_a_charge_in + self.enfants_a_charge_droit_ouvert_prestation_familiale_in = enfants_a_charge_droit_ouvert_prestation_familiale_in + self.prise_en_compte_in = prise_en_compte_in + self.versement_in = versement_in + self.montant_verse_in = montant_verse_in + self.droit_ouvert_base_in = droit_ouvert_base_in + self.montant_initial_base_in = montant_initial_base_in + self.montant_initial_base_premier_enfant_in = montant_initial_base_premier_enfant_in + self.montant_initial_base_deuxieme_enfant_in = montant_initial_base_deuxieme_enfant_in + self.montant_initial_base_troisieme_enfant_et_plus_in = montant_initial_base_troisieme_enfant_et_plus_in + self.rapport_enfants_total_moyen_in = rapport_enfants_total_moyen_in + self.nombre_moyen_enfants_in = nombre_moyen_enfants_in + self.nombre_total_enfants_in = nombre_total_enfants_in + self.montant_avec_garde_alternee_base_in = montant_avec_garde_alternee_base_in + self.montant_verse_base_in = montant_verse_base_in + self.avait_enfant_a_charge_avant_1er_janvier_2012_in = avait_enfant_a_charge_avant_1er_janvier_2012_in + self.montant_initial_base_premier_enfant_mayotte_in = montant_initial_base_premier_enfant_mayotte_in + self.montant_initial_base_deuxieme_enfant_mayotte_in = montant_initial_base_deuxieme_enfant_mayotte_in + self.montant_initial_base_troisieme_enfant_mayotte_in = montant_initial_base_troisieme_enfant_mayotte_in + self.montant_initial_base_quatrieme_enfant_et_plus_mayotte_in = montant_initial_base_quatrieme_enfant_et_plus_mayotte_in + self.droit_ouvert_forfaitaire_in = droit_ouvert_forfaitaire_in + self.montant_verse_forfaitaire_par_enfant_in = montant_verse_forfaitaire_par_enfant_in + self.montant_verse_forfaitaire_in = montant_verse_forfaitaire_in + self.droit_ouvert_majoration_in = droit_ouvert_majoration_in + self.montant_initial_metropole_majoration_in = montant_initial_metropole_majoration_in + self.montant_initial_majoration_in = montant_initial_majoration_in + self.montant_avec_garde_alternee_majoration_in = montant_avec_garde_alternee_majoration_in + self.montant_verse_majoration_in = montant_verse_majoration_in + self.droit_ouvert_complement_in = droit_ouvert_complement_in + self.montant_base_complement_pour_base_et_majoration_in = montant_base_complement_pour_base_et_majoration_in + self.complement_degressif_in = complement_degressif_in + self.montant_verse_complement_pour_base_et_majoration_in = montant_verse_complement_pour_base_et_majoration_in + self.montant_verse_complement_pour_forfaitaire_in = montant_verse_complement_pour_forfaitaire_in + self.nombre_enfants_l521_1_in = nombre_enfants_l521_1_in + self.age_minimum_alinea_1_l521_3_in = age_minimum_alinea_1_l521_3_in + self.nombre_enfants_alinea_2_l521_3_in = nombre_enfants_alinea_2_l521_3_in + self.est_enfant_le_plus_age_in = est_enfant_le_plus_age_in + self.plafond_I_d521_3_in = plafond_I_d521_3_in + self.plafond_II_d521_3_in = plafond_II_d521_3_in + + def __eq__(self, other: object) -> bool: + if isinstance(other, AllocationsFamilialesIn): + return (self.personne_charge_effective_permanente_est_parent_in == other.personne_charge_effective_permanente_est_parent_in and + self.personne_charge_effective_permanente_remplit_titre_I_in == other.personne_charge_effective_permanente_remplit_titre_I_in and + self.ressources_menage_in == other.ressources_menage_in and + self.residence_in == other.residence_in and + self.date_courante_in == other.date_courante_in and + self.enfants_a_charge_in == other.enfants_a_charge_in and + self.enfants_a_charge_droit_ouvert_prestation_familiale_in == other.enfants_a_charge_droit_ouvert_prestation_familiale_in and + self.prise_en_compte_in == other.prise_en_compte_in and + self.versement_in == other.versement_in and + self.montant_verse_in == other.montant_verse_in and + self.droit_ouvert_base_in == other.droit_ouvert_base_in and + self.montant_initial_base_in == other.montant_initial_base_in and + self.montant_initial_base_premier_enfant_in == other.montant_initial_base_premier_enfant_in and + self.montant_initial_base_deuxieme_enfant_in == other.montant_initial_base_deuxieme_enfant_in and + self.montant_initial_base_troisieme_enfant_et_plus_in == other.montant_initial_base_troisieme_enfant_et_plus_in and + self.rapport_enfants_total_moyen_in == other.rapport_enfants_total_moyen_in and + self.nombre_moyen_enfants_in == other.nombre_moyen_enfants_in and + self.nombre_total_enfants_in == other.nombre_total_enfants_in and + self.montant_avec_garde_alternee_base_in == other.montant_avec_garde_alternee_base_in and + self.montant_verse_base_in == other.montant_verse_base_in and + self.avait_enfant_a_charge_avant_1er_janvier_2012_in == other.avait_enfant_a_charge_avant_1er_janvier_2012_in and + self.montant_initial_base_premier_enfant_mayotte_in == other.montant_initial_base_premier_enfant_mayotte_in and + self.montant_initial_base_deuxieme_enfant_mayotte_in == other.montant_initial_base_deuxieme_enfant_mayotte_in and + self.montant_initial_base_troisieme_enfant_mayotte_in == other.montant_initial_base_troisieme_enfant_mayotte_in and + self.montant_initial_base_quatrieme_enfant_et_plus_mayotte_in == other.montant_initial_base_quatrieme_enfant_et_plus_mayotte_in and + self.droit_ouvert_forfaitaire_in == other.droit_ouvert_forfaitaire_in and + self.montant_verse_forfaitaire_par_enfant_in == other.montant_verse_forfaitaire_par_enfant_in and + self.montant_verse_forfaitaire_in == other.montant_verse_forfaitaire_in and + self.droit_ouvert_majoration_in == other.droit_ouvert_majoration_in and + self.montant_initial_metropole_majoration_in == other.montant_initial_metropole_majoration_in and + self.montant_initial_majoration_in == other.montant_initial_majoration_in and + self.montant_avec_garde_alternee_majoration_in == other.montant_avec_garde_alternee_majoration_in and + self.montant_verse_majoration_in == other.montant_verse_majoration_in and + self.droit_ouvert_complement_in == other.droit_ouvert_complement_in and + self.montant_base_complement_pour_base_et_majoration_in == other.montant_base_complement_pour_base_et_majoration_in and + self.complement_degressif_in == other.complement_degressif_in and + self.montant_verse_complement_pour_base_et_majoration_in == other.montant_verse_complement_pour_base_et_majoration_in and + self.montant_verse_complement_pour_forfaitaire_in == other.montant_verse_complement_pour_forfaitaire_in and + self.nombre_enfants_l521_1_in == other.nombre_enfants_l521_1_in and + self.age_minimum_alinea_1_l521_3_in == other.age_minimum_alinea_1_l521_3_in and + self.nombre_enfants_alinea_2_l521_3_in == other.nombre_enfants_alinea_2_l521_3_in and + self.est_enfant_le_plus_age_in == other.est_enfant_le_plus_age_in and + self.plafond_I_d521_3_in == other.plafond_I_d521_3_in and + self.plafond_II_d521_3_in == other.plafond_II_d521_3_in) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "AllocationsFamilialesIn(personne_charge_effective_permanente_est_parent_in={},personne_charge_effective_permanente_remplit_titre_I_in={},ressources_menage_in={},residence_in={},date_courante_in={},enfants_a_charge_in={},enfants_a_charge_droit_ouvert_prestation_familiale_in={},prise_en_compte_in={},versement_in={},montant_verse_in={},droit_ouvert_base_in={},montant_initial_base_in={},montant_initial_base_premier_enfant_in={},montant_initial_base_deuxieme_enfant_in={},montant_initial_base_troisieme_enfant_et_plus_in={},rapport_enfants_total_moyen_in={},nombre_moyen_enfants_in={},nombre_total_enfants_in={},montant_avec_garde_alternee_base_in={},montant_verse_base_in={},avait_enfant_a_charge_avant_1er_janvier_2012_in={},montant_initial_base_premier_enfant_mayotte_in={},montant_initial_base_deuxieme_enfant_mayotte_in={},montant_initial_base_troisieme_enfant_mayotte_in={},montant_initial_base_quatrieme_enfant_et_plus_mayotte_in={},droit_ouvert_forfaitaire_in={},montant_verse_forfaitaire_par_enfant_in={},montant_verse_forfaitaire_in={},droit_ouvert_majoration_in={},montant_initial_metropole_majoration_in={},montant_initial_majoration_in={},montant_avec_garde_alternee_majoration_in={},montant_verse_majoration_in={},droit_ouvert_complement_in={},montant_base_complement_pour_base_et_majoration_in={},complement_degressif_in={},montant_verse_complement_pour_base_et_majoration_in={},montant_verse_complement_pour_forfaitaire_in={},nombre_enfants_l521_1_in={},age_minimum_alinea_1_l521_3_in={},nombre_enfants_alinea_2_l521_3_in={},est_enfant_le_plus_age_in={},plafond_I_d521_3_in={},plafond_II_d521_3_in={})".format(self.personne_charge_effective_permanente_est_parent_in, + self.personne_charge_effective_permanente_remplit_titre_I_in, + self.ressources_menage_in, self.residence_in, self.date_courante_in, + self.enfants_a_charge_in, + self.enfants_a_charge_droit_ouvert_prestation_familiale_in, + self.prise_en_compte_in, self.versement_in, self.montant_verse_in, + self.droit_ouvert_base_in, self.montant_initial_base_in, + self.montant_initial_base_premier_enfant_in, + self.montant_initial_base_deuxieme_enfant_in, + self.montant_initial_base_troisieme_enfant_et_plus_in, + self.rapport_enfants_total_moyen_in, self.nombre_moyen_enfants_in, + self.nombre_total_enfants_in, self.montant_avec_garde_alternee_base_in, + self.montant_verse_base_in, + self.avait_enfant_a_charge_avant_1er_janvier_2012_in, + self.montant_initial_base_premier_enfant_mayotte_in, + self.montant_initial_base_deuxieme_enfant_mayotte_in, + self.montant_initial_base_troisieme_enfant_mayotte_in, + self.montant_initial_base_quatrieme_enfant_et_plus_mayotte_in, + self.droit_ouvert_forfaitaire_in, + self.montant_verse_forfaitaire_par_enfant_in, + self.montant_verse_forfaitaire_in, self.droit_ouvert_majoration_in, + self.montant_initial_metropole_majoration_in, + self.montant_initial_majoration_in, + self.montant_avec_garde_alternee_majoration_in, + self.montant_verse_majoration_in, self.droit_ouvert_complement_in, + self.montant_base_complement_pour_base_et_majoration_in, + self.complement_degressif_in, + self.montant_verse_complement_pour_base_et_majoration_in, + self.montant_verse_complement_pour_forfaitaire_in, + self.nombre_enfants_l521_1_in, self.age_minimum_alinea_1_l521_3_in, + self.nombre_enfants_alinea_2_l521_3_in, self.est_enfant_le_plus_age_in, + self.plafond_I_d521_3_in, self.plafond_II_d521_3_in) + class InterfaceAllocationsFamilialesOut: - def __init__(self, date_courante_out: Date, enfants_out: List[EnfantEntree], enfants_a_charge_out: List[Enfant], ressources_menage_out: Money, residence_out: Collectivite, montant_verse_out: Money, personne_charge_effective_permanente_est_parent_out: bool, personne_charge_effective_permanente_remplit_titre_I_out: bool, avait_enfant_a_charge_avant_1er_janvier_2012_out: bool) -> None: - self.date_courante_out = date_courante_out - self.enfants_out = enfants_out - self.enfants_a_charge_out = enfants_a_charge_out - self.ressources_menage_out = ressources_menage_out - self.residence_out = residence_out - self.montant_verse_out = montant_verse_out - self.personne_charge_effective_permanente_est_parent_out = personne_charge_effective_permanente_est_parent_out - self.personne_charge_effective_permanente_remplit_titre_I_out = personne_charge_effective_permanente_remplit_titre_I_out - self.avait_enfant_a_charge_avant_1er_janvier_2012_out = avait_enfant_a_charge_avant_1er_janvier_2012_out - - def __eq__(self, other: object) -> bool: - if isinstance(other, InterfaceAllocationsFamilialesOut): - return (self.date_courante_out == other.date_courante_out and - self.enfants_out == other.enfants_out and - self.enfants_a_charge_out == other.enfants_a_charge_out and - self.ressources_menage_out == other.ressources_menage_out and - self.residence_out == other.residence_out and - self.montant_verse_out == other.montant_verse_out and - self.personne_charge_effective_permanente_est_parent_out == other.personne_charge_effective_permanente_est_parent_out and - self.personne_charge_effective_permanente_remplit_titre_I_out == other.personne_charge_effective_permanente_remplit_titre_I_out and - self.avait_enfant_a_charge_avant_1er_janvier_2012_out == other.avait_enfant_a_charge_avant_1er_janvier_2012_out) - else: - return False - - def __ne__(self, other: object) -> bool: - return not (self == other) - - def __str__(self) -> str: - return "InterfaceAllocationsFamilialesOut(date_courante_out={},enfants_out={},enfants_a_charge_out={},ressources_menage_out={},residence_out={},montant_verse_out={},personne_charge_effective_permanente_est_parent_out={},personne_charge_effective_permanente_remplit_titre_I_out={},avait_enfant_a_charge_avant_1er_janvier_2012_out={})".format(self.date_courante_out, - self.enfants_out, self.enfants_a_charge_out, - self.ressources_menage_out, self.residence_out, self.montant_verse_out, - self.personne_charge_effective_permanente_est_parent_out, - self.personne_charge_effective_permanente_remplit_titre_I_out, - self.avait_enfant_a_charge_avant_1er_janvier_2012_out) + def __init__(self, date_courante_out: Date, enfants_out: List[EnfantEntree], enfants_a_charge_out: List[Enfant], ressources_menage_out: Money, residence_out: Collectivite, montant_verse_out: Money, personne_charge_effective_permanente_est_parent_out: bool, personne_charge_effective_permanente_remplit_titre_I_out: bool, avait_enfant_a_charge_avant_1er_janvier_2012_out: bool) -> None: + self.date_courante_out = date_courante_out + self.enfants_out = enfants_out + self.enfants_a_charge_out = enfants_a_charge_out + self.ressources_menage_out = ressources_menage_out + self.residence_out = residence_out + self.montant_verse_out = montant_verse_out + self.personne_charge_effective_permanente_est_parent_out = personne_charge_effective_permanente_est_parent_out + self.personne_charge_effective_permanente_remplit_titre_I_out = personne_charge_effective_permanente_remplit_titre_I_out + self.avait_enfant_a_charge_avant_1er_janvier_2012_out = avait_enfant_a_charge_avant_1er_janvier_2012_out + + def __eq__(self, other: object) -> bool: + if isinstance(other, InterfaceAllocationsFamilialesOut): + return (self.date_courante_out == other.date_courante_out and + self.enfants_out == other.enfants_out and + self.enfants_a_charge_out == other.enfants_a_charge_out and + self.ressources_menage_out == other.ressources_menage_out and + self.residence_out == other.residence_out and + self.montant_verse_out == other.montant_verse_out and + self.personne_charge_effective_permanente_est_parent_out == other.personne_charge_effective_permanente_est_parent_out and + self.personne_charge_effective_permanente_remplit_titre_I_out == other.personne_charge_effective_permanente_remplit_titre_I_out and + self.avait_enfant_a_charge_avant_1er_janvier_2012_out == other.avait_enfant_a_charge_avant_1er_janvier_2012_out) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "InterfaceAllocationsFamilialesOut(date_courante_out={},enfants_out={},enfants_a_charge_out={},ressources_menage_out={},residence_out={},montant_verse_out={},personne_charge_effective_permanente_est_parent_out={},personne_charge_effective_permanente_remplit_titre_I_out={},avait_enfant_a_charge_avant_1er_janvier_2012_out={})".format(self.date_courante_out, + self.enfants_out, self.enfants_a_charge_out, + self.ressources_menage_out, self.residence_out, self.montant_verse_out, + self.personne_charge_effective_permanente_est_parent_out, + self.personne_charge_effective_permanente_remplit_titre_I_out, + self.avait_enfant_a_charge_avant_1er_janvier_2012_out) + class InterfaceAllocationsFamilialesIn: - def __init__(self, date_courante_in: Callable[[Unit], Date], enfants_in: Callable[[Unit], (List[EnfantEntree])], enfants_a_charge_in: Callable[[Unit], (List[Enfant])], ressources_menage_in: Callable[[Unit], Money], residence_in: Callable[[Unit], Collectivite], montant_verse_in: Callable[[Unit], Money], personne_charge_effective_permanente_est_parent_in: Callable[[Unit], bool], personne_charge_effective_permanente_remplit_titre_I_in: Callable[[Unit], bool], avait_enfant_a_charge_avant_1er_janvier_2012_in: Callable[[Unit], bool]) -> None: - self.date_courante_in = date_courante_in - self.enfants_in = enfants_in - self.enfants_a_charge_in = enfants_a_charge_in - self.ressources_menage_in = ressources_menage_in - self.residence_in = residence_in - self.montant_verse_in = montant_verse_in - self.personne_charge_effective_permanente_est_parent_in = personne_charge_effective_permanente_est_parent_in - self.personne_charge_effective_permanente_remplit_titre_I_in = personne_charge_effective_permanente_remplit_titre_I_in - self.avait_enfant_a_charge_avant_1er_janvier_2012_in = avait_enfant_a_charge_avant_1er_janvier_2012_in - - def __eq__(self, other: object) -> bool: - if isinstance(other, InterfaceAllocationsFamilialesIn): - return (self.date_courante_in == other.date_courante_in and - self.enfants_in == other.enfants_in and - self.enfants_a_charge_in == other.enfants_a_charge_in and - self.ressources_menage_in == other.ressources_menage_in and - self.residence_in == other.residence_in and - self.montant_verse_in == other.montant_verse_in and - self.personne_charge_effective_permanente_est_parent_in == other.personne_charge_effective_permanente_est_parent_in and - self.personne_charge_effective_permanente_remplit_titre_I_in == other.personne_charge_effective_permanente_remplit_titre_I_in and - self.avait_enfant_a_charge_avant_1er_janvier_2012_in == other.avait_enfant_a_charge_avant_1er_janvier_2012_in) - else: - return False - - def __ne__(self, other: object) -> bool: - return not (self == other) - - def __str__(self) -> str: - return "InterfaceAllocationsFamilialesIn(date_courante_in={},enfants_in={},enfants_a_charge_in={},ressources_menage_in={},residence_in={},montant_verse_in={},personne_charge_effective_permanente_est_parent_in={},personne_charge_effective_permanente_remplit_titre_I_in={},avait_enfant_a_charge_avant_1er_janvier_2012_in={})".format(self.date_courante_in, - self.enfants_in, self.enfants_a_charge_in, self.ressources_menage_in, - self.residence_in, self.montant_verse_in, - self.personne_charge_effective_permanente_est_parent_in, - self.personne_charge_effective_permanente_remplit_titre_I_in, - self.avait_enfant_a_charge_avant_1er_janvier_2012_in) - - - -def smic(smic_in_1:SmicIn): + def __init__(self, date_courante_in: Callable[[Unit], Date], enfants_in: Callable[[Unit], (List[EnfantEntree])], enfants_a_charge_in: Callable[[Unit], (List[Enfant])], ressources_menage_in: Callable[[Unit], Money], residence_in: Callable[[Unit], Collectivite], montant_verse_in: Callable[[Unit], Money], personne_charge_effective_permanente_est_parent_in: Callable[[Unit], bool], personne_charge_effective_permanente_remplit_titre_I_in: Callable[[Unit], bool], avait_enfant_a_charge_avant_1er_janvier_2012_in: Callable[[Unit], bool]) -> None: + self.date_courante_in = date_courante_in + self.enfants_in = enfants_in + self.enfants_a_charge_in = enfants_a_charge_in + self.ressources_menage_in = ressources_menage_in + self.residence_in = residence_in + self.montant_verse_in = montant_verse_in + self.personne_charge_effective_permanente_est_parent_in = personne_charge_effective_permanente_est_parent_in + self.personne_charge_effective_permanente_remplit_titre_I_in = personne_charge_effective_permanente_remplit_titre_I_in + self.avait_enfant_a_charge_avant_1er_janvier_2012_in = avait_enfant_a_charge_avant_1er_janvier_2012_in + + def __eq__(self, other: object) -> bool: + if isinstance(other, InterfaceAllocationsFamilialesIn): + return (self.date_courante_in == other.date_courante_in and + self.enfants_in == other.enfants_in and + self.enfants_a_charge_in == other.enfants_a_charge_in and + self.ressources_menage_in == other.ressources_menage_in and + self.residence_in == other.residence_in and + self.montant_verse_in == other.montant_verse_in and + self.personne_charge_effective_permanente_est_parent_in == other.personne_charge_effective_permanente_est_parent_in and + self.personne_charge_effective_permanente_remplit_titre_I_in == other.personne_charge_effective_permanente_remplit_titre_I_in and + self.avait_enfant_a_charge_avant_1er_janvier_2012_in == other.avait_enfant_a_charge_avant_1er_janvier_2012_in) + else: + return False + + def __ne__(self, other: object) -> bool: + return not (self == other) + + def __str__(self) -> str: + return "InterfaceAllocationsFamilialesIn(date_courante_in={},enfants_in={},enfants_a_charge_in={},ressources_menage_in={},residence_in={},montant_verse_in={},personne_charge_effective_permanente_est_parent_in={},personne_charge_effective_permanente_remplit_titre_I_in={},avait_enfant_a_charge_avant_1er_janvier_2012_in={})".format(self.date_courante_in, + self.enfants_in, self.enfants_a_charge_in, self.ressources_menage_in, + self.residence_in, self.montant_verse_in, + self.personne_charge_effective_permanente_est_parent_in, + self.personne_charge_effective_permanente_remplit_titre_I_in, + self.avait_enfant_a_charge_avant_1er_janvier_2012_in) + + +def smic(smic_in_1: SmicIn): date_courante_2 = smic_in_1.date_courante_in residence_3 = smic_in_1.residence_in brut_horaire_4 = smic_in_1.brut_horaire_in @@ -753,1584 +766,1912 @@ def smic(smic_in_1:SmicIn): try: local_var_6 = date_courante_2(Unit()) except EmptyError: - if log_decision_taken(SourcePosition(filename="", start_line=0, - start_column=1, end_line=0, end_column=1, - law_headings=[]), False): - raise EmptyError - else: + def local_var_7(_: Any): + return log_decision_taken(SourcePosition(filename="", + start_line=0, start_column=1, end_line=0, end_column=1, + law_headings=[]), False) + + def local_var_9(_: Any): raise EmptyError + local_var_6 = handle_default([], local_var_7, local_var_9) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=41, start_column=12, end_line=41, end_column=25, - law_headings=["Prologue"])) + start_line=41, start_column=12, end_line=41, end_column=25, + law_headings=["Prologue"])) date_courante_5 = log_variable_definition(["Smic", "date_courante"], - local_var_6) + local_var_6) try: try: - local_var_8 = residence_3(Unit()) + local_var_12 = residence_3(Unit()) except EmptyError: - if log_decision_taken(SourcePosition(filename="", start_line=0, - start_column=1, end_line=0, end_column=1, - law_headings=[]), False): - raise EmptyError - else: + def local_var_13(_: Any): + return log_decision_taken(SourcePosition(filename="", + start_line=0, start_column=1, end_line=0, end_column=1, + law_headings=[]), False) + + def local_var_15(_: Any): raise EmptyError + local_var_12 = handle_default([], local_var_13, local_var_15) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=42, start_column=12, end_line=42, end_column=21, - law_headings=["Prologue"])) - residence_7 = log_variable_definition(["Smic", "résidence"], - local_var_8) + start_line=42, start_column=12, end_line=42, end_column=21, + law_headings=["Prologue"])) + residence_11 = log_variable_definition(["Smic", "résidence"], + local_var_12) try: try: - local_var_10 = brut_horaire_4(Unit()) + local_var_18 = brut_horaire_4(Unit()) except EmptyError: - def local_var_21(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=219, start_column=5, - end_line=228, end_column=6, law_headings=["Article 1", - "Décret n° 2018-1173 du 19 décembre 2018 portant relèvement du salaire minimum de croissance", - "Montant du salaire minimum de croissance", - "Décrets divers"]), ((date_courante_5 >= - date_of_numbers(2019,1,1)) and ((date_courante_5 <= - date_of_numbers(2019,12,31)) and ((residence_7 == - Collectivite(Collectivite_Code.Metropole, Unit())) or - ((residence_7 == - Collectivite(Collectivite_Code.Guadeloupe, Unit())) or - ((residence_7 == Collectivite(Collectivite_Code.Guyane, - Unit())) or ((residence_7 == - Collectivite(Collectivite_Code.Martinique, Unit())) or - ((residence_7 == - Collectivite(Collectivite_Code.LaReunion, Unit())) or - ((residence_7 == - Collectivite(Collectivite_Code.SaintBarthelemy, - Unit())) or ((residence_7 == - Collectivite(Collectivite_Code.SaintMartin, Unit())) or - (residence_7 == - Collectivite(Collectivite_Code.SaintPierreEtMiquelon, - Unit())))))))))))): + def local_var_49(_: Any): + def local_var_51(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=219, start_column=5, + end_line=228, end_column=6, + law_headings=["Article 1", + "Décret n° 2018-1173 du 19 décembre 2018 portant relèvement du salaire minimum de croissance", + "Montant du salaire minimum de croissance", + "Décrets divers"]), ((date_courante_5 >= + date_of_numbers(2019, 1, 1)) and ((date_courante_5 <= + date_of_numbers(2019, 12, 31)) and ((residence_11 == + Collectivite(Collectivite_Code.Metropole, Unit())) or + ((residence_11 == + Collectivite(Collectivite_Code.Guadeloupe, + Unit())) or ((residence_11 == + Collectivite(Collectivite_Code.Guyane, Unit())) or + ((residence_11 == + Collectivite(Collectivite_Code.Martinique, + Unit())) or ((residence_11 == + Collectivite(Collectivite_Code.LaReunion, Unit())) or + ((residence_11 == + Collectivite(Collectivite_Code.SaintBarthelemy, + Unit())) or ((residence_11 == + Collectivite(Collectivite_Code.SaintMartin, + Unit())) or (residence_11 == + Collectivite(Collectivite_Code.SaintPierreEtMiquelon, + Unit())))))))))))) + + def local_var_53(_: Any): return money_of_cents_string("1003") - else: - raise EmptyError - def local_var_19(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=237, start_column=5, - end_line=239, end_column=6, law_headings=["Article 1", - "Décret n° 2018-1173 du 19 décembre 2018 portant relèvement du salaire minimum de croissance", - "Montant du salaire minimum de croissance", - "Décrets divers"]), ((date_courante_5 >= - date_of_numbers(2019,1,1)) and ((date_courante_5 <= - date_of_numbers(2019,12,31)) and (residence_7 == - Collectivite(Collectivite_Code.Mayotte, - Unit()))))): + return handle_default([], local_var_51, local_var_53) + + def local_var_43(_: Any): + def local_var_45(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=237, start_column=5, + end_line=239, end_column=6, + law_headings=["Article 1", + "Décret n° 2018-1173 du 19 décembre 2018 portant relèvement du salaire minimum de croissance", + "Montant du salaire minimum de croissance", + "Décrets divers"]), ((date_courante_5 >= + date_of_numbers(2019, 1, 1)) and ((date_courante_5 <= + date_of_numbers(2019, 12, 31)) and (residence_11 == + Collectivite(Collectivite_Code.Mayotte, Unit()))))) + + def local_var_47(_: Any): return money_of_cents_string("757") - else: - raise EmptyError - def local_var_17(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=258, start_column=5, - end_line=267, end_column=6, law_headings=["Article 1", - "Décret n° 2019-1387 du 18 décembre 2019 portant relèvement du salaire minimum de croissance", - "Montant du salaire minimum de croissance", - "Décrets divers"]), ((date_courante_5 >= - date_of_numbers(2020,1,1)) and ((date_courante_5 <= - date_of_numbers(2020,12,31)) and ((residence_7 == - Collectivite(Collectivite_Code.Metropole, Unit())) or - ((residence_7 == - Collectivite(Collectivite_Code.Guadeloupe, Unit())) or - ((residence_7 == Collectivite(Collectivite_Code.Guyane, - Unit())) or ((residence_7 == - Collectivite(Collectivite_Code.Martinique, Unit())) or - ((residence_7 == - Collectivite(Collectivite_Code.LaReunion, Unit())) or - ((residence_7 == - Collectivite(Collectivite_Code.SaintBarthelemy, - Unit())) or ((residence_7 == - Collectivite(Collectivite_Code.SaintMartin, Unit())) or - (residence_7 == - Collectivite(Collectivite_Code.SaintPierreEtMiquelon, - Unit())))))))))))): + return handle_default([], local_var_45, local_var_47) + + def local_var_37(_: Any): + def local_var_39(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=258, start_column=5, + end_line=267, end_column=6, + law_headings=["Article 1", + "Décret n° 2019-1387 du 18 décembre 2019 portant relèvement du salaire minimum de croissance", + "Montant du salaire minimum de croissance", + "Décrets divers"]), ((date_courante_5 >= + date_of_numbers(2020, 1, 1)) and ((date_courante_5 <= + date_of_numbers(2020, 12, 31)) and ((residence_11 == + Collectivite(Collectivite_Code.Metropole, Unit())) or + ((residence_11 == + Collectivite(Collectivite_Code.Guadeloupe, + Unit())) or ((residence_11 == + Collectivite(Collectivite_Code.Guyane, Unit())) or + ((residence_11 == + Collectivite(Collectivite_Code.Martinique, + Unit())) or ((residence_11 == + Collectivite(Collectivite_Code.LaReunion, Unit())) or + ((residence_11 == + Collectivite(Collectivite_Code.SaintBarthelemy, + Unit())) or ((residence_11 == + Collectivite(Collectivite_Code.SaintMartin, + Unit())) or (residence_11 == + Collectivite(Collectivite_Code.SaintPierreEtMiquelon, + Unit())))))))))))) + + def local_var_41(_: Any): return money_of_cents_string("1015") - else: - raise EmptyError - def local_var_15(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=276, start_column=5, - end_line=278, end_column=6, law_headings=["Article 1", - "Décret n° 2019-1387 du 18 décembre 2019 portant relèvement du salaire minimum de croissance", - "Montant du salaire minimum de croissance", - "Décrets divers"]), ((date_courante_5 >= - date_of_numbers(2020,1,1)) and ((date_courante_5 <= - date_of_numbers(2020,12,31)) and (residence_7 == - Collectivite(Collectivite_Code.Mayotte, - Unit()))))): + return handle_default([], local_var_39, local_var_41) + + def local_var_31(_: Any): + def local_var_33(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=276, start_column=5, + end_line=278, end_column=6, + law_headings=["Article 1", + "Décret n° 2019-1387 du 18 décembre 2019 portant relèvement du salaire minimum de croissance", + "Montant du salaire minimum de croissance", + "Décrets divers"]), ((date_courante_5 >= + date_of_numbers(2020, 1, 1)) and ((date_courante_5 <= + date_of_numbers(2020, 12, 31)) and (residence_11 == + Collectivite(Collectivite_Code.Mayotte, Unit()))))) + + def local_var_35(_: Any): return money_of_cents_string("766") - else: - raise EmptyError - def local_var_13(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=297, start_column=5, - end_line=306, end_column=6, law_headings=["Article 1", - "Décret n° 2020-1598 du 16 décembre 2020 portant relèvement du salaire minimum de croissance", - "Montant du salaire minimum de croissance", - "Décrets divers"]), ((date_courante_5 >= - date_of_numbers(2021,1,1)) and ((date_courante_5 <= - date_of_numbers(2021,12,31)) and ((residence_7 == - Collectivite(Collectivite_Code.Metropole, Unit())) or - ((residence_7 == - Collectivite(Collectivite_Code.Guadeloupe, Unit())) or - ((residence_7 == Collectivite(Collectivite_Code.Guyane, - Unit())) or ((residence_7 == - Collectivite(Collectivite_Code.Martinique, Unit())) or - ((residence_7 == - Collectivite(Collectivite_Code.LaReunion, Unit())) or - ((residence_7 == - Collectivite(Collectivite_Code.SaintBarthelemy, - Unit())) or ((residence_7 == - Collectivite(Collectivite_Code.SaintMartin, Unit())) or - (residence_7 == - Collectivite(Collectivite_Code.SaintPierreEtMiquelon, - Unit())))))))))))): + return handle_default([], local_var_33, local_var_35) + + def local_var_25(_: Any): + def local_var_27(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=297, start_column=5, + end_line=306, end_column=6, + law_headings=["Article 1", + "Décret n° 2020-1598 du 16 décembre 2020 portant relèvement du salaire minimum de croissance", + "Montant du salaire minimum de croissance", + "Décrets divers"]), ((date_courante_5 >= + date_of_numbers(2021, 1, 1)) and ((date_courante_5 <= + date_of_numbers(2021, 12, 31)) and ((residence_11 == + Collectivite(Collectivite_Code.Metropole, Unit())) or + ((residence_11 == + Collectivite(Collectivite_Code.Guadeloupe, + Unit())) or ((residence_11 == + Collectivite(Collectivite_Code.Guyane, Unit())) or + ((residence_11 == + Collectivite(Collectivite_Code.Martinique, + Unit())) or ((residence_11 == + Collectivite(Collectivite_Code.LaReunion, Unit())) or + ((residence_11 == + Collectivite(Collectivite_Code.SaintBarthelemy, + Unit())) or ((residence_11 == + Collectivite(Collectivite_Code.SaintMartin, + Unit())) or (residence_11 == + Collectivite(Collectivite_Code.SaintPierreEtMiquelon, + Unit())))))))))))) + + def local_var_29(_: Any): return money_of_cents_string("1025") - else: - raise EmptyError - def local_var_11(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=315, start_column=5, - end_line=317, end_column=6, law_headings=["Article 1", - "Décret n° 2020-1598 du 16 décembre 2020 portant relèvement du salaire minimum de croissance", - "Montant du salaire minimum de croissance", - "Décrets divers"]), ((date_courante_5 >= - date_of_numbers(2021,1,1)) and ((date_courante_5 <= - date_of_numbers(2021,12,31)) and (residence_7 == - Collectivite(Collectivite_Code.Mayotte, - Unit()))))): + return handle_default([], local_var_27, local_var_29) + + def local_var_19(_: Any): + def local_var_21(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=315, start_column=5, + end_line=317, end_column=6, + law_headings=["Article 1", + "Décret n° 2020-1598 du 16 décembre 2020 portant relèvement du salaire minimum de croissance", + "Montant du salaire minimum de croissance", + "Décrets divers"]), ((date_courante_5 >= + date_of_numbers(2021, 1, 1)) and ((date_courante_5 <= + date_of_numbers(2021, 12, 31)) and (residence_11 == + Collectivite(Collectivite_Code.Mayotte, Unit()))))) + + def local_var_23(_: Any): return money_of_cents_string("774") - else: - raise EmptyError - def local_var_23(_:Any): + return handle_default([], local_var_21, local_var_23) + + def local_var_55(_: Any): return log_decision_taken(SourcePosition(filename="", - start_line=0, start_column=1, end_line=0, end_column=1, - law_headings=[]), False) - def local_var_25(_:Any): + start_line=0, start_column=1, end_line=0, end_column=1, + law_headings=[]), False) + + def local_var_57(_: Any): raise EmptyError - local_var_10 = handle_default([local_var_11, local_var_13, - local_var_15, local_var_17, local_var_19, local_var_21], - local_var_23, local_var_25) + local_var_18 = handle_default([local_var_19, local_var_25, + local_var_31, local_var_37, local_var_43, local_var_49], + local_var_55, local_var_57) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=43, start_column=12, end_line=43, end_column=24, - law_headings=["Prologue"])) - brut_horaire_9 = log_variable_definition(["Smic", "brut_horaire"], - local_var_10) - return SmicOut(date_courante_out = date_courante_5, - residence_out = residence_7, brut_horaire_out = brut_horaire_9) - -def allocation_familiales_avril2008(allocation_familiales_avril2008_in_27:AllocationFamilialesAvril2008In): - age_minimum_alinea_1_l521_3_28 = allocation_familiales_avril2008_in_27.age_minimum_alinea_1_l521_3_in + start_line=43, start_column=12, end_line=43, end_column=24, + law_headings=["Prologue"])) + brut_horaire_17 = log_variable_definition(["Smic", "brut_horaire"], + local_var_18) + return SmicOut(date_courante_out=date_courante_5, + residence_out=residence_11, brut_horaire_out=brut_horaire_17) + + +def allocation_familiales_avril2008(allocation_familiales_avril2008_in_59: AllocationFamilialesAvril2008In): + age_minimum_alinea_1_l521_3_60 = allocation_familiales_avril2008_in_59.age_minimum_alinea_1_l521_3_in try: try: - local_var_30 = age_minimum_alinea_1_l521_3_28(Unit()) + local_var_62 = age_minimum_alinea_1_l521_3_60(Unit()) except EmptyError: try: - local_var_30 = integer_of_string("16") + def local_var_63(_: Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_R.catala_fr", + start_line=78, start_column=14, + end_line=78, end_column=41, + law_headings=["Article R521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets en Conseil d'Etat", + "Code de la sécurité sociale"]), True) + + def local_var_65(_: Any): + return integer_of_string("16") + local_var_62 = handle_default([], local_var_63, local_var_65) except EmptyError: raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=81, start_column=12, end_line=81, end_column=39, - law_headings=["Prologue"])) - age_minimum_alinea_1_l521_3_29 = log_variable_definition(["AllocationFamilialesAvril2008", - "âge_minimum_alinéa_1_l521_3"], local_var_30) - return AllocationFamilialesAvril2008Out(age_minimum_alinea_1_l521_3_out = age_minimum_alinea_1_l521_3_29) - -def enfant_le_plus_age(enfant_le_plus_age_in_31:EnfantLePlusAgeIn): - enfants_32 = enfant_le_plus_age_in_31.enfants_in - le_plus_age_33 = enfant_le_plus_age_in_31.le_plus_age_in + start_line=81, start_column=12, end_line=81, end_column=39, + law_headings=["Prologue"])) + age_minimum_alinea_1_l521_3_61 = log_variable_definition(["AllocationFamilialesAvril2008", + "âge_minimum_alinéa_1_l521_3"], local_var_62) + return AllocationFamilialesAvril2008Out(age_minimum_alinea_1_l521_3_out=age_minimum_alinea_1_l521_3_61) + + +def enfant_le_plus_age(enfant_le_plus_age_in_67: EnfantLePlusAgeIn): + enfants_68 = enfant_le_plus_age_in_67.enfants_in + le_plus_age_69 = enfant_le_plus_age_in_67.le_plus_age_in try: try: - local_var_35 = enfants_32(Unit()) + local_var_71 = enfants_68(Unit()) except EmptyError: - if log_decision_taken(SourcePosition(filename="", start_line=0, - start_column=1, end_line=0, end_column=1, - law_headings=[]), False): - raise EmptyError - else: + def local_var_72(_: Any): + return log_decision_taken(SourcePosition(filename="", + start_line=0, start_column=1, end_line=0, end_column=1, + law_headings=[]), False) + + def local_var_74(_: Any): raise EmptyError + local_var_71 = handle_default([], local_var_72, local_var_74) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=84, start_column=12, end_line=84, end_column=19, - law_headings=["Prologue"])) - enfants_34 = log_variable_definition(["EnfantLePlusÂgé", "enfants"], - local_var_35) + start_line=84, start_column=12, end_line=84, end_column=19, + law_headings=["Prologue"])) + enfants_70 = log_variable_definition(["EnfantLePlusÂgé", "enfants"], + local_var_71) try: try: - local_var_37 = le_plus_age_33(Unit()) + local_var_77 = le_plus_age_69(Unit()) except EmptyError: try: - def local_var_39(potentiel_plus_age_40:Any): - return potentiel_plus_age_40.age - predicate_38 = local_var_39 - def local_var_41(acc_42:Any, item_43:Any): - if (predicate_38(acc_42) > - predicate_38(item_43)): - return acc_42 - else: - return item_43 - local_var_37 = list_fold_left(local_var_41, - Enfant(identifiant = - integer_of_string("1"), - obligation_scolaire = SituationObligationScolaire(SituationObligationScolaire_Code.Pendant, - Unit()), - remuneration_mensuelle = money_of_cents_string("0"), - date_de_naissance = date_of_numbers(1900,1,1), - age = integer_of_string("0"), - prise_en_charge = PriseEnCharge(PriseEnCharge_Code.EffectiveEtPermanente, - Unit()), - a_deja_ouvert_droit_aux_allocations_familiales = False), - enfants_34) + def local_var_78(_: Any): + return log_decision_taken(SourcePosition(filename="./epilogue.catala_fr", + start_line=12, start_column=14, + end_line=12, end_column=25, + law_headings=["Règles diverses", "Épilogue", + "Décrets divers"]), True) + + def local_var_80(_: Any): + def local_var_83(potentiel_plus_age_84: Any): + return potentiel_plus_age_84.age + predicate_82 = local_var_83 + + def local_var_85(acc_86: Any, item_87: Any): + if (predicate_82(acc_86) > + predicate_82(item_87)): + return acc_86 + else: + return item_87 + return list_fold_left(local_var_85, + Enfant(identifiant=- integer_of_string("1"), + obligation_scolaire=SituationObligationScolaire(SituationObligationScolaire_Code.Pendant, + Unit()), + remuneration_mensuelle=money_of_cents_string( + "0"), + date_de_naissance=date_of_numbers( + 1900, 1, 1), + age=integer_of_string("0"), + prise_en_charge=PriseEnCharge(PriseEnCharge_Code.EffectiveEtPermanente, + Unit()), + a_deja_ouvert_droit_aux_allocations_familiales=False), + enfants_70) + local_var_77 = handle_default([], local_var_78, local_var_80) except EmptyError: raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=85, start_column=12, end_line=85, end_column=23, - law_headings=["Prologue"])) - le_plus_age_36 = log_variable_definition(["EnfantLePlusÂgé", - "le_plus_âgé"], local_var_37) - return EnfantLePlusAgeOut(enfants_out = enfants_34, - le_plus_age_out = le_plus_age_36) - -def prestations_familiales(prestations_familiales_in_44:PrestationsFamilialesIn): - droit_ouvert_45 = prestations_familiales_in_44.droit_ouvert_in - conditions_hors_age_46 = prestations_familiales_in_44.conditions_hors_age_in - plafond_l512_3_2_47 = prestations_familiales_in_44.plafond_l512_3_2_in - age_l512_3_2_48 = prestations_familiales_in_44.age_l512_3_2_in - regime_outre_mer_l751_1_49 = prestations_familiales_in_44.regime_outre_mer_l751_1_in - date_courante_50 = prestations_familiales_in_44.date_courante_in - prestation_courante_51 = prestations_familiales_in_44.prestation_courante_in - residence_52 = prestations_familiales_in_44.residence_in - base_mensuelle_53 = prestations_familiales_in_44.base_mensuelle_in + start_line=85, start_column=12, end_line=85, end_column=23, + law_headings=["Prologue"])) + le_plus_age_76 = log_variable_definition(["EnfantLePlusÂgé", + "le_plus_âgé"], local_var_77) + return EnfantLePlusAgeOut(enfants_out=enfants_70, + le_plus_age_out=le_plus_age_76) + + +def prestations_familiales(prestations_familiales_in_88: PrestationsFamilialesIn): + droit_ouvert_89 = prestations_familiales_in_88.droit_ouvert_in + conditions_hors_age_90 = prestations_familiales_in_88.conditions_hors_age_in + plafond_l512_3_2_91 = prestations_familiales_in_88.plafond_l512_3_2_in + age_l512_3_2_92 = prestations_familiales_in_88.age_l512_3_2_in + regime_outre_mer_l751_1_93 = prestations_familiales_in_88.regime_outre_mer_l751_1_in + date_courante_94 = prestations_familiales_in_88.date_courante_in + prestation_courante_95 = prestations_familiales_in_88.prestation_courante_in + residence_96 = prestations_familiales_in_88.residence_in + base_mensuelle_97 = prestations_familiales_in_88.base_mensuelle_in try: try: - local_var_55 = age_l512_3_2_48(Unit()) + local_var_99 = age_l512_3_2_92(Unit()) except EmptyError: try: - local_var_55 = integer_of_string("20") + def local_var_100(_: Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_R.catala_fr", + start_line=21, start_column=14, + end_line=21, end_column=26, + law_headings=["Article R512-2", + "Chapitre 2 : Champ d'application.", + "Titre 1 : Champ d'application - Généralités", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets en Conseil d'Etat", + "Code de la sécurité sociale"]), True) + + def local_var_102(_: Any): + return integer_of_string("20") + local_var_99 = handle_default([], local_var_100, + local_var_102) except EmptyError: raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=68, start_column=12, end_line=68, end_column=24, - law_headings=["Prologue"])) - age_l512_3_2_54 = log_variable_definition(["PrestationsFamiliales", - "âge_l512_3_2"], local_var_55) + start_line=68, start_column=12, end_line=68, end_column=24, + law_headings=["Prologue"])) + age_l512_3_2_98 = log_variable_definition(["PrestationsFamiliales", + "âge_l512_3_2"], local_var_99) try: try: - local_var_57 = date_courante_50(Unit()) + local_var_105 = date_courante_94(Unit()) except EmptyError: - if log_decision_taken(SourcePosition(filename="", start_line=0, - start_column=1, end_line=0, end_column=1, - law_headings=[]), False): - raise EmptyError - else: + def local_var_106(_: Any): + return log_decision_taken(SourcePosition(filename="", + start_line=0, start_column=1, end_line=0, end_column=1, + law_headings=[]), False) + + def local_var_108(_: Any): raise EmptyError + local_var_105 = handle_default([], local_var_106, local_var_108) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=70, start_column=12, end_line=70, end_column=25, - law_headings=["Prologue"])) - date_courante_56 = log_variable_definition(["PrestationsFamiliales", - "date_courante"], local_var_57) + start_line=70, start_column=12, end_line=70, end_column=25, + law_headings=["Prologue"])) + date_courante_104 = log_variable_definition(["PrestationsFamiliales", + "date_courante"], local_var_105) try: try: - local_var_59 = prestation_courante_51(Unit()) + local_var_111 = prestation_courante_95(Unit()) except EmptyError: - if log_decision_taken(SourcePosition(filename="", start_line=0, - start_column=1, end_line=0, end_column=1, - law_headings=[]), False): - raise EmptyError - else: + def local_var_112(_: Any): + return log_decision_taken(SourcePosition(filename="", + start_line=0, start_column=1, end_line=0, end_column=1, + law_headings=[]), False) + + def local_var_114(_: Any): raise EmptyError + local_var_111 = handle_default([], local_var_112, local_var_114) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=71, start_column=12, end_line=71, end_column=31, - law_headings=["Prologue"])) - prestation_courante_58 = log_variable_definition(["PrestationsFamiliales", - "prestation_courante"], local_var_59) + start_line=71, start_column=12, end_line=71, end_column=31, + law_headings=["Prologue"])) + prestation_courante_110 = log_variable_definition(["PrestationsFamiliales", + "prestation_courante"], local_var_111) try: try: - local_var_61 = residence_52(Unit()) + local_var_117 = residence_96(Unit()) except EmptyError: - if log_decision_taken(SourcePosition(filename="", start_line=0, - start_column=1, end_line=0, end_column=1, - law_headings=[]), False): - raise EmptyError - else: + def local_var_118(_: Any): + return log_decision_taken(SourcePosition(filename="", + start_line=0, start_column=1, end_line=0, end_column=1, + law_headings=[]), False) + + def local_var_120(_: Any): raise EmptyError + local_var_117 = handle_default([], local_var_118, local_var_120) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=72, start_column=12, end_line=72, end_column=21, - law_headings=["Prologue"])) - residence_60 = log_variable_definition(["PrestationsFamiliales", - "résidence"], local_var_61) + start_line=72, start_column=12, end_line=72, end_column=21, + law_headings=["Prologue"])) + residence_116 = log_variable_definition(["PrestationsFamiliales", + "résidence"], local_var_117) try: try: - local_var_63 = base_mensuelle_53(Unit()) + local_var_123 = base_mensuelle_97(Unit()) except EmptyError: - def local_var_68(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=24, start_column=5, - end_line=25, end_column=34, - law_headings=["Instruction ministérielle N°DSS/SD2B/2019/65 du 25 mars 2019 relative à la revalorisation au 1er avril 2019 des prestations familiales servies en métropole", - "Montant de la base mensuelle des allocations familiales", - "Décrets divers"]), ((date_courante_56 >= - date_of_numbers(2019,4,1)) and (date_courante_56 < - date_of_numbers(2020,4,1)))): + def local_var_136(_: Any): + def local_var_138(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=24, start_column=5, + end_line=25, end_column=34, + law_headings=["Instruction ministérielle N°DSS/SD2B/2019/65 du 25 mars 2019 relative à la revalorisation au 1er avril 2019 des prestations familiales servies en métropole", + "Montant de la base mensuelle des allocations familiales", + "Décrets divers"]), ((date_courante_104 >= + date_of_numbers(2019, 4, 1)) and (date_courante_104 < + date_of_numbers(2020, 4, 1)))) + + def local_var_140(_: Any): return money_of_cents_string("41316") - else: - raise EmptyError - def local_var_66(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=44, start_column=5, - end_line=45, end_column=34, - law_headings=["Instruction interministérielle no DSS/SD2B/2020/33 du 18 février 2020 relative à la revalorisation au 1er avril 2020 des prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à La Réunion, à Saint-Barthélemy, à Saint-Martin et dans le département de Mayotte", - "Montant de la base mensuelle des allocations familiales", - "Décrets divers"]), ((date_courante_56 >= - date_of_numbers(2020,4,1)) and (date_courante_56 < - date_of_numbers(2021,4,1)))): + return handle_default([], local_var_138, local_var_140) + + def local_var_130(_: Any): + def local_var_132(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=44, start_column=5, + end_line=45, end_column=34, + law_headings=["Instruction interministérielle no DSS/SD2B/2020/33 du 18 février 2020 relative à la revalorisation au 1er avril 2020 des prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à La Réunion, à Saint-Barthélemy, à Saint-Martin et dans le département de Mayotte", + "Montant de la base mensuelle des allocations familiales", + "Décrets divers"]), ((date_courante_104 >= + date_of_numbers(2020, 4, 1)) and (date_courante_104 < + date_of_numbers(2021, 4, 1)))) + + def local_var_134(_: Any): return money_of_cents_string("41404") - else: - raise EmptyError - def local_var_64(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=60, start_column=5, - end_line=61, end_column=34, - law_headings=["Instruction interministérielle n°DSS/2B/2021/65 du 19 mars 2021 relative à la revalorisation au 1er avril 2021 des prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et dans le département de Mayotte", - "Montant de la base mensuelle des allocations familiales", - "Décrets divers"]), ((date_courante_56 >= - date_of_numbers(2021,4,1)) and (date_courante_56 < - date_of_numbers(2022,4,1)))): + return handle_default([], local_var_132, local_var_134) + + def local_var_124(_: Any): + def local_var_126(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=60, start_column=5, + end_line=61, end_column=34, + law_headings=["Instruction interministérielle n°DSS/2B/2021/65 du 19 mars 2021 relative à la revalorisation au 1er avril 2021 des prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et dans le département de Mayotte", + "Montant de la base mensuelle des allocations familiales", + "Décrets divers"]), ((date_courante_104 >= + date_of_numbers(2021, 4, 1)) and (date_courante_104 < + date_of_numbers(2022, 4, 1)))) + + def local_var_128(_: Any): return money_of_cents_string("41481") - else: - raise EmptyError - def local_var_70(_:Any): + return handle_default([], local_var_126, local_var_128) + + def local_var_142(_: Any): return log_decision_taken(SourcePosition(filename="", - start_line=0, start_column=1, end_line=0, end_column=1, - law_headings=[]), False) - def local_var_72(_:Any): + start_line=0, start_column=1, end_line=0, end_column=1, + law_headings=[]), False) + + def local_var_144(_: Any): raise EmptyError - local_var_63 = handle_default([local_var_64, local_var_66, - local_var_68], local_var_70, local_var_72) + local_var_123 = handle_default([local_var_124, local_var_130, + local_var_136], local_var_142, local_var_144) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=74, start_column=12, end_line=74, end_column=26, - law_headings=["Prologue"])) - base_mensuelle_62 = log_variable_definition(["PrestationsFamiliales", - "base_mensuelle"], local_var_63) - def local_var_75(_:Unit): + start_line=74, start_column=12, end_line=74, end_column=26, + law_headings=["Prologue"])) + base_mensuelle_122 = log_variable_definition(["PrestationsFamiliales", + "base_mensuelle"], local_var_123) + + def local_var_147(_: Unit): try: - local_var_77 = date_courante_56 + def local_var_150(_: Any): + return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", + start_line=78, start_column=14, + end_line=78, end_column=32, + law_headings=["Prologue"]), True) + + def local_var_152(_: Any): + return date_courante_104 + local_var_149 = handle_default([], local_var_150, local_var_152) except EmptyError: raise EmptyError return log_variable_definition(["PrestationsFamiliales", - "smic.date_courante"], local_var_77) - smic_dot_date_courante_74 = local_var_75 - def local_var_79(_:Unit): + "smic.date_courante"], local_var_149) + smic_dot_date_courante_146 = local_var_147 + + def local_var_155(_: Unit): try: - local_var_81 = residence_60 + def local_var_158(_: Any): + return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", + start_line=77, start_column=14, + end_line=77, end_column=28, + law_headings=["Prologue"]), True) + + def local_var_160(_: Any): + return residence_116 + local_var_157 = handle_default([], local_var_158, local_var_160) except EmptyError: raise EmptyError return log_variable_definition(["PrestationsFamiliales", - "smic.résidence"], local_var_81) - smic_dot_residence_78 = local_var_79 - def local_var_83(_:Unit): + "smic.résidence"], local_var_157) + smic_dot_residence_154 = local_var_155 + + def local_var_163(_: Unit): raise EmptyError - result_82 = log_end_call(["PrestationsFamiliales", "smic", "Smic"], - log_begin_call(["PrestationsFamiliales", "smic", "Smic"], smic, - SmicIn(date_courante_in = smic_dot_date_courante_74, - residence_in = smic_dot_residence_78, - brut_horaire_in = local_var_83))) - smic_dot_date_courante_85 = result_82.date_courante_out - smic_dot_residence_86 = result_82.residence_out - smic_dot_brut_horaire_87 = result_82.brut_horaire_out + result_162 = log_end_call(["PrestationsFamiliales", "smic", "Smic"], + log_begin_call(["PrestationsFamiliales", "smic", "Smic"], smic, + SmicIn(date_courante_in=smic_dot_date_courante_146, + residence_in=smic_dot_residence_154, + brut_horaire_in=local_var_163))) + smic_dot_date_courante_165 = result_162.date_courante_out + smic_dot_residence_166 = result_162.residence_out + smic_dot_brut_horaire_167 = result_162.brut_horaire_out try: try: - local_var_89 = regime_outre_mer_l751_1_49(Unit()) + local_var_169 = regime_outre_mer_l751_1_93(Unit()) except EmptyError: try: - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=354, start_column=5, - end_line=359, end_column=30, - law_headings=["Article L751-1", - "Chapitre 1er : Généralités", - "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin", - "Livre 7 : Régimes divers - Dispositions diverses", - "Partie législative", - "Code de la sécurité sociale"]), ((residence_60 == - Collectivite(Collectivite_Code.Guadeloupe, Unit())) or - ((residence_60 == Collectivite(Collectivite_Code.Guyane, - Unit())) or ((residence_60 == - Collectivite(Collectivite_Code.Martinique, Unit())) or - ((residence_60 == - Collectivite(Collectivite_Code.LaReunion, Unit())) or - ((residence_60 == - Collectivite(Collectivite_Code.SaintBarthelemy, - Unit())) or (residence_60 == - Collectivite(Collectivite_Code.SaintMartin, - Unit())))))))): - local_var_89 = True - else: - raise EmptyError + def local_var_170(_: Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=354, start_column=5, + end_line=359, end_column=30, + law_headings=["Article L751-1", + "Chapitre 1er : Généralités", + "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin", + "Livre 7 : Régimes divers - Dispositions diverses", + "Partie législative", + "Code de la sécurité sociale"]), ((residence_116 == + Collectivite(Collectivite_Code.Guadeloupe, + Unit())) or ((residence_116 == + Collectivite(Collectivite_Code.Guyane, Unit())) or + ((residence_116 == + Collectivite(Collectivite_Code.Martinique, + Unit())) or ((residence_116 == + Collectivite(Collectivite_Code.LaReunion, Unit())) or + ((residence_116 == + Collectivite(Collectivite_Code.SaintBarthelemy, + Unit())) or (residence_116 == + Collectivite(Collectivite_Code.SaintMartin, + Unit())))))))) + + def local_var_172(_: Any): + return True + local_var_169 = handle_default([], local_var_170, + local_var_172) except EmptyError: - local_var_89 = False + local_var_169 = False except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=69, start_column=12, end_line=69, end_column=35, - law_headings=["Prologue"])) - regime_outre_mer_l751_1_88 = log_variable_definition(["PrestationsFamiliales", - "régime_outre_mer_l751_1"], local_var_89) + start_line=69, start_column=12, end_line=69, end_column=35, + law_headings=["Prologue"])) + regime_outre_mer_l751_1_168 = log_variable_definition(["PrestationsFamiliales", + "régime_outre_mer_l751_1"], local_var_169) try: try: - local_var_91 = plafond_l512_3_2_47(Unit()) + local_var_175 = plafond_l512_3_2_91(Unit()) except EmptyError: try: try: - if log_decision_taken(SourcePosition(filename="./securite_sociale_R.catala_fr", - start_line=216, start_column=18, - end_line=216, end_column=41, - law_headings=["Article R755-0-2", - "Chapitre 5 : Prestations familiales et prestations assimilées", - "Titre 5 : Départements d'outre-mer", - "Livre 7 : Régimes divers - Dispositions diverses", - "Partie réglementaire - Décrets en Conseil d'Etat", - "Code de la sécurité sociale"]), regime_outre_mer_l751_1_88): - local_var_91 = ((smic_dot_brut_horaire_87 * - decimal_of_string("0.55")) * - decimal_of_string("169.")) - else: - raise EmptyError + def local_var_176(_: Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_R.catala_fr", + start_line=216, start_column=18, + end_line=216, end_column=41, + law_headings=["Article R755-0-2", + "Chapitre 5 : Prestations familiales et prestations assimilées", + "Titre 5 : Départements d'outre-mer", + "Livre 7 : Régimes divers - Dispositions diverses", + "Partie réglementaire - Décrets en Conseil d'Etat", + "Code de la sécurité sociale"]), regime_outre_mer_l751_1_168) + + def local_var_178(_: Any): + return ((smic_dot_brut_horaire_167 * + decimal_of_string("0.55")) * + decimal_of_string("169.")) + local_var_175 = handle_default([], local_var_176, + local_var_178) except EmptyError: - local_var_91 = ((smic_dot_brut_horaire_87 * - decimal_of_string("0.55")) * - decimal_of_string("169.")) + local_var_175 = ((smic_dot_brut_horaire_167 * + decimal_of_string("0.55")) * + decimal_of_string("169.")) except EmptyError: raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=67, start_column=12, end_line=67, end_column=28, - law_headings=["Prologue"])) - plafond_l512_3_2_90 = log_variable_definition(["PrestationsFamiliales", - "plafond_l512_3_2"], local_var_91) + start_line=67, start_column=12, end_line=67, end_column=28, + law_headings=["Prologue"])) + plafond_l512_3_2_174 = log_variable_definition(["PrestationsFamiliales", + "plafond_l512_3_2"], local_var_175) try: try: - local_var_93 = conditions_hors_age_46(Unit()) + local_var_181 = conditions_hors_age_90(Unit()) except EmptyError: - def local_var_93(param_94:Enfant): + def local_var_181(param_182: Enfant): try: try: - match_arg_785 = param_94.obligation_scolaire - if match_arg_785.code == SituationObligationScolaire_Code.Avant: - _ = match_arg_785.value - local_var_99 = False - elif match_arg_785.code == SituationObligationScolaire_Code.Pendant: - _ = match_arg_785.value - local_var_99 = True - elif match_arg_785.code == SituationObligationScolaire_Code.Apres: - _ = match_arg_785.value - local_var_99 = False - match_arg_786 = param_94.obligation_scolaire - if match_arg_786.code == SituationObligationScolaire_Code.Avant: - _ = match_arg_786.value - local_var_103 = False - elif match_arg_786.code == SituationObligationScolaire_Code.Pendant: - _ = match_arg_786.value - local_var_103 = False - elif match_arg_786.code == SituationObligationScolaire_Code.Apres: - _ = match_arg_786.value - local_var_103 = True - match_arg_787 = param_94.obligation_scolaire - if match_arg_787.code == SituationObligationScolaire_Code.Avant: - _ = match_arg_787.value - local_var_95 = True - elif match_arg_787.code == SituationObligationScolaire_Code.Pendant: - _ = match_arg_787.value - local_var_95 = False - elif match_arg_787.code == SituationObligationScolaire_Code.Apres: - _ = match_arg_787.value - local_var_95 = False - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=68, start_column=5, - end_line=71, end_column=57, - law_headings=["Article L512-3", - "Chapitre 2 : Champ d'application", - "Titre 1 : Champ d'application - Généralités", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), (local_var_95 or - (local_var_99 or (local_var_103 and - (param_94.remuneration_mensuelle <= - plafond_l512_3_2_90))))): + def local_var_183(_: Any): + match_arg_1365 = param_182.obligation_scolaire + if match_arg_1365.code == SituationObligationScolaire_Code.Avant: + _ = match_arg_1365.value + local_var_185 = True + elif match_arg_1365.code == SituationObligationScolaire_Code.Pendant: + _ = match_arg_1365.value + local_var_185 = False + elif match_arg_1365.code == SituationObligationScolaire_Code.Apres: + _ = match_arg_1365.value + local_var_185 = False + match_arg_1366 = param_182.obligation_scolaire + if match_arg_1366.code == SituationObligationScolaire_Code.Avant: + _ = match_arg_1366.value + local_var_193 = False + elif match_arg_1366.code == SituationObligationScolaire_Code.Pendant: + _ = match_arg_1366.value + local_var_193 = False + elif match_arg_1366.code == SituationObligationScolaire_Code.Apres: + _ = match_arg_1366.value + local_var_193 = True + match_arg_1367 = param_182.obligation_scolaire + if match_arg_1367.code == SituationObligationScolaire_Code.Avant: + _ = match_arg_1367.value + local_var_189 = False + elif match_arg_1367.code == SituationObligationScolaire_Code.Pendant: + _ = match_arg_1367.value + local_var_189 = True + elif match_arg_1367.code == SituationObligationScolaire_Code.Apres: + _ = match_arg_1367.value + local_var_189 = False + return log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=68, start_column=5, + end_line=71, end_column=57, + law_headings=["Article L512-3", + "Chapitre 2 : Champ d'application", + "Titre 1 : Champ d'application - Généralités", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), ((local_var_185 or + (local_var_189 or local_var_193)) and + (param_182.remuneration_mensuelle <= + plafond_l512_3_2_174))) + + def local_var_197(_: Any): return True - else: - raise EmptyError + return handle_default([], local_var_183, + local_var_197) except EmptyError: return False except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=66, start_column=12, end_line=66, - end_column=31, law_headings=["Prologue"])) + start_line=66, start_column=12, end_line=66, + end_column=31, law_headings=["Prologue"])) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=66, start_column=12, end_line=66, end_column=31, - law_headings=["Prologue"])) - conditions_hors_age_92 = log_variable_definition(["PrestationsFamiliales", - "conditions_hors_âge"], local_var_93) + start_line=66, start_column=12, end_line=66, end_column=31, + law_headings=["Prologue"])) + conditions_hors_age_180 = log_variable_definition(["PrestationsFamiliales", + "conditions_hors_âge"], local_var_181) try: try: - local_var_108 = droit_ouvert_45(Unit()) + local_var_200 = droit_ouvert_89(Unit()) except EmptyError: - def local_var_108(param_109:Enfant): + def local_var_200(param_201: Enfant): try: - def local_var_116(_:Any): - match_arg_788 = param_109.obligation_scolaire - if match_arg_788.code == SituationObligationScolaire_Code.Avant: - _ = match_arg_788.value - local_var_122 = False - elif match_arg_788.code == SituationObligationScolaire_Code.Pendant: - _ = match_arg_788.value - local_var_122 = True - elif match_arg_788.code == SituationObligationScolaire_Code.Apres: - _ = match_arg_788.value - local_var_122 = False - match_arg_789 = param_109.obligation_scolaire - if match_arg_789.code == SituationObligationScolaire_Code.Avant: - _ = match_arg_789.value - local_var_118 = True - elif match_arg_789.code == SituationObligationScolaire_Code.Pendant: - _ = match_arg_789.value - local_var_118 = False - elif match_arg_789.code == SituationObligationScolaire_Code.Apres: - _ = match_arg_789.value - local_var_118 = False - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=49, start_column=5, - end_line=50, end_column=50, - law_headings=["Article L512-3", - "Chapitre 2 : Champ d'application", - "Titre 1 : Champ d'application - Généralités", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), (local_var_118 or - local_var_122)): + def local_var_212(_: Any): + def local_var_214(_: Any): + match_arg_1368 = param_201.obligation_scolaire + if match_arg_1368.code == SituationObligationScolaire_Code.Avant: + _ = match_arg_1368.value + local_var_220 = False + elif match_arg_1368.code == SituationObligationScolaire_Code.Pendant: + _ = match_arg_1368.value + local_var_220 = True + elif match_arg_1368.code == SituationObligationScolaire_Code.Apres: + _ = match_arg_1368.value + local_var_220 = False + match_arg_1369 = param_201.obligation_scolaire + if match_arg_1369.code == SituationObligationScolaire_Code.Avant: + _ = match_arg_1369.value + local_var_216 = True + elif match_arg_1369.code == SituationObligationScolaire_Code.Pendant: + _ = match_arg_1369.value + local_var_216 = False + elif match_arg_1369.code == SituationObligationScolaire_Code.Apres: + _ = match_arg_1369.value + local_var_216 = False + return log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=49, start_column=5, + end_line=50, end_column=50, + law_headings=["Article L512-3", + "Chapitre 2 : Champ d'application", + "Titre 1 : Champ d'application - Généralités", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), (local_var_216 or + local_var_220)) + + def local_var_224(_: Any): return True - else: - raise EmptyError - def local_var_110(_:Any): - match_arg_790 = param_109.obligation_scolaire - if match_arg_790.code == SituationObligationScolaire_Code.Avant: - _ = match_arg_790.value - local_var_112 = False - elif match_arg_790.code == SituationObligationScolaire_Code.Pendant: - _ = match_arg_790.value - local_var_112 = False - elif match_arg_790.code == SituationObligationScolaire_Code.Apres: - _ = match_arg_790.value - local_var_112 = True - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=60, start_column=5, - end_line=62, end_column=32, - law_headings=["Article L512-3", - "Chapitre 2 : Champ d'application", - "Titre 1 : Champ d'application - Généralités", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), (local_var_112 and - ((param_109.remuneration_mensuelle <= - plafond_l512_3_2_90) and (param_109.age < - age_l512_3_2_54)))): + return handle_default([], local_var_214, + local_var_224) + + def local_var_202(_: Any): + def local_var_204(_: Any): + match_arg_1370 = param_201.obligation_scolaire + if match_arg_1370.code == SituationObligationScolaire_Code.Avant: + _ = match_arg_1370.value + local_var_206 = False + elif match_arg_1370.code == SituationObligationScolaire_Code.Pendant: + _ = match_arg_1370.value + local_var_206 = False + elif match_arg_1370.code == SituationObligationScolaire_Code.Apres: + _ = match_arg_1370.value + local_var_206 = True + return log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=60, start_column=5, + end_line=62, end_column=32, + law_headings=["Article L512-3", + "Chapitre 2 : Champ d'application", + "Titre 1 : Champ d'application - Généralités", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), (local_var_206 and + ((param_201.remuneration_mensuelle <= + plafond_l512_3_2_174) and (param_201.age < + age_l512_3_2_98)))) + + def local_var_210(_: Any): return True - else: - raise EmptyError - def local_var_126(_:Any): + return handle_default([], local_var_204, + local_var_210) + + def local_var_226(_: Any): return log_decision_taken(SourcePosition(filename="", - start_line=0, start_column=1, - end_line=0, end_column=1, law_headings=[]), True) - def local_var_128(_:Any): + start_line=0, start_column=1, + end_line=0, end_column=1, law_headings=[]), True) + + def local_var_228(_: Any): return False - return handle_default([local_var_110, local_var_116], - local_var_126, local_var_128) + return handle_default([local_var_202, local_var_212], + local_var_226, local_var_228) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=65, start_column=12, end_line=65, - end_column=24, law_headings=["Prologue"])) + start_line=65, start_column=12, end_line=65, + end_column=24, law_headings=["Prologue"])) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=65, start_column=12, end_line=65, end_column=24, - law_headings=["Prologue"])) - droit_ouvert_107 = log_variable_definition(["PrestationsFamiliales", - "droit_ouvert"], local_var_108) - return PrestationsFamilialesOut(droit_ouvert_out = droit_ouvert_107, - conditions_hors_age_out = conditions_hors_age_92, - plafond_l512_3_2_out = plafond_l512_3_2_90, - age_l512_3_2_out = age_l512_3_2_54, - regime_outre_mer_l751_1_out = regime_outre_mer_l751_1_88, - date_courante_out = date_courante_56, - prestation_courante_out = prestation_courante_58, - residence_out = residence_60, base_mensuelle_out = base_mensuelle_62) - -def allocations_familiales(allocations_familiales_in_130:AllocationsFamilialesIn): - personne_charge_effective_permanente_est_parent_131 = allocations_familiales_in_130.personne_charge_effective_permanente_est_parent_in - personne_charge_effective_permanente_remplit_titre__i_132 = allocations_familiales_in_130.personne_charge_effective_permanente_remplit_titre_I_in - ressources_menage_133 = allocations_familiales_in_130.ressources_menage_in - residence_134 = allocations_familiales_in_130.residence_in - date_courante_135 = allocations_familiales_in_130.date_courante_in - enfants_a_charge_136 = allocations_familiales_in_130.enfants_a_charge_in - enfants_a_charge_droit_ouvert_prestation_familiale_137 = allocations_familiales_in_130.enfants_a_charge_droit_ouvert_prestation_familiale_in - prise_en_compte_138 = allocations_familiales_in_130.prise_en_compte_in - versement_139 = allocations_familiales_in_130.versement_in - montant_verse_140 = allocations_familiales_in_130.montant_verse_in - droit_ouvert_base_141 = allocations_familiales_in_130.droit_ouvert_base_in - montant_initial_base_142 = allocations_familiales_in_130.montant_initial_base_in - montant_initial_base_premier_enfant_143 = allocations_familiales_in_130.montant_initial_base_premier_enfant_in - montant_initial_base_deuxieme_enfant_144 = allocations_familiales_in_130.montant_initial_base_deuxieme_enfant_in - montant_initial_base_troisieme_enfant_et_plus_145 = allocations_familiales_in_130.montant_initial_base_troisieme_enfant_et_plus_in - rapport_enfants_total_moyen_146 = allocations_familiales_in_130.rapport_enfants_total_moyen_in - nombre_moyen_enfants_147 = allocations_familiales_in_130.nombre_moyen_enfants_in - nombre_total_enfants_148 = allocations_familiales_in_130.nombre_total_enfants_in - montant_avec_garde_alternee_base_149 = allocations_familiales_in_130.montant_avec_garde_alternee_base_in - montant_verse_base_150 = allocations_familiales_in_130.montant_verse_base_in - avait_enfant_a_charge_avant_1er_janvier_2012_151 = allocations_familiales_in_130.avait_enfant_a_charge_avant_1er_janvier_2012_in - montant_initial_base_premier_enfant_mayotte_152 = allocations_familiales_in_130.montant_initial_base_premier_enfant_mayotte_in - montant_initial_base_deuxieme_enfant_mayotte_153 = allocations_familiales_in_130.montant_initial_base_deuxieme_enfant_mayotte_in - montant_initial_base_troisieme_enfant_mayotte_154 = allocations_familiales_in_130.montant_initial_base_troisieme_enfant_mayotte_in - montant_initial_base_quatrieme_enfant_et_plus_mayotte_155 = allocations_familiales_in_130.montant_initial_base_quatrieme_enfant_et_plus_mayotte_in - droit_ouvert_forfaitaire_156 = allocations_familiales_in_130.droit_ouvert_forfaitaire_in - montant_verse_forfaitaire_par_enfant_157 = allocations_familiales_in_130.montant_verse_forfaitaire_par_enfant_in - montant_verse_forfaitaire_158 = allocations_familiales_in_130.montant_verse_forfaitaire_in - droit_ouvert_majoration_159 = allocations_familiales_in_130.droit_ouvert_majoration_in - montant_initial_metropole_majoration_160 = allocations_familiales_in_130.montant_initial_metropole_majoration_in - montant_initial_majoration_161 = allocations_familiales_in_130.montant_initial_majoration_in - montant_avec_garde_alternee_majoration_162 = allocations_familiales_in_130.montant_avec_garde_alternee_majoration_in - montant_verse_majoration_163 = allocations_familiales_in_130.montant_verse_majoration_in - droit_ouvert_complement_164 = allocations_familiales_in_130.droit_ouvert_complement_in - montant_base_complement_pour_base_et_majoration_165 = allocations_familiales_in_130.montant_base_complement_pour_base_et_majoration_in - complement_degressif_166 = allocations_familiales_in_130.complement_degressif_in - montant_verse_complement_pour_base_et_majoration_167 = allocations_familiales_in_130.montant_verse_complement_pour_base_et_majoration_in - montant_verse_complement_pour_forfaitaire_168 = allocations_familiales_in_130.montant_verse_complement_pour_forfaitaire_in - nombre_enfants_l521_1_169 = allocations_familiales_in_130.nombre_enfants_l521_1_in - age_minimum_alinea_1_l521_3_170 = allocations_familiales_in_130.age_minimum_alinea_1_l521_3_in - nombre_enfants_alinea_2_l521_3_171 = allocations_familiales_in_130.nombre_enfants_alinea_2_l521_3_in - est_enfant_le_plus_age_172 = allocations_familiales_in_130.est_enfant_le_plus_age_in - plafond__i_d521_3_173 = allocations_familiales_in_130.plafond_I_d521_3_in - plafond__i_i_d521_3_174 = allocations_familiales_in_130.plafond_II_d521_3_in + start_line=65, start_column=12, end_line=65, end_column=24, + law_headings=["Prologue"])) + droit_ouvert_199 = log_variable_definition(["PrestationsFamiliales", + "droit_ouvert"], local_var_200) + return PrestationsFamilialesOut(droit_ouvert_out=droit_ouvert_199, + conditions_hors_age_out=conditions_hors_age_180, + plafond_l512_3_2_out=plafond_l512_3_2_174, + age_l512_3_2_out=age_l512_3_2_98, + regime_outre_mer_l751_1_out=regime_outre_mer_l751_1_168, + date_courante_out=date_courante_104, + prestation_courante_out=prestation_courante_110, + residence_out=residence_116, + base_mensuelle_out=base_mensuelle_122) + + +def allocations_familiales(allocations_familiales_in_230: AllocationsFamilialesIn): + personne_charge_effective_permanente_est_parent_231 = allocations_familiales_in_230.personne_charge_effective_permanente_est_parent_in + personne_charge_effective_permanente_remplit_titre__i_232 = allocations_familiales_in_230.personne_charge_effective_permanente_remplit_titre_I_in + ressources_menage_233 = allocations_familiales_in_230.ressources_menage_in + residence_234 = allocations_familiales_in_230.residence_in + date_courante_235 = allocations_familiales_in_230.date_courante_in + enfants_a_charge_236 = allocations_familiales_in_230.enfants_a_charge_in + enfants_a_charge_droit_ouvert_prestation_familiale_237 = allocations_familiales_in_230.enfants_a_charge_droit_ouvert_prestation_familiale_in + prise_en_compte_238 = allocations_familiales_in_230.prise_en_compte_in + versement_239 = allocations_familiales_in_230.versement_in + montant_verse_240 = allocations_familiales_in_230.montant_verse_in + droit_ouvert_base_241 = allocations_familiales_in_230.droit_ouvert_base_in + montant_initial_base_242 = allocations_familiales_in_230.montant_initial_base_in + montant_initial_base_premier_enfant_243 = allocations_familiales_in_230.montant_initial_base_premier_enfant_in + montant_initial_base_deuxieme_enfant_244 = allocations_familiales_in_230.montant_initial_base_deuxieme_enfant_in + montant_initial_base_troisieme_enfant_et_plus_245 = allocations_familiales_in_230.montant_initial_base_troisieme_enfant_et_plus_in + rapport_enfants_total_moyen_246 = allocations_familiales_in_230.rapport_enfants_total_moyen_in + nombre_moyen_enfants_247 = allocations_familiales_in_230.nombre_moyen_enfants_in + nombre_total_enfants_248 = allocations_familiales_in_230.nombre_total_enfants_in + montant_avec_garde_alternee_base_249 = allocations_familiales_in_230.montant_avec_garde_alternee_base_in + montant_verse_base_250 = allocations_familiales_in_230.montant_verse_base_in + avait_enfant_a_charge_avant_1er_janvier_2012_251 = allocations_familiales_in_230.avait_enfant_a_charge_avant_1er_janvier_2012_in + montant_initial_base_premier_enfant_mayotte_252 = allocations_familiales_in_230.montant_initial_base_premier_enfant_mayotte_in + montant_initial_base_deuxieme_enfant_mayotte_253 = allocations_familiales_in_230.montant_initial_base_deuxieme_enfant_mayotte_in + montant_initial_base_troisieme_enfant_mayotte_254 = allocations_familiales_in_230.montant_initial_base_troisieme_enfant_mayotte_in + montant_initial_base_quatrieme_enfant_et_plus_mayotte_255 = allocations_familiales_in_230.montant_initial_base_quatrieme_enfant_et_plus_mayotte_in + droit_ouvert_forfaitaire_256 = allocations_familiales_in_230.droit_ouvert_forfaitaire_in + montant_verse_forfaitaire_par_enfant_257 = allocations_familiales_in_230.montant_verse_forfaitaire_par_enfant_in + montant_verse_forfaitaire_258 = allocations_familiales_in_230.montant_verse_forfaitaire_in + droit_ouvert_majoration_259 = allocations_familiales_in_230.droit_ouvert_majoration_in + montant_initial_metropole_majoration_260 = allocations_familiales_in_230.montant_initial_metropole_majoration_in + montant_initial_majoration_261 = allocations_familiales_in_230.montant_initial_majoration_in + montant_avec_garde_alternee_majoration_262 = allocations_familiales_in_230.montant_avec_garde_alternee_majoration_in + montant_verse_majoration_263 = allocations_familiales_in_230.montant_verse_majoration_in + droit_ouvert_complement_264 = allocations_familiales_in_230.droit_ouvert_complement_in + montant_base_complement_pour_base_et_majoration_265 = allocations_familiales_in_230.montant_base_complement_pour_base_et_majoration_in + complement_degressif_266 = allocations_familiales_in_230.complement_degressif_in + montant_verse_complement_pour_base_et_majoration_267 = allocations_familiales_in_230.montant_verse_complement_pour_base_et_majoration_in + montant_verse_complement_pour_forfaitaire_268 = allocations_familiales_in_230.montant_verse_complement_pour_forfaitaire_in + nombre_enfants_l521_1_269 = allocations_familiales_in_230.nombre_enfants_l521_1_in + age_minimum_alinea_1_l521_3_270 = allocations_familiales_in_230.age_minimum_alinea_1_l521_3_in + nombre_enfants_alinea_2_l521_3_271 = allocations_familiales_in_230.nombre_enfants_alinea_2_l521_3_in + est_enfant_le_plus_age_272 = allocations_familiales_in_230.est_enfant_le_plus_age_in + plafond__i_d521_3_273 = allocations_familiales_in_230.plafond_I_d521_3_in + plafond__i_i_d521_3_274 = allocations_familiales_in_230.plafond_II_d521_3_in try: try: - local_var_176 = personne_charge_effective_permanente_est_parent_131(Unit()) + local_var_276 = personne_charge_effective_permanente_est_parent_231( + Unit()) except EmptyError: - if log_decision_taken(SourcePosition(filename="", start_line=0, - start_column=1, end_line=0, end_column=1, - law_headings=[]), True): - local_var_176 = False - else: - raise EmptyError + def local_var_277(_: Any): + return log_decision_taken(SourcePosition(filename="", + start_line=0, start_column=1, end_line=0, end_column=1, + law_headings=[]), True) + + def local_var_279(_: Any): + return False + local_var_276 = handle_default([], local_var_277, local_var_279) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=90, start_column=12, end_line=90, end_column=59, - law_headings=["Prologue"])) - personne_charge_effective_permanente_est_parent_175 = log_variable_definition(["AllocationsFamiliales", - "personne_charge_effective_permanente_est_parent"], local_var_176) + start_line=90, start_column=12, end_line=90, end_column=59, + law_headings=["Prologue"])) + personne_charge_effective_permanente_est_parent_275 = log_variable_definition(["AllocationsFamiliales", + "personne_charge_effective_permanente_est_parent"], local_var_276) try: try: - local_var_178 = personne_charge_effective_permanente_remplit_titre__i_132(Unit()) + local_var_282 = personne_charge_effective_permanente_remplit_titre__i_232( + Unit()) except EmptyError: - if log_decision_taken(SourcePosition(filename="", start_line=0, - start_column=1, end_line=0, end_column=1, - law_headings=[]), True): - local_var_178 = False - else: - raise EmptyError + def local_var_283(_: Any): + return log_decision_taken(SourcePosition(filename="", + start_line=0, start_column=1, end_line=0, end_column=1, + law_headings=[]), True) + + def local_var_285(_: Any): + return False + local_var_282 = handle_default([], local_var_283, local_var_285) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=91, start_column=12, end_line=91, end_column=64, - law_headings=["Prologue"])) - personne_charge_effective_permanente_remplit_titre__i_177 = log_variable_definition(["AllocationsFamiliales", - "personne_charge_effective_permanente_remplit_titre_I"], - local_var_178) + start_line=91, start_column=12, end_line=91, end_column=64, + law_headings=["Prologue"])) + personne_charge_effective_permanente_remplit_titre__i_281 = log_variable_definition(["AllocationsFamiliales", + "personne_charge_effective_permanente_remplit_titre_I"], + local_var_282) try: try: - local_var_180 = ressources_menage_133(Unit()) + local_var_288 = ressources_menage_233(Unit()) except EmptyError: - if log_decision_taken(SourcePosition(filename="", start_line=0, - start_column=1, end_line=0, end_column=1, - law_headings=[]), False): - raise EmptyError - else: + def local_var_289(_: Any): + return log_decision_taken(SourcePosition(filename="", + start_line=0, start_column=1, end_line=0, end_column=1, + law_headings=[]), False) + + def local_var_291(_: Any): raise EmptyError + local_var_288 = handle_default([], local_var_289, local_var_291) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=92, start_column=12, end_line=92, end_column=29, - law_headings=["Prologue"])) - ressources_menage_179 = log_variable_definition(["AllocationsFamiliales", - "ressources_ménage"], local_var_180) + start_line=92, start_column=12, end_line=92, end_column=29, + law_headings=["Prologue"])) + ressources_menage_287 = log_variable_definition(["AllocationsFamiliales", + "ressources_ménage"], local_var_288) try: try: - local_var_182 = residence_134(Unit()) + local_var_294 = residence_234(Unit()) except EmptyError: - if log_decision_taken(SourcePosition(filename="", start_line=0, - start_column=1, end_line=0, end_column=1, - law_headings=[]), False): - raise EmptyError - else: + def local_var_295(_: Any): + return log_decision_taken(SourcePosition(filename="", + start_line=0, start_column=1, end_line=0, end_column=1, + law_headings=[]), False) + + def local_var_297(_: Any): raise EmptyError + local_var_294 = handle_default([], local_var_295, local_var_297) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=93, start_column=12, end_line=93, end_column=21, - law_headings=["Prologue"])) - residence_181 = log_variable_definition(["AllocationsFamiliales", - "résidence"], local_var_182) + start_line=93, start_column=12, end_line=93, end_column=21, + law_headings=["Prologue"])) + residence_293 = log_variable_definition(["AllocationsFamiliales", + "résidence"], local_var_294) try: try: - local_var_184 = date_courante_135(Unit()) + local_var_300 = date_courante_235(Unit()) except EmptyError: - if log_decision_taken(SourcePosition(filename="", start_line=0, - start_column=1, end_line=0, end_column=1, - law_headings=[]), False): - raise EmptyError - else: + def local_var_301(_: Any): + return log_decision_taken(SourcePosition(filename="", + start_line=0, start_column=1, end_line=0, end_column=1, + law_headings=[]), False) + + def local_var_303(_: Any): raise EmptyError + local_var_300 = handle_default([], local_var_301, local_var_303) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=96, start_column=12, end_line=96, end_column=25, - law_headings=["Prologue"])) - date_courante_183 = log_variable_definition(["AllocationsFamiliales", - "date_courante"], local_var_184) + start_line=96, start_column=12, end_line=96, end_column=25, + law_headings=["Prologue"])) + date_courante_299 = log_variable_definition(["AllocationsFamiliales", + "date_courante"], local_var_300) try: try: - local_var_186 = enfants_a_charge_136(Unit()) + local_var_306 = enfants_a_charge_236(Unit()) except EmptyError: - if log_decision_taken(SourcePosition(filename="", start_line=0, - start_column=1, end_line=0, end_column=1, - law_headings=[]), False): - raise EmptyError - else: + def local_var_307(_: Any): + return log_decision_taken(SourcePosition(filename="", + start_line=0, start_column=1, end_line=0, end_column=1, + law_headings=[]), False) + + def local_var_309(_: Any): raise EmptyError + local_var_306 = handle_default([], local_var_307, local_var_309) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=99, start_column=12, end_line=99, end_column=28, - law_headings=["Prologue"])) - enfants_a_charge_185 = log_variable_definition(["AllocationsFamiliales", - "enfants_à_charge"], local_var_186) + start_line=99, start_column=12, end_line=99, end_column=28, + law_headings=["Prologue"])) + enfants_a_charge_305 = log_variable_definition(["AllocationsFamiliales", + "enfants_à_charge"], local_var_306) try: try: - local_var_188 = prise_en_compte_138(Unit()) + local_var_312 = prise_en_compte_238(Unit()) except EmptyError: - def local_var_188(param_189:Enfant): + def local_var_312(param_313: Enfant): try: - def local_var_222(_:Any): - match_arg_791 = param_189.prise_en_charge - if match_arg_791.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: - _ = match_arg_791.value - local_var_224 = False - elif match_arg_791.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: - _ = match_arg_791.value - local_var_224 = False - elif match_arg_791.code == PriseEnCharge_Code.EffectiveEtPermanente: - _ = match_arg_791.value - local_var_224 = True - elif match_arg_791.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: - _ = match_arg_791.value - local_var_224 = False - elif match_arg_791.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: - _ = match_arg_791.value - local_var_224 = False - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=184, start_column=5, - end_line=184, end_column=60, - law_headings=["Article L521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), local_var_224): + def local_var_362(_: Any): + def local_var_364(_: Any): + match_arg_1371 = param_313.prise_en_charge + if match_arg_1371.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: + _ = match_arg_1371.value + local_var_366 = False + elif match_arg_1371.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: + _ = match_arg_1371.value + local_var_366 = False + elif match_arg_1371.code == PriseEnCharge_Code.EffectiveEtPermanente: + _ = match_arg_1371.value + local_var_366 = True + elif match_arg_1371.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: + _ = match_arg_1371.value + local_var_366 = False + elif match_arg_1371.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: + _ = match_arg_1371.value + local_var_366 = False + return log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=184, start_column=5, + end_line=184, end_column=60, + law_headings=["Article L521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), local_var_366) + + def local_var_372(_: Any): return PriseEnCompte(PriseEnCompte_Code.Complete, - Unit()) - else: - raise EmptyError - def local_var_214(_:Any): - match_arg_792 = param_189.prise_en_charge - if match_arg_792.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: - _ = match_arg_792.value - local_var_216 = False - elif match_arg_792.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: - _ = match_arg_792.value - local_var_216 = True - elif match_arg_792.code == PriseEnCharge_Code.EffectiveEtPermanente: - _ = match_arg_792.value - local_var_216 = False - elif match_arg_792.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: - _ = match_arg_792.value - local_var_216 = False - elif match_arg_792.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: - _ = match_arg_792.value - local_var_216 = False - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=204, start_column=5, - end_line=204, end_column=69, - law_headings=["Article L521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), local_var_216): + Unit()) + return handle_default([], local_var_364, + local_var_372) + + def local_var_350(_: Any): + def local_var_352(_: Any): + match_arg_1372 = param_313.prise_en_charge + if match_arg_1372.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: + _ = match_arg_1372.value + local_var_354 = False + elif match_arg_1372.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: + _ = match_arg_1372.value + local_var_354 = True + elif match_arg_1372.code == PriseEnCharge_Code.EffectiveEtPermanente: + _ = match_arg_1372.value + local_var_354 = False + elif match_arg_1372.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: + _ = match_arg_1372.value + local_var_354 = False + elif match_arg_1372.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: + _ = match_arg_1372.value + local_var_354 = False + return log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=204, start_column=5, + end_line=204, end_column=69, + law_headings=["Article L521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), local_var_354) + + def local_var_360(_: Any): return PriseEnCompte(PriseEnCompte_Code.Complete, - Unit()) - else: - raise EmptyError - def local_var_206(_:Any): - match_arg_793 = param_189.prise_en_charge - if match_arg_793.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: - _ = match_arg_793.value - local_var_208 = True - elif match_arg_793.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: - _ = match_arg_793.value - local_var_208 = False - elif match_arg_793.code == PriseEnCharge_Code.EffectiveEtPermanente: - _ = match_arg_793.value - local_var_208 = False - elif match_arg_793.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: - _ = match_arg_793.value - local_var_208 = False - elif match_arg_793.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: - _ = match_arg_793.value - local_var_208 = False - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=214, start_column=5, - end_line=214, end_column=70, - law_headings=["Article L521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), local_var_208): + Unit()) + return handle_default([], local_var_352, + local_var_360) + + def local_var_338(_: Any): + def local_var_340(_: Any): + match_arg_1373 = param_313.prise_en_charge + if match_arg_1373.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: + _ = match_arg_1373.value + local_var_342 = True + elif match_arg_1373.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: + _ = match_arg_1373.value + local_var_342 = False + elif match_arg_1373.code == PriseEnCharge_Code.EffectiveEtPermanente: + _ = match_arg_1373.value + local_var_342 = False + elif match_arg_1373.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: + _ = match_arg_1373.value + local_var_342 = False + elif match_arg_1373.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: + _ = match_arg_1373.value + local_var_342 = False + return log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=214, start_column=5, + end_line=214, end_column=70, + law_headings=["Article L521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), local_var_342) + + def local_var_348(_: Any): return PriseEnCompte(PriseEnCompte_Code.Partagee, - Unit()) - else: - raise EmptyError - def local_var_198(_:Any): - match_arg_794 = param_189.prise_en_charge - if match_arg_794.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: - _ = match_arg_794.value - local_var_200 = False - elif match_arg_794.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: - _ = match_arg_794.value - local_var_200 = False - elif match_arg_794.code == PriseEnCharge_Code.EffectiveEtPermanente: - _ = match_arg_794.value - local_var_200 = False - elif match_arg_794.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: - _ = match_arg_794.value - local_var_200 = False - elif match_arg_794.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: - _ = match_arg_794.value - local_var_200 = True - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=253, start_column=5, - end_line=254, end_column=56, - law_headings=["Article L521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), local_var_200): + Unit()) + return handle_default([], local_var_340, + local_var_348) + + def local_var_326(_: Any): + def local_var_328(_: Any): + match_arg_1374 = param_313.prise_en_charge + if match_arg_1374.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: + _ = match_arg_1374.value + local_var_330 = False + elif match_arg_1374.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: + _ = match_arg_1374.value + local_var_330 = False + elif match_arg_1374.code == PriseEnCharge_Code.EffectiveEtPermanente: + _ = match_arg_1374.value + local_var_330 = False + elif match_arg_1374.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: + _ = match_arg_1374.value + local_var_330 = False + elif match_arg_1374.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: + _ = match_arg_1374.value + local_var_330 = True + return log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=253, start_column=5, + end_line=254, end_column=56, + law_headings=["Article L521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), local_var_330) + + def local_var_336(_: Any): return PriseEnCompte(PriseEnCompte_Code.Zero, - Unit()) - else: - raise EmptyError - def local_var_190(_:Any): - match_arg_795 = param_189.prise_en_charge - if match_arg_795.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: - _ = match_arg_795.value - local_var_192 = False - elif match_arg_795.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: - _ = match_arg_795.value - local_var_192 = False - elif match_arg_795.code == PriseEnCharge_Code.EffectiveEtPermanente: - _ = match_arg_795.value - local_var_192 = False - elif match_arg_795.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: - _ = match_arg_795.value - local_var_192 = True - elif match_arg_795.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: - _ = match_arg_795.value - local_var_192 = False - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=263, start_column=5, - end_line=264, end_column=48, - law_headings=["Article L521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), local_var_192): + Unit()) + return handle_default([], local_var_328, + local_var_336) + + def local_var_314(_: Any): + def local_var_316(_: Any): + match_arg_1375 = param_313.prise_en_charge + if match_arg_1375.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: + _ = match_arg_1375.value + local_var_318 = False + elif match_arg_1375.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: + _ = match_arg_1375.value + local_var_318 = False + elif match_arg_1375.code == PriseEnCharge_Code.EffectiveEtPermanente: + _ = match_arg_1375.value + local_var_318 = False + elif match_arg_1375.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: + _ = match_arg_1375.value + local_var_318 = True + elif match_arg_1375.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: + _ = match_arg_1375.value + local_var_318 = False + return log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=263, start_column=5, + end_line=264, end_column=48, + law_headings=["Article L521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), local_var_318) + + def local_var_324(_: Any): return PriseEnCompte(PriseEnCompte_Code.Complete, - Unit()) - else: - raise EmptyError - def local_var_230(_:Any): + Unit()) + return handle_default([], local_var_316, + local_var_324) + + def local_var_374(_: Any): return log_decision_taken(SourcePosition(filename="", - start_line=0, start_column=1, - end_line=0, end_column=1, - law_headings=[]), False) - def local_var_232(_:Any): + start_line=0, start_column=1, + end_line=0, end_column=1, + law_headings=[]), False) + + def local_var_376(_: Any): raise EmptyError - return handle_default([local_var_190, local_var_198, - local_var_206, local_var_214, local_var_222], - local_var_230, local_var_232) + return handle_default([local_var_314, local_var_326, + local_var_338, local_var_350, local_var_362], + local_var_374, local_var_376) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=102, start_column=12, end_line=102, - end_column=27, law_headings=["Prologue"])) + start_line=102, start_column=12, end_line=102, + end_column=27, law_headings=["Prologue"])) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=102, start_column=12, end_line=102, end_column=27, - law_headings=["Prologue"])) - prise_en_compte_187 = log_variable_definition(["AllocationsFamiliales", - "prise_en_compte"], local_var_188) + start_line=102, start_column=12, end_line=102, end_column=27, + law_headings=["Prologue"])) + prise_en_compte_311 = log_variable_definition(["AllocationsFamiliales", + "prise_en_compte"], local_var_312) try: try: - local_var_235 = versement_139(Unit()) + local_var_379 = versement_239(Unit()) except EmptyError: - def local_var_235(param_236:Enfant): + def local_var_379(param_380: Enfant): try: - def local_var_269(_:Any): - match_arg_796 = param_236.prise_en_charge - if match_arg_796.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: - _ = match_arg_796.value - local_var_271 = False - elif match_arg_796.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: - _ = match_arg_796.value - local_var_271 = False - elif match_arg_796.code == PriseEnCharge_Code.EffectiveEtPermanente: - _ = match_arg_796.value - local_var_271 = True - elif match_arg_796.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: - _ = match_arg_796.value - local_var_271 = False - elif match_arg_796.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: - _ = match_arg_796.value - local_var_271 = False - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=188, start_column=5, - end_line=188, end_column=60, - law_headings=["Article L521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), local_var_271): + def local_var_429(_: Any): + def local_var_431(_: Any): + match_arg_1376 = param_380.prise_en_charge + if match_arg_1376.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: + _ = match_arg_1376.value + local_var_433 = False + elif match_arg_1376.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: + _ = match_arg_1376.value + local_var_433 = False + elif match_arg_1376.code == PriseEnCharge_Code.EffectiveEtPermanente: + _ = match_arg_1376.value + local_var_433 = True + elif match_arg_1376.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: + _ = match_arg_1376.value + local_var_433 = False + elif match_arg_1376.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: + _ = match_arg_1376.value + local_var_433 = False + return log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=188, start_column=5, + end_line=188, end_column=60, + law_headings=["Article L521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), local_var_433) + + def local_var_439(_: Any): return VersementAllocations(VersementAllocations_Code.Normal, - Unit()) - else: - raise EmptyError - def local_var_261(_:Any): - match_arg_797 = param_236.prise_en_charge - if match_arg_797.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: - _ = match_arg_797.value - local_var_263 = False - elif match_arg_797.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: - _ = match_arg_797.value - local_var_263 = True - elif match_arg_797.code == PriseEnCharge_Code.EffectiveEtPermanente: - _ = match_arg_797.value - local_var_263 = False - elif match_arg_797.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: - _ = match_arg_797.value - local_var_263 = False - elif match_arg_797.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: - _ = match_arg_797.value - local_var_263 = False - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=208, start_column=5, - end_line=208, end_column=69, - law_headings=["Article L521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), local_var_263): + Unit()) + return handle_default([], local_var_431, + local_var_439) + + def local_var_417(_: Any): + def local_var_419(_: Any): + match_arg_1377 = param_380.prise_en_charge + if match_arg_1377.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: + _ = match_arg_1377.value + local_var_421 = False + elif match_arg_1377.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: + _ = match_arg_1377.value + local_var_421 = True + elif match_arg_1377.code == PriseEnCharge_Code.EffectiveEtPermanente: + _ = match_arg_1377.value + local_var_421 = False + elif match_arg_1377.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: + _ = match_arg_1377.value + local_var_421 = False + elif match_arg_1377.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: + _ = match_arg_1377.value + local_var_421 = False + return log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=208, start_column=5, + end_line=208, end_column=69, + law_headings=["Article L521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), local_var_421) + + def local_var_427(_: Any): return VersementAllocations(VersementAllocations_Code.Normal, - Unit()) - else: - raise EmptyError - def local_var_253(_:Any): - match_arg_798 = param_236.prise_en_charge - if match_arg_798.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: - _ = match_arg_798.value - local_var_255 = True - elif match_arg_798.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: - _ = match_arg_798.value - local_var_255 = False - elif match_arg_798.code == PriseEnCharge_Code.EffectiveEtPermanente: - _ = match_arg_798.value - local_var_255 = False - elif match_arg_798.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: - _ = match_arg_798.value - local_var_255 = False - elif match_arg_798.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: - _ = match_arg_798.value - local_var_255 = False - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=218, start_column=5, - end_line=218, end_column=70, - law_headings=["Article L521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), local_var_255): + Unit()) + return handle_default([], local_var_419, + local_var_427) + + def local_var_405(_: Any): + def local_var_407(_: Any): + match_arg_1378 = param_380.prise_en_charge + if match_arg_1378.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: + _ = match_arg_1378.value + local_var_409 = True + elif match_arg_1378.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: + _ = match_arg_1378.value + local_var_409 = False + elif match_arg_1378.code == PriseEnCharge_Code.EffectiveEtPermanente: + _ = match_arg_1378.value + local_var_409 = False + elif match_arg_1378.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: + _ = match_arg_1378.value + local_var_409 = False + elif match_arg_1378.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: + _ = match_arg_1378.value + local_var_409 = False + return log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=218, start_column=5, + end_line=218, end_column=70, + law_headings=["Article L521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), local_var_409) + + def local_var_415(_: Any): return VersementAllocations(VersementAllocations_Code.Normal, - Unit()) - else: - raise EmptyError - def local_var_245(_:Any): - match_arg_799 = param_236.prise_en_charge - if match_arg_799.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: - _ = match_arg_799.value - local_var_247 = False - elif match_arg_799.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: - _ = match_arg_799.value - local_var_247 = False - elif match_arg_799.code == PriseEnCharge_Code.EffectiveEtPermanente: - _ = match_arg_799.value - local_var_247 = False - elif match_arg_799.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: - _ = match_arg_799.value - local_var_247 = False - elif match_arg_799.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: - _ = match_arg_799.value - local_var_247 = True - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=258, start_column=5, - end_line=259, end_column=56, - law_headings=["Article L521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), local_var_247): + Unit()) + return handle_default([], local_var_407, + local_var_415) + + def local_var_393(_: Any): + def local_var_395(_: Any): + match_arg_1379 = param_380.prise_en_charge + if match_arg_1379.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: + _ = match_arg_1379.value + local_var_397 = False + elif match_arg_1379.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: + _ = match_arg_1379.value + local_var_397 = False + elif match_arg_1379.code == PriseEnCharge_Code.EffectiveEtPermanente: + _ = match_arg_1379.value + local_var_397 = False + elif match_arg_1379.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: + _ = match_arg_1379.value + local_var_397 = False + elif match_arg_1379.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: + _ = match_arg_1379.value + local_var_397 = True + return log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=258, start_column=5, + end_line=259, end_column=56, + law_headings=["Article L521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), local_var_397) + + def local_var_403(_: Any): return VersementAllocations(VersementAllocations_Code.AllocationVerseeAuxServicesSociaux, - Unit()) - else: - raise EmptyError - def local_var_237(_:Any): - match_arg_800 = param_236.prise_en_charge - if match_arg_800.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: - _ = match_arg_800.value - local_var_239 = False - elif match_arg_800.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: - _ = match_arg_800.value - local_var_239 = False - elif match_arg_800.code == PriseEnCharge_Code.EffectiveEtPermanente: - _ = match_arg_800.value - local_var_239 = False - elif match_arg_800.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: - _ = match_arg_800.value - local_var_239 = True - elif match_arg_800.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: - _ = match_arg_800.value - local_var_239 = False - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=269, start_column=5, - end_line=270, end_column=48, - law_headings=["Article L521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), local_var_239): + Unit()) + return handle_default([], local_var_395, + local_var_403) + + def local_var_381(_: Any): + def local_var_383(_: Any): + match_arg_1380 = param_380.prise_en_charge + if match_arg_1380.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: + _ = match_arg_1380.value + local_var_385 = False + elif match_arg_1380.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: + _ = match_arg_1380.value + local_var_385 = False + elif match_arg_1380.code == PriseEnCharge_Code.EffectiveEtPermanente: + _ = match_arg_1380.value + local_var_385 = False + elif match_arg_1380.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: + _ = match_arg_1380.value + local_var_385 = True + elif match_arg_1380.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: + _ = match_arg_1380.value + local_var_385 = False + return log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=269, start_column=5, + end_line=270, end_column=48, + law_headings=["Article L521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), local_var_385) + + def local_var_391(_: Any): return VersementAllocations(VersementAllocations_Code.Normal, - Unit()) - else: - raise EmptyError - def local_var_277(_:Any): + Unit()) + return handle_default([], local_var_383, + local_var_391) + + def local_var_441(_: Any): return log_decision_taken(SourcePosition(filename="", - start_line=0, start_column=1, - end_line=0, end_column=1, - law_headings=[]), False) - def local_var_279(_:Any): + start_line=0, start_column=1, + end_line=0, end_column=1, + law_headings=[]), False) + + def local_var_443(_: Any): raise EmptyError - return handle_default([local_var_237, local_var_245, - local_var_253, local_var_261, local_var_269], - local_var_277, local_var_279) + return handle_default([local_var_381, local_var_393, + local_var_405, local_var_417, local_var_429], + local_var_441, local_var_443) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=103, start_column=12, end_line=103, - end_column=21, law_headings=["Prologue"])) + start_line=103, start_column=12, end_line=103, + end_column=21, law_headings=["Prologue"])) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=103, start_column=12, end_line=103, end_column=21, - law_headings=["Prologue"])) - versement_234 = log_variable_definition(["AllocationsFamiliales", - "versement"], local_var_235) + start_line=103, start_column=12, end_line=103, end_column=21, + law_headings=["Prologue"])) + versement_378 = log_variable_definition(["AllocationsFamiliales", + "versement"], local_var_379) try: try: - local_var_282 = avait_enfant_a_charge_avant_1er_janvier_2012_151(Unit()) + local_var_446 = avait_enfant_a_charge_avant_1er_janvier_2012_251( + Unit()) except EmptyError: - if log_decision_taken(SourcePosition(filename="", start_line=0, - start_column=1, end_line=0, end_column=1, - law_headings=[]), True): - local_var_282 = False - else: - raise EmptyError + def local_var_447(_: Any): + return log_decision_taken(SourcePosition(filename="", + start_line=0, start_column=1, end_line=0, end_column=1, + law_headings=[]), True) + + def local_var_449(_: Any): + return False + local_var_446 = handle_default([], local_var_447, local_var_449) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=120, start_column=12, end_line=120, end_column=56, - law_headings=["Prologue"])) - avait_enfant_a_charge_avant_1er_janvier_2012_281 = log_variable_definition(["AllocationsFamiliales", - "avait_enfant_à_charge_avant_1er_janvier_2012"], local_var_282) + start_line=120, start_column=12, end_line=120, end_column=56, + law_headings=["Prologue"])) + avait_enfant_a_charge_avant_1er_janvier_2012_445 = log_variable_definition(["AllocationsFamiliales", + "avait_enfant_à_charge_avant_1er_janvier_2012"], local_var_446) try: try: - local_var_284 = nombre_enfants_l521_1_169(Unit()) + local_var_452 = nombre_enfants_l521_1_269(Unit()) except EmptyError: try: - local_var_284 = integer_of_string("3") + def local_var_453(_: Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=288, start_column=14, + end_line=288, end_column=35, + law_headings=["Article D521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), True) + + def local_var_455(_: Any): + return integer_of_string("3") + local_var_452 = handle_default([], local_var_453, + local_var_455) except EmptyError: raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=151, start_column=12, end_line=151, end_column=33, - law_headings=["Prologue"])) - nombre_enfants_l521_1_283 = log_variable_definition(["AllocationsFamiliales", - "nombre_enfants_l521_1"], local_var_284) + start_line=151, start_column=12, end_line=151, end_column=33, + law_headings=["Prologue"])) + nombre_enfants_l521_1_451 = log_variable_definition(["AllocationsFamiliales", + "nombre_enfants_l521_1"], local_var_452) try: try: - local_var_286 = nombre_enfants_alinea_2_l521_3_171(Unit()) + local_var_458 = nombre_enfants_alinea_2_l521_3_271(Unit()) except EmptyError: try: - local_var_286 = integer_of_string("3") + def local_var_459(_: Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_R.catala_fr", + start_line=64, start_column=14, + end_line=64, end_column=44, + law_headings=["Article R521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets en Conseil d'Etat", + "Code de la sécurité sociale"]), True) + + def local_var_461(_: Any): + return integer_of_string("3") + local_var_458 = handle_default([], local_var_459, + local_var_461) except EmptyError: raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=153, start_column=12, end_line=153, end_column=42, - law_headings=["Prologue"])) - nombre_enfants_alinea_2_l521_3_285 = log_variable_definition(["AllocationsFamiliales", - "nombre_enfants_alinéa_2_l521_3"], local_var_286) - def local_var_288(_:Unit): + start_line=153, start_column=12, end_line=153, end_column=42, + law_headings=["Prologue"])) + nombre_enfants_alinea_2_l521_3_457 = log_variable_definition(["AllocationsFamiliales", + "nombre_enfants_alinéa_2_l521_3"], local_var_458) + + def local_var_464(_: Unit): raise EmptyError - result_287 = log_end_call(["AllocationsFamiliales", "version_avril_2008", - "AllocationFamilialesAvril2008"], - log_begin_call(["AllocationsFamiliales", "version_avril_2008", - "AllocationFamilialesAvril2008"], allocation_familiales_avril2008, - AllocationFamilialesAvril2008In(age_minimum_alinea_1_l521_3_in = local_var_288))) - version_avril_2008_dot_age_minimum_alinea_1_l521_3_290 = result_287.age_minimum_alinea_1_l521_3_out - def local_var_292(_:Unit): + result_463 = log_end_call(["AllocationsFamiliales", "version_avril_2008", + "AllocationFamilialesAvril2008"], + log_begin_call(["AllocationsFamiliales", "version_avril_2008", + "AllocationFamilialesAvril2008"], allocation_familiales_avril2008, + AllocationFamilialesAvril2008In(age_minimum_alinea_1_l521_3_in=local_var_464))) + version_avril_2008_dot_age_minimum_alinea_1_l521_3_466 = result_463.age_minimum_alinea_1_l521_3_out + + def local_var_468(_: Unit): try: - local_var_294 = date_courante_183 + def local_var_471(_: Any): + return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", + start_line=161, start_column=14, + end_line=161, end_column=50, + law_headings=["Prologue"]), True) + + def local_var_473(_: Any): + return date_courante_299 + local_var_470 = handle_default([], local_var_471, local_var_473) except EmptyError: raise EmptyError return log_variable_definition(["AllocationsFamiliales", - "prestations_familiales.date_courante"], local_var_294) - prestations_familiales_dot_date_courante_291 = local_var_292 - def local_var_296(_:Unit): + "prestations_familiales.date_courante"], local_var_470) + prestations_familiales_dot_date_courante_467 = local_var_468 + + def local_var_476(_: Unit): try: - local_var_298 = ElementPrestationsFamiliales(ElementPrestationsFamiliales_Code.AllocationsFamiliales, - Unit()) + def local_var_479(_: Any): + return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", + start_line=159, start_column=14, + end_line=159, end_column=56, + law_headings=["Prologue"]), True) + + def local_var_481(_: Any): + return ElementPrestationsFamiliales(ElementPrestationsFamiliales_Code.AllocationsFamiliales, + Unit()) + local_var_478 = handle_default([], local_var_479, local_var_481) except EmptyError: raise EmptyError return log_variable_definition(["AllocationsFamiliales", - "prestations_familiales.prestation_courante"], local_var_298) - prestations_familiales_dot_prestation_courante_295 = local_var_296 - def local_var_300(_:Unit): + "prestations_familiales.prestation_courante"], local_var_478) + prestations_familiales_dot_prestation_courante_475 = local_var_476 + + def local_var_484(_: Unit): try: - local_var_302 = residence_181 + def local_var_487(_: Any): + return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", + start_line=163, start_column=14, + end_line=163, end_column=46, + law_headings=["Prologue"]), True) + + def local_var_489(_: Any): + return residence_293 + local_var_486 = handle_default([], local_var_487, local_var_489) except EmptyError: raise EmptyError return log_variable_definition(["AllocationsFamiliales", - "prestations_familiales.résidence"], local_var_302) - prestations_familiales_dot_residence_299 = local_var_300 - def local_var_304(_:Unit): + "prestations_familiales.résidence"], local_var_486) + prestations_familiales_dot_residence_483 = local_var_484 + + def local_var_492(_: Unit): raise EmptyError - def local_var_306(_:Unit): + + def local_var_494(_: Unit): raise EmptyError - def local_var_308(_:Unit): + + def local_var_496(_: Unit): raise EmptyError - def local_var_310(_:Unit): + + def local_var_498(_: Unit): raise EmptyError - def local_var_312(_:Unit): + + def local_var_500(_: Unit): raise EmptyError - def local_var_314(_:Unit): + + def local_var_502(_: Unit): raise EmptyError - result_303 = log_end_call(["AllocationsFamiliales", - "prestations_familiales", "PrestationsFamiliales"], - log_begin_call(["AllocationsFamiliales", "prestations_familiales", - "PrestationsFamiliales"], prestations_familiales, - PrestationsFamilialesIn(droit_ouvert_in = local_var_304, - conditions_hors_age_in = local_var_306, - plafond_l512_3_2_in = local_var_308, age_l512_3_2_in = local_var_310, - regime_outre_mer_l751_1_in = local_var_312, - date_courante_in = prestations_familiales_dot_date_courante_291, - prestation_courante_in = prestations_familiales_dot_prestation_courante_295, - residence_in = prestations_familiales_dot_residence_299, - base_mensuelle_in = local_var_314))) - prestations_familiales_dot_droit_ouvert_316 = result_303.droit_ouvert_out - prestations_familiales_dot_conditions_hors_age_317 = result_303.conditions_hors_age_out - prestations_familiales_dot_plafond_l512_3_2_318 = result_303.plafond_l512_3_2_out - prestations_familiales_dot_age_l512_3_2_319 = result_303.age_l512_3_2_out - prestations_familiales_dot_regime_outre_mer_l751_1_320 = result_303.regime_outre_mer_l751_1_out - prestations_familiales_dot_date_courante_321 = result_303.date_courante_out - prestations_familiales_dot_prestation_courante_322 = result_303.prestation_courante_out - prestations_familiales_dot_residence_323 = result_303.residence_out - prestations_familiales_dot_base_mensuelle_324 = result_303.base_mensuelle_out - def local_var_326(_:Unit): + result_491 = log_end_call(["AllocationsFamiliales", + "prestations_familiales", "PrestationsFamiliales"], + log_begin_call(["AllocationsFamiliales", "prestations_familiales", + "PrestationsFamiliales"], prestations_familiales, + PrestationsFamilialesIn(droit_ouvert_in=local_var_492, + conditions_hors_age_in=local_var_494, + plafond_l512_3_2_in=local_var_496, age_l512_3_2_in=local_var_498, + regime_outre_mer_l751_1_in=local_var_500, + date_courante_in=prestations_familiales_dot_date_courante_467, + prestation_courante_in=prestations_familiales_dot_prestation_courante_475, + residence_in=prestations_familiales_dot_residence_483, + base_mensuelle_in=local_var_502))) + prestations_familiales_dot_droit_ouvert_504 = result_491.droit_ouvert_out + prestations_familiales_dot_conditions_hors_age_505 = result_491.conditions_hors_age_out + prestations_familiales_dot_plafond_l512_3_2_506 = result_491.plafond_l512_3_2_out + prestations_familiales_dot_age_l512_3_2_507 = result_491.age_l512_3_2_out + prestations_familiales_dot_regime_outre_mer_l751_1_508 = result_491.regime_outre_mer_l751_1_out + prestations_familiales_dot_date_courante_509 = result_491.date_courante_out + prestations_familiales_dot_prestation_courante_510 = result_491.prestation_courante_out + prestations_familiales_dot_residence_511 = result_491.residence_out + prestations_familiales_dot_base_mensuelle_512 = result_491.base_mensuelle_out + + def local_var_514(_: Unit): try: - local_var_328 = enfants_a_charge_185 + def local_var_517(_: Any): + return log_decision_taken(SourcePosition(filename="./epilogue.catala_fr", + start_line=32, start_column=14, + end_line=32, end_column=40, + law_headings=["Règles diverses", "Épilogue", + "Décrets divers"]), True) + + def local_var_519(_: Any): + return enfants_a_charge_305 + local_var_516 = handle_default([], local_var_517, local_var_519) except EmptyError: raise EmptyError return log_variable_definition(["AllocationsFamiliales", - "enfant_le_plus_âgé.enfants"], local_var_328) - enfant_le_plus_age_dot_enfants_325 = local_var_326 - def local_var_330(_:Unit): + "enfant_le_plus_âgé.enfants"], local_var_516) + enfant_le_plus_age_dot_enfants_513 = local_var_514 + + def local_var_522(_: Unit): raise EmptyError - result_329 = log_end_call(["AllocationsFamiliales", - "enfant_le_plus_âgé", "EnfantLePlusÂgé"], - log_begin_call(["AllocationsFamiliales", "enfant_le_plus_âgé", - "EnfantLePlusÂgé"], enfant_le_plus_age, - EnfantLePlusAgeIn(enfants_in = enfant_le_plus_age_dot_enfants_325, - le_plus_age_in = local_var_330))) - enfant_le_plus_age_dot_enfants_332 = result_329.enfants_out - enfant_le_plus_age_dot_le_plus_age_333 = result_329.le_plus_age_out + result_521 = log_end_call(["AllocationsFamiliales", + "enfant_le_plus_âgé", "EnfantLePlusÂgé"], + log_begin_call(["AllocationsFamiliales", "enfant_le_plus_âgé", + "EnfantLePlusÂgé"], enfant_le_plus_age, + EnfantLePlusAgeIn(enfants_in=enfant_le_plus_age_dot_enfants_513, + le_plus_age_in=local_var_522))) + enfant_le_plus_age_dot_enfants_524 = result_521.enfants_out + enfant_le_plus_age_dot_le_plus_age_525 = result_521.le_plus_age_out try: try: - local_var_335 = age_minimum_alinea_1_l521_3_170(Unit()) + local_var_527 = age_minimum_alinea_1_l521_3_270(Unit()) except EmptyError: - def local_var_335(param_336:Enfant): + def local_var_527(param_528: Enfant): try: try: try: - if log_decision_taken(SourcePosition(filename="./securite_sociale_R.catala_fr", - start_line=83, start_column=19, - end_line=83, end_column=69, - law_headings=["Article R521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets en Conseil d'Etat", - "Code de la sécurité sociale"]), ((param_336.date_de_naissance + - duration_of_numbers(11,0,0)) <= - date_of_numbers(2008,4,30))): - return version_avril_2008_dot_age_minimum_alinea_1_l521_3_290 - else: - raise EmptyError + def local_var_529(_: Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_R.catala_fr", + start_line=83, start_column=19, + end_line=83, end_column=69, + law_headings=["Article R521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets en Conseil d'Etat", + "Code de la sécurité sociale"]), ((param_528.date_de_naissance + + duration_of_numbers(11, 0, 0)) <= + date_of_numbers(2008, 4, 30))) + + def local_var_531(_: Any): + return version_avril_2008_dot_age_minimum_alinea_1_l521_3_466 + return handle_default([], local_var_529, + local_var_531) except EmptyError: return integer_of_string("14") except EmptyError: raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=152, start_column=12, end_line=152, - end_column=39, law_headings=["Prologue"])) + start_line=152, start_column=12, end_line=152, + end_column=39, law_headings=["Prologue"])) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=152, start_column=12, end_line=152, end_column=39, - law_headings=["Prologue"])) - age_minimum_alinea_1_l521_3_334 = log_variable_definition(["AllocationsFamiliales", - "âge_minimum_alinéa_1_l521_3"], local_var_335) + start_line=152, start_column=12, end_line=152, end_column=39, + law_headings=["Prologue"])) + age_minimum_alinea_1_l521_3_526 = log_variable_definition(["AllocationsFamiliales", + "âge_minimum_alinéa_1_l521_3"], local_var_527) try: try: - local_var_338 = enfants_a_charge_droit_ouvert_prestation_familiale_137(Unit()) + local_var_534 = enfants_a_charge_droit_ouvert_prestation_familiale_237( + Unit()) except EmptyError: try: - def local_var_339(enfant_340:Any): - return log_end_call(["PrestationsFamiliales", - "droit_ouvert"], - log_variable_definition(["PrestationsFamiliales", - "droit_ouvert", "output"], - log_begin_call(["PrestationsFamiliales", - "droit_ouvert"], - prestations_familiales_dot_droit_ouvert_316, - log_variable_definition(["PrestationsFamiliales", - "droit_ouvert", "input"], enfant_340)))) - local_var_338 = list_filter(local_var_339, - enfants_a_charge_185) + def local_var_535(_: Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=75, start_column=14, + end_line=75, end_column=64, + law_headings=["Article L512-3", + "Chapitre 2 : Champ d'application", + "Titre 1 : Champ d'application - Généralités", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), True) + + def local_var_537(_: Any): + def local_var_539(enfant_540: Any): + return log_end_call(["PrestationsFamiliales", + "droit_ouvert"], + log_variable_definition(["PrestationsFamiliales", + "droit_ouvert", "output"], + log_begin_call(["PrestationsFamiliales", + "droit_ouvert"], + prestations_familiales_dot_droit_ouvert_504, + log_variable_definition(["PrestationsFamiliales", + "droit_ouvert", "input"], enfant_540)))) + return list_filter(local_var_539, enfants_a_charge_305) + local_var_534 = handle_default([], local_var_535, + local_var_537) except EmptyError: raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=100, start_column=12, end_line=100, end_column=62, - law_headings=["Prologue"])) - enfants_a_charge_droit_ouvert_prestation_familiale_337 = log_variable_definition(["AllocationsFamiliales", - "enfants_à_charge_droit_ouvert_prestation_familiale"], - local_var_338) + start_line=100, start_column=12, end_line=100, end_column=62, + law_headings=["Prologue"])) + enfants_a_charge_droit_ouvert_prestation_familiale_533 = log_variable_definition(["AllocationsFamiliales", + "enfants_à_charge_droit_ouvert_prestation_familiale"], + local_var_534) try: try: - local_var_342 = est_enfant_le_plus_age_172(Unit()) + local_var_542 = est_enfant_le_plus_age_272(Unit()) except EmptyError: - def local_var_342(param_343:Enfant): + def local_var_542(param_543: Enfant): try: try: - return (enfant_le_plus_age_dot_le_plus_age_333 == - param_343) + def local_var_544(_: Any): + return log_decision_taken(SourcePosition(filename="./epilogue.catala_fr", + start_line=33, start_column=14, + end_line=33, end_column=36, + law_headings=["Règles diverses", + "Épilogue", "Décrets divers"]), True) + + def local_var_546(_: Any): + return (enfant_le_plus_age_dot_le_plus_age_525 == + param_543) + return handle_default([], local_var_544, + local_var_546) except EmptyError: raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=154, start_column=12, end_line=154, - end_column=34, law_headings=["Prologue"])) + start_line=154, start_column=12, end_line=154, + end_column=34, law_headings=["Prologue"])) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=154, start_column=12, end_line=154, end_column=34, - law_headings=["Prologue"])) - est_enfant_le_plus_age_341 = log_variable_definition(["AllocationsFamiliales", - "est_enfant_le_plus_âgé"], local_var_342) + start_line=154, start_column=12, end_line=154, end_column=34, + law_headings=["Prologue"])) + est_enfant_le_plus_age_541 = log_variable_definition(["AllocationsFamiliales", + "est_enfant_le_plus_âgé"], local_var_542) try: try: - local_var_345 = plafond__i_i_d521_3_174(Unit()) + local_var_549 = plafond__i_i_d521_3_274(Unit()) except EmptyError: try: - def local_var_352(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=94, start_column=5, - end_line=94, end_column=69, - law_headings=["Circulaire interministérielle N° DSS/SD2B/2017/352 du 22 décembre 2017 relative à la revalorisation au 1er janvier 2018 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", - "Montant des plafonds de ressources", - "Décrets divers"]), ((date_courante_183 >= - date_of_numbers(2018,1,1)) and (date_courante_183 <= - date_of_numbers(2018,12,31)))): + def local_var_568(_: Any): + def local_var_570(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=94, start_column=5, + end_line=94, end_column=69, + law_headings=["Circulaire interministérielle N° DSS/SD2B/2017/352 du 22 décembre 2017 relative à la revalorisation au 1er janvier 2018 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", + "Montant des plafonds de ressources", + "Décrets divers"]), ((date_courante_299 >= + date_of_numbers(2018, 1, 1)) and + (date_courante_299 <= + date_of_numbers(2018, 12, 31)))) + + def local_var_572(_: Any): return (money_of_cents_string("7877000") + - (money_of_cents_string("562800") * - decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337)))) - else: - raise EmptyError - def local_var_350(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=127, start_column=5, - end_line=127, end_column=69, - law_headings=["Instruction interministérielle n° DSS/SD2B/2018/279 du 17 décembre 2018 relative à la revalorisation au 1er janvier 2019 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", - "Montant des plafonds de ressources", - "Décrets divers"]), ((date_courante_183 >= - date_of_numbers(2019,1,1)) and (date_courante_183 <= - date_of_numbers(2019,12,31)))): + (money_of_cents_string("562800") * + decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533)))) + return handle_default([], local_var_570, local_var_572) + + def local_var_562(_: Any): + def local_var_564(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=127, start_column=5, + end_line=127, end_column=69, + law_headings=["Instruction interministérielle n° DSS/SD2B/2018/279 du 17 décembre 2018 relative à la revalorisation au 1er janvier 2019 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", + "Montant des plafonds de ressources", + "Décrets divers"]), ((date_courante_299 >= + date_of_numbers(2019, 1, 1)) and + (date_courante_299 <= + date_of_numbers(2019, 12, 31)))) + + def local_var_566(_: Any): return (money_of_cents_string("7955800") + - (money_of_cents_string("568400") * - decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337)))) - else: - raise EmptyError - def local_var_348(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=160, start_column=5, - end_line=160, end_column=69, - law_headings=["Instruction interministerielle no DSS/SD2B/2019/261 du 18 décembre 2019 relative à la revalorisation au 1er janvier 2020 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à La Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", - "Montant des plafonds de ressources", - "Décrets divers"]), ((date_courante_183 >= - date_of_numbers(2020,1,1)) and (date_courante_183 <= - date_of_numbers(2020,12,31)))): + (money_of_cents_string("568400") * + decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533)))) + return handle_default([], local_var_564, local_var_566) + + def local_var_556(_: Any): + def local_var_558(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=160, start_column=5, + end_line=160, end_column=69, + law_headings=["Instruction interministerielle no DSS/SD2B/2019/261 du 18 décembre 2019 relative à la revalorisation au 1er janvier 2020 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à La Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", + "Montant des plafonds de ressources", + "Décrets divers"]), ((date_courante_299 >= + date_of_numbers(2020, 1, 1)) and + (date_courante_299 <= + date_of_numbers(2020, 12, 31)))) + + def local_var_560(_: Any): return (money_of_cents_string("8083100") + - (money_of_cents_string("577500") * - decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337)))) - else: - raise EmptyError - def local_var_346(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=196, start_column=5, - end_line=196, end_column=69, - law_headings=["Article 1", - "Arrêté du 14 décembre 2020 relatif au montant des plafonds de ressources de certaines prestations familiales et aux tranches du barème applicable au recouvrement des indus et à la saisie des prestations", - "Montant des plafonds de ressources", - "Décrets divers"]), ((date_courante_183 >= - date_of_numbers(2021,1,1)) and (date_courante_183 <= - date_of_numbers(2021,12,31)))): + (money_of_cents_string("577500") * + decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533)))) + return handle_default([], local_var_558, local_var_560) + + def local_var_550(_: Any): + def local_var_552(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=196, start_column=5, + end_line=196, end_column=69, + law_headings=["Article 1", + "Arrêté du 14 décembre 2020 relatif au montant des plafonds de ressources de certaines prestations familiales et aux tranches du barème applicable au recouvrement des indus et à la saisie des prestations", + "Montant des plafonds de ressources", + "Décrets divers"]), ((date_courante_299 >= + date_of_numbers(2021, 1, 1)) and + (date_courante_299 <= + date_of_numbers(2021, 12, 31)))) + + def local_var_554(_: Any): return (money_of_cents_string("8155800") + - (money_of_cents_string("582700") * - decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337)))) - else: - raise EmptyError - def local_var_354(_:Any): + (money_of_cents_string("582700") * + decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533)))) + return handle_default([], local_var_552, local_var_554) + + def local_var_574(_: Any): return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=308, start_column=14, - end_line=308, end_column=31, - law_headings=["Article D521-3", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), True) - def local_var_356(_:Any): + start_line=308, start_column=14, + end_line=308, end_column=31, + law_headings=["Article D521-3", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), True) + + def local_var_576(_: Any): return (money_of_cents_string("7830000") + - (money_of_cents_string("559500") * - decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337)))) - local_var_345 = handle_default([local_var_346, local_var_348, - local_var_350, local_var_352], local_var_354, - local_var_356) + (money_of_cents_string("559500") * + decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533)))) + local_var_549 = handle_default([local_var_550, local_var_556, + local_var_562, local_var_568], local_var_574, + local_var_576) except EmptyError: raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=156, start_column=12, end_line=156, end_column=29, - law_headings=["Prologue"])) - plafond__i_i_d521_3_344 = log_variable_definition(["AllocationsFamiliales", - "plafond_II_d521_3"], local_var_345) + start_line=156, start_column=12, end_line=156, end_column=29, + law_headings=["Prologue"])) + plafond__i_i_d521_3_548 = log_variable_definition(["AllocationsFamiliales", + "plafond_II_d521_3"], local_var_549) try: try: - local_var_359 = plafond__i_d521_3_173(Unit()) + local_var_579 = plafond__i_d521_3_273(Unit()) except EmptyError: try: - def local_var_366(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=87, start_column=5, - end_line=87, end_column=69, - law_headings=["Circulaire interministérielle N° DSS/SD2B/2017/352 du 22 décembre 2017 relative à la revalorisation au 1er janvier 2018 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", - "Montant des plafonds de ressources", - "Décrets divers"]), ((date_courante_183 >= - date_of_numbers(2018,1,1)) and (date_courante_183 <= - date_of_numbers(2018,12,31)))): + def local_var_598(_: Any): + def local_var_600(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=87, start_column=5, + end_line=87, end_column=69, + law_headings=["Circulaire interministérielle N° DSS/SD2B/2017/352 du 22 décembre 2017 relative à la revalorisation au 1er janvier 2018 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", + "Montant des plafonds de ressources", + "Décrets divers"]), ((date_courante_299 >= + date_of_numbers(2018, 1, 1)) and + (date_courante_299 <= + date_of_numbers(2018, 12, 31)))) + + def local_var_602(_: Any): return (money_of_cents_string("5628600") + - (money_of_cents_string("562800") * - decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337)))) - else: - raise EmptyError - def local_var_364(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=120, start_column=5, - end_line=120, end_column=69, - law_headings=["Instruction interministérielle n° DSS/SD2B/2018/279 du 17 décembre 2018 relative à la revalorisation au 1er janvier 2019 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", - "Montant des plafonds de ressources", - "Décrets divers"]), ((date_courante_183 >= - date_of_numbers(2019,1,1)) and (date_courante_183 <= - date_of_numbers(2019,12,31)))): + (money_of_cents_string("562800") * + decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533)))) + return handle_default([], local_var_600, local_var_602) + + def local_var_592(_: Any): + def local_var_594(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=120, start_column=5, + end_line=120, end_column=69, + law_headings=["Instruction interministérielle n° DSS/SD2B/2018/279 du 17 décembre 2018 relative à la revalorisation au 1er janvier 2019 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", + "Montant des plafonds de ressources", + "Décrets divers"]), ((date_courante_299 >= + date_of_numbers(2019, 1, 1)) and + (date_courante_299 <= + date_of_numbers(2019, 12, 31)))) + + def local_var_596(_: Any): return (money_of_cents_string("5684900") + - (money_of_cents_string("568400") * - decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337)))) - else: - raise EmptyError - def local_var_362(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=153, start_column=5, - end_line=153, end_column=69, - law_headings=["Instruction interministerielle no DSS/SD2B/2019/261 du 18 décembre 2019 relative à la revalorisation au 1er janvier 2020 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à La Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", - "Montant des plafonds de ressources", - "Décrets divers"]), ((date_courante_183 >= - date_of_numbers(2020,1,1)) and (date_courante_183 <= - date_of_numbers(2020,12,31)))): + (money_of_cents_string("568400") * + decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533)))) + return handle_default([], local_var_594, local_var_596) + + def local_var_586(_: Any): + def local_var_588(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=153, start_column=5, + end_line=153, end_column=69, + law_headings=["Instruction interministerielle no DSS/SD2B/2019/261 du 18 décembre 2019 relative à la revalorisation au 1er janvier 2020 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à La Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", + "Montant des plafonds de ressources", + "Décrets divers"]), ((date_courante_299 >= + date_of_numbers(2020, 1, 1)) and + (date_courante_299 <= + date_of_numbers(2020, 12, 31)))) + + def local_var_590(_: Any): return (money_of_cents_string("5775900") + - (money_of_cents_string("577500") * - decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337)))) - else: - raise EmptyError - def local_var_360(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=180, start_column=5, - end_line=180, end_column=69, - law_headings=["Article 1", - "Arrêté du 14 décembre 2020 relatif au montant des plafonds de ressources de certaines prestations familiales et aux tranches du barème applicable au recouvrement des indus et à la saisie des prestations", - "Montant des plafonds de ressources", - "Décrets divers"]), ((date_courante_183 >= - date_of_numbers(2021,1,1)) and (date_courante_183 <= - date_of_numbers(2021,12,31)))): + (money_of_cents_string("577500") * + decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533)))) + return handle_default([], local_var_588, local_var_590) + + def local_var_580(_: Any): + def local_var_582(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=180, start_column=5, + end_line=180, end_column=69, + law_headings=["Article 1", + "Arrêté du 14 décembre 2020 relatif au montant des plafonds de ressources de certaines prestations familiales et aux tranches du barème applicable au recouvrement des indus et à la saisie des prestations", + "Montant des plafonds de ressources", + "Décrets divers"]), ((date_courante_299 >= + date_of_numbers(2021, 1, 1)) and + (date_courante_299 <= + date_of_numbers(2021, 12, 31)))) + + def local_var_584(_: Any): return (money_of_cents_string("5827900") + - (money_of_cents_string("582700") * - decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337)))) - else: - raise EmptyError - def local_var_368(_:Any): + (money_of_cents_string("582700") * + decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533)))) + return handle_default([], local_var_582, local_var_584) + + def local_var_604(_: Any): return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=298, start_column=14, - end_line=298, end_column=30, - law_headings=["Article D521-3", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), True) - def local_var_370(_:Any): + start_line=298, start_column=14, + end_line=298, end_column=30, + law_headings=["Article D521-3", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), True) + + def local_var_606(_: Any): return (money_of_cents_string("5595000") + - (money_of_cents_string("559500") * - decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337)))) - local_var_359 = handle_default([local_var_360, local_var_362, - local_var_364, local_var_366], local_var_368, - local_var_370) + (money_of_cents_string("559500") * + decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533)))) + local_var_579 = handle_default([local_var_580, local_var_586, + local_var_592, local_var_598], local_var_604, + local_var_606) except EmptyError: raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=155, start_column=12, end_line=155, end_column=28, - law_headings=["Prologue"])) - plafond__i_d521_3_358 = log_variable_definition(["AllocationsFamiliales", - "plafond_I_d521_3"], local_var_359) + start_line=155, start_column=12, end_line=155, end_column=28, + law_headings=["Prologue"])) + plafond__i_d521_3_578 = log_variable_definition(["AllocationsFamiliales", + "plafond_I_d521_3"], local_var_579) try: try: - local_var_373 = droit_ouvert_complement_164(Unit()) + local_var_609 = droit_ouvert_complement_264(Unit()) except EmptyError: try: try: - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=426, start_column=5, - end_line=427, end_column=71, - law_headings=["Article L755-12", - "Chapitre 5 : Prestations familiales et prestations assimilées", - "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin", - "Livre 7 : Régimes divers - Dispositions diverses", - "Partie législative", - "Code de la sécurité sociale"]), (prestations_familiales_dot_regime_outre_mer_l751_1_320 and - (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) == - integer_of_string("1")))): - local_var_373 = False - else: - raise EmptyError + def local_var_610(_: Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=426, start_column=5, + end_line=427, end_column=71, + law_headings=["Article L755-12", + "Chapitre 5 : Prestations familiales et prestations assimilées", + "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin", + "Livre 7 : Régimes divers - Dispositions diverses", + "Partie législative", + "Code de la sécurité sociale"]), (prestations_familiales_dot_regime_outre_mer_l751_1_508 and + (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) == + integer_of_string("1")))) + + def local_var_612(_: Any): + return False + local_var_609 = handle_default([], local_var_610, + local_var_612) except EmptyError: - local_var_373 = True + local_var_609 = True except EmptyError: - local_var_373 = False + local_var_609 = False except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=139, start_column=12, end_line=139, end_column=35, - law_headings=["Prologue"])) - droit_ouvert_complement_372 = log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_complément"], local_var_373) + start_line=139, start_column=12, end_line=139, end_column=35, + law_headings=["Prologue"])) + droit_ouvert_complement_608 = log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_complément"], local_var_609) try: try: - local_var_375 = droit_ouvert_forfaitaire_156(Unit()) + local_var_615 = droit_ouvert_forfaitaire_256(Unit()) except EmptyError: - def local_var_375(param_376:Enfant): + def local_var_615(param_616: Enfant): try: try: try: - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=420, start_column=6, - end_line=421, end_column=72, - law_headings=["Article L755-12", - "Chapitre 5 : Prestations familiales et prestations assimilées", - "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin", - "Livre 7 : Régimes divers - Dispositions diverses", - "Partie législative", - "Code de la sécurité sociale"]), (prestations_familiales_dot_regime_outre_mer_l751_1_320 and - (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) == - integer_of_string("1")))): + def local_var_617(_: Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=420, start_column=6, + end_line=421, end_column=72, + law_headings=["Article L755-12", + "Chapitre 5 : Prestations familiales et prestations assimilées", + "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin", + "Livre 7 : Régimes divers - Dispositions diverses", + "Partie législative", + "Code de la sécurité sociale"]), (prestations_familiales_dot_regime_outre_mer_l751_1_508 and + (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) == + integer_of_string("1")))) + + def local_var_619(_: Any): return False - else: - raise EmptyError + return handle_default([], local_var_617, + local_var_619) except EmptyError: if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=119, start_column=5, - end_line=125, end_column=59, - law_headings=["Article L521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), ((list_length(enfants_a_charge_185) >= - nombre_enfants_alinea_2_l521_3_285) and - ((param_376.age == - prestations_familiales_dot_age_l512_3_2_319) and - (param_376.a_deja_ouvert_droit_aux_allocations_familiales and - log_end_call(["PrestationsFamiliales", - "conditions_hors_âge"], - log_variable_definition(["PrestationsFamiliales", - "conditions_hors_âge", "output"], - log_begin_call(["PrestationsFamiliales", - "conditions_hors_âge"], - prestations_familiales_dot_conditions_hors_age_317, - log_variable_definition(["PrestationsFamiliales", - "conditions_hors_âge", "input"], - param_376)))))))): + start_line=119, start_column=5, + end_line=125, end_column=59, + law_headings=["Article L521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), ((list_length(enfants_a_charge_305) >= + nombre_enfants_alinea_2_l521_3_457) and + ((param_616.age == + prestations_familiales_dot_age_l512_3_2_507) and + (param_616.a_deja_ouvert_droit_aux_allocations_familiales and + log_end_call(["PrestationsFamiliales", + "conditions_hors_âge"], + log_variable_definition(["PrestationsFamiliales", + "conditions_hors_âge", "output"], + log_begin_call(["PrestationsFamiliales", + "conditions_hors_âge"], + prestations_familiales_dot_conditions_hors_age_505, + log_variable_definition(["PrestationsFamiliales", + "conditions_hors_âge", "input"], + param_616)))))))): return True else: raise EmptyError @@ -2338,868 +2679,1084 @@ def local_var_375(param_376:Enfant): return False except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=127, start_column=12, end_line=127, - end_column=36, law_headings=["Prologue"])) + start_line=127, start_column=12, end_line=127, + end_column=36, law_headings=["Prologue"])) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=127, start_column=12, end_line=127, end_column=36, - law_headings=["Prologue"])) - droit_ouvert_forfaitaire_374 = log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_forfaitaire"], local_var_375) + start_line=127, start_column=12, end_line=127, end_column=36, + law_headings=["Prologue"])) + droit_ouvert_forfaitaire_614 = log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_forfaitaire"], local_var_615) try: try: - local_var_378 = montant_initial_base_quatrieme_enfant_et_plus_mayotte_155(Unit()) + local_var_622 = montant_initial_base_quatrieme_enfant_et_plus_mayotte_255( + Unit()) except EmptyError: try: - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("3")): - local_var_378 = ((prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.0463")) * - decimal_of_integer((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) - - integer_of_string("3")))) - else: - local_var_378 = money_of_cents_string("0") + def local_var_623(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=385, start_column=14, + end_line=385, end_column=67, + law_headings=["Article 7", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), True) + + def local_var_625(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("3")): + return ((prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.0463")) * + decimal_of_integer((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) - + integer_of_string("3")))) + else: + return money_of_cents_string("0") + local_var_622 = handle_default([], local_var_623, + local_var_625) except EmptyError: raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=124, start_column=12, end_line=124, end_column=65, - law_headings=["Prologue"])) - montant_initial_base_quatrieme_enfant_et_plus_mayotte_377 = log_variable_definition(["AllocationsFamiliales", - "montant_initial_base_quatrième_enfant_et_plus_mayotte"], - local_var_378) + start_line=124, start_column=12, end_line=124, end_column=65, + law_headings=["Prologue"])) + montant_initial_base_quatrieme_enfant_et_plus_mayotte_621 = log_variable_definition(["AllocationsFamiliales", + "montant_initial_base_quatrième_enfant_et_plus_mayotte"], + local_var_622) try: try: - local_var_380 = montant_initial_base_troisieme_enfant_mayotte_154(Unit()) + local_var_628 = montant_initial_base_troisieme_enfant_mayotte_254( + Unit()) except EmptyError: try: - def local_var_399(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=584, start_column=5, - end_line=584, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_183 >= - date_of_numbers(2011,1,1)) and (date_courante_183 <= - date_of_numbers(2011,12,31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("2")): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.0463")) + def local_var_683(_: Any): + def local_var_685(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=584, start_column=5, + end_line=584, end_column=69, + law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_299 >= + date_of_numbers(2011, 1, 1)) and + (date_courante_299 <= + date_of_numbers(2011, 12, 31)))) + + def local_var_687(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("2")): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.0463")) else: return money_of_cents_string("0") - else: - raise EmptyError - def local_var_397(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=591, start_column=5, - end_line=591, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_183 >= - date_of_numbers(2012,1,1)) and (date_courante_183 <= - date_of_numbers(2012,12,31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("2")): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.0539")) + return handle_default([], local_var_685, local_var_687) + + def local_var_677(_: Any): + def local_var_679(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=591, start_column=5, + end_line=591, end_column=69, + law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_299 >= + date_of_numbers(2012, 1, 1)) and + (date_courante_299 <= + date_of_numbers(2012, 12, 31)))) + + def local_var_681(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("2")): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.0539")) else: return money_of_cents_string("0") - else: - raise EmptyError - def local_var_395(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=598, start_column=5, - end_line=598, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_183 >= - date_of_numbers(2013,1,1)) and (date_courante_183 <= - date_of_numbers(2013,12,31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("2")): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.075")) + return handle_default([], local_var_679, local_var_681) + + def local_var_671(_: Any): + def local_var_673(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=598, start_column=5, + end_line=598, end_column=69, + law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_299 >= + date_of_numbers(2013, 1, 1)) and + (date_courante_299 <= + date_of_numbers(2013, 12, 31)))) + + def local_var_675(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("2")): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.075")) else: return money_of_cents_string("0") - else: - raise EmptyError - def local_var_393(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=605, start_column=5, - end_line=605, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_183 >= - date_of_numbers(2014,1,1)) and (date_courante_183 <= - date_of_numbers(2014,12,31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("2")): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.069")) + return handle_default([], local_var_673, local_var_675) + + def local_var_665(_: Any): + def local_var_667(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=605, start_column=5, + end_line=605, end_column=69, + law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_299 >= + date_of_numbers(2014, 1, 1)) and + (date_courante_299 <= + date_of_numbers(2014, 12, 31)))) + + def local_var_669(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("2")): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.069")) else: return money_of_cents_string("0") - else: - raise EmptyError - def local_var_391(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=612, start_column=5, - end_line=612, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_183 >= - date_of_numbers(2015,1,1)) and (date_courante_183 <= - date_of_numbers(2015,12,31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("2")): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.0766")) + return handle_default([], local_var_667, local_var_669) + + def local_var_659(_: Any): + def local_var_661(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=612, start_column=5, + end_line=612, end_column=69, + law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_299 >= + date_of_numbers(2015, 1, 1)) and + (date_courante_299 <= + date_of_numbers(2015, 12, 31)))) + + def local_var_663(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("2")): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.0766")) else: return money_of_cents_string("0") - else: - raise EmptyError - def local_var_389(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=619, start_column=5, - end_line=619, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_183 >= - date_of_numbers(2016,1,1)) and (date_courante_183 <= - date_of_numbers(2016,12,31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("2")): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.0842")) + return handle_default([], local_var_661, local_var_663) + + def local_var_653(_: Any): + def local_var_655(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=619, start_column=5, + end_line=619, end_column=69, + law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_299 >= + date_of_numbers(2016, 1, 1)) and + (date_courante_299 <= + date_of_numbers(2016, 12, 31)))) + + def local_var_657(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("2")): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.0842")) else: return money_of_cents_string("0") - else: - raise EmptyError - def local_var_387(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=626, start_column=5, - end_line=626, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_183 >= - date_of_numbers(2017,1,1)) and (date_courante_183 <= - date_of_numbers(2017,12,31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("2")): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.0918")) + return handle_default([], local_var_655, local_var_657) + + def local_var_647(_: Any): + def local_var_649(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=626, start_column=5, + end_line=626, end_column=69, + law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_299 >= + date_of_numbers(2017, 1, 1)) and + (date_courante_299 <= + date_of_numbers(2017, 12, 31)))) + + def local_var_651(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("2")): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.0918")) else: return money_of_cents_string("0") - else: - raise EmptyError - def local_var_385(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=633, start_column=5, - end_line=633, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_183 >= - date_of_numbers(2018,1,1)) and (date_courante_183 <= - date_of_numbers(2018,12,31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("2")): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.1089")) + return handle_default([], local_var_649, local_var_651) + + def local_var_641(_: Any): + def local_var_643(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=633, start_column=5, + end_line=633, end_column=69, + law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_299 >= + date_of_numbers(2018, 1, 1)) and + (date_courante_299 <= + date_of_numbers(2018, 12, 31)))) + + def local_var_645(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("2")): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.1089")) else: return money_of_cents_string("0") - else: - raise EmptyError - def local_var_383(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=640, start_column=5, - end_line=640, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_183 >= - date_of_numbers(2019,1,1)) and (date_courante_183 <= - date_of_numbers(2019,12,31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("2")): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.1259")) + return handle_default([], local_var_643, local_var_645) + + def local_var_635(_: Any): + def local_var_637(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=640, start_column=5, + end_line=640, end_column=69, + law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_299 >= + date_of_numbers(2019, 1, 1)) and + (date_courante_299 <= + date_of_numbers(2019, 12, 31)))) + + def local_var_639(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("2")): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.1259")) else: return money_of_cents_string("0") - else: - raise EmptyError - def local_var_381(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=647, start_column=5, - end_line=647, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_183 >= - date_of_numbers(2020,1,1)) and (date_courante_183 <= - date_of_numbers(2020,12,31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("2")): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.143")) + return handle_default([], local_var_637, local_var_639) + + def local_var_629(_: Any): + def local_var_631(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=647, start_column=5, + end_line=647, end_column=69, + law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_299 >= + date_of_numbers(2020, 1, 1)) and + (date_courante_299 <= + date_of_numbers(2020, 12, 31)))) + + def local_var_633(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("2")): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.143")) else: return money_of_cents_string("0") - else: - raise EmptyError - def local_var_401(_:Any): + return handle_default([], local_var_631, local_var_633) + + def local_var_689(_: Any): return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=376, start_column=14, - end_line=376, end_column=59, - law_headings=["Article 7", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), True) - def local_var_403(_:Any): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("2")): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.16")) + start_line=376, start_column=14, + end_line=376, end_column=59, + law_headings=["Article 7", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), True) + + def local_var_691(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("2")): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.16")) else: return money_of_cents_string("0") - local_var_380 = handle_default([local_var_381, local_var_383, - local_var_385, local_var_387, local_var_389, - local_var_391, local_var_393, local_var_395, - local_var_397, local_var_399], local_var_401, - local_var_403) + local_var_628 = handle_default([local_var_629, local_var_635, + local_var_641, local_var_647, local_var_653, + local_var_659, local_var_665, local_var_671, + local_var_677, local_var_683], local_var_689, + local_var_691) except EmptyError: raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=123, start_column=12, end_line=123, end_column=57, - law_headings=["Prologue"])) - montant_initial_base_troisieme_enfant_mayotte_379 = log_variable_definition(["AllocationsFamiliales", - "montant_initial_base_troisième_enfant_mayotte"], local_var_380) + start_line=123, start_column=12, end_line=123, end_column=57, + law_headings=["Prologue"])) + montant_initial_base_troisieme_enfant_mayotte_627 = log_variable_definition(["AllocationsFamiliales", + "montant_initial_base_troisième_enfant_mayotte"], local_var_628) try: try: - local_var_406 = montant_initial_base_deuxieme_enfant_mayotte_153(Unit()) + local_var_694 = montant_initial_base_deuxieme_enfant_mayotte_253( + Unit()) except EmptyError: try: - def local_var_425(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=513, start_column=5, - end_line=513, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_183 >= - date_of_numbers(2011,1,1)) and (date_courante_183 <= - date_of_numbers(2011,12,31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.232")) + def local_var_749(_: Any): + def local_var_751(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=513, start_column=5, + end_line=513, end_column=69, + law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_299 >= + date_of_numbers(2011, 1, 1)) and + (date_courante_299 <= + date_of_numbers(2011, 12, 31)))) + + def local_var_753(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("1")): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.232")) else: return money_of_cents_string("0") - else: - raise EmptyError - def local_var_423(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=520, start_column=5, - end_line=520, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_183 >= - date_of_numbers(2012,1,1)) and (date_courante_183 <= - date_of_numbers(2012,12,31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.2379")) + return handle_default([], local_var_751, local_var_753) + + def local_var_743(_: Any): + def local_var_745(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=520, start_column=5, + end_line=520, end_column=69, + law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_299 >= + date_of_numbers(2012, 1, 1)) and + (date_courante_299 <= + date_of_numbers(2012, 12, 31)))) + + def local_var_747(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("1")): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.2379")) else: return money_of_cents_string("0") - else: - raise EmptyError - def local_var_421(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=527, start_column=5, - end_line=527, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_183 >= - date_of_numbers(2013,1,1)) and (date_courante_183 <= - date_of_numbers(2013,12,31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.2437")) + return handle_default([], local_var_745, local_var_747) + + def local_var_737(_: Any): + def local_var_739(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=527, start_column=5, + end_line=527, end_column=69, + law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_299 >= + date_of_numbers(2013, 1, 1)) and + (date_courante_299 <= + date_of_numbers(2013, 12, 31)))) + + def local_var_741(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("1")): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.2437")) else: return money_of_cents_string("0") - else: - raise EmptyError - def local_var_419(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=534, start_column=5, - end_line=534, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_183 >= - date_of_numbers(2014,1,1)) and (date_courante_183 <= - date_of_numbers(2014,12,31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.2496")) + return handle_default([], local_var_739, local_var_741) + + def local_var_731(_: Any): + def local_var_733(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=534, start_column=5, + end_line=534, end_column=69, + law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_299 >= + date_of_numbers(2014, 1, 1)) and + (date_courante_299 <= + date_of_numbers(2014, 12, 31)))) + + def local_var_735(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("1")): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.2496")) else: return money_of_cents_string("0") - else: - raise EmptyError - def local_var_417(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=541, start_column=5, - end_line=541, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_183 >= - date_of_numbers(2015,1,1)) and (date_courante_183 <= - date_of_numbers(2015,12,31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.2555")) + return handle_default([], local_var_733, local_var_735) + + def local_var_725(_: Any): + def local_var_727(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=541, start_column=5, + end_line=541, end_column=69, + law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_299 >= + date_of_numbers(2015, 1, 1)) and + (date_courante_299 <= + date_of_numbers(2015, 12, 31)))) + + def local_var_729(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("1")): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.2555")) else: return money_of_cents_string("0") - else: - raise EmptyError - def local_var_415(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=548, start_column=5, - end_line=548, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_183 >= - date_of_numbers(2016,1,1)) and (date_courante_183 <= - date_of_numbers(2016,12,31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.273")) + return handle_default([], local_var_727, local_var_729) + + def local_var_719(_: Any): + def local_var_721(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=548, start_column=5, + end_line=548, end_column=69, + law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_299 >= + date_of_numbers(2016, 1, 1)) and + (date_courante_299 <= + date_of_numbers(2016, 12, 31)))) + + def local_var_723(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("1")): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.273")) else: return money_of_cents_string("0") - else: - raise EmptyError - def local_var_413(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=555, start_column=5, - end_line=555, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_183 >= - date_of_numbers(2017,1,1)) and (date_courante_183 <= - date_of_numbers(2017,12,31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.2672")) + return handle_default([], local_var_721, local_var_723) + + def local_var_713(_: Any): + def local_var_715(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=555, start_column=5, + end_line=555, end_column=69, + law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_299 >= + date_of_numbers(2017, 1, 1)) and + (date_courante_299 <= + date_of_numbers(2017, 12, 31)))) + + def local_var_717(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("1")): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.2672")) else: return money_of_cents_string("0") - else: - raise EmptyError - def local_var_411(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=562, start_column=5, - end_line=562, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_183 >= - date_of_numbers(2018,1,1)) and (date_courante_183 <= - date_of_numbers(2018,12,31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.284")) + return handle_default([], local_var_715, local_var_717) + + def local_var_707(_: Any): + def local_var_709(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=562, start_column=5, + end_line=562, end_column=69, + law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_299 >= + date_of_numbers(2018, 1, 1)) and + (date_courante_299 <= + date_of_numbers(2018, 12, 31)))) + + def local_var_711(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("1")): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.284")) else: return money_of_cents_string("0") - else: - raise EmptyError - def local_var_409(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=569, start_column=5, - end_line=569, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_183 >= - date_of_numbers(2019,1,1)) and (date_courante_183 <= - date_of_numbers(2019,12,31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.2936")) + return handle_default([], local_var_709, local_var_711) + + def local_var_701(_: Any): + def local_var_703(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=569, start_column=5, + end_line=569, end_column=69, + law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_299 >= + date_of_numbers(2019, 1, 1)) and + (date_courante_299 <= + date_of_numbers(2019, 12, 31)))) + + def local_var_705(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("1")): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.2936")) else: return money_of_cents_string("0") - else: - raise EmptyError - def local_var_407(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=576, start_column=5, - end_line=576, end_column=69, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_183 >= - date_of_numbers(2020,1,1)) and (date_courante_183 <= - date_of_numbers(2020,12,31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.3068")) + return handle_default([], local_var_703, local_var_705) + + def local_var_695(_: Any): + def local_var_697(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=576, start_column=5, + end_line=576, end_column=69, + law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_299 >= + date_of_numbers(2020, 1, 1)) and + (date_courante_299 <= + date_of_numbers(2020, 12, 31)))) + + def local_var_699(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("1")): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.3068")) else: return money_of_cents_string("0") - else: - raise EmptyError - def local_var_427(_:Any): + return handle_default([], local_var_697, local_var_699) + + def local_var_755(_: Any): return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=367, start_column=14, - end_line=367, end_column=58, - law_headings=["Article 7", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), True) - def local_var_429(_:Any): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.32")) + start_line=367, start_column=14, + end_line=367, end_column=58, + law_headings=["Article 7", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), True) + + def local_var_757(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("1")): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.32")) else: return money_of_cents_string("0") - local_var_406 = handle_default([local_var_407, local_var_409, - local_var_411, local_var_413, local_var_415, - local_var_417, local_var_419, local_var_421, - local_var_423, local_var_425], local_var_427, - local_var_429) + local_var_694 = handle_default([local_var_695, local_var_701, + local_var_707, local_var_713, local_var_719, + local_var_725, local_var_731, local_var_737, + local_var_743, local_var_749], local_var_755, + local_var_757) except EmptyError: raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=122, start_column=12, end_line=122, end_column=56, - law_headings=["Prologue"])) - montant_initial_base_deuxieme_enfant_mayotte_405 = log_variable_definition(["AllocationsFamiliales", - "montant_initial_base_deuxième_enfant_mayotte"], local_var_406) + start_line=122, start_column=12, end_line=122, end_column=56, + law_headings=["Prologue"])) + montant_initial_base_deuxieme_enfant_mayotte_693 = log_variable_definition(["AllocationsFamiliales", + "montant_initial_base_deuxième_enfant_mayotte"], local_var_694) try: try: - local_var_432 = montant_initial_base_premier_enfant_mayotte_152(Unit()) + local_var_760 = montant_initial_base_premier_enfant_mayotte_252( + Unit()) except EmptyError: try: - def local_var_453(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=425, start_column=5, - end_line=426, end_column=53, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_183 >= - date_of_numbers(2011,1,1)) and ((date_courante_183 <= - date_of_numbers(2011,12,31)) and - not avait_enfant_a_charge_avant_1er_janvier_2012_281))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("0")): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.145")) + def local_var_821(_: Any): + def local_var_823(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=425, start_column=5, + end_line=426, end_column=53, + law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_299 >= + date_of_numbers(2011, 1, 1)) and + ((date_courante_299 <= + date_of_numbers(2011, 12, 31)) and + not avait_enfant_a_charge_avant_1er_janvier_2012_445))) + + def local_var_825(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("0")): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.145")) else: return money_of_cents_string("0") - else: - raise EmptyError - def local_var_451(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=433, start_column=5, - end_line=434, end_column=53, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_183 >= - date_of_numbers(2012,1,1)) and ((date_courante_183 <= - date_of_numbers(2012,12,31)) and - not avait_enfant_a_charge_avant_1er_janvier_2012_281))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("0")): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.1393")) + return handle_default([], local_var_823, local_var_825) + + def local_var_815(_: Any): + def local_var_817(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=433, start_column=5, + end_line=434, end_column=53, + law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_299 >= + date_of_numbers(2012, 1, 1)) and + ((date_courante_299 <= + date_of_numbers(2012, 12, 31)) and + not avait_enfant_a_charge_avant_1er_janvier_2012_445))) + + def local_var_819(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("0")): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.1393")) else: return money_of_cents_string("0") - else: - raise EmptyError - def local_var_449(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=441, start_column=5, - end_line=442, end_column=53, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_183 >= - date_of_numbers(2013,1,1)) and ((date_courante_183 <= - date_of_numbers(2013,12,31)) and - not avait_enfant_a_charge_avant_1er_janvier_2012_281))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("0")): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.1335")) + return handle_default([], local_var_817, local_var_819) + + def local_var_809(_: Any): + def local_var_811(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=441, start_column=5, + end_line=442, end_column=53, + law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_299 >= + date_of_numbers(2013, 1, 1)) and + ((date_courante_299 <= + date_of_numbers(2013, 12, 31)) and + not avait_enfant_a_charge_avant_1er_janvier_2012_445))) + + def local_var_813(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("0")): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.1335")) else: return money_of_cents_string("0") - else: - raise EmptyError - def local_var_447(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=449, start_column=5, - end_line=450, end_column=53, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_183 >= - date_of_numbers(2014,1,1)) and ((date_courante_183 <= - date_of_numbers(2014,12,31)) and - not avait_enfant_a_charge_avant_1er_janvier_2012_281))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("0")): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.1278")) + return handle_default([], local_var_811, local_var_813) + + def local_var_803(_: Any): + def local_var_805(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=449, start_column=5, + end_line=450, end_column=53, + law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_299 >= + date_of_numbers(2014, 1, 1)) and + ((date_courante_299 <= + date_of_numbers(2014, 12, 31)) and + not avait_enfant_a_charge_avant_1er_janvier_2012_445))) + + def local_var_807(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("0")): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.1278")) else: return money_of_cents_string("0") - else: - raise EmptyError - def local_var_445(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=457, start_column=5, - end_line=458, end_column=53, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_183 >= - date_of_numbers(2015,1,1)) and ((date_courante_183 <= - date_of_numbers(2015,12,31)) and - not avait_enfant_a_charge_avant_1er_janvier_2012_281))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("0")): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.122")) + return handle_default([], local_var_805, local_var_807) + + def local_var_797(_: Any): + def local_var_799(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=457, start_column=5, + end_line=458, end_column=53, + law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_299 >= + date_of_numbers(2015, 1, 1)) and + ((date_courante_299 <= + date_of_numbers(2015, 12, 31)) and + not avait_enfant_a_charge_avant_1er_janvier_2012_445))) + + def local_var_801(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("0")): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.122")) else: return money_of_cents_string("0") - else: - raise EmptyError - def local_var_443(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=465, start_column=5, - end_line=466, end_column=53, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_183 >= - date_of_numbers(2016,1,1)) and ((date_courante_183 <= - date_of_numbers(2016,12,31)) and - not avait_enfant_a_charge_avant_1er_janvier_2012_281))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("0")): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.1163")) + return handle_default([], local_var_799, local_var_801) + + def local_var_791(_: Any): + def local_var_793(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=465, start_column=5, + end_line=466, end_column=53, + law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_299 >= + date_of_numbers(2016, 1, 1)) and + ((date_courante_299 <= + date_of_numbers(2016, 12, 31)) and + not avait_enfant_a_charge_avant_1er_janvier_2012_445))) + + def local_var_795(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("0")): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.1163")) else: return money_of_cents_string("0") - else: - raise EmptyError - def local_var_441(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=473, start_column=5, - end_line=474, end_column=53, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_183 >= - date_of_numbers(2017,1,1)) and ((date_courante_183 <= - date_of_numbers(2017,12,31)) and - not avait_enfant_a_charge_avant_1er_janvier_2012_281))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("0")): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.115")) + return handle_default([], local_var_793, local_var_795) + + def local_var_785(_: Any): + def local_var_787(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=473, start_column=5, + end_line=474, end_column=53, + law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_299 >= + date_of_numbers(2017, 1, 1)) and + ((date_courante_299 <= + date_of_numbers(2017, 12, 31)) and + not avait_enfant_a_charge_avant_1er_janvier_2012_445))) + + def local_var_789(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("0")): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.115")) else: return money_of_cents_string("0") - else: - raise EmptyError - def local_var_439(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=481, start_column=5, - end_line=482, end_column=53, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_183 >= - date_of_numbers(2018,1,1)) and ((date_courante_183 <= - date_of_numbers(2018,12,31)) and - not avait_enfant_a_charge_avant_1er_janvier_2012_281))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("0")): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.0976")) + return handle_default([], local_var_787, local_var_789) + + def local_var_779(_: Any): + def local_var_781(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=481, start_column=5, + end_line=482, end_column=53, + law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_299 >= + date_of_numbers(2018, 1, 1)) and + ((date_courante_299 <= + date_of_numbers(2018, 12, 31)) and + not avait_enfant_a_charge_avant_1er_janvier_2012_445))) + + def local_var_783(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("0")): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.0976")) else: return money_of_cents_string("0") - else: - raise EmptyError - def local_var_437(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=489, start_column=5, - end_line=490, end_column=53, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_183 >= - date_of_numbers(2019,1,1)) and ((date_courante_183 <= - date_of_numbers(2019,12,31)) and - not avait_enfant_a_charge_avant_1er_janvier_2012_281))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("0")): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.0847")) + return handle_default([], local_var_781, local_var_783) + + def local_var_773(_: Any): + def local_var_775(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=489, start_column=5, + end_line=490, end_column=53, + law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_299 >= + date_of_numbers(2019, 1, 1)) and + ((date_courante_299 <= + date_of_numbers(2019, 12, 31)) and + not avait_enfant_a_charge_avant_1er_janvier_2012_445))) + + def local_var_777(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("0")): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.0847")) else: return money_of_cents_string("0") - else: - raise EmptyError - def local_var_435(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=497, start_column=5, - end_line=498, end_column=53, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_183 >= - date_of_numbers(2020,1,1)) and ((date_courante_183 <= - date_of_numbers(2020,12,31)) and - not avait_enfant_a_charge_avant_1er_janvier_2012_281))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("0")): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.0717")) + return handle_default([], local_var_775, local_var_777) + + def local_var_767(_: Any): + def local_var_769(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=497, start_column=5, + end_line=498, end_column=53, + law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_299 >= + date_of_numbers(2020, 1, 1)) and + ((date_courante_299 <= + date_of_numbers(2020, 12, 31)) and + not avait_enfant_a_charge_avant_1er_janvier_2012_445))) + + def local_var_771(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("0")): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.0717")) else: return money_of_cents_string("0") - else: - raise EmptyError - def local_var_433(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=505, start_column=5, - end_line=505, end_column=49, law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), avait_enfant_a_charge_avant_1er_janvier_2012_281): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("0")): + return handle_default([], local_var_769, local_var_771) + + def local_var_761(_: Any): + def local_var_763(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=505, start_column=5, + end_line=505, end_column=49, + law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), avait_enfant_a_charge_avant_1er_janvier_2012_445) + + def local_var_765(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("0")): return money_of_cents_string("5728") else: return money_of_cents_string("0") - else: - raise EmptyError - def local_var_455(_:Any): + return handle_default([], local_var_763, local_var_765) + + def local_var_827(_: Any): return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=358, start_column=14, - end_line=358, end_column=57, - law_headings=["Article 7", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), True) - def local_var_457(_:Any): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("0")): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.0588")) + start_line=358, start_column=14, + end_line=358, end_column=57, + law_headings=["Article 7", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), True) + + def local_var_829(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("0")): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.0588")) else: return money_of_cents_string("0") - local_var_432 = handle_default([local_var_433, local_var_435, - local_var_437, local_var_439, local_var_441, - local_var_443, local_var_445, local_var_447, - local_var_449, local_var_451, local_var_453], - local_var_455, local_var_457) + local_var_760 = handle_default([local_var_761, local_var_767, + local_var_773, local_var_779, local_var_785, + local_var_791, local_var_797, local_var_803, + local_var_809, local_var_815, local_var_821], + local_var_827, local_var_829) except EmptyError: raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=121, start_column=12, end_line=121, end_column=55, - law_headings=["Prologue"])) - montant_initial_base_premier_enfant_mayotte_431 = log_variable_definition(["AllocationsFamiliales", - "montant_initial_base_premier_enfant_mayotte"], local_var_432) + start_line=121, start_column=12, end_line=121, end_column=55, + law_headings=["Prologue"])) + montant_initial_base_premier_enfant_mayotte_759 = log_variable_definition(["AllocationsFamiliales", + "montant_initial_base_premier_enfant_mayotte"], local_var_760) try: try: - local_var_460 = nombre_total_enfants_148(Unit()) + local_var_832 = nombre_total_enfants_248(Unit()) except EmptyError: try: - local_var_460 = decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337)) + def local_var_833(_: Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_R.catala_fr", + start_line=162, start_column=14, + end_line=162, end_column=34, + law_headings=["Article R521-3", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets en Conseil d'Etat", + "Code de la sécurité sociale"]), True) + + def local_var_835(_: Any): + return decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533)) + local_var_832 = handle_default([], local_var_833, + local_var_835) except EmptyError: raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=115, start_column=12, end_line=115, end_column=32, - law_headings=["Prologue"])) - nombre_total_enfants_459 = log_variable_definition(["AllocationsFamiliales", - "nombre_total_enfants"], local_var_460) + start_line=115, start_column=12, end_line=115, end_column=32, + law_headings=["Prologue"])) + nombre_total_enfants_831 = log_variable_definition(["AllocationsFamiliales", + "nombre_total_enfants"], local_var_832) try: try: - local_var_462 = nombre_moyen_enfants_147(Unit()) + local_var_838 = nombre_moyen_enfants_247(Unit()) except EmptyError: try: - def local_var_463(acc_464:Decimal, enfant_465:Any): - match_arg_801 = log_end_call(["AllocationsFamiliales", - "prise_en_compte"], - log_variable_definition(["AllocationsFamiliales", - "prise_en_compte", "output"], - log_begin_call(["AllocationsFamiliales", - "prise_en_compte"], prise_en_compte_187, - log_variable_definition(["AllocationsFamiliales", - "prise_en_compte", "input"], - enfant_465)))) - if match_arg_801.code == PriseEnCompte_Code.Complete: - _ = match_arg_801.value - local_var_466 = decimal_of_string("1.") - elif match_arg_801.code == PriseEnCompte_Code.Partagee: - _ = match_arg_801.value - local_var_466 = decimal_of_string("0.5") - elif match_arg_801.code == PriseEnCompte_Code.Zero: - _ = match_arg_801.value - local_var_466 = decimal_of_string("0.") - return (acc_464 + local_var_466) - local_var_462 = list_fold_left(local_var_463, - decimal_of_string("0."), - enfants_a_charge_droit_ouvert_prestation_familiale_337) + def local_var_839(_: Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_R.catala_fr", + start_line=142, start_column=14, + end_line=142, end_column=34, + law_headings=["Article R521-3", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets en Conseil d'Etat", + "Code de la sécurité sociale"]), True) + + def local_var_841(_: Any): + def local_var_843(acc_844: Decimal, enfant_845: Any): + match_arg_1381 = log_end_call(["AllocationsFamiliales", + "prise_en_compte"], + log_variable_definition(["AllocationsFamiliales", + "prise_en_compte", "output"], + log_begin_call(["AllocationsFamiliales", + "prise_en_compte"], prise_en_compte_311, + log_variable_definition(["AllocationsFamiliales", + "prise_en_compte", "input"], + enfant_845)))) + if match_arg_1381.code == PriseEnCompte_Code.Complete: + _ = match_arg_1381.value + local_var_846 = decimal_of_string("1.") + elif match_arg_1381.code == PriseEnCompte_Code.Partagee: + _ = match_arg_1381.value + local_var_846 = decimal_of_string("0.5") + elif match_arg_1381.code == PriseEnCompte_Code.Zero: + _ = match_arg_1381.value + local_var_846 = decimal_of_string("0.") + return (acc_844 + local_var_846) + return list_fold_left(local_var_843, + decimal_of_string("0."), + enfants_a_charge_droit_ouvert_prestation_familiale_533) + local_var_838 = handle_default([], local_var_839, + local_var_841) except EmptyError: raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=114, start_column=12, end_line=114, end_column=32, - law_headings=["Prologue"])) - nombre_moyen_enfants_461 = log_variable_definition(["AllocationsFamiliales", - "nombre_moyen_enfants"], local_var_462) + start_line=114, start_column=12, end_line=114, end_column=32, + law_headings=["Prologue"])) + nombre_moyen_enfants_837 = log_variable_definition(["AllocationsFamiliales", + "nombre_moyen_enfants"], local_var_838) try: try: - local_var_471 = montant_initial_base_premier_enfant_143(Unit()) + local_var_851 = montant_initial_base_premier_enfant_243(Unit()) except EmptyError: try: try: - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=359, start_column=5, - end_line=360, end_column=71, - law_headings=["Article D755-5", - "Chapitre 5 : Prestations familiales et prestations assimilées", - "Titre 5 : Départements d'outre-mer", - "Livre 7 : Régimes divers - Dispositions diverses", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (prestations_familiales_dot_regime_outre_mer_l751_1_320 and - (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) == - integer_of_string("1")))): - local_var_471 = (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.0588")) - else: - raise EmptyError + def local_var_852(_: Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=359, start_column=5, + end_line=360, end_column=71, + law_headings=["Article D755-5", + "Chapitre 5 : Prestations familiales et prestations assimilées", + "Titre 5 : Départements d'outre-mer", + "Livre 7 : Régimes divers - Dispositions diverses", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), (prestations_familiales_dot_regime_outre_mer_l751_1_508 and + (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) == + integer_of_string("1")))) + + def local_var_854(_: Any): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.0588")) + local_var_851 = handle_default([], local_var_852, + local_var_854) except EmptyError: - local_var_471 = money_of_cents_string("0") + local_var_851 = money_of_cents_string("0") except EmptyError: raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=110, start_column=12, end_line=110, end_column=47, - law_headings=["Prologue"])) - montant_initial_base_premier_enfant_470 = log_variable_definition(["AllocationsFamiliales", - "montant_initial_base_premier_enfant"], local_var_471) + start_line=110, start_column=12, end_line=110, end_column=47, + law_headings=["Prologue"])) + montant_initial_base_premier_enfant_850 = log_variable_definition(["AllocationsFamiliales", + "montant_initial_base_premier_enfant"], local_var_851) try: try: - local_var_473 = droit_ouvert_base_141(Unit()) + local_var_857 = droit_ouvert_base_241(Unit()) except EmptyError: try: - def local_var_476(_:Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=406, start_column=5, - end_line=407, end_column=72, - law_headings=["Article L755-12", - "Chapitre 5 : Prestations familiales et prestations assimilées", - "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin", - "Livre 7 : Régimes divers - Dispositions diverses", - "Partie législative", - "Code de la sécurité sociale"]), (prestations_familiales_dot_regime_outre_mer_l751_1_320 and - (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) >= - integer_of_string("1")))): + def local_var_864(_: Any): + def local_var_866(_: Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=406, start_column=5, + end_line=407, end_column=72, + law_headings=["Article L755-12", + "Chapitre 5 : Prestations familiales et prestations assimilées", + "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin", + "Livre 7 : Régimes divers - Dispositions diverses", + "Partie législative", + "Code de la sécurité sociale"]), (prestations_familiales_dot_regime_outre_mer_l751_1_508 and + (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) >= + integer_of_string("1")))) + + def local_var_868(_: Any): return True - else: - raise EmptyError - def local_var_474(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=344, start_column=5, - end_line=345, end_column=72, - law_headings=["Article 7", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((residence_181 == - Collectivite(Collectivite_Code.Mayotte, Unit())) and - (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) >= - integer_of_string("1")))): + return handle_default([], local_var_866, local_var_868) + + def local_var_858(_: Any): + def local_var_860(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=344, start_column=5, + end_line=345, end_column=72, + law_headings=["Article 7", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((residence_293 == + Collectivite(Collectivite_Code.Mayotte, + Unit())) and + (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) >= + integer_of_string("1")))) + + def local_var_862(_: Any): return True - else: - raise EmptyError - def local_var_478(_:Any): + return handle_default([], local_var_860, local_var_862) + + def local_var_870(_: Any): return log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=101, start_column=5, - end_line=101, end_column=70, - law_headings=["Article L521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) >= - integer_of_string("2"))) - def local_var_480(_:Any): + start_line=101, start_column=5, + end_line=101, end_column=70, + law_headings=["Article L521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) >= + integer_of_string("2"))) + + def local_var_872(_: Any): return True - local_var_473 = handle_default([local_var_474, - local_var_476], local_var_478, local_var_480) + local_var_857 = handle_default([local_var_858, + local_var_864], local_var_870, local_var_872) except EmptyError: - local_var_473 = False + local_var_857 = False except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=108, start_column=12, end_line=108, end_column=29, - law_headings=["Prologue"])) - droit_ouvert_base_472 = log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_base"], local_var_473) + start_line=108, start_column=12, end_line=108, end_column=29, + law_headings=["Prologue"])) + droit_ouvert_base_856 = log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_base"], local_var_857) try: try: - local_var_483 = droit_ouvert_majoration_159(Unit()) + local_var_875 = droit_ouvert_majoration_259(Unit()) except EmptyError: - def local_var_483(param_484:Enfant): + def local_var_875(param_876: Enfant): try: try: try: - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=313, start_column=5, - end_line=315, end_column=58, - law_headings=["Article L521-3", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), ((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) >= - nombre_enfants_alinea_2_l521_3_285) and - (param_484.age >= - log_end_call(["AllocationsFamiliales", - "âge_minimum_alinéa_1_l521_3"], - log_variable_definition(["AllocationsFamiliales", - "âge_minimum_alinéa_1_l521_3", "output"], - log_begin_call(["AllocationsFamiliales", - "âge_minimum_alinéa_1_l521_3"], - age_minimum_alinea_1_l521_3_334, - log_variable_definition(["AllocationsFamiliales", - "âge_minimum_alinéa_1_l521_3", "input"], - param_484))))))): + def local_var_877(_: Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=313, start_column=5, + end_line=315, end_column=58, + law_headings=["Article L521-3", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), ((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) >= + nombre_enfants_alinea_2_l521_3_457) and + (param_876.age >= + log_end_call(["AllocationsFamiliales", + "âge_minimum_alinéa_1_l521_3"], + log_variable_definition(["AllocationsFamiliales", + "âge_minimum_alinéa_1_l521_3", + "output"], + log_begin_call(["AllocationsFamiliales", + "âge_minimum_alinéa_1_l521_3"], + age_minimum_alinea_1_l521_3_526, + log_variable_definition(["AllocationsFamiliales", + "âge_minimum_alinéa_1_l521_3", + "input"], param_876))))))) + + def local_var_879(_: Any): return True - else: - raise EmptyError + return handle_default([], local_var_877, + local_var_879) except EmptyError: if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=299, start_column=5, - end_line=300, end_column=58, - law_headings=["Article L521-3", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), (not log_end_call(["AllocationsFamiliales", - "est_enfant_le_plus_âgé"], - log_variable_definition(["AllocationsFamiliales", - "est_enfant_le_plus_âgé", "output"], - log_begin_call(["AllocationsFamiliales", - "est_enfant_le_plus_âgé"], - est_enfant_le_plus_age_341, - log_variable_definition(["AllocationsFamiliales", - "est_enfant_le_plus_âgé", "input"], - param_484)))) and (param_484.age >= - log_end_call(["AllocationsFamiliales", - "âge_minimum_alinéa_1_l521_3"], - log_variable_definition(["AllocationsFamiliales", - "âge_minimum_alinéa_1_l521_3", "output"], - log_begin_call(["AllocationsFamiliales", - "âge_minimum_alinéa_1_l521_3"], - age_minimum_alinea_1_l521_3_334, - log_variable_definition(["AllocationsFamiliales", - "âge_minimum_alinéa_1_l521_3", "input"], - param_484))))))): + start_line=299, start_column=5, + end_line=300, end_column=58, + law_headings=["Article L521-3", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), (not log_end_call(["AllocationsFamiliales", + "est_enfant_le_plus_âgé"], + log_variable_definition(["AllocationsFamiliales", + "est_enfant_le_plus_âgé", "output"], + log_begin_call(["AllocationsFamiliales", + "est_enfant_le_plus_âgé"], + est_enfant_le_plus_age_541, + log_variable_definition(["AllocationsFamiliales", + "est_enfant_le_plus_âgé", "input"], + param_876)))) and (param_876.age >= + log_end_call(["AllocationsFamiliales", + "âge_minimum_alinéa_1_l521_3"], + log_variable_definition(["AllocationsFamiliales", + "âge_minimum_alinéa_1_l521_3", "output"], + log_begin_call(["AllocationsFamiliales", + "âge_minimum_alinéa_1_l521_3"], + age_minimum_alinea_1_l521_3_526, + log_variable_definition(["AllocationsFamiliales", + "âge_minimum_alinéa_1_l521_3", "input"], + param_876))))))): return True else: raise EmptyError @@ -3207,1359 +3764,1706 @@ def local_var_483(param_484:Enfant): return False except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=132, start_column=12, end_line=132, - end_column=35, law_headings=["Prologue"])) + start_line=132, start_column=12, end_line=132, + end_column=35, law_headings=["Prologue"])) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=132, start_column=12, end_line=132, end_column=35, - law_headings=["Prologue"])) - droit_ouvert_majoration_482 = log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration"], local_var_483) + start_line=132, start_column=12, end_line=132, end_column=35, + law_headings=["Prologue"])) + droit_ouvert_majoration_874 = log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_majoration"], local_var_875) try: try: - local_var_486 = complement_degressif_166(Unit()) + local_var_882 = complement_degressif_266(Unit()) except EmptyError: - def local_var_486(param_487:Money): + def local_var_882(param_883: Money): try: try: - def local_var_490(_:Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=162, start_column=5, - end_line=163, end_column=68, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), ((ressources_menage_179 > - plafond__i_d521_3_358) and - (ressources_menage_179 <= - (plafond__i_d521_3_358 + (param_487 * - decimal_of_string("12.")))))): - return ((plafond__i_d521_3_358 + - ((param_487 * decimal_of_string("12.")) - - ressources_menage_179)) * - (decimal_of_string("1.") / - decimal_of_string("12."))) - else: - raise EmptyError - def local_var_488(_:Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=170, start_column=5, - end_line=171, end_column=68, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), ((ressources_menage_179 > - plafond__i_i_d521_3_344) and - (ressources_menage_179 <= - (plafond__i_i_d521_3_344 + (param_487 * - decimal_of_string("12.")))))): - return ((plafond__i_i_d521_3_344 + - ((param_487 * decimal_of_string("12.")) - - ressources_menage_179)) * - (decimal_of_string("1.") / - decimal_of_string("12."))) - else: - raise EmptyError - def local_var_492(_:Any): + def local_var_890(_: Any): + def local_var_892(_: Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=162, start_column=5, + end_line=163, end_column=68, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), ((ressources_menage_287 > + plafond__i_d521_3_578) and + (ressources_menage_287 <= + (plafond__i_d521_3_578 + (param_883 * + decimal_of_string("12.")))))) + + def local_var_894(_: Any): + return ((plafond__i_d521_3_578 + + ((param_883 * decimal_of_string("12.")) - + ressources_menage_287)) * + (decimal_of_string("1.") / + decimal_of_string("12."))) + return handle_default([], local_var_892, + local_var_894) + + def local_var_884(_: Any): + def local_var_886(_: Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=170, start_column=5, + end_line=171, end_column=68, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), ((ressources_menage_287 > + plafond__i_i_d521_3_548) and + (ressources_menage_287 <= + (plafond__i_i_d521_3_548 + (param_883 * + decimal_of_string("12.")))))) + + def local_var_888(_: Any): + return ((plafond__i_i_d521_3_548 + + ((param_883 * decimal_of_string("12.")) - + ressources_menage_287)) * + (decimal_of_string("1.") / + decimal_of_string("12."))) + return handle_default([], local_var_886, + local_var_888) + + def local_var_896(_: Any): return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=176, start_column=14, - end_line=176, end_column=34, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), True) - def local_var_494(_:Any): + start_line=176, start_column=14, + end_line=176, end_column=34, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), True) + + def local_var_898(_: Any): return money_of_cents_string("0") - return handle_default([local_var_488, local_var_490], - local_var_492, local_var_494) + return handle_default([local_var_884, local_var_890], + local_var_896, local_var_898) except EmptyError: raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=141, start_column=12, end_line=141, - end_column=32, law_headings=["Prologue"])) + start_line=141, start_column=12, end_line=141, + end_column=32, law_headings=["Prologue"])) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=141, start_column=12, end_line=141, end_column=32, - law_headings=["Prologue"])) - complement_degressif_485 = log_variable_definition(["AllocationsFamiliales", - "complément_dégressif"], local_var_486) + start_line=141, start_column=12, end_line=141, end_column=32, + law_headings=["Prologue"])) + complement_degressif_881 = log_variable_definition(["AllocationsFamiliales", + "complément_dégressif"], local_var_882) try: try: - local_var_497 = montant_verse_forfaitaire_par_enfant_157(Unit()) + local_var_901 = montant_verse_forfaitaire_par_enfant_257(Unit()) except EmptyError: - def local_var_502(_:Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=215, start_column=5, - end_line=215, end_column=43, - law_headings=["Article D521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (ressources_menage_179 <= - plafond__i_d521_3_358)): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.20234")) - else: - raise EmptyError - def local_var_500(_:Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=229, start_column=5, - end_line=230, end_column=46, - law_headings=["Article D521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), ((ressources_menage_179 > - plafond__i_d521_3_358) and (ressources_menage_179 <= - plafond__i_i_d521_3_344))): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.1117")) - else: - raise EmptyError - def local_var_498(_:Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=243, start_column=5, - end_line=243, end_column=43, - law_headings=["Article D521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (ressources_menage_179 > - plafond__i_i_d521_3_344)): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.0559")) - else: - raise EmptyError - def local_var_504(_:Any): + def local_var_914(_: Any): + def local_var_916(_: Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=215, start_column=5, + end_line=215, end_column=43, + law_headings=["Article D521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), (ressources_menage_287 <= + plafond__i_d521_3_578)) + + def local_var_918(_: Any): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.20234")) + return handle_default([], local_var_916, local_var_918) + + def local_var_908(_: Any): + def local_var_910(_: Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=229, start_column=5, + end_line=230, end_column=46, + law_headings=["Article D521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), ((ressources_menage_287 > + plafond__i_d521_3_578) and (ressources_menage_287 <= + plafond__i_i_d521_3_548))) + + def local_var_912(_: Any): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.1117")) + return handle_default([], local_var_910, local_var_912) + + def local_var_902(_: Any): + def local_var_904(_: Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=243, start_column=5, + end_line=243, end_column=43, + law_headings=["Article D521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), (ressources_menage_287 > + plafond__i_i_d521_3_548)) + + def local_var_906(_: Any): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.0559")) + return handle_default([], local_var_904, local_var_906) + + def local_var_920(_: Any): return log_decision_taken(SourcePosition(filename="", - start_line=0, start_column=1, end_line=0, end_column=1, - law_headings=[]), False) - def local_var_506(_:Any): + start_line=0, start_column=1, end_line=0, end_column=1, + law_headings=[]), False) + + def local_var_922(_: Any): raise EmptyError - local_var_497 = handle_default([local_var_498, local_var_500, - local_var_502], local_var_504, local_var_506) + local_var_901 = handle_default([local_var_902, local_var_908, + local_var_914], local_var_920, local_var_922) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=128, start_column=12, end_line=128, end_column=48, - law_headings=["Prologue"])) - montant_verse_forfaitaire_par_enfant_496 = log_variable_definition(["AllocationsFamiliales", - "montant_versé_forfaitaire_par_enfant"], local_var_497) + start_line=128, start_column=12, end_line=128, end_column=48, + law_headings=["Prologue"])) + montant_verse_forfaitaire_par_enfant_900 = log_variable_definition(["AllocationsFamiliales", + "montant_versé_forfaitaire_par_enfant"], local_var_901) try: try: - local_var_509 = montant_initial_base_troisieme_enfant_et_plus_145(Unit()) + local_var_925 = montant_initial_base_troisieme_enfant_et_plus_245( + Unit()) except EmptyError: - def local_var_514(_:Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=35, start_column=3, - end_line=35, end_column=41, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (ressources_menage_179 <= - plafond__i_d521_3_358)): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("2")): - return ((prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.41")) * - decimal_of_integer((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) - - integer_of_string("2")))) + def local_var_938(_: Any): + def local_var_940(_: Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=35, start_column=3, + end_line=35, end_column=41, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), (ressources_menage_287 <= + plafond__i_d521_3_578)) + + def local_var_942(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("2")): + return ((prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.41")) * + decimal_of_integer((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) - + integer_of_string("2")))) else: return money_of_cents_string("0") - else: - raise EmptyError - def local_var_512(_:Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=74, start_column=3, - end_line=75, end_column=44, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), ((ressources_menage_179 > - plafond__i_d521_3_358) and (ressources_menage_179 <= - plafond__i_i_d521_3_344))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("2")): - return ((prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.205")) * - decimal_of_integer((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) - - integer_of_string("2")))) + return handle_default([], local_var_940, local_var_942) + + def local_var_932(_: Any): + def local_var_934(_: Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=74, start_column=3, + end_line=75, end_column=44, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), ((ressources_menage_287 > + plafond__i_d521_3_578) and (ressources_menage_287 <= + plafond__i_i_d521_3_548))) + + def local_var_936(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("2")): + return ((prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.205")) * + decimal_of_integer((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) - + integer_of_string("2")))) else: return money_of_cents_string("0") - else: - raise EmptyError - def local_var_510(_:Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=113, start_column=3, - end_line=113, end_column=41, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (ressources_menage_179 > - plafond__i_i_d521_3_344)): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("2")): - return ((prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.1025")) * - decimal_of_integer((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) - - integer_of_string("2")))) + return handle_default([], local_var_934, local_var_936) + + def local_var_926(_: Any): + def local_var_928(_: Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=113, start_column=3, + end_line=113, end_column=41, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), (ressources_menage_287 > + plafond__i_i_d521_3_548)) + + def local_var_930(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("2")): + return ((prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.1025")) * + decimal_of_integer((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) - + integer_of_string("2")))) else: return money_of_cents_string("0") - else: - raise EmptyError - def local_var_516(_:Any): + return handle_default([], local_var_928, local_var_930) + + def local_var_944(_: Any): return log_decision_taken(SourcePosition(filename="", - start_line=0, start_column=1, end_line=0, end_column=1, - law_headings=[]), False) - def local_var_518(_:Any): + start_line=0, start_column=1, end_line=0, end_column=1, + law_headings=[]), False) + + def local_var_946(_: Any): raise EmptyError - local_var_509 = handle_default([local_var_510, local_var_512, - local_var_514], local_var_516, local_var_518) + local_var_925 = handle_default([local_var_926, local_var_932, + local_var_938], local_var_944, local_var_946) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=112, start_column=12, end_line=112, end_column=57, - law_headings=["Prologue"])) - montant_initial_base_troisieme_enfant_et_plus_508 = log_variable_definition(["AllocationsFamiliales", - "montant_initial_base_troisième_enfant_et_plus"], local_var_509) + start_line=112, start_column=12, end_line=112, end_column=57, + law_headings=["Prologue"])) + montant_initial_base_troisieme_enfant_et_plus_924 = log_variable_definition(["AllocationsFamiliales", + "montant_initial_base_troisième_enfant_et_plus"], local_var_925) try: try: - local_var_521 = montant_initial_base_deuxieme_enfant_144(Unit()) + local_var_949 = montant_initial_base_deuxieme_enfant_244(Unit()) except EmptyError: - def local_var_526(_:Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=35, start_column=3, - end_line=35, end_column=41, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (ressources_menage_179 <= - plafond__i_d521_3_358)): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.32")) + def local_var_962(_: Any): + def local_var_964(_: Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=35, start_column=3, + end_line=35, end_column=41, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), (ressources_menage_287 <= + plafond__i_d521_3_578)) + + def local_var_966(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("1")): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.32")) else: return money_of_cents_string("0") - else: - raise EmptyError - def local_var_524(_:Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=74, start_column=3, - end_line=75, end_column=44, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), ((ressources_menage_179 > - plafond__i_d521_3_358) and (ressources_menage_179 <= - plafond__i_i_d521_3_344))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.16")) + return handle_default([], local_var_964, local_var_966) + + def local_var_956(_: Any): + def local_var_958(_: Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=74, start_column=3, + end_line=75, end_column=44, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), ((ressources_menage_287 > + plafond__i_d521_3_578) and (ressources_menage_287 <= + plafond__i_i_d521_3_548))) + + def local_var_960(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("1")): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.16")) else: return money_of_cents_string("0") - else: - raise EmptyError - def local_var_522(_:Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=113, start_column=3, - end_line=113, end_column=41, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (ressources_menage_179 > - plafond__i_i_d521_3_344)): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) > - integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.08")) + return handle_default([], local_var_958, local_var_960) + + def local_var_950(_: Any): + def local_var_952(_: Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=113, start_column=3, + end_line=113, end_column=41, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), (ressources_menage_287 > + plafond__i_i_d521_3_548)) + + def local_var_954(_: Any): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) > + integer_of_string("1")): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.08")) else: return money_of_cents_string("0") - else: - raise EmptyError - def local_var_528(_:Any): + return handle_default([], local_var_952, local_var_954) + + def local_var_968(_: Any): return log_decision_taken(SourcePosition(filename="", - start_line=0, start_column=1, end_line=0, end_column=1, - law_headings=[]), False) - def local_var_530(_:Any): + start_line=0, start_column=1, end_line=0, end_column=1, + law_headings=[]), False) + + def local_var_970(_: Any): raise EmptyError - local_var_521 = handle_default([local_var_522, local_var_524, - local_var_526], local_var_528, local_var_530) + local_var_949 = handle_default([local_var_950, local_var_956, + local_var_962], local_var_968, local_var_970) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=111, start_column=12, end_line=111, end_column=48, - law_headings=["Prologue"])) - montant_initial_base_deuxieme_enfant_520 = log_variable_definition(["AllocationsFamiliales", - "montant_initial_base_deuxième_enfant"], local_var_521) + start_line=111, start_column=12, end_line=111, end_column=48, + law_headings=["Prologue"])) + montant_initial_base_deuxieme_enfant_948 = log_variable_definition(["AllocationsFamiliales", + "montant_initial_base_deuxième_enfant"], local_var_949) try: try: - local_var_533 = rapport_enfants_total_moyen_146(Unit()) + local_var_973 = rapport_enfants_total_moyen_246(Unit()) except EmptyError: try: - if (nombre_total_enfants_459 == - decimal_of_string("0.")): - local_var_533 = decimal_of_string("0.") - else: - local_var_533 = (nombre_moyen_enfants_461 / - nombre_total_enfants_459) + def local_var_974(_: Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_R.catala_fr", + start_line=128, start_column=14, + end_line=128, end_column=41, + law_headings=["Article R521-3", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets en Conseil d'Etat", + "Code de la sécurité sociale"]), True) + + def local_var_976(_: Any): + if (nombre_total_enfants_831 == + decimal_of_string("0.")): + return decimal_of_string("0.") + else: + return (nombre_moyen_enfants_837 / + nombre_total_enfants_831) + local_var_973 = handle_default([], local_var_974, + local_var_976) except EmptyError: raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=113, start_column=12, end_line=113, end_column=39, - law_headings=["Prologue"])) - rapport_enfants_total_moyen_532 = log_variable_definition(["AllocationsFamiliales", - "rapport_enfants_total_moyen"], local_var_533) + start_line=113, start_column=12, end_line=113, end_column=39, + law_headings=["Prologue"])) + rapport_enfants_total_moyen_972 = log_variable_definition(["AllocationsFamiliales", + "rapport_enfants_total_moyen"], local_var_973) try: try: - local_var_535 = montant_initial_metropole_majoration_160(Unit()) + local_var_979 = montant_initial_metropole_majoration_260(Unit()) except EmptyError: - def local_var_535(param_536:Enfant): + def local_var_979(param_980: Enfant): try: - def local_var_543(_:Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=55, start_column=3, - end_line=55, end_column=41, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), ((ressources_menage_179 <= - plafond__i_d521_3_358) and - log_end_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "output"], - log_begin_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - droit_ouvert_majoration_482, - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "input"], - param_536)))))): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.16")) - else: - raise EmptyError - def local_var_541(_:Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=95, start_column=3, - end_line=96, end_column=44, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (((ressources_menage_179 > - plafond__i_d521_3_358) and - (ressources_menage_179 <= - plafond__i_i_d521_3_344)) and - log_end_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "output"], - log_begin_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - droit_ouvert_majoration_482, - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "input"], - param_536)))))): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.08")) - else: - raise EmptyError - def local_var_539(_:Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=132, start_column=3, - end_line=132, end_column=41, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), ((ressources_menage_179 > - plafond__i_i_d521_3_344) and - log_end_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "output"], - log_begin_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - droit_ouvert_majoration_482, - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "input"], - param_536)))))): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.04")) - else: - raise EmptyError - def local_var_537(_:Any): - if log_decision_taken(SourcePosition(filename="./epilogue.catala_fr", - start_line=27, start_column=5, - end_line=27, end_column=44, - law_headings=["Règles diverses", "Épilogue", - "Décrets divers"]), not log_end_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "output"], - log_begin_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - droit_ouvert_majoration_482, - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "input"], - param_536))))): + def local_var_999(_: Any): + def local_var_1001(_: Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=55, start_column=3, + end_line=55, end_column=41, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), ((ressources_menage_287 <= + plafond__i_d521_3_578) and + log_end_call(["AllocationsFamiliales", + "droit_ouvert_majoration"], + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_majoration", "output"], + log_begin_call(["AllocationsFamiliales", + "droit_ouvert_majoration"], + droit_ouvert_majoration_874, + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_majoration", "input"], + param_980)))))) + + def local_var_1003(_: Any): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.16")) + return handle_default([], local_var_1001, + local_var_1003) + + def local_var_993(_: Any): + def local_var_995(_: Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=95, start_column=3, + end_line=96, end_column=44, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), (((ressources_menage_287 > + plafond__i_d521_3_578) and + (ressources_menage_287 <= + plafond__i_i_d521_3_548)) and + log_end_call(["AllocationsFamiliales", + "droit_ouvert_majoration"], + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_majoration", "output"], + log_begin_call(["AllocationsFamiliales", + "droit_ouvert_majoration"], + droit_ouvert_majoration_874, + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_majoration", "input"], + param_980)))))) + + def local_var_997(_: Any): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.08")) + return handle_default([], local_var_995, + local_var_997) + + def local_var_987(_: Any): + def local_var_989(_: Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=132, start_column=3, + end_line=132, end_column=41, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), ((ressources_menage_287 > + plafond__i_i_d521_3_548) and + log_end_call(["AllocationsFamiliales", + "droit_ouvert_majoration"], + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_majoration", "output"], + log_begin_call(["AllocationsFamiliales", + "droit_ouvert_majoration"], + droit_ouvert_majoration_874, + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_majoration", "input"], + param_980)))))) + + def local_var_991(_: Any): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.04")) + return handle_default([], local_var_989, + local_var_991) + + def local_var_981(_: Any): + def local_var_983(_: Any): + return log_decision_taken(SourcePosition(filename="./epilogue.catala_fr", + start_line=27, start_column=5, + end_line=27, end_column=44, + law_headings=["Règles diverses", + "Épilogue", + "Décrets divers"]), not log_end_call(["AllocationsFamiliales", + "droit_ouvert_majoration"], + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_majoration", "output"], + log_begin_call(["AllocationsFamiliales", + "droit_ouvert_majoration"], + droit_ouvert_majoration_874, + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_majoration", "input"], + param_980))))) + + def local_var_985(_: Any): return money_of_cents_string("0") - else: - raise EmptyError - def local_var_545(_:Any): + return handle_default([], local_var_983, + local_var_985) + + def local_var_1005(_: Any): return log_decision_taken(SourcePosition(filename="", - start_line=0, start_column=1, - end_line=0, end_column=1, - law_headings=[]), False) - def local_var_547(_:Any): + start_line=0, start_column=1, + end_line=0, end_column=1, + law_headings=[]), False) + + def local_var_1007(_: Any): raise EmptyError - return handle_default([local_var_537, local_var_539, - local_var_541, local_var_543], local_var_545, - local_var_547) + return handle_default([local_var_981, local_var_987, + local_var_993, local_var_999], local_var_1005, + local_var_1007) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=133, start_column=12, end_line=133, - end_column=48, law_headings=["Prologue"])) + start_line=133, start_column=12, end_line=133, + end_column=48, law_headings=["Prologue"])) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=133, start_column=12, end_line=133, end_column=48, - law_headings=["Prologue"])) - montant_initial_metropole_majoration_534 = log_variable_definition(["AllocationsFamiliales", - "montant_initial_métropole_majoration"], local_var_535) + start_line=133, start_column=12, end_line=133, end_column=48, + law_headings=["Prologue"])) + montant_initial_metropole_majoration_978 = log_variable_definition(["AllocationsFamiliales", + "montant_initial_métropole_majoration"], local_var_979) try: try: - local_var_550 = montant_verse_forfaitaire_158(Unit()) + local_var_1010 = montant_verse_forfaitaire_258(Unit()) except EmptyError: try: - def local_var_551(acc_552:Integer, enfant_553:Any): - if log_end_call(["AllocationsFamiliales", - "droit_ouvert_forfaitaire"], - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_forfaitaire", "output"], - log_begin_call(["AllocationsFamiliales", - "droit_ouvert_forfaitaire"], - droit_ouvert_forfaitaire_374, - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_forfaitaire", "input"], - enfant_553)))): - return (acc_552 + integer_of_string("1")) - else: - return acc_552 - local_var_550 = (montant_verse_forfaitaire_par_enfant_496 * - decimal_of_integer(list_fold_left(local_var_551, - integer_of_string("0"), enfants_a_charge_185))) + def local_var_1011(_: Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=194, start_column=14, + end_line=194, end_column=39, + law_headings=["Article D521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), True) + + def local_var_1013(_: Any): + def local_var_1015(acc_1016: Integer, enfant_1017: Any): + if log_end_call(["AllocationsFamiliales", + "droit_ouvert_forfaitaire"], + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_forfaitaire", "output"], + log_begin_call(["AllocationsFamiliales", + "droit_ouvert_forfaitaire"], + droit_ouvert_forfaitaire_614, + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_forfaitaire", "input"], + enfant_1017)))): + return (acc_1016 + integer_of_string("1")) + else: + return acc_1016 + return (montant_verse_forfaitaire_par_enfant_900 * + decimal_of_integer(list_fold_left(local_var_1015, + integer_of_string("0"), enfants_a_charge_305))) + local_var_1010 = handle_default([], local_var_1011, + local_var_1013) except EmptyError: raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=129, start_column=12, end_line=129, end_column=37, - law_headings=["Prologue"])) - montant_verse_forfaitaire_549 = log_variable_definition(["AllocationsFamiliales", - "montant_versé_forfaitaire"], local_var_550) + start_line=129, start_column=12, end_line=129, end_column=37, + law_headings=["Prologue"])) + montant_verse_forfaitaire_1009 = log_variable_definition(["AllocationsFamiliales", + "montant_versé_forfaitaire"], local_var_1010) try: try: - local_var_555 = montant_initial_base_142(Unit()) + local_var_1019 = montant_initial_base_242(Unit()) except EmptyError: try: - def local_var_558(_:Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=350, start_column=5, - end_line=351, end_column=69, - law_headings=["Article D755-5", - "Chapitre 5 : Prestations familiales et prestations assimilées", - "Titre 5 : Départements d'outre-mer", - "Livre 7 : Régimes divers - Dispositions diverses", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (prestations_familiales_dot_regime_outre_mer_l751_1_320 and - (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) == - integer_of_string("1")))): - return montant_initial_base_premier_enfant_470 - else: - raise EmptyError - def local_var_556(_:Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=335, start_column=5, - end_line=335, end_column=24, - law_headings=["Article 7", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), (residence_181 == - Collectivite(Collectivite_Code.Mayotte, - Unit()))): - return (montant_initial_base_premier_enfant_mayotte_431 + - (montant_initial_base_deuxieme_enfant_mayotte_405 + - (montant_initial_base_troisieme_enfant_mayotte_379 + - montant_initial_base_quatrieme_enfant_et_plus_mayotte_377))) - else: - raise EmptyError - def local_var_560(_:Any): + def local_var_1026(_: Any): + def local_var_1028(_: Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=350, start_column=5, + end_line=351, end_column=69, + law_headings=["Article D755-5", + "Chapitre 5 : Prestations familiales et prestations assimilées", + "Titre 5 : Départements d'outre-mer", + "Livre 7 : Régimes divers - Dispositions diverses", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), (prestations_familiales_dot_regime_outre_mer_l751_1_508 and + (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) == + integer_of_string("1")))) + + def local_var_1030(_: Any): + return montant_initial_base_premier_enfant_850 + return handle_default([], local_var_1028, local_var_1030) + + def local_var_1020(_: Any): + def local_var_1022(_: Any): + return log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=335, start_column=5, + end_line=335, end_column=24, + law_headings=["Article 7", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), (residence_293 == + Collectivite(Collectivite_Code.Mayotte, Unit()))) + + def local_var_1024(_: Any): + return (montant_initial_base_premier_enfant_mayotte_759 + + (montant_initial_base_deuxieme_enfant_mayotte_693 + + (montant_initial_base_troisieme_enfant_mayotte_627 + + montant_initial_base_quatrieme_enfant_et_plus_mayotte_621))) + return handle_default([], local_var_1022, local_var_1024) + + def local_var_1032(_: Any): return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=18, start_column=14, - end_line=18, end_column=34, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), True) - def local_var_562(_:Any): - return (montant_initial_base_deuxieme_enfant_520 + - montant_initial_base_troisieme_enfant_et_plus_508) - local_var_555 = handle_default([local_var_556, - local_var_558], local_var_560, local_var_562) + start_line=18, start_column=14, + end_line=18, end_column=34, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), True) + + def local_var_1034(_: Any): + return (montant_initial_base_deuxieme_enfant_948 + + montant_initial_base_troisieme_enfant_et_plus_924) + local_var_1019 = handle_default([local_var_1020, + local_var_1026], local_var_1032, local_var_1034) except EmptyError: raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=109, start_column=12, end_line=109, end_column=32, - law_headings=["Prologue"])) - montant_initial_base_554 = log_variable_definition(["AllocationsFamiliales", - "montant_initial_base"], local_var_555) + start_line=109, start_column=12, end_line=109, end_column=32, + law_headings=["Prologue"])) + montant_initial_base_1018 = log_variable_definition(["AllocationsFamiliales", + "montant_initial_base"], local_var_1019) try: try: - local_var_565 = montant_initial_majoration_161(Unit()) + local_var_1037 = montant_initial_majoration_261(Unit()) except EmptyError: - def local_var_565(param_566:Enfant): + def local_var_1037(param_1038: Enfant): try: try: - def local_var_569(_:Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=373, start_column=5, - end_line=376, end_column=42, - law_headings=["Article D755-5", - "Chapitre 5 : Prestations familiales et prestations assimilées", - "Titre 5 : Départements d'outre-mer", - "Livre 7 : Régimes divers - Dispositions diverses", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (log_end_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "output"], - log_begin_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - droit_ouvert_majoration_482, - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "input"], - param_566)))) and - (prestations_familiales_dot_regime_outre_mer_l751_1_320 and - ((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) == - integer_of_string("1")) and - ((param_566.age >= - integer_of_string("11")) and (param_566.age < - integer_of_string("16"))))))): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.0369")) - else: - raise EmptyError - def local_var_567(_:Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=382, start_column=5, - end_line=385, end_column=23, - law_headings=["Article D755-5", - "Chapitre 5 : Prestations familiales et prestations assimilées", - "Titre 5 : Départements d'outre-mer", - "Livre 7 : Régimes divers - Dispositions diverses", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (log_end_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "output"], - log_begin_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - droit_ouvert_majoration_482, - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "input"], - param_566)))) and - (prestations_familiales_dot_regime_outre_mer_l751_1_320 and - ((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_337) == - integer_of_string("1")) and (param_566.age >= - integer_of_string("16")))))): - return (prestations_familiales_dot_base_mensuelle_324 * - decimal_of_string("0.0567")) - else: - raise EmptyError - def local_var_571(_:Any): + def local_var_1045(_: Any): + def local_var_1047(_: Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=373, start_column=5, + end_line=376, end_column=42, + law_headings=["Article D755-5", + "Chapitre 5 : Prestations familiales et prestations assimilées", + "Titre 5 : Départements d'outre-mer", + "Livre 7 : Régimes divers - Dispositions diverses", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), (log_end_call(["AllocationsFamiliales", + "droit_ouvert_majoration"], + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_majoration", "output"], + log_begin_call(["AllocationsFamiliales", + "droit_ouvert_majoration"], + droit_ouvert_majoration_874, + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_majoration", "input"], + param_1038)))) and + (prestations_familiales_dot_regime_outre_mer_l751_1_508 and + ((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) == + integer_of_string("1")) and + ((param_1038.age >= + integer_of_string("11")) and + (param_1038.age < + integer_of_string("16"))))))) + + def local_var_1049(_: Any): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.0369")) + return handle_default([], local_var_1047, + local_var_1049) + + def local_var_1039(_: Any): + def local_var_1041(_: Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=382, start_column=5, + end_line=385, end_column=23, + law_headings=["Article D755-5", + "Chapitre 5 : Prestations familiales et prestations assimilées", + "Titre 5 : Départements d'outre-mer", + "Livre 7 : Régimes divers - Dispositions diverses", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), (log_end_call(["AllocationsFamiliales", + "droit_ouvert_majoration"], + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_majoration", "output"], + log_begin_call(["AllocationsFamiliales", + "droit_ouvert_majoration"], + droit_ouvert_majoration_874, + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_majoration", "input"], + param_1038)))) and + (prestations_familiales_dot_regime_outre_mer_l751_1_508 and + ((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_533) == + integer_of_string("1")) and + (param_1038.age >= + integer_of_string("16")))))) + + def local_var_1043(_: Any): + return (prestations_familiales_dot_base_mensuelle_512 * + decimal_of_string("0.0567")) + return handle_default([], local_var_1041, + local_var_1043) + + def local_var_1051(_: Any): return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=22, start_column=14, - end_line=22, end_column=40, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), True) - def local_var_573(_:Any): + start_line=22, start_column=14, + end_line=22, end_column=40, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), True) + + def local_var_1053(_: Any): return log_end_call(["AllocationsFamiliales", - "montant_initial_métropole_majoration"], - log_variable_definition(["AllocationsFamiliales", - "montant_initial_métropole_majoration", - "output"], - log_begin_call(["AllocationsFamiliales", - "montant_initial_métropole_majoration"], - montant_initial_metropole_majoration_534, - log_variable_definition(["AllocationsFamiliales", - "montant_initial_métropole_majoration", - "input"], param_566)))) - return handle_default([local_var_567, local_var_569], - local_var_571, local_var_573) + "montant_initial_métropole_majoration"], + log_variable_definition(["AllocationsFamiliales", + "montant_initial_métropole_majoration", + "output"], + log_begin_call(["AllocationsFamiliales", + "montant_initial_métropole_majoration"], + montant_initial_metropole_majoration_978, + log_variable_definition(["AllocationsFamiliales", + "montant_initial_métropole_majoration", + "input"], param_1038)))) + return handle_default([local_var_1039, + local_var_1045], local_var_1051, local_var_1053) except EmptyError: raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=134, start_column=12, end_line=134, - end_column=38, law_headings=["Prologue"])) + start_line=134, start_column=12, end_line=134, + end_column=38, law_headings=["Prologue"])) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=134, start_column=12, end_line=134, end_column=38, - law_headings=["Prologue"])) - montant_initial_majoration_564 = log_variable_definition(["AllocationsFamiliales", - "montant_initial_majoration"], local_var_565) + start_line=134, start_column=12, end_line=134, end_column=38, + law_headings=["Prologue"])) + montant_initial_majoration_1036 = log_variable_definition(["AllocationsFamiliales", + "montant_initial_majoration"], local_var_1037) try: try: - local_var_576 = montant_verse_complement_pour_forfaitaire_168(Unit()) + local_var_1056 = montant_verse_complement_pour_forfaitaire_268( + Unit()) except EmptyError: try: - def local_var_579(_:Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=262, start_column=5, - end_line=264, end_column=42, - law_headings=["Article D521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), ((ressources_menage_179 > - plafond__i_d521_3_358) and (ressources_menage_179 <= - (plafond__i_d521_3_358 + - (montant_verse_forfaitaire_549 * - decimal_of_string("12.")))))): - return ((plafond__i_d521_3_358 + - ((montant_verse_forfaitaire_549 * - decimal_of_string("12.")) - - ressources_menage_179)) * - (decimal_of_string("1.") / - decimal_of_string("12."))) - else: - raise EmptyError - def local_var_577(_:Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=272, start_column=5, - end_line=274, end_column=41, - law_headings=["Article D521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), ((ressources_menage_179 > - plafond__i_i_d521_3_344) and - (ressources_menage_179 <= (plafond__i_i_d521_3_344 + - (montant_verse_forfaitaire_549 * - decimal_of_string("12.")))))): - return ((plafond__i_i_d521_3_344 + - ((montant_verse_forfaitaire_549 * - decimal_of_string("12.")) - - ressources_menage_179)) * - (decimal_of_string("1.") / - decimal_of_string("12."))) - else: - raise EmptyError - def local_var_581(_:Any): + def local_var_1063(_: Any): + def local_var_1065(_: Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=262, start_column=5, + end_line=264, end_column=42, + law_headings=["Article D521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), ((ressources_menage_287 > + plafond__i_d521_3_578) and + (ressources_menage_287 <= + (plafond__i_d521_3_578 + + (montant_verse_forfaitaire_1009 * + decimal_of_string("12.")))))) + + def local_var_1067(_: Any): + return ((plafond__i_d521_3_578 + + ((montant_verse_forfaitaire_1009 * + decimal_of_string("12.")) - + ressources_menage_287)) * + (decimal_of_string("1.") / + decimal_of_string("12."))) + return handle_default([], local_var_1065, local_var_1067) + + def local_var_1057(_: Any): + def local_var_1059(_: Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=272, start_column=5, + end_line=274, end_column=41, + law_headings=["Article D521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), ((ressources_menage_287 > + plafond__i_i_d521_3_548) and + (ressources_menage_287 <= + (plafond__i_i_d521_3_548 + + (montant_verse_forfaitaire_1009 * + decimal_of_string("12.")))))) + + def local_var_1061(_: Any): + return ((plafond__i_i_d521_3_548 + + ((montant_verse_forfaitaire_1009 * + decimal_of_string("12.")) - + ressources_menage_287)) * + (decimal_of_string("1.") / + decimal_of_string("12."))) + return handle_default([], local_var_1059, local_var_1061) + + def local_var_1069(_: Any): return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=280, start_column=14, - end_line=280, end_column=55, - law_headings=["Article D521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), True) - def local_var_583(_:Any): + start_line=280, start_column=14, + end_line=280, end_column=55, + law_headings=["Article D521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), True) + + def local_var_1071(_: Any): return money_of_cents_string("0") - local_var_576 = handle_default([local_var_577, - local_var_579], local_var_581, local_var_583) + local_var_1056 = handle_default([local_var_1057, + local_var_1063], local_var_1069, local_var_1071) except EmptyError: raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=143, start_column=12, end_line=143, end_column=53, - law_headings=["Prologue"])) - montant_verse_complement_pour_forfaitaire_575 = log_variable_definition(["AllocationsFamiliales", - "montant_versé_complément_pour_forfaitaire"], local_var_576) + start_line=143, start_column=12, end_line=143, end_column=53, + law_headings=["Prologue"])) + montant_verse_complement_pour_forfaitaire_1055 = log_variable_definition(["AllocationsFamiliales", + "montant_versé_complément_pour_forfaitaire"], local_var_1056) try: try: - local_var_586 = montant_avec_garde_alternee_base_149(Unit()) + local_var_1074 = montant_avec_garde_alternee_base_249(Unit()) except EmptyError: try: - local_var_586 = (montant_initial_base_554 * - rapport_enfants_total_moyen_532) + def local_var_1075(_: Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_R.catala_fr", + start_line=125, start_column=14, + end_line=125, end_column=46, + law_headings=["Article R521-3", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets en Conseil d'Etat", + "Code de la sécurité sociale"]), True) + + def local_var_1077(_: Any): + return (montant_initial_base_1018 * + rapport_enfants_total_moyen_972) + local_var_1074 = handle_default([], local_var_1075, + local_var_1077) except EmptyError: raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=116, start_column=12, end_line=116, end_column=44, - law_headings=["Prologue"])) - montant_avec_garde_alternee_base_585 = log_variable_definition(["AllocationsFamiliales", - "montant_avec_garde_alternée_base"], local_var_586) + start_line=116, start_column=12, end_line=116, end_column=44, + law_headings=["Prologue"])) + montant_avec_garde_alternee_base_1073 = log_variable_definition(["AllocationsFamiliales", + "montant_avec_garde_alternée_base"], local_var_1074) try: try: - local_var_588 = montant_avec_garde_alternee_majoration_162(Unit()) + local_var_1080 = montant_avec_garde_alternee_majoration_262(Unit()) except EmptyError: - def local_var_588(param_589:Enfant): + def local_var_1080(param_1081: Enfant): try: try: - match_arg_802 = log_end_call(["AllocationsFamiliales", - "prise_en_compte"], - log_variable_definition(["AllocationsFamiliales", - "prise_en_compte", "output"], - log_begin_call(["AllocationsFamiliales", - "prise_en_compte"], prise_en_compte_187, - log_variable_definition(["AllocationsFamiliales", - "prise_en_compte", "input"], - param_589)))) - if match_arg_802.code == PriseEnCompte_Code.Complete: - _ = match_arg_802.value - local_var_590 = decimal_of_string("1.") - elif match_arg_802.code == PriseEnCompte_Code.Partagee: - _ = match_arg_802.value - local_var_590 = decimal_of_string("0.5") - elif match_arg_802.code == PriseEnCompte_Code.Zero: - _ = match_arg_802.value - local_var_590 = decimal_of_string("0.") - return (log_end_call(["AllocationsFamiliales", - "montant_initial_majoration"], - log_variable_definition(["AllocationsFamiliales", - "montant_initial_majoration", "output"], - log_begin_call(["AllocationsFamiliales", - "montant_initial_majoration"], - montant_initial_majoration_564, - log_variable_definition(["AllocationsFamiliales", - "montant_initial_majoration", "input"], - param_589)))) * local_var_590) + def local_var_1082(_: Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_R.catala_fr", + start_line=187, start_column=5, + end_line=187, end_column=43, + law_headings=["Article R521-4", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets en Conseil d'Etat", + "Code de la sécurité sociale"]), True) + + def local_var_1084(_: Any): + match_arg_1382 = log_end_call(["AllocationsFamiliales", + "prise_en_compte"], + log_variable_definition(["AllocationsFamiliales", + "prise_en_compte", "output"], + log_begin_call(["AllocationsFamiliales", + "prise_en_compte"], prise_en_compte_311, + log_variable_definition(["AllocationsFamiliales", + "prise_en_compte", "input"], + param_1081)))) + if match_arg_1382.code == PriseEnCompte_Code.Complete: + _ = match_arg_1382.value + local_var_1086 = decimal_of_string("1.") + elif match_arg_1382.code == PriseEnCompte_Code.Partagee: + _ = match_arg_1382.value + local_var_1086 = decimal_of_string("0.5") + elif match_arg_1382.code == PriseEnCompte_Code.Zero: + _ = match_arg_1382.value + local_var_1086 = decimal_of_string("0.") + return (log_end_call(["AllocationsFamiliales", + "montant_initial_majoration"], + log_variable_definition(["AllocationsFamiliales", + "montant_initial_majoration", "output"], + log_begin_call(["AllocationsFamiliales", + "montant_initial_majoration"], + montant_initial_majoration_1036, + log_variable_definition(["AllocationsFamiliales", + "montant_initial_majoration", "input"], + param_1081)))) * local_var_1086) + return handle_default([], local_var_1082, + local_var_1084) except EmptyError: raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=135, start_column=12, end_line=135, - end_column=50, law_headings=["Prologue"])) + start_line=135, start_column=12, end_line=135, + end_column=50, law_headings=["Prologue"])) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=135, start_column=12, end_line=135, end_column=50, - law_headings=["Prologue"])) - montant_avec_garde_alternee_majoration_587 = log_variable_definition(["AllocationsFamiliales", - "montant_avec_garde_alternée_majoration"], local_var_588) + start_line=135, start_column=12, end_line=135, end_column=50, + law_headings=["Prologue"])) + montant_avec_garde_alternee_majoration_1079 = log_variable_definition(["AllocationsFamiliales", + "montant_avec_garde_alternée_majoration"], local_var_1080) try: try: - local_var_595 = montant_verse_base_150(Unit()) + local_var_1091 = montant_verse_base_250(Unit()) except EmptyError: try: - if droit_ouvert_base_472: - local_var_595 = montant_avec_garde_alternee_base_585 - else: - local_var_595 = money_of_cents_string("0") + def local_var_1092(_: Any): + return log_decision_taken(SourcePosition(filename="./epilogue.catala_fr", + start_line=36, start_column=14, + end_line=36, end_column=32, + law_headings=["Règles diverses", "Épilogue", + "Décrets divers"]), True) + + def local_var_1094(_: Any): + if droit_ouvert_base_856: + return montant_avec_garde_alternee_base_1073 + else: + return money_of_cents_string("0") + local_var_1091 = handle_default([], local_var_1092, + local_var_1094) except EmptyError: raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=117, start_column=12, end_line=117, end_column=30, - law_headings=["Prologue"])) - montant_verse_base_594 = log_variable_definition(["AllocationsFamiliales", - "montant_versé_base"], local_var_595) + start_line=117, start_column=12, end_line=117, end_column=30, + law_headings=["Prologue"])) + montant_verse_base_1090 = log_variable_definition(["AllocationsFamiliales", + "montant_versé_base"], local_var_1091) try: try: - local_var_597 = montant_verse_majoration_163(Unit()) + local_var_1097 = montant_verse_majoration_263(Unit()) except EmptyError: try: - if droit_ouvert_base_472: - def local_var_598(acc_599:Money, enfant_600:Any): - return (acc_599 + - log_end_call(["AllocationsFamiliales", - "montant_avec_garde_alternée_majoration"], - log_variable_definition(["AllocationsFamiliales", - "montant_avec_garde_alternée_majoration", - "output"], - log_begin_call(["AllocationsFamiliales", - "montant_avec_garde_alternée_majoration"], - montant_avec_garde_alternee_majoration_587, - log_variable_definition(["AllocationsFamiliales", - "montant_avec_garde_alternée_majoration", - "input"], enfant_600))))) - local_var_597 = list_fold_left(local_var_598, - money_of_cents_string("0"), enfants_a_charge_185) - else: - local_var_597 = money_of_cents_string("0") + def local_var_1098(_: Any): + return log_decision_taken(SourcePosition(filename="./epilogue.catala_fr", + start_line=38, start_column=14, + end_line=38, end_column=38, + law_headings=["Règles diverses", "Épilogue", + "Décrets divers"]), True) + + def local_var_1100(_: Any): + if droit_ouvert_base_856: + def local_var_1102(acc_1103: Money, enfant_1104: Any): + return (acc_1103 + + log_end_call(["AllocationsFamiliales", + "montant_avec_garde_alternée_majoration"], + log_variable_definition(["AllocationsFamiliales", + "montant_avec_garde_alternée_majoration", + "output"], + log_begin_call(["AllocationsFamiliales", + "montant_avec_garde_alternée_majoration"], + montant_avec_garde_alternee_majoration_1079, + log_variable_definition(["AllocationsFamiliales", + "montant_avec_garde_alternée_majoration", + "input"], enfant_1104))))) + return list_fold_left(local_var_1102, + money_of_cents_string("0"), enfants_a_charge_305) + else: + return money_of_cents_string("0") + local_var_1097 = handle_default([], local_var_1098, + local_var_1100) except EmptyError: raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=136, start_column=12, end_line=136, end_column=36, - law_headings=["Prologue"])) - montant_verse_majoration_596 = log_variable_definition(["AllocationsFamiliales", - "montant_versé_majoration"], local_var_597) + start_line=136, start_column=12, end_line=136, end_column=36, + law_headings=["Prologue"])) + montant_verse_majoration_1096 = log_variable_definition(["AllocationsFamiliales", + "montant_versé_majoration"], local_var_1097) try: try: - local_var_602 = montant_base_complement_pour_base_et_majoration_165(Unit()) + local_var_1106 = montant_base_complement_pour_base_et_majoration_265( + Unit()) except EmptyError: try: - local_var_602 = (montant_verse_base_594 + - montant_verse_majoration_596) + def local_var_1107(_: Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=184, start_column=14, + end_line=184, end_column=61, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), True) + + def local_var_1109(_: Any): + return (montant_verse_base_1090 + + montant_verse_majoration_1096) + local_var_1106 = handle_default([], local_var_1107, + local_var_1109) except EmptyError: raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=140, start_column=12, end_line=140, end_column=59, - law_headings=["Prologue"])) - montant_base_complement_pour_base_et_majoration_601 = log_variable_definition(["AllocationsFamiliales", - "montant_base_complément_pour_base_et_majoration"], local_var_602) + start_line=140, start_column=12, end_line=140, end_column=59, + law_headings=["Prologue"])) + montant_base_complement_pour_base_et_majoration_1105 = log_variable_definition(["AllocationsFamiliales", + "montant_base_complément_pour_base_et_majoration"], local_var_1106) try: try: - local_var_604 = montant_verse_complement_pour_base_et_majoration_167(Unit()) + local_var_1112 = montant_verse_complement_pour_base_et_majoration_267( + Unit()) except EmptyError: try: - if droit_ouvert_complement_372: - local_var_604 = log_end_call(["AllocationsFamiliales", - "complément_dégressif"], - log_variable_definition(["AllocationsFamiliales", - "complément_dégressif", "output"], - log_begin_call(["AllocationsFamiliales", - "complément_dégressif"], complement_degressif_485, - log_variable_definition(["AllocationsFamiliales", - "complément_dégressif", "input"], - montant_base_complement_pour_base_et_majoration_601)))) - else: - local_var_604 = money_of_cents_string("0") + def local_var_1113(_: Any): + return log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=178, start_column=14, + end_line=178, end_column=62, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), True) + + def local_var_1115(_: Any): + if droit_ouvert_complement_608: + return log_end_call(["AllocationsFamiliales", + "complément_dégressif"], + log_variable_definition(["AllocationsFamiliales", + "complément_dégressif", "output"], + log_begin_call(["AllocationsFamiliales", + "complément_dégressif"], + complement_degressif_881, + log_variable_definition(["AllocationsFamiliales", + "complément_dégressif", "input"], + montant_base_complement_pour_base_et_majoration_1105)))) + else: + return money_of_cents_string("0") + local_var_1112 = handle_default([], local_var_1113, + local_var_1115) except EmptyError: raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=142, start_column=12, end_line=142, end_column=60, - law_headings=["Prologue"])) - montant_verse_complement_pour_base_et_majoration_603 = log_variable_definition(["AllocationsFamiliales", - "montant_versé_complément_pour_base_et_majoration"], local_var_604) + start_line=142, start_column=12, end_line=142, end_column=60, + law_headings=["Prologue"])) + montant_verse_complement_pour_base_et_majoration_1111 = log_variable_definition(["AllocationsFamiliales", + "montant_versé_complément_pour_base_et_majoration"], + local_var_1112) try: try: - local_var_606 = montant_verse_140(Unit()) + local_var_1118 = montant_verse_240(Unit()) except EmptyError: try: - if droit_ouvert_base_472: - local_var_606 = (montant_verse_base_594 + - (montant_verse_majoration_596 + - (montant_verse_forfaitaire_549 + - (montant_verse_complement_pour_base_et_majoration_603 + - montant_verse_complement_pour_forfaitaire_575)))) - else: - local_var_606 = money_of_cents_string("0") + def local_var_1119(_: Any): + return log_decision_taken(SourcePosition(filename="./epilogue.catala_fr", + start_line=44, start_column=14, + end_line=44, end_column=27, + law_headings=["Règles diverses", "Épilogue", + "Décrets divers"]), True) + + def local_var_1121(_: Any): + if droit_ouvert_base_856: + return (montant_verse_base_1090 + + (montant_verse_majoration_1096 + + (montant_verse_forfaitaire_1009 + + (montant_verse_complement_pour_base_et_majoration_1111 + + montant_verse_complement_pour_forfaitaire_1055)))) + else: + return money_of_cents_string("0") + local_var_1118 = handle_default([], local_var_1119, + local_var_1121) except EmptyError: raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=105, start_column=12, end_line=105, end_column=25, - law_headings=["Prologue"])) - montant_verse_605 = log_variable_definition(["AllocationsFamiliales", - "montant_versé"], local_var_606) - assert (personne_charge_effective_permanente_est_parent_175 or - (not personne_charge_effective_permanente_est_parent_175 and - personne_charge_effective_permanente_remplit_titre__i_177)) - return AllocationsFamilialesOut(personne_charge_effective_permanente_est_parent_out = personne_charge_effective_permanente_est_parent_175, - personne_charge_effective_permanente_remplit_titre_I_out = personne_charge_effective_permanente_remplit_titre__i_177, - ressources_menage_out = ressources_menage_179, - residence_out = residence_181, date_courante_out = date_courante_183, - enfants_a_charge_out = enfants_a_charge_185, - enfants_a_charge_droit_ouvert_prestation_familiale_out = enfants_a_charge_droit_ouvert_prestation_familiale_337, - prise_en_compte_out = prise_en_compte_187, - versement_out = versement_234, montant_verse_out = montant_verse_605, - droit_ouvert_base_out = droit_ouvert_base_472, - montant_initial_base_out = montant_initial_base_554, - montant_initial_base_premier_enfant_out = montant_initial_base_premier_enfant_470, - montant_initial_base_deuxieme_enfant_out = montant_initial_base_deuxieme_enfant_520, - montant_initial_base_troisieme_enfant_et_plus_out = montant_initial_base_troisieme_enfant_et_plus_508, - rapport_enfants_total_moyen_out = rapport_enfants_total_moyen_532, - nombre_moyen_enfants_out = nombre_moyen_enfants_461, - nombre_total_enfants_out = nombre_total_enfants_459, - montant_avec_garde_alternee_base_out = montant_avec_garde_alternee_base_585, - montant_verse_base_out = montant_verse_base_594, - avait_enfant_a_charge_avant_1er_janvier_2012_out = avait_enfant_a_charge_avant_1er_janvier_2012_281, - montant_initial_base_premier_enfant_mayotte_out = montant_initial_base_premier_enfant_mayotte_431, - montant_initial_base_deuxieme_enfant_mayotte_out = montant_initial_base_deuxieme_enfant_mayotte_405, - montant_initial_base_troisieme_enfant_mayotte_out = montant_initial_base_troisieme_enfant_mayotte_379, - montant_initial_base_quatrieme_enfant_et_plus_mayotte_out = montant_initial_base_quatrieme_enfant_et_plus_mayotte_377, - droit_ouvert_forfaitaire_out = droit_ouvert_forfaitaire_374, - montant_verse_forfaitaire_par_enfant_out = montant_verse_forfaitaire_par_enfant_496, - montant_verse_forfaitaire_out = montant_verse_forfaitaire_549, - droit_ouvert_majoration_out = droit_ouvert_majoration_482, - montant_initial_metropole_majoration_out = montant_initial_metropole_majoration_534, - montant_initial_majoration_out = montant_initial_majoration_564, - montant_avec_garde_alternee_majoration_out = montant_avec_garde_alternee_majoration_587, - montant_verse_majoration_out = montant_verse_majoration_596, - droit_ouvert_complement_out = droit_ouvert_complement_372, - montant_base_complement_pour_base_et_majoration_out = montant_base_complement_pour_base_et_majoration_601, - complement_degressif_out = complement_degressif_485, - montant_verse_complement_pour_base_et_majoration_out = montant_verse_complement_pour_base_et_majoration_603, - montant_verse_complement_pour_forfaitaire_out = montant_verse_complement_pour_forfaitaire_575, - nombre_enfants_l521_1_out = nombre_enfants_l521_1_283, - age_minimum_alinea_1_l521_3_out = age_minimum_alinea_1_l521_3_334, - nombre_enfants_alinea_2_l521_3_out = nombre_enfants_alinea_2_l521_3_285, - est_enfant_le_plus_age_out = est_enfant_le_plus_age_341, - plafond_I_d521_3_out = plafond__i_d521_3_358, - plafond_II_d521_3_out = plafond__i_i_d521_3_344) - -def interface_allocations_familiales(interface_allocations_familiales_in_607:InterfaceAllocationsFamilialesIn): - date_courante_608 = interface_allocations_familiales_in_607.date_courante_in - enfants_609 = interface_allocations_familiales_in_607.enfants_in - enfants_a_charge_610 = interface_allocations_familiales_in_607.enfants_a_charge_in - ressources_menage_611 = interface_allocations_familiales_in_607.ressources_menage_in - residence_612 = interface_allocations_familiales_in_607.residence_in - montant_verse_613 = interface_allocations_familiales_in_607.montant_verse_in - personne_charge_effective_permanente_est_parent_614 = interface_allocations_familiales_in_607.personne_charge_effective_permanente_est_parent_in - personne_charge_effective_permanente_remplit_titre__i_615 = interface_allocations_familiales_in_607.personne_charge_effective_permanente_remplit_titre_I_in - avait_enfant_a_charge_avant_1er_janvier_2012_616 = interface_allocations_familiales_in_607.avait_enfant_a_charge_avant_1er_janvier_2012_in + start_line=105, start_column=12, end_line=105, end_column=25, + law_headings=["Prologue"])) + montant_verse_1117 = log_variable_definition(["AllocationsFamiliales", + "montant_versé"], local_var_1118) + assert (personne_charge_effective_permanente_est_parent_275 or + (not personne_charge_effective_permanente_est_parent_275 and + personne_charge_effective_permanente_remplit_titre__i_281)) + return AllocationsFamilialesOut(personne_charge_effective_permanente_est_parent_out=personne_charge_effective_permanente_est_parent_275, + personne_charge_effective_permanente_remplit_titre_I_out=personne_charge_effective_permanente_remplit_titre__i_281, + ressources_menage_out=ressources_menage_287, + residence_out=residence_293, date_courante_out=date_courante_299, + enfants_a_charge_out=enfants_a_charge_305, + enfants_a_charge_droit_ouvert_prestation_familiale_out=enfants_a_charge_droit_ouvert_prestation_familiale_533, + prise_en_compte_out=prise_en_compte_311, + versement_out=versement_378, + montant_verse_out=montant_verse_1117, + droit_ouvert_base_out=droit_ouvert_base_856, + montant_initial_base_out=montant_initial_base_1018, + montant_initial_base_premier_enfant_out=montant_initial_base_premier_enfant_850, + montant_initial_base_deuxieme_enfant_out=montant_initial_base_deuxieme_enfant_948, + montant_initial_base_troisieme_enfant_et_plus_out=montant_initial_base_troisieme_enfant_et_plus_924, + rapport_enfants_total_moyen_out=rapport_enfants_total_moyen_972, + nombre_moyen_enfants_out=nombre_moyen_enfants_837, + nombre_total_enfants_out=nombre_total_enfants_831, + montant_avec_garde_alternee_base_out=montant_avec_garde_alternee_base_1073, + montant_verse_base_out=montant_verse_base_1090, + avait_enfant_a_charge_avant_1er_janvier_2012_out=avait_enfant_a_charge_avant_1er_janvier_2012_445, + montant_initial_base_premier_enfant_mayotte_out=montant_initial_base_premier_enfant_mayotte_759, + montant_initial_base_deuxieme_enfant_mayotte_out=montant_initial_base_deuxieme_enfant_mayotte_693, + montant_initial_base_troisieme_enfant_mayotte_out=montant_initial_base_troisieme_enfant_mayotte_627, + montant_initial_base_quatrieme_enfant_et_plus_mayotte_out=montant_initial_base_quatrieme_enfant_et_plus_mayotte_621, + droit_ouvert_forfaitaire_out=droit_ouvert_forfaitaire_614, + montant_verse_forfaitaire_par_enfant_out=montant_verse_forfaitaire_par_enfant_900, + montant_verse_forfaitaire_out=montant_verse_forfaitaire_1009, + droit_ouvert_majoration_out=droit_ouvert_majoration_874, + montant_initial_metropole_majoration_out=montant_initial_metropole_majoration_978, + montant_initial_majoration_out=montant_initial_majoration_1036, + montant_avec_garde_alternee_majoration_out=montant_avec_garde_alternee_majoration_1079, + montant_verse_majoration_out=montant_verse_majoration_1096, + droit_ouvert_complement_out=droit_ouvert_complement_608, + montant_base_complement_pour_base_et_majoration_out=montant_base_complement_pour_base_et_majoration_1105, + complement_degressif_out=complement_degressif_881, + montant_verse_complement_pour_base_et_majoration_out=montant_verse_complement_pour_base_et_majoration_1111, + montant_verse_complement_pour_forfaitaire_out=montant_verse_complement_pour_forfaitaire_1055, + nombre_enfants_l521_1_out=nombre_enfants_l521_1_451, + age_minimum_alinea_1_l521_3_out=age_minimum_alinea_1_l521_3_526, + nombre_enfants_alinea_2_l521_3_out=nombre_enfants_alinea_2_l521_3_457, + est_enfant_le_plus_age_out=est_enfant_le_plus_age_541, + plafond_I_d521_3_out=plafond__i_d521_3_578, + plafond_II_d521_3_out=plafond__i_i_d521_3_548) + + +def interface_allocations_familiales(interface_allocations_familiales_in_1123: InterfaceAllocationsFamilialesIn): + date_courante_1124 = interface_allocations_familiales_in_1123.date_courante_in + enfants_1125 = interface_allocations_familiales_in_1123.enfants_in + enfants_a_charge_1126 = interface_allocations_familiales_in_1123.enfants_a_charge_in + ressources_menage_1127 = interface_allocations_familiales_in_1123.ressources_menage_in + residence_1128 = interface_allocations_familiales_in_1123.residence_in + montant_verse_1129 = interface_allocations_familiales_in_1123.montant_verse_in + personne_charge_effective_permanente_est_parent_1130 = interface_allocations_familiales_in_1123.personne_charge_effective_permanente_est_parent_in + personne_charge_effective_permanente_remplit_titre__i_1131 = interface_allocations_familiales_in_1123.personne_charge_effective_permanente_remplit_titre_I_in + avait_enfant_a_charge_avant_1er_janvier_2012_1132 = interface_allocations_familiales_in_1123.avait_enfant_a_charge_avant_1er_janvier_2012_in try: try: - local_var_618 = date_courante_608(Unit()) + local_var_1134 = date_courante_1124(Unit()) except EmptyError: - if log_decision_taken(SourcePosition(filename="", start_line=0, - start_column=1, end_line=0, end_column=1, - law_headings=[]), False): - raise EmptyError - else: + def local_var_1135(_: Any): + return log_decision_taken(SourcePosition(filename="", + start_line=0, start_column=1, end_line=0, end_column=1, + law_headings=[]), False) + + def local_var_1137(_: Any): raise EmptyError + local_var_1134 = handle_default([], local_var_1135, + local_var_1137) except EmptyError: raise NoValueProvided(SourcePosition(filename="./epilogue.catala_fr", - start_line=72, start_column=12, end_line=72, end_column=25, - law_headings=["Interface du programme", "Épilogue", - "Décrets divers"])) - date_courante_617 = log_variable_definition(["InterfaceAllocationsFamiliales", - "date_courante"], local_var_618) + start_line=72, start_column=12, end_line=72, end_column=25, + law_headings=["Interface du programme", "Épilogue", + "Décrets divers"])) + date_courante_1133 = log_variable_definition(["InterfaceAllocationsFamiliales", + "date_courante"], local_var_1134) try: try: - local_var_620 = enfants_609(Unit()) + local_var_1140 = enfants_1125(Unit()) except EmptyError: - if log_decision_taken(SourcePosition(filename="", start_line=0, - start_column=1, end_line=0, end_column=1, - law_headings=[]), False): - raise EmptyError - else: + def local_var_1141(_: Any): + return log_decision_taken(SourcePosition(filename="", + start_line=0, start_column=1, end_line=0, end_column=1, + law_headings=[]), False) + + def local_var_1143(_: Any): raise EmptyError + local_var_1140 = handle_default([], local_var_1141, + local_var_1143) except EmptyError: raise NoValueProvided(SourcePosition(filename="./epilogue.catala_fr", - start_line=73, start_column=12, end_line=73, end_column=19, - law_headings=["Interface du programme", "Épilogue", - "Décrets divers"])) - enfants_619 = log_variable_definition(["InterfaceAllocationsFamiliales", - "enfants"], local_var_620) + start_line=73, start_column=12, end_line=73, end_column=19, + law_headings=["Interface du programme", "Épilogue", + "Décrets divers"])) + enfants_1139 = log_variable_definition(["InterfaceAllocationsFamiliales", + "enfants"], local_var_1140) try: try: - local_var_622 = ressources_menage_611(Unit()) + local_var_1146 = ressources_menage_1127(Unit()) except EmptyError: - if log_decision_taken(SourcePosition(filename="", start_line=0, - start_column=1, end_line=0, end_column=1, - law_headings=[]), False): - raise EmptyError - else: + def local_var_1147(_: Any): + return log_decision_taken(SourcePosition(filename="", + start_line=0, start_column=1, end_line=0, end_column=1, + law_headings=[]), False) + + def local_var_1149(_: Any): raise EmptyError + local_var_1146 = handle_default([], local_var_1147, + local_var_1149) except EmptyError: raise NoValueProvided(SourcePosition(filename="./epilogue.catala_fr", - start_line=76, start_column=12, end_line=76, end_column=29, - law_headings=["Interface du programme", "Épilogue", - "Décrets divers"])) - ressources_menage_621 = log_variable_definition(["InterfaceAllocationsFamiliales", - "ressources_ménage"], local_var_622) + start_line=76, start_column=12, end_line=76, end_column=29, + law_headings=["Interface du programme", "Épilogue", + "Décrets divers"])) + ressources_menage_1145 = log_variable_definition(["InterfaceAllocationsFamiliales", + "ressources_ménage"], local_var_1146) try: try: - local_var_624 = residence_612(Unit()) + local_var_1152 = residence_1128(Unit()) except EmptyError: - if log_decision_taken(SourcePosition(filename="", start_line=0, - start_column=1, end_line=0, end_column=1, - law_headings=[]), False): - raise EmptyError - else: + def local_var_1153(_: Any): + return log_decision_taken(SourcePosition(filename="", + start_line=0, start_column=1, end_line=0, end_column=1, + law_headings=[]), False) + + def local_var_1155(_: Any): raise EmptyError + local_var_1152 = handle_default([], local_var_1153, + local_var_1155) except EmptyError: raise NoValueProvided(SourcePosition(filename="./epilogue.catala_fr", - start_line=77, start_column=12, end_line=77, end_column=21, - law_headings=["Interface du programme", "Épilogue", - "Décrets divers"])) - residence_623 = log_variable_definition(["InterfaceAllocationsFamiliales", - "résidence"], local_var_624) + start_line=77, start_column=12, end_line=77, end_column=21, + law_headings=["Interface du programme", "Épilogue", + "Décrets divers"])) + residence_1151 = log_variable_definition(["InterfaceAllocationsFamiliales", + "résidence"], local_var_1152) try: try: - local_var_626 = personne_charge_effective_permanente_est_parent_614(Unit()) + local_var_1158 = personne_charge_effective_permanente_est_parent_1130( + Unit()) except EmptyError: - if log_decision_taken(SourcePosition(filename="", start_line=0, - start_column=1, end_line=0, end_column=1, - law_headings=[]), True): - local_var_626 = False - else: - raise EmptyError + def local_var_1159(_: Any): + return log_decision_taken(SourcePosition(filename="", + start_line=0, start_column=1, end_line=0, end_column=1, + law_headings=[]), True) + + def local_var_1161(_: Any): + return False + local_var_1158 = handle_default([], local_var_1159, + local_var_1161) except EmptyError: raise NoValueProvided(SourcePosition(filename="./epilogue.catala_fr", - start_line=79, start_column=12, end_line=79, end_column=59, - law_headings=["Interface du programme", "Épilogue", - "Décrets divers"])) - personne_charge_effective_permanente_est_parent_625 = log_variable_definition(["InterfaceAllocationsFamiliales", - "personne_charge_effective_permanente_est_parent"], local_var_626) + start_line=79, start_column=12, end_line=79, end_column=59, + law_headings=["Interface du programme", "Épilogue", + "Décrets divers"])) + personne_charge_effective_permanente_est_parent_1157 = log_variable_definition(["InterfaceAllocationsFamiliales", + "personne_charge_effective_permanente_est_parent"], local_var_1158) try: try: - local_var_628 = personne_charge_effective_permanente_remplit_titre__i_615(Unit()) + local_var_1164 = personne_charge_effective_permanente_remplit_titre__i_1131( + Unit()) except EmptyError: - if log_decision_taken(SourcePosition(filename="", start_line=0, - start_column=1, end_line=0, end_column=1, - law_headings=[]), True): - local_var_628 = False - else: - raise EmptyError + def local_var_1165(_: Any): + return log_decision_taken(SourcePosition(filename="", + start_line=0, start_column=1, end_line=0, end_column=1, + law_headings=[]), True) + + def local_var_1167(_: Any): + return False + local_var_1164 = handle_default([], local_var_1165, + local_var_1167) except EmptyError: raise NoValueProvided(SourcePosition(filename="./epilogue.catala_fr", - start_line=80, start_column=12, end_line=80, end_column=64, - law_headings=["Interface du programme", "Épilogue", - "Décrets divers"])) - personne_charge_effective_permanente_remplit_titre__i_627 = log_variable_definition(["InterfaceAllocationsFamiliales", - "personne_charge_effective_permanente_remplit_titre_I"], - local_var_628) + start_line=80, start_column=12, end_line=80, end_column=64, + law_headings=["Interface du programme", "Épilogue", + "Décrets divers"])) + personne_charge_effective_permanente_remplit_titre__i_1163 = log_variable_definition(["InterfaceAllocationsFamiliales", + "personne_charge_effective_permanente_remplit_titre_I"], + local_var_1164) try: try: - local_var_630 = avait_enfant_a_charge_avant_1er_janvier_2012_616(Unit()) + local_var_1170 = avait_enfant_a_charge_avant_1er_janvier_2012_1132( + Unit()) except EmptyError: - if log_decision_taken(SourcePosition(filename="", start_line=0, - start_column=1, end_line=0, end_column=1, - law_headings=[]), True): - local_var_630 = False - else: - raise EmptyError + def local_var_1171(_: Any): + return log_decision_taken(SourcePosition(filename="", + start_line=0, start_column=1, end_line=0, end_column=1, + law_headings=[]), True) + + def local_var_1173(_: Any): + return False + local_var_1170 = handle_default([], local_var_1171, + local_var_1173) except EmptyError: raise NoValueProvided(SourcePosition(filename="./epilogue.catala_fr", - start_line=81, start_column=12, end_line=81, end_column=56, - law_headings=["Interface du programme", "Épilogue", - "Décrets divers"])) - avait_enfant_a_charge_avant_1er_janvier_2012_629 = log_variable_definition(["InterfaceAllocationsFamiliales", - "avait_enfant_à_charge_avant_1er_janvier_2012"], local_var_630) + start_line=81, start_column=12, end_line=81, end_column=56, + law_headings=["Interface du programme", "Épilogue", + "Décrets divers"])) + avait_enfant_a_charge_avant_1er_janvier_2012_1169 = log_variable_definition(["InterfaceAllocationsFamiliales", + "avait_enfant_à_charge_avant_1er_janvier_2012"], local_var_1170) try: try: - local_var_632 = enfants_a_charge_610(Unit()) + local_var_1176 = enfants_a_charge_1126(Unit()) except EmptyError: try: - def local_var_633(enfant_634:Any): - if ((enfant_634.d_date_de_naissance + - duration_of_numbers(3,0,0)) >= - date_courante_617): - local_var_635 = SituationObligationScolaire(SituationObligationScolaire_Code.Avant, - Unit()) - else: - if ((enfant_634.d_date_de_naissance + - duration_of_numbers(16,0,0)) >= - date_courante_617): - local_var_635 = SituationObligationScolaire(SituationObligationScolaire_Code.Pendant, - Unit()) + def local_var_1177(_: Any): + return log_decision_taken(SourcePosition(filename="./epilogue.catala_fr", + start_line=112, start_column=14, + end_line=112, end_column=30, + law_headings=["Article L131-1", + "Interface du programme", "Épilogue", + "Décrets divers"]), True) + + def local_var_1179(_: Any): + def local_var_1181(enfant_1182: Any): + if ((enfant_1182.d_date_de_naissance + + duration_of_numbers(3, 0, 0)) >= + date_courante_1133): + local_var_1183 = SituationObligationScolaire(SituationObligationScolaire_Code.Avant, + Unit()) else: - local_var_635 = SituationObligationScolaire(SituationObligationScolaire_Code.Apres, - Unit()) - return Enfant(identifiant = enfant_634.d_identifiant, - obligation_scolaire = local_var_635, - remuneration_mensuelle = enfant_634.d_remuneration_mensuelle, - date_de_naissance = enfant_634.d_date_de_naissance, - age = year_of_date((date_of_numbers(0,1,1) + - (date_courante_617 - - enfant_634.d_date_de_naissance))), - prise_en_charge = enfant_634.d_prise_en_charge, - a_deja_ouvert_droit_aux_allocations_familiales = enfant_634.d_a_deja_ouvert_droit_aux_allocations_familiales) - local_var_632 = list_map(local_var_633, enfants_619) + if ((enfant_1182.d_date_de_naissance + + duration_of_numbers(16, 0, 0)) >= + date_courante_1133): + local_var_1183 = SituationObligationScolaire(SituationObligationScolaire_Code.Pendant, + Unit()) + else: + local_var_1183 = SituationObligationScolaire(SituationObligationScolaire_Code.Apres, + Unit()) + return Enfant(identifiant=enfant_1182.d_identifiant, + obligation_scolaire=local_var_1183, + remuneration_mensuelle=enfant_1182.d_remuneration_mensuelle, + date_de_naissance=enfant_1182.d_date_de_naissance, + age=year_of_date((date_of_numbers(0, 1, 1) + + (date_courante_1133 - + enfant_1182.d_date_de_naissance))), + prise_en_charge=enfant_1182.d_prise_en_charge, + a_deja_ouvert_droit_aux_allocations_familiales=enfant_1182.d_a_deja_ouvert_droit_aux_allocations_familiales) + return list_map(local_var_1181, enfants_1139) + local_var_1176 = handle_default([], local_var_1177, + local_var_1179) except EmptyError: raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./epilogue.catala_fr", - start_line=74, start_column=12, end_line=74, end_column=28, - law_headings=["Interface du programme", "Épilogue", - "Décrets divers"])) - enfants_a_charge_631 = log_variable_definition(["InterfaceAllocationsFamiliales", - "enfants_à_charge"], local_var_632) - def local_var_637(_:Unit): + start_line=74, start_column=12, end_line=74, end_column=28, + law_headings=["Interface du programme", "Épilogue", + "Décrets divers"])) + enfants_a_charge_1175 = log_variable_definition(["InterfaceAllocationsFamiliales", + "enfants_à_charge"], local_var_1176) + + def local_var_1185(_: Unit): try: - if log_decision_taken(SourcePosition(filename="./epilogue.catala_fr", - start_line=90, start_column=20, end_line=90, end_column=67, - law_headings=["Interface du programme", "Épilogue", - "Décrets divers"]), personne_charge_effective_permanente_est_parent_625): - local_var_639 = True - else: - raise EmptyError + def local_var_1188(_: Any): + return log_decision_taken(SourcePosition(filename="./epilogue.catala_fr", + start_line=90, start_column=20, + end_line=90, end_column=67, + law_headings=["Interface du programme", "Épilogue", + "Décrets divers"]), personne_charge_effective_permanente_est_parent_1157) + + def local_var_1190(_: Any): + return True + local_var_1187 = handle_default([], local_var_1188, + local_var_1190) except EmptyError: - local_var_639 = False + local_var_1187 = False return log_variable_definition(["InterfaceAllocationsFamiliales", - "allocations_familiales.personne_charge_effective_permanente_est_parent"], - local_var_639) - allocations_familiales_dot_personne_charge_effective_permanente_est_parent_636 = local_var_637 - def local_var_641(_:Unit): + "allocations_familiales.personne_charge_effective_permanente_est_parent"], + local_var_1187) + allocations_familiales_dot_personne_charge_effective_permanente_est_parent_1184 = local_var_1185 + + def local_var_1193(_: Unit): try: - if log_decision_taken(SourcePosition(filename="./epilogue.catala_fr", - start_line=93, start_column=20, end_line=93, end_column=72, - law_headings=["Interface du programme", "Épilogue", - "Décrets divers"]), personne_charge_effective_permanente_remplit_titre__i_627): - local_var_643 = True - else: - raise EmptyError + def local_var_1196(_: Any): + return log_decision_taken(SourcePosition(filename="./epilogue.catala_fr", + start_line=93, start_column=20, + end_line=93, end_column=72, + law_headings=["Interface du programme", "Épilogue", + "Décrets divers"]), personne_charge_effective_permanente_remplit_titre__i_1163) + + def local_var_1198(_: Any): + return True + local_var_1195 = handle_default([], local_var_1196, + local_var_1198) except EmptyError: - local_var_643 = False + local_var_1195 = False return log_variable_definition(["InterfaceAllocationsFamiliales", - "allocations_familiales.personne_charge_effective_permanente_remplit_titre_I"], - local_var_643) - allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i_640 = local_var_641 - def local_var_645(_:Unit): + "allocations_familiales.personne_charge_effective_permanente_remplit_titre_I"], + local_var_1195) + allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i_1192 = local_var_1193 + + def local_var_1201(_: Unit): try: - local_var_647 = ressources_menage_621 + def local_var_1204(_: Any): + return log_decision_taken(SourcePosition(filename="./epilogue.catala_fr", + start_line=86, start_column=14, + end_line=86, end_column=54, + law_headings=["Interface du programme", "Épilogue", + "Décrets divers"]), True) + + def local_var_1206(_: Any): + return ressources_menage_1145 + local_var_1203 = handle_default([], local_var_1204, + local_var_1206) except EmptyError: raise EmptyError return log_variable_definition(["InterfaceAllocationsFamiliales", - "allocations_familiales.ressources_ménage"], local_var_647) - allocations_familiales_dot_ressources_menage_644 = local_var_645 - def local_var_649(_:Unit): + "allocations_familiales.ressources_ménage"], local_var_1203) + allocations_familiales_dot_ressources_menage_1200 = local_var_1201 + + def local_var_1209(_: Unit): try: - local_var_651 = residence_623 + def local_var_1212(_: Any): + return log_decision_taken(SourcePosition(filename="./epilogue.catala_fr", + start_line=87, start_column=14, + end_line=87, end_column=46, + law_headings=["Interface du programme", "Épilogue", + "Décrets divers"]), True) + + def local_var_1214(_: Any): + return residence_1151 + local_var_1211 = handle_default([], local_var_1212, + local_var_1214) except EmptyError: raise EmptyError return log_variable_definition(["InterfaceAllocationsFamiliales", - "allocations_familiales.résidence"], local_var_651) - allocations_familiales_dot_residence_648 = local_var_649 - def local_var_653(_:Unit): + "allocations_familiales.résidence"], local_var_1211) + allocations_familiales_dot_residence_1208 = local_var_1209 + + def local_var_1217(_: Unit): try: - local_var_655 = date_courante_617 + def local_var_1220(_: Any): + return log_decision_taken(SourcePosition(filename="./epilogue.catala_fr", + start_line=84, start_column=14, + end_line=84, end_column=50, + law_headings=["Interface du programme", "Épilogue", + "Décrets divers"]), True) + + def local_var_1222(_: Any): + return date_courante_1133 + local_var_1219 = handle_default([], local_var_1220, + local_var_1222) except EmptyError: raise EmptyError return log_variable_definition(["InterfaceAllocationsFamiliales", - "allocations_familiales.date_courante"], local_var_655) - allocations_familiales_dot_date_courante_652 = local_var_653 - def local_var_657(_:Unit): + "allocations_familiales.date_courante"], local_var_1219) + allocations_familiales_dot_date_courante_1216 = local_var_1217 + + def local_var_1225(_: Unit): try: - local_var_659 = enfants_a_charge_631 + def local_var_1228(_: Any): + return log_decision_taken(SourcePosition(filename="./epilogue.catala_fr", + start_line=85, start_column=14, + end_line=85, end_column=53, + law_headings=["Interface du programme", "Épilogue", + "Décrets divers"]), True) + + def local_var_1230(_: Any): + return enfants_a_charge_1175 + local_var_1227 = handle_default([], local_var_1228, + local_var_1230) except EmptyError: raise EmptyError return log_variable_definition(["InterfaceAllocationsFamiliales", - "allocations_familiales.enfants_à_charge"], local_var_659) - allocations_familiales_dot_enfants_a_charge_656 = local_var_657 - def local_var_661(_:Unit): + "allocations_familiales.enfants_à_charge"], local_var_1227) + allocations_familiales_dot_enfants_a_charge_1224 = local_var_1225 + + def local_var_1233(_: Unit): try: - if log_decision_taken(SourcePosition(filename="./epilogue.catala_fr", - start_line=96, start_column=20, end_line=96, end_column=64, - law_headings=["Interface du programme", "Épilogue", - "Décrets divers"]), avait_enfant_a_charge_avant_1er_janvier_2012_629): - local_var_663 = True - else: - raise EmptyError + def local_var_1236(_: Any): + return log_decision_taken(SourcePosition(filename="./epilogue.catala_fr", + start_line=96, start_column=20, + end_line=96, end_column=64, + law_headings=["Interface du programme", "Épilogue", + "Décrets divers"]), avait_enfant_a_charge_avant_1er_janvier_2012_1169) + + def local_var_1238(_: Any): + return True + local_var_1235 = handle_default([], local_var_1236, + local_var_1238) except EmptyError: - local_var_663 = False + local_var_1235 = False return log_variable_definition(["InterfaceAllocationsFamiliales", - "allocations_familiales.avait_enfant_à_charge_avant_1er_janvier_2012"], - local_var_663) - allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012_660 = local_var_661 - def local_var_665(_:Unit): + "allocations_familiales.avait_enfant_à_charge_avant_1er_janvier_2012"], + local_var_1235) + allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012_1232 = local_var_1233 + + def local_var_1241(_: Unit): raise EmptyError - def local_var_667(_:Unit): + + def local_var_1243(_: Unit): raise EmptyError - def local_var_669(_:Unit): + + def local_var_1245(_: Unit): raise EmptyError - def local_var_671(_:Unit): + + def local_var_1247(_: Unit): raise EmptyError - def local_var_673(_:Unit): + + def local_var_1249(_: Unit): raise EmptyError - def local_var_675(_:Unit): + + def local_var_1251(_: Unit): raise EmptyError - def local_var_677(_:Unit): + + def local_var_1253(_: Unit): raise EmptyError - def local_var_679(_:Unit): + + def local_var_1255(_: Unit): raise EmptyError - def local_var_681(_:Unit): + + def local_var_1257(_: Unit): raise EmptyError - def local_var_683(_:Unit): + + def local_var_1259(_: Unit): raise EmptyError - def local_var_685(_:Unit): + + def local_var_1261(_: Unit): raise EmptyError - def local_var_687(_:Unit): + + def local_var_1263(_: Unit): raise EmptyError - def local_var_689(_:Unit): + + def local_var_1265(_: Unit): raise EmptyError - def local_var_691(_:Unit): + + def local_var_1267(_: Unit): raise EmptyError - def local_var_693(_:Unit): + + def local_var_1269(_: Unit): raise EmptyError - def local_var_695(_:Unit): + + def local_var_1271(_: Unit): raise EmptyError - def local_var_697(_:Unit): + + def local_var_1273(_: Unit): raise EmptyError - def local_var_699(_:Unit): + + def local_var_1275(_: Unit): raise EmptyError - def local_var_701(_:Unit): + + def local_var_1277(_: Unit): raise EmptyError - def local_var_703(_:Unit): + + def local_var_1279(_: Unit): raise EmptyError - def local_var_705(_:Unit): + + def local_var_1281(_: Unit): raise EmptyError - def local_var_707(_:Unit): + + def local_var_1283(_: Unit): raise EmptyError - def local_var_709(_:Unit): + + def local_var_1285(_: Unit): raise EmptyError - def local_var_711(_:Unit): + + def local_var_1287(_: Unit): raise EmptyError - def local_var_713(_:Unit): + + def local_var_1289(_: Unit): raise EmptyError - def local_var_715(_:Unit): + + def local_var_1291(_: Unit): raise EmptyError - def local_var_717(_:Unit): + + def local_var_1293(_: Unit): raise EmptyError - def local_var_719(_:Unit): + + def local_var_1295(_: Unit): raise EmptyError - def local_var_721(_:Unit): + + def local_var_1297(_: Unit): raise EmptyError - def local_var_723(_:Unit): + + def local_var_1299(_: Unit): raise EmptyError - def local_var_725(_:Unit): + + def local_var_1301(_: Unit): raise EmptyError - def local_var_727(_:Unit): + + def local_var_1303(_: Unit): raise EmptyError - def local_var_729(_:Unit): + + def local_var_1305(_: Unit): raise EmptyError - def local_var_731(_:Unit): + + def local_var_1307(_: Unit): raise EmptyError - def local_var_733(_:Unit): + + def local_var_1309(_: Unit): raise EmptyError - def local_var_735(_:Unit): + + def local_var_1311(_: Unit): raise EmptyError - def local_var_737(_:Unit): + + def local_var_1313(_: Unit): raise EmptyError - result_664 = log_end_call(["InterfaceAllocationsFamiliales", - "allocations_familiales", "AllocationsFamiliales"], - log_begin_call(["InterfaceAllocationsFamiliales", - "allocations_familiales", "AllocationsFamiliales"], - allocations_familiales, - AllocationsFamilialesIn(personne_charge_effective_permanente_est_parent_in = allocations_familiales_dot_personne_charge_effective_permanente_est_parent_636, - personne_charge_effective_permanente_remplit_titre_I_in = allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i_640, - ressources_menage_in = allocations_familiales_dot_ressources_menage_644, - residence_in = allocations_familiales_dot_residence_648, - date_courante_in = allocations_familiales_dot_date_courante_652, - enfants_a_charge_in = allocations_familiales_dot_enfants_a_charge_656, - enfants_a_charge_droit_ouvert_prestation_familiale_in = local_var_665, - prise_en_compte_in = local_var_667, versement_in = local_var_669, - montant_verse_in = local_var_671, - droit_ouvert_base_in = local_var_673, - montant_initial_base_in = local_var_675, - montant_initial_base_premier_enfant_in = local_var_677, - montant_initial_base_deuxieme_enfant_in = local_var_679, - montant_initial_base_troisieme_enfant_et_plus_in = local_var_681, - rapport_enfants_total_moyen_in = local_var_683, - nombre_moyen_enfants_in = local_var_685, - nombre_total_enfants_in = local_var_687, - montant_avec_garde_alternee_base_in = local_var_689, - montant_verse_base_in = local_var_691, - avait_enfant_a_charge_avant_1er_janvier_2012_in = allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012_660, - montant_initial_base_premier_enfant_mayotte_in = local_var_693, - montant_initial_base_deuxieme_enfant_mayotte_in = local_var_695, - montant_initial_base_troisieme_enfant_mayotte_in = local_var_697, - montant_initial_base_quatrieme_enfant_et_plus_mayotte_in = local_var_699, - droit_ouvert_forfaitaire_in = local_var_701, - montant_verse_forfaitaire_par_enfant_in = local_var_703, - montant_verse_forfaitaire_in = local_var_705, - droit_ouvert_majoration_in = local_var_707, - montant_initial_metropole_majoration_in = local_var_709, - montant_initial_majoration_in = local_var_711, - montant_avec_garde_alternee_majoration_in = local_var_713, - montant_verse_majoration_in = local_var_715, - droit_ouvert_complement_in = local_var_717, - montant_base_complement_pour_base_et_majoration_in = local_var_719, - complement_degressif_in = local_var_721, - montant_verse_complement_pour_base_et_majoration_in = local_var_723, - montant_verse_complement_pour_forfaitaire_in = local_var_725, - nombre_enfants_l521_1_in = local_var_727, - age_minimum_alinea_1_l521_3_in = local_var_729, - nombre_enfants_alinea_2_l521_3_in = local_var_731, - est_enfant_le_plus_age_in = local_var_733, - plafond_I_d521_3_in = local_var_735, - plafond_II_d521_3_in = local_var_737))) - allocations_familiales_dot_personne_charge_effective_permanente_est_parent_739 = result_664.personne_charge_effective_permanente_est_parent_out - allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i_740 = result_664.personne_charge_effective_permanente_remplit_titre_I_out - allocations_familiales_dot_ressources_menage_741 = result_664.ressources_menage_out - allocations_familiales_dot_residence_742 = result_664.residence_out - allocations_familiales_dot_date_courante_743 = result_664.date_courante_out - allocations_familiales_dot_enfants_a_charge_744 = result_664.enfants_a_charge_out - allocations_familiales_dot_enfants_a_charge_droit_ouvert_prestation_familiale_745 = result_664.enfants_a_charge_droit_ouvert_prestation_familiale_out - allocations_familiales_dot_prise_en_compte_746 = result_664.prise_en_compte_out - allocations_familiales_dot_versement_747 = result_664.versement_out - allocations_familiales_dot_montant_verse_748 = result_664.montant_verse_out - allocations_familiales_dot_droit_ouvert_base_749 = result_664.droit_ouvert_base_out - allocations_familiales_dot_montant_initial_base_750 = result_664.montant_initial_base_out - allocations_familiales_dot_montant_initial_base_premier_enfant_751 = result_664.montant_initial_base_premier_enfant_out - allocations_familiales_dot_montant_initial_base_deuxieme_enfant_752 = result_664.montant_initial_base_deuxieme_enfant_out - allocations_familiales_dot_montant_initial_base_troisieme_enfant_et_plus_753 = result_664.montant_initial_base_troisieme_enfant_et_plus_out - allocations_familiales_dot_rapport_enfants_total_moyen_754 = result_664.rapport_enfants_total_moyen_out - allocations_familiales_dot_nombre_moyen_enfants_755 = result_664.nombre_moyen_enfants_out - allocations_familiales_dot_nombre_total_enfants_756 = result_664.nombre_total_enfants_out - allocations_familiales_dot_montant_avec_garde_alternee_base_757 = result_664.montant_avec_garde_alternee_base_out - allocations_familiales_dot_montant_verse_base_758 = result_664.montant_verse_base_out - allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012_759 = result_664.avait_enfant_a_charge_avant_1er_janvier_2012_out - allocations_familiales_dot_montant_initial_base_premier_enfant_mayotte_760 = result_664.montant_initial_base_premier_enfant_mayotte_out - allocations_familiales_dot_montant_initial_base_deuxieme_enfant_mayotte_761 = result_664.montant_initial_base_deuxieme_enfant_mayotte_out - allocations_familiales_dot_montant_initial_base_troisieme_enfant_mayotte_762 = result_664.montant_initial_base_troisieme_enfant_mayotte_out - allocations_familiales_dot_montant_initial_base_quatrieme_enfant_et_plus_mayotte_763 = result_664.montant_initial_base_quatrieme_enfant_et_plus_mayotte_out - allocations_familiales_dot_droit_ouvert_forfaitaire_764 = result_664.droit_ouvert_forfaitaire_out - allocations_familiales_dot_montant_verse_forfaitaire_par_enfant_765 = result_664.montant_verse_forfaitaire_par_enfant_out - allocations_familiales_dot_montant_verse_forfaitaire_766 = result_664.montant_verse_forfaitaire_out - allocations_familiales_dot_droit_ouvert_majoration_767 = result_664.droit_ouvert_majoration_out - allocations_familiales_dot_montant_initial_metropole_majoration_768 = result_664.montant_initial_metropole_majoration_out - allocations_familiales_dot_montant_initial_majoration_769 = result_664.montant_initial_majoration_out - allocations_familiales_dot_montant_avec_garde_alternee_majoration_770 = result_664.montant_avec_garde_alternee_majoration_out - allocations_familiales_dot_montant_verse_majoration_771 = result_664.montant_verse_majoration_out - allocations_familiales_dot_droit_ouvert_complement_772 = result_664.droit_ouvert_complement_out - allocations_familiales_dot_montant_base_complement_pour_base_et_majoration_773 = result_664.montant_base_complement_pour_base_et_majoration_out - allocations_familiales_dot_complement_degressif_774 = result_664.complement_degressif_out - allocations_familiales_dot_montant_verse_complement_pour_base_et_majoration_775 = result_664.montant_verse_complement_pour_base_et_majoration_out - allocations_familiales_dot_montant_verse_complement_pour_forfaitaire_776 = result_664.montant_verse_complement_pour_forfaitaire_out - allocations_familiales_dot_nombre_enfants_l521_1_777 = result_664.nombre_enfants_l521_1_out - allocations_familiales_dot_age_minimum_alinea_1_l521_3_778 = result_664.age_minimum_alinea_1_l521_3_out - allocations_familiales_dot_nombre_enfants_alinea_2_l521_3_779 = result_664.nombre_enfants_alinea_2_l521_3_out - allocations_familiales_dot_est_enfant_le_plus_age_780 = result_664.est_enfant_le_plus_age_out - allocations_familiales_dot_plafond__i_d521_3_781 = result_664.plafond_I_d521_3_out - allocations_familiales_dot_plafond__i_i_d521_3_782 = result_664.plafond_II_d521_3_out + result_1240 = log_end_call(["InterfaceAllocationsFamiliales", + "allocations_familiales", "AllocationsFamiliales"], + log_begin_call(["InterfaceAllocationsFamiliales", + "allocations_familiales", "AllocationsFamiliales"], + allocations_familiales, + AllocationsFamilialesIn(personne_charge_effective_permanente_est_parent_in=allocations_familiales_dot_personne_charge_effective_permanente_est_parent_1184, + personne_charge_effective_permanente_remplit_titre_I_in=allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i_1192, + ressources_menage_in=allocations_familiales_dot_ressources_menage_1200, + residence_in=allocations_familiales_dot_residence_1208, + date_courante_in=allocations_familiales_dot_date_courante_1216, + enfants_a_charge_in=allocations_familiales_dot_enfants_a_charge_1224, + enfants_a_charge_droit_ouvert_prestation_familiale_in=local_var_1241, + prise_en_compte_in=local_var_1243, versement_in=local_var_1245, + montant_verse_in=local_var_1247, + droit_ouvert_base_in=local_var_1249, + montant_initial_base_in=local_var_1251, + montant_initial_base_premier_enfant_in=local_var_1253, + montant_initial_base_deuxieme_enfant_in=local_var_1255, + montant_initial_base_troisieme_enfant_et_plus_in=local_var_1257, + rapport_enfants_total_moyen_in=local_var_1259, + nombre_moyen_enfants_in=local_var_1261, + nombre_total_enfants_in=local_var_1263, + montant_avec_garde_alternee_base_in=local_var_1265, + montant_verse_base_in=local_var_1267, + avait_enfant_a_charge_avant_1er_janvier_2012_in=allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012_1232, + montant_initial_base_premier_enfant_mayotte_in=local_var_1269, + montant_initial_base_deuxieme_enfant_mayotte_in=local_var_1271, + montant_initial_base_troisieme_enfant_mayotte_in=local_var_1273, + montant_initial_base_quatrieme_enfant_et_plus_mayotte_in=local_var_1275, + droit_ouvert_forfaitaire_in=local_var_1277, + montant_verse_forfaitaire_par_enfant_in=local_var_1279, + montant_verse_forfaitaire_in=local_var_1281, + droit_ouvert_majoration_in=local_var_1283, + montant_initial_metropole_majoration_in=local_var_1285, + montant_initial_majoration_in=local_var_1287, + montant_avec_garde_alternee_majoration_in=local_var_1289, + montant_verse_majoration_in=local_var_1291, + droit_ouvert_complement_in=local_var_1293, + montant_base_complement_pour_base_et_majoration_in=local_var_1295, + complement_degressif_in=local_var_1297, + montant_verse_complement_pour_base_et_majoration_in=local_var_1299, + montant_verse_complement_pour_forfaitaire_in=local_var_1301, + nombre_enfants_l521_1_in=local_var_1303, + age_minimum_alinea_1_l521_3_in=local_var_1305, + nombre_enfants_alinea_2_l521_3_in=local_var_1307, + est_enfant_le_plus_age_in=local_var_1309, + plafond_I_d521_3_in=local_var_1311, + plafond_II_d521_3_in=local_var_1313))) + allocations_familiales_dot_personne_charge_effective_permanente_est_parent_1315 = result_1240.personne_charge_effective_permanente_est_parent_out + allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i_1316 = result_1240.personne_charge_effective_permanente_remplit_titre_I_out + allocations_familiales_dot_ressources_menage_1317 = result_1240.ressources_menage_out + allocations_familiales_dot_residence_1318 = result_1240.residence_out + allocations_familiales_dot_date_courante_1319 = result_1240.date_courante_out + allocations_familiales_dot_enfants_a_charge_1320 = result_1240.enfants_a_charge_out + allocations_familiales_dot_enfants_a_charge_droit_ouvert_prestation_familiale_1321 = result_1240.enfants_a_charge_droit_ouvert_prestation_familiale_out + allocations_familiales_dot_prise_en_compte_1322 = result_1240.prise_en_compte_out + allocations_familiales_dot_versement_1323 = result_1240.versement_out + allocations_familiales_dot_montant_verse_1324 = result_1240.montant_verse_out + allocations_familiales_dot_droit_ouvert_base_1325 = result_1240.droit_ouvert_base_out + allocations_familiales_dot_montant_initial_base_1326 = result_1240.montant_initial_base_out + allocations_familiales_dot_montant_initial_base_premier_enfant_1327 = result_1240.montant_initial_base_premier_enfant_out + allocations_familiales_dot_montant_initial_base_deuxieme_enfant_1328 = result_1240.montant_initial_base_deuxieme_enfant_out + allocations_familiales_dot_montant_initial_base_troisieme_enfant_et_plus_1329 = result_1240.montant_initial_base_troisieme_enfant_et_plus_out + allocations_familiales_dot_rapport_enfants_total_moyen_1330 = result_1240.rapport_enfants_total_moyen_out + allocations_familiales_dot_nombre_moyen_enfants_1331 = result_1240.nombre_moyen_enfants_out + allocations_familiales_dot_nombre_total_enfants_1332 = result_1240.nombre_total_enfants_out + allocations_familiales_dot_montant_avec_garde_alternee_base_1333 = result_1240.montant_avec_garde_alternee_base_out + allocations_familiales_dot_montant_verse_base_1334 = result_1240.montant_verse_base_out + allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012_1335 = result_1240.avait_enfant_a_charge_avant_1er_janvier_2012_out + allocations_familiales_dot_montant_initial_base_premier_enfant_mayotte_1336 = result_1240.montant_initial_base_premier_enfant_mayotte_out + allocations_familiales_dot_montant_initial_base_deuxieme_enfant_mayotte_1337 = result_1240.montant_initial_base_deuxieme_enfant_mayotte_out + allocations_familiales_dot_montant_initial_base_troisieme_enfant_mayotte_1338 = result_1240.montant_initial_base_troisieme_enfant_mayotte_out + allocations_familiales_dot_montant_initial_base_quatrieme_enfant_et_plus_mayotte_1339 = result_1240.montant_initial_base_quatrieme_enfant_et_plus_mayotte_out + allocations_familiales_dot_droit_ouvert_forfaitaire_1340 = result_1240.droit_ouvert_forfaitaire_out + allocations_familiales_dot_montant_verse_forfaitaire_par_enfant_1341 = result_1240.montant_verse_forfaitaire_par_enfant_out + allocations_familiales_dot_montant_verse_forfaitaire_1342 = result_1240.montant_verse_forfaitaire_out + allocations_familiales_dot_droit_ouvert_majoration_1343 = result_1240.droit_ouvert_majoration_out + allocations_familiales_dot_montant_initial_metropole_majoration_1344 = result_1240.montant_initial_metropole_majoration_out + allocations_familiales_dot_montant_initial_majoration_1345 = result_1240.montant_initial_majoration_out + allocations_familiales_dot_montant_avec_garde_alternee_majoration_1346 = result_1240.montant_avec_garde_alternee_majoration_out + allocations_familiales_dot_montant_verse_majoration_1347 = result_1240.montant_verse_majoration_out + allocations_familiales_dot_droit_ouvert_complement_1348 = result_1240.droit_ouvert_complement_out + allocations_familiales_dot_montant_base_complement_pour_base_et_majoration_1349 = result_1240.montant_base_complement_pour_base_et_majoration_out + allocations_familiales_dot_complement_degressif_1350 = result_1240.complement_degressif_out + allocations_familiales_dot_montant_verse_complement_pour_base_et_majoration_1351 = result_1240.montant_verse_complement_pour_base_et_majoration_out + allocations_familiales_dot_montant_verse_complement_pour_forfaitaire_1352 = result_1240.montant_verse_complement_pour_forfaitaire_out + allocations_familiales_dot_nombre_enfants_l521_1_1353 = result_1240.nombre_enfants_l521_1_out + allocations_familiales_dot_age_minimum_alinea_1_l521_3_1354 = result_1240.age_minimum_alinea_1_l521_3_out + allocations_familiales_dot_nombre_enfants_alinea_2_l521_3_1355 = result_1240.nombre_enfants_alinea_2_l521_3_out + allocations_familiales_dot_est_enfant_le_plus_age_1356 = result_1240.est_enfant_le_plus_age_out + allocations_familiales_dot_plafond__i_d521_3_1357 = result_1240.plafond_I_d521_3_out + allocations_familiales_dot_plafond__i_i_d521_3_1358 = result_1240.plafond_II_d521_3_out try: try: - local_var_784 = montant_verse_613(Unit()) + local_var_1360 = montant_verse_1129(Unit()) except EmptyError: try: - local_var_784 = allocations_familiales_dot_montant_verse_748 + def local_var_1361(_: Any): + return log_decision_taken(SourcePosition(filename="./epilogue.catala_fr", + start_line=88, start_column=14, + end_line=88, end_column=27, + law_headings=["Interface du programme", "Épilogue", + "Décrets divers"]), True) + + def local_var_1363(_: Any): + return allocations_familiales_dot_montant_verse_1324 + local_var_1360 = handle_default([], local_var_1361, + local_var_1363) except EmptyError: raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./epilogue.catala_fr", - start_line=78, start_column=12, end_line=78, end_column=25, - law_headings=["Interface du programme", "Épilogue", - "Décrets divers"])) - montant_verse_783 = log_variable_definition(["InterfaceAllocationsFamiliales", - "montant_versé"], local_var_784) - return InterfaceAllocationsFamilialesOut(date_courante_out = date_courante_617, - enfants_out = enfants_619, - enfants_a_charge_out = enfants_a_charge_631, - ressources_menage_out = ressources_menage_621, - residence_out = residence_623, montant_verse_out = montant_verse_783, - personne_charge_effective_permanente_est_parent_out = personne_charge_effective_permanente_est_parent_625, - personne_charge_effective_permanente_remplit_titre_I_out = personne_charge_effective_permanente_remplit_titre__i_627, - avait_enfant_a_charge_avant_1er_janvier_2012_out = avait_enfant_a_charge_avant_1er_janvier_2012_629) \ No newline at end of file + start_line=78, start_column=12, end_line=78, end_column=25, + law_headings=["Interface du programme", "Épilogue", + "Décrets divers"])) + montant_verse_1359 = log_variable_definition(["InterfaceAllocationsFamiliales", + "montant_versé"], local_var_1360) + return InterfaceAllocationsFamilialesOut(date_courante_out=date_courante_1133, + enfants_out=enfants_1139, + enfants_a_charge_out=enfants_a_charge_1175, + ressources_menage_out=ressources_menage_1145, + residence_out=residence_1151, + montant_verse_out=montant_verse_1359, + personne_charge_effective_permanente_est_parent_out=personne_charge_effective_permanente_est_parent_1157, + personne_charge_effective_permanente_remplit_titre_I_out=personne_charge_effective_permanente_remplit_titre__i_1163, + avait_enfant_a_charge_avant_1er_janvier_2012_out=avait_enfant_a_charge_avant_1er_janvier_2012_1169) From b44e8e4f088faf91d725725b5402685991931a34 Mon Sep 17 00:00:00 2001 From: Alain Date: Fri, 4 Feb 2022 16:25:57 +0100 Subject: [PATCH 072/102] changed optimization so it actually work --- compiler/lcalc/optimizations.ml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/compiler/lcalc/optimizations.ml b/compiler/lcalc/optimizations.ml index b5aae1e39..8e4f34b25 100644 --- a/compiler/lcalc/optimizations.ml +++ b/compiler/lcalc/optimizations.ml @@ -85,8 +85,8 @@ let rec beta_expr (_ : unit) (e : expr Pos.marked) : expr Pos.marked Bindlib.box let default_mark e' = Pos.same_pos_as e' e in match Pos.unmark e with | EApp (e1, args) -> ( - let+ e1 = visitor_map beta_expr () e1 - and+ args = List.map (visitor_map beta_expr ()) args |> Bindlib.box_list in + let+ e1 = beta_expr () e1 + and+ args = List.map (beta_expr ()) args |> Bindlib.box_list in match Pos.unmark e1 with | EAbs ((binder, _pos_binder), _ts) -> let (_ : (_, _) Bindlib.mbinder) = binder in @@ -97,7 +97,7 @@ let rec beta_expr (_ : unit) (e : expr Pos.marked) : expr Pos.marked Bindlib.box let iota_optimizations (p : program) : program = { p with scopes = List.map (fun (var, e) -> (var, Bindlib.unbox (iota_expr () e))) p.scopes } -let _beta_optimizations (p : program) : program = +let beta_optimizations (p : program) : program = { p with scopes = List.map (fun (var, e) -> (var, Bindlib.unbox (beta_expr () e))) p.scopes } let rec peephole_expr (_ : unit) (e : expr Pos.marked) : expr Pos.marked Bindlib.box = @@ -105,9 +105,9 @@ let rec peephole_expr (_ : unit) (e : expr Pos.marked) : expr Pos.marked Bindlib match Pos.unmark e with | EIfThenElse (e1, e2, e3) -> ( - let+ e1 = visitor_map peephole_expr () e1 - and+ e2 = visitor_map peephole_expr () e2 - and+ e3 = visitor_map peephole_expr () e3 in + let+ e1 = peephole_expr () e1 + and+ e2 = peephole_expr () e2 + and+ e3 = peephole_expr () e3 in match Pos.unmark e1 with | ELit (LBool true) | EApp ((EOp (Unop (Log _)), _), [ (ELit (LBool true), _) ]) -> e2 | ELit (LBool false) | EApp ((EOp (Unop (Log _)), _), [ (ELit (LBool false), _) ]) -> e3 @@ -117,4 +117,5 @@ let rec peephole_expr (_ : unit) (e : expr Pos.marked) : expr Pos.marked Bindlib let peephole_optimizations (p : program) : program = { p with scopes = List.map (fun (var, e) -> (var, Bindlib.unbox (peephole_expr () e))) p.scopes } -let optimize_program (p : program) : program = p |> iota_optimizations |> peephole_optimizations +let optimize_program (p : program) : program = + p |> iota_optimizations |> peephole_optimizations |> beta_optimizations |> beta_optimizations |> beta_optimizations |> beta_optimizations |> beta_optimizations |> beta_optimizations |> beta_optimizations |> beta_optimizations |> beta_optimizations |> beta_optimizations |> beta_optimizations |> beta_optimizations From 424b68a6a5b3df9ef717e2b5f5b8763031bc576f Mon Sep 17 00:00:00 2001 From: Alain Date: Fri, 4 Feb 2022 16:43:59 +0100 Subject: [PATCH 073/102] formatting --- compiler/lcalc/optimizations.ml | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/compiler/lcalc/optimizations.ml b/compiler/lcalc/optimizations.ml index 8e4f34b25..fe4e1d2c5 100644 --- a/compiler/lcalc/optimizations.ml +++ b/compiler/lcalc/optimizations.ml @@ -69,15 +69,13 @@ let rec iota_expr (_ : unit) (e : expr Pos.marked) : expr Pos.marked Bindlib.box and+ case = visitor_map iota_expr () (List.nth cases i) in default_mark @@ EApp (case, [ e1 ]) | EMatch (e', cases, n) - when begin - cases - |> List.mapi (fun i (case, _pos) -> - match case with - | EInj (_ei, i', n', _ts') -> - i = i' && (* n = n' *) Dcalc.Ast.EnumName.compare n n' = 0 - | _ -> false) - |> List.for_all Fun.id - end -> + when cases + |> List.mapi (fun i (case, _pos) -> + match case with + | EInj (_ei, i', n', _ts') -> + i = i' && (* n = n' *) Dcalc.Ast.EnumName.compare n n' = 0 + | _ -> false) + |> List.for_all Fun.id -> visitor_map iota_expr () e' | _ -> visitor_map iota_expr () e @@ -85,8 +83,7 @@ let rec beta_expr (_ : unit) (e : expr Pos.marked) : expr Pos.marked Bindlib.box let default_mark e' = Pos.same_pos_as e' e in match Pos.unmark e with | EApp (e1, args) -> ( - let+ e1 = beta_expr () e1 - and+ args = List.map (beta_expr ()) args |> Bindlib.box_list in + let+ e1 = beta_expr () e1 and+ args = List.map (beta_expr ()) args |> Bindlib.box_list in match Pos.unmark e1 with | EAbs ((binder, _pos_binder), _ts) -> let (_ : (_, _) Bindlib.mbinder) = binder in @@ -105,9 +102,7 @@ let rec peephole_expr (_ : unit) (e : expr Pos.marked) : expr Pos.marked Bindlib match Pos.unmark e with | EIfThenElse (e1, e2, e3) -> ( - let+ e1 = peephole_expr () e1 - and+ e2 = peephole_expr () e2 - and+ e3 = peephole_expr () e3 in + let+ e1 = peephole_expr () e1 and+ e2 = peephole_expr () e2 and+ e3 = peephole_expr () e3 in match Pos.unmark e1 with | ELit (LBool true) | EApp ((EOp (Unop (Log _)), _), [ (ELit (LBool true), _) ]) -> e2 | ELit (LBool false) | EApp ((EOp (Unop (Log _)), _), [ (ELit (LBool false), _) ]) -> e3 @@ -118,4 +113,4 @@ let peephole_optimizations (p : program) : program = { p with scopes = List.map (fun (var, e) -> (var, Bindlib.unbox (peephole_expr () e))) p.scopes } let optimize_program (p : program) : program = - p |> iota_optimizations |> peephole_optimizations |> beta_optimizations |> beta_optimizations |> beta_optimizations |> beta_optimizations |> beta_optimizations |> beta_optimizations |> beta_optimizations |> beta_optimizations |> beta_optimizations |> beta_optimizations |> beta_optimizations |> beta_optimizations + p |> iota_optimizations |> peephole_optimizations |> beta_optimizations From c97ab86c1c666ecc74f4199f30463e7908a81924 Mon Sep 17 00:00:00 2001 From: Alain Date: Fri, 4 Feb 2022 16:50:40 +0100 Subject: [PATCH 074/102] removed un-used code --- compiler/lcalc/to_ocaml.ml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/compiler/lcalc/to_ocaml.ml b/compiler/lcalc/to_ocaml.ml index 353794926..618988664 100644 --- a/compiler/lcalc/to_ocaml.ml +++ b/compiler/lcalc/to_ocaml.ml @@ -59,14 +59,6 @@ let format_op_kind (fmt : Format.formatter) (k : Dcalc.Ast.op_kind) = Format.fprintf fmt "%s" (match k with KInt -> "!" | KRat -> "&" | KMoney -> "$" | KDate -> "@" | KDuration -> "^") -let _format_log_entry (fmt : Format.formatter) (entry : Dcalc.Ast.log_entry) : unit = - Format.fprintf fmt "%s" - (match entry with - | VarDef _ -> ":=" - | BeginCall -> "→ " - | EndCall -> "← " - | PosRecordIfTrueBool -> "☛ ") - let format_binop (fmt : Format.formatter) (op : Dcalc.Ast.binop Pos.marked) : unit = match Pos.unmark op with | Add k -> Format.fprintf fmt "+%a" format_op_kind k From 730bd71cd3dd10926e2124428cacf3f144508e2e Mon Sep 17 00:00:00 2001 From: Alain Date: Fri, 4 Feb 2022 16:58:58 +0100 Subject: [PATCH 075/102] new invariant about assert in dcalc it is now a pure function, and is always in the form EAssert (ErrorOnEmpty _). --- compiler/lcalc/compile_without_exceptions.ml | 9 ++++----- compiler/scopelang/scope_to_dcalc.ml | 3 ++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index e11c74925..b35e99cba 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -136,11 +136,6 @@ let rec translate_and_cut (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marke | D.ELit D.LEmptyError -> let v' = A.Var.make ("empty_litteral", pos) in (A.make_var (v', pos), A.VarMap.singleton v' e) - | D.EAssert _ -> - (* as discuted, if the value in an assertion is empty, an error should the raised. This - beavior is different from the ICFP paper. *) - let v' = A.Var.make ("assertion_value", pos) in - (A.make_var (v', pos), A.VarMap.singleton v' e) (* This one is a very special case. It transform an unpure expression environement to a pure expression. *) | ErrorOnEmpty arg -> @@ -170,6 +165,10 @@ let rec translate_and_cut (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marke (*(* equivalent code : *) let e' = let+ e1' = e1' and+ e2' = e2' and+ e3' = e3' in (A.EIfThenElse (e1', e2', e3'), pos) in *) (e', disjoint_union_maps pos [ c1; c2; c3 ]) + | D.EAssert e1 -> + (* same behavior as in the ICFP paper: if e1 is empty, then no error is raised. *) + let e1', c1 = translate_and_cut ctx e1 in + (Bindlib.box_apply (fun e1' -> (A.EAssert e1', pos)) e1', c1) | D.EAbs ((binder, pos_binder), ts) -> let vars, body = Bindlib.unmbind binder in let ctx, lc_vars = diff --git a/compiler/scopelang/scope_to_dcalc.ml b/compiler/scopelang/scope_to_dcalc.ml index d31ae7a21..1161c8165 100644 --- a/compiler/scopelang/scope_to_dcalc.ml +++ b/compiler/scopelang/scope_to_dcalc.ml @@ -491,7 +491,8 @@ let translate_rule (ctx : ctx) (rule : Ast.rule) (Dcalc.Ast.Var.make ("_", Pos.get_position e), Pos.get_position e); Dcalc.Ast.scope_let_typ = (Dcalc.Ast.TLit TUnit, Pos.get_position e); Dcalc.Ast.scope_let_expr = - Bindlib.box_apply (fun new_e -> Pos.same_pos_as (Dcalc.Ast.EAssert new_e) e) new_e; + (* To ensure that we throw an error if the value is not defined, we add an check "ErrorOnEmpty" here. *) + Bindlib.box_apply (fun new_e -> Pos.same_pos_as (Dcalc.Ast.EAssert (Dcalc.Ast.ErrorOnEmpty new_e, Pos.get_position e)) e) new_e; Dcalc.Ast.scope_let_kind = Dcalc.Ast.Assertion; }; ], From 016056728eea44182bbbc9b607afc11d084139f7 Mon Sep 17 00:00:00 2001 From: Alain Date: Mon, 7 Feb 2022 09:17:13 +0100 Subject: [PATCH 076/102] forcing the invariant of the previous commit --- compiler/scopelang/scope_to_dcalc.ml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/compiler/scopelang/scope_to_dcalc.ml b/compiler/scopelang/scope_to_dcalc.ml index 1161c8165..1c8aebee9 100644 --- a/compiler/scopelang/scope_to_dcalc.ml +++ b/compiler/scopelang/scope_to_dcalc.ml @@ -492,7 +492,12 @@ let translate_rule (ctx : ctx) (rule : Ast.rule) Dcalc.Ast.scope_let_typ = (Dcalc.Ast.TLit TUnit, Pos.get_position e); Dcalc.Ast.scope_let_expr = (* To ensure that we throw an error if the value is not defined, we add an check "ErrorOnEmpty" here. *) - Bindlib.box_apply (fun new_e -> Pos.same_pos_as (Dcalc.Ast.EAssert (Dcalc.Ast.ErrorOnEmpty new_e, Pos.get_position e)) e) new_e; + Bindlib.box_apply + (fun new_e -> + Pos.same_pos_as + (Dcalc.Ast.EAssert (Dcalc.Ast.ErrorOnEmpty new_e, Pos.get_position e)) + e) + new_e; Dcalc.Ast.scope_let_kind = Dcalc.Ast.Assertion; }; ], From 16e09a1e3659df7818e87b57caf25786472179f1 Mon Sep 17 00:00:00 2001 From: Alain Date: Mon, 7 Feb 2022 09:17:23 +0100 Subject: [PATCH 077/102] type translation --- compiler/lcalc/compile_without_exceptions.ml | 44 ++++++++++++++++---- 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index b35e99cba..538588172 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -72,6 +72,27 @@ let add_var (pos : Pos.t) (var : D.Var.t) (is_pure : bool) (ctx : ctx) : ctx = (* D.VarMap.add var { expr; var = new_var; is_pure } ctx *) +(** [tau' = translate_typ tau] translate the a dcalc type into a lcalc type. + + Since positions where there is thunked expressions is exactly where we will put option + expressions. Hence, the transformation simply reduce [unit -> 'a] into ['a option] recursivly. + There is no polymorphism inside catala. *) +let rec translate_typ (tau : D.typ Pos.marked) : D.typ Pos.marked = + (Fun.flip Pos.same_pos_as) tau + begin + match Pos.unmark tau with + | D.TLit l -> D.TLit l + | D.TTuple (ts, s) -> D.TTuple (List.map translate_typ ts, s) + | D.TEnum (ts, en) -> D.TEnum (List.map translate_typ ts, en) + | D.TAny -> D.TAny + | D.TArray ts -> D.TArray (translate_typ ts) + (* catala is not polymorphic*) + | D.TArrow ((D.TLit D.TUnit, _), _t2) -> + (* D.TEnum ([ translate_typ t2 ], A.option_enum) *) + D.TAny + | D.TArrow (t1, t2) -> D.TArrow (translate_typ t1, translate_typ t2) + end + let translate_lit (l : D.lit) (pos : Pos.t) : A.lit = match l with | D.LBool l -> A.LBool l @@ -166,9 +187,9 @@ let rec translate_and_cut (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marke (A.EIfThenElse (e1', e2', e3'), pos) in *) (e', disjoint_union_maps pos [ c1; c2; c3 ]) | D.EAssert e1 -> - (* same behavior as in the ICFP paper: if e1 is empty, then no error is raised. *) - let e1', c1 = translate_and_cut ctx e1 in - (Bindlib.box_apply (fun e1' -> (A.EAssert e1', pos)) e1', c1) + (* same behavior as in the ICFP paper: if e1 is empty, then no error is raised. *) + let e1', c1 = translate_and_cut ctx e1 in + (Bindlib.box_apply (fun e1' -> (A.EAssert e1', pos)) e1', c1) | D.EAbs ((binder, pos_binder), ts) -> let vars, body = Bindlib.unmbind binder in let ctx, lc_vars = @@ -189,7 +210,9 @@ let rec translate_and_cut (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marke let new_body, cuts = translate_and_cut ctx body in let new_binder = Bindlib.bind_mvar lc_vars new_body in - ( Bindlib.box_apply (fun new_binder -> (A.EAbs ((new_binder, pos_binder), ts), pos)) new_binder, + ( Bindlib.box_apply + (fun new_binder -> (A.EAbs ((new_binder, pos_binder), List.map translate_typ ts), pos)) + new_binder, cuts ) | EApp (e1, args) -> (* general case is simple *) @@ -396,7 +419,7 @@ let rec translate_scope_let (ctx : ctx) (lets : scope_lets) = Cli.debug_print @@ Format.asprintf "unbinding %a" Dcalc.Print.format_var var; let ctx' = add_var pos var var_is_pure ctx in let new_var = (find ~info:"variable that was just created" var ctx').var in - A.make_let_in new_var typ + A.make_let_in new_var (translate_typ typ) (translate_expr ctx ~append_esome:false expr) (translate_scope_let ctx' next) @@ -415,11 +438,16 @@ let translate_scope_body (scope_pos : Pos.t) (_decl_ctx : D.decl_ctx) (ctx : ctx translate_scope_let ctx' lets let translate_program (prgm : D.program) : A.program = - (* modify *) + (* modify the *) let decl_ctx = { - D.ctx_enums = prgm.decl_ctx.ctx_enums |> D.EnumMap.add A.option_enum A.option_enum_config; - D.ctx_structs = prgm.decl_ctx.ctx_structs; + D.ctx_enums = + prgm.decl_ctx.ctx_enums + |> D.EnumMap.add A.option_enum A.option_enum_config + |> D.EnumMap.map (fun l -> ListLabels.map l ~f:(fun (n, tau) -> (n, translate_typ tau))); + D.ctx_structs = + prgm.decl_ctx.ctx_structs + |> D.StructMap.map (fun l -> ListLabels.map l ~f:(fun (n, tau) -> (n, translate_typ tau))); } in From ed2c1924704b47eeba20a1fc0ae6664e05c0bbec Mon Sep 17 00:00:00 2001 From: Alain Date: Mon, 7 Feb 2022 10:58:41 +0100 Subject: [PATCH 078/102] Add monomorphisation of eoptions types Compilation as TAny is not enough clear to define structures in ocaml. --- compiler/lcalc/compile_without_exceptions.ml | 9 +++++---- compiler/lcalc/to_ocaml.ml | 10 ++++++++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index 538588172..82f4d7b05 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -87,10 +87,11 @@ let rec translate_typ (tau : D.typ Pos.marked) : D.typ Pos.marked = | D.TAny -> D.TAny | D.TArray ts -> D.TArray (translate_typ ts) (* catala is not polymorphic*) - | D.TArrow ((D.TLit D.TUnit, _), _t2) -> - (* D.TEnum ([ translate_typ t2 ], A.option_enum) *) - D.TAny - | D.TArrow (t1, t2) -> D.TArrow (translate_typ t1, translate_typ t2) + | D.TArrow ((D.TLit D.TUnit, _), t2) -> + D.TEnum ([ translate_typ t2 ], A.option_enum) + (* D.TAny *) + | D.TArrow (t1, t2) -> + D.TArrow (translate_typ t1, translate_typ t2) end let translate_lit (l : D.lit) (pos : Pos.t) : A.lit = diff --git a/compiler/lcalc/to_ocaml.ml b/compiler/lcalc/to_ocaml.ml index 618988664..4e0cca6e7 100644 --- a/compiler/lcalc/to_ocaml.ml +++ b/compiler/lcalc/to_ocaml.ml @@ -169,10 +169,16 @@ let rec format_typ (fmt : Format.formatter) (typ : Dcalc.Ast.typ Pos.marked) : u Format.fprintf fmt "@[(%a)@]" (Format.pp_print_list ~pp_sep:(fun fmt () -> Format.fprintf fmt "@ *@ ") - (fun fmt t -> Format.fprintf fmt "%a" format_typ_with_parens t)) + format_typ_with_parens) ts | TTuple (_, Some s) -> Format.fprintf fmt "%a" format_struct_name s - | TEnum (_, e) -> Format.fprintf fmt "%a" format_enum_name e + | TEnum (ts, e) when D.EnumName.compare e Ast.option_enum = 0 -> + Format.fprintf fmt "@[(%a)@] %a" + (Format.pp_print_list + ~pp_sep:(fun fmt () -> Format.fprintf fmt "@ ,@ ") + format_typ_with_parens) + ts format_enum_name e + | TEnum (_ts, e) -> Format.fprintf fmt "%a" format_enum_name e | TArrow (t1, t2) -> Format.fprintf fmt "@[%a ->@ %a@]" format_typ_with_parens t1 format_typ_with_parens t2 | TArray t1 -> Format.fprintf fmt "@[%a@ array@]" format_typ_with_parens t1 From 3a1ab17796b0f3f1af4229d6a8261b3ef39e5593 Mon Sep 17 00:00:00 2001 From: Alain Date: Mon, 7 Feb 2022 11:00:36 +0100 Subject: [PATCH 079/102] fix uncorrect scope definition select only part of type transformation to do --- compiler/lcalc/compile_without_exceptions.ml | 47 +++++++++++++------- 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index 82f4d7b05..8199e66c5 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -88,10 +88,8 @@ let rec translate_typ (tau : D.typ Pos.marked) : D.typ Pos.marked = | D.TArray ts -> D.TArray (translate_typ ts) (* catala is not polymorphic*) | D.TArrow ((D.TLit D.TUnit, _), t2) -> - D.TEnum ([ translate_typ t2 ], A.option_enum) - (* D.TAny *) - | D.TArrow (t1, t2) -> - D.TArrow (translate_typ t1, translate_typ t2) + D.TEnum ([ translate_typ t2 ], A.option_enum) (* D.TAny *) + | D.TArrow (t1, t2) -> D.TArrow (translate_typ t1, translate_typ t2) end let translate_lit (l : D.lit) (pos : Pos.t) : A.lit = @@ -429,26 +427,42 @@ let translate_scope_body (scope_pos : Pos.t) (_decl_ctx : D.decl_ctx) (ctx : ctx match body with | { scope_body_result = result; - scope_body_input_struct = _input_struct; + scope_body_input_struct = input_struct; scope_body_output_struct = _output_struct; } -> let v, lets = Bindlib.unbind result in - let ctx' = add_var scope_pos v true ctx in + let v' = (find ~info:"variable that was just created" v ctx').var in - translate_scope_let ctx' lets + A.make_abs [| v' |] (translate_scope_let ctx' lets) Pos.no_pos + [ (D.TTuple ([], Some input_struct), Pos.no_pos) ] + Pos.no_pos let translate_program (prgm : D.program) : A.program = (* modify the *) + let inputs_structs = + ListLabels.fold_left prgm.scopes ~init:[] ~f:(fun acc (_, _, body) -> + body.D.scope_body_input_struct :: acc) + in + + Cli.debug_print + @@ Format.asprintf "List of structs to modify: [%a]" + (Format.pp_print_list D.StructName.format_t) + inputs_structs; + let decl_ctx = { - D.ctx_enums = - prgm.decl_ctx.ctx_enums - |> D.EnumMap.add A.option_enum A.option_enum_config - |> D.EnumMap.map (fun l -> ListLabels.map l ~f:(fun (n, tau) -> (n, translate_typ tau))); + D.ctx_enums = prgm.decl_ctx.ctx_enums |> D.EnumMap.add A.option_enum A.option_enum_config; D.ctx_structs = prgm.decl_ctx.ctx_structs - |> D.StructMap.map (fun l -> ListLabels.map l ~f:(fun (n, tau) -> (n, translate_typ tau))); + |> D.StructMap.mapi (fun n l -> + if List.mem n inputs_structs then + ListLabels.map l ~f:(fun (n, tau) -> + Cli.debug_print @@ Format.asprintf "Input type: %a" D.pp_typ (fst tau); + Cli.debug_print + @@ Format.asprintf "Output type: %a" D.pp_typ (fst (translate_typ tau)); + (n, translate_typ tau)) + else l); } in @@ -456,15 +470,18 @@ let translate_program (prgm : D.program) : A.program = prgm.scopes |> ListLabels.fold_left ~init:([], D.VarMap.empty) ~f:(fun ((acc, ctx) : _ * info D.VarMap.t) (scope_name, n, scope_body) -> - let scope_body = Bindlib.unbox (translate_and_bind scope_body) in + + let v, scope_body = + Bindlib.unbind (Bindlib.unbox (Bindlib.bind_var n (translate_and_bind scope_body))) + in Cli.debug_print @@ Format.asprintf "global free variable : %a" (Format.pp_print_list Dcalc.Print.format_var) (free_vars_scope_body scope_body); - let new_ctx = add_var Pos.no_pos n true ctx in + let new_ctx = add_var Pos.no_pos v true ctx in - let new_n = find ~info:"variable that was just created" n new_ctx in + let new_n = find ~info:"variable that was just created ici" v new_ctx in let scope_pos = Pos.get_position (D.ScopeName.get_info scope_name) in From 29b734be4659df44f31c5210cb30e623bc74284d Mon Sep 17 00:00:00 2001 From: Alain Date: Wed, 9 Feb 2022 11:29:45 +0100 Subject: [PATCH 080/102] reorganisation of the file compile_without exceptions working binding of whole program working translation --- compiler/lcalc/compile_without_exceptions.ml | 246 +++++++++++-------- 1 file changed, 140 insertions(+), 106 deletions(-) diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index 8199e66c5..52265d79e 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -70,7 +70,125 @@ let add_var (pos : Pos.t) (var : D.Var.t) (is_pure : bool) (ctx : ctx) : ctx = D.VarMap.update var (fun _ -> Some { expr; var = new_var; is_pure }) ctx -(* D.VarMap.add var { expr; var = new_var; is_pure } ctx *) +(* internal representation of scopes. We make here heavy use of bindlib. *) + +type scope_lets = + | Result of D.expr Pos.marked + | ScopeLet of { + scope_let_kind : D.scope_let_kind; + scope_let_typ : D.typ Pos.marked; + scope_let_expr : D.expr Pos.marked; + scope_let_next : (D.expr, scope_lets) Bindlib.binder; + scope_let_pos : Pos.t; + } + +type scope_body = { + scope_body_input_struct : D.StructName.t; + scope_body_output_struct : D.StructName.t; + scope_body_result : (D.expr, scope_lets) Bindlib.binder; +} + +type scopes = + | Nil + | ScopeDef of { + scope_name : D.ScopeName.t; + scope_body : scope_body; + scope_next : (D.expr, scopes) Bindlib.binder; + } + +let union = D.VarMap.union (fun _ _ _ -> Some ()) + +let rec fv_scope_lets scope_lets = + match scope_lets with + | Result e -> D.fv e + | ScopeLet { scope_let_expr = e; scope_let_next = next; _ } -> + let v, body = Bindlib.unbind next in + union (D.fv e) (D.VarMap.remove v (fv_scope_lets body)) + +let fv_scope_body { scope_body_result = binder; _ } = + let v, body = Bindlib.unbind binder in + D.VarMap.remove v (fv_scope_lets body) + +let rec fv_scopes scopes = + match scopes with + | Nil -> D.VarMap.empty + | ScopeDef { scope_body = body; scope_next = next; _ } -> + let v, next = Bindlib.unbind next in + + union (D.VarMap.remove v (fv_scopes next)) (fv_scope_body body) + +let _free_vars_scope_lets scope_lets = fv_scope_lets scope_lets |> D.VarMap.bindings |> List.map fst + +let _free_vars_scope_body scope_body = fv_scope_body scope_body |> D.VarMap.bindings |> List.map fst + +let free_vars_scopes scopes = fv_scopes scopes |> D.VarMap.bindings |> List.map fst + +let bind_scope_lets (acc : scope_lets Bindlib.box) (scope_let : D.scope_let) : + scope_lets Bindlib.box = + let pos = snd scope_let.D.scope_let_var in + + Cli.debug_print + @@ Format.asprintf "binding let %a. Variable occurs = %b" Dcalc.Print.format_var + (fst scope_let.D.scope_let_var) + (Bindlib.occur (fst scope_let.D.scope_let_var) acc); + + let binder = Bindlib.bind_var (fst scope_let.D.scope_let_var) acc in + Bindlib.box_apply2 + (fun expr binder -> + Cli.debug_print + @@ Format.asprintf "free variables in expression: %a" + (Format.pp_print_list Dcalc.Print.format_var) + (D.free_vars expr); + ScopeLet + { + scope_let_kind = scope_let.D.scope_let_kind; + scope_let_typ = scope_let.D.scope_let_typ; + scope_let_expr = expr; + scope_let_next = binder; + scope_let_pos = pos; + }) + scope_let.D.scope_let_expr binder + +let bind_scope_body (body : D.scope_body) : scope_body Bindlib.box = + let body_result = + ListLabels.fold_right body.D.scope_body_lets + ~init:(Bindlib.box_apply (fun e -> Result e) body.D.scope_body_result) + ~f:(Fun.flip bind_scope_lets) + in + + Cli.debug_print @@ Format.asprintf "binding arg %a" Dcalc.Print.format_var body.D.scope_body_arg; + let scope_body_result = Bindlib.bind_var body.D.scope_body_arg body_result in + + Cli.debug_print + @@ Format.asprintf "isfinal term is closed: %b" (Bindlib.is_closed scope_body_result); + Bindlib.box_apply + (fun scope_body_result -> + Cli.debug_print + @@ Format.asprintf "rank of the final term: %i" (Bindlib.binder_rank scope_body_result); + { + scope_body_output_struct = body.D.scope_body_output_struct; + scope_body_input_struct = body.D.scope_body_input_struct; + scope_body_result; + }) + scope_body_result + +let bind_scope + ((scope_name, scope_var, scope_body) : D.ScopeName.t * D.expr Bindlib.var * D.scope_body) + (acc : scopes Bindlib.box) : scopes Bindlib.box = + Bindlib.box_apply2 + (fun scope_body scope_next -> ScopeDef { scope_name; scope_body; scope_next }) + (bind_scope_body scope_body) (Bindlib.bind_var scope_var acc) + +let bind_scopes (scopes : (D.ScopeName.t * D.expr Bindlib.var * D.scope_body) list) : + scopes Bindlib.box = + let result = ListLabels.fold_right scopes ~init:(Bindlib.box Nil) ~f:bind_scope in + + Cli.debug_print + @@ Format.asprintf "free variable in the program : [%a]" + (Format.pp_print_list Dcalc.Print.format_var) + (free_vars_scopes (Bindlib.unbox result)); + + result (** [tau' = translate_typ tau] translate the a dcalc type into a lcalc type. @@ -316,86 +434,6 @@ and translate_expr ?(append_esome = true) (ctx : ctx) (e : D.expr Pos.marked) : Cli.debug_print @@ Format.asprintf "build matchopt using %a" Print.format_var v; A.make_matchopt pos_c v (D.TAny, pos_c) c' (A.make_none pos_c) acc) -type scope_lets = - | Result of D.expr Pos.marked - | ScopeLet of { - scope_let_kind : D.scope_let_kind; - scope_let_typ : D.typ Pos.marked; - scope_let_expr : D.expr Pos.marked; - scope_let_next : (D.expr, scope_lets) Bindlib.binder; - scope_let_pos : Pos.t; - } - -let union = D.VarMap.union (fun _ _ _ -> Some ()) - -let rec fv_scope_lets scope_lets = - match scope_lets with - | Result e -> D.fv e - | ScopeLet { scope_let_expr = e; scope_let_next = next; _ } -> - let v, body = Bindlib.unbind next in - union (D.fv e) (D.VarMap.remove v (fv_scope_lets body)) - -type scope_body = { - scope_body_input_struct : D.StructName.t; - scope_body_output_struct : D.StructName.t; - scope_body_result : (D.expr, scope_lets) Bindlib.binder; -} - -let fv_scope_body { scope_body_result = binder; _ } = - let v, body = Bindlib.unbind binder in - D.VarMap.remove v (fv_scope_lets body) - -let free_vars_scope_body scope_body = fv_scope_body scope_body |> D.VarMap.bindings |> List.map fst - -let translate_and_bind_lets (acc : scope_lets Bindlib.box) (scope_let : D.scope_let) : - scope_lets Bindlib.box = - let pos = snd scope_let.D.scope_let_var in - - Cli.debug_print - @@ Format.asprintf "binding let %a. Variable occurs = %b" Dcalc.Print.format_var - (fst scope_let.D.scope_let_var) - (Bindlib.occur (fst scope_let.D.scope_let_var) acc); - - let binder = Bindlib.bind_var (fst scope_let.D.scope_let_var) acc in - Bindlib.box_apply2 - (fun expr binder -> - Cli.debug_print - @@ Format.asprintf "free variables in expression: %a" - (Format.pp_print_list Dcalc.Print.format_var) - (D.free_vars expr); - ScopeLet - { - scope_let_kind = scope_let.D.scope_let_kind; - scope_let_typ = scope_let.D.scope_let_typ; - scope_let_expr = expr; - scope_let_next = binder; - scope_let_pos = pos; - }) - scope_let.D.scope_let_expr binder - -let translate_and_bind (body : D.scope_body) : scope_body Bindlib.box = - let body_result = - ListLabels.fold_right body.D.scope_body_lets - ~init:(Bindlib.box_apply (fun e -> Result e) body.D.scope_body_result) - ~f:(Fun.flip translate_and_bind_lets) - in - - Cli.debug_print @@ Format.asprintf "binding arg %a" Dcalc.Print.format_var body.D.scope_body_arg; - let scope_body_result = Bindlib.bind_var body.D.scope_body_arg body_result in - - Cli.debug_print - @@ Format.asprintf "isfinal term is closed: %b" (Bindlib.is_closed scope_body_result); - Bindlib.box_apply - (fun scope_body_result -> - Cli.debug_print - @@ Format.asprintf "rank of the final term: %i" (Bindlib.binder_rank scope_body_result); - { - scope_body_output_struct = body.D.scope_body_output_struct; - scope_body_input_struct = body.D.scope_body_input_struct; - scope_body_result; - }) - scope_body_result - let rec translate_scope_let (ctx : ctx) (lets : scope_lets) = match lets with | Result e -> translate_expr ~append_esome:false ctx e @@ -438,6 +476,26 @@ let translate_scope_body (scope_pos : Pos.t) (_decl_ctx : D.decl_ctx) (ctx : ctx [ (D.TTuple ([], Some input_struct), Pos.no_pos) ] Pos.no_pos +let rec translate_scopes (decl_ctx : D.decl_ctx) (ctx : ctx) (scopes : scopes) : + (A.expr Bindlib.var * (A.expr * Pos.t)) list Bindlib.box = + match scopes with + | Nil -> Bindlib.box [] + | ScopeDef { scope_name; scope_body; scope_next } -> + let scope_var, next = Bindlib.unbind scope_next in + let new_ctx = add_var Pos.no_pos scope_var true ctx in + let new_scope_name = (find ~info:"variable that was just created" scope_var new_ctx).var in + + let scope_pos = Pos.get_position (D.ScopeName.get_info scope_name) in + + let new_body = translate_scope_body scope_pos decl_ctx ctx scope_body in + let tail = translate_scopes decl_ctx new_ctx next in + + Bindlib.box_apply2 (fun body tail -> (new_scope_name, body) :: tail) new_body tail + +let translate_scopes (decl_ctx : D.decl_ctx) (ctx : ctx) (scopes : scopes) : + (A.expr Bindlib.var * (A.expr * Pos.t)) list = + Bindlib.unbox (translate_scopes decl_ctx ctx scopes) + let translate_program (prgm : D.program) : A.program = (* modify the *) let inputs_structs = @@ -467,31 +525,7 @@ let translate_program (prgm : D.program) : A.program = in let scopes = - prgm.scopes - |> ListLabels.fold_left ~init:([], D.VarMap.empty) - ~f:(fun ((acc, ctx) : _ * info D.VarMap.t) (scope_name, n, scope_body) -> - - let v, scope_body = - Bindlib.unbind (Bindlib.unbox (Bindlib.bind_var n (translate_and_bind scope_body))) - in - - Cli.debug_print - @@ Format.asprintf "global free variable : %a" - (Format.pp_print_list Dcalc.Print.format_var) - (free_vars_scope_body scope_body); - let new_ctx = add_var Pos.no_pos v true ctx in - - let new_n = find ~info:"variable that was just created ici" v new_ctx in - - let scope_pos = Pos.get_position (D.ScopeName.get_info scope_name) in - - let new_acc = - (new_n, Bindlib.unbox (translate_scope_body scope_pos decl_ctx ctx scope_body)) :: acc - in - - (new_acc, new_ctx)) - |> fst |> List.rev - |> List.map (fun (info, e) -> (info.var, e)) + prgm.scopes |> bind_scopes |> Bindlib.unbox |> translate_scopes decl_ctx D.VarMap.empty in { scopes; decl_ctx } From bd0fe18cc340bada6322725c64d4ae8196d6c815 Mon Sep 17 00:00:00 2001 From: Alain Date: Wed, 9 Feb 2022 11:44:00 +0100 Subject: [PATCH 081/102] handling with special care SubScopeVarDefinition using the invariant that is it thunked --- compiler/lcalc/compile_without_exceptions.ml | 24 ++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index 52265d79e..4f9691107 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -437,6 +437,30 @@ and translate_expr ?(append_esome = true) (ctx : ctx) (e : D.expr Pos.marked) : let rec translate_scope_let (ctx : ctx) (lets : scope_lets) = match lets with | Result e -> translate_expr ~append_esome:false ctx e + | ScopeLet + { + scope_let_kind = SubScopeVarDefinition; + scope_let_typ = typ; + scope_let_expr = D.EAbs ((binder, _), _), _pos; + scope_let_next = next; + scope_let_pos = pos; + } -> + (* special case : the subscope variable is always thunked. We remove this thunking. *) + let _, expr = Bindlib.unmbind binder in + + let var_is_pure = true in + let var, next = Bindlib.unbind next in + Cli.debug_print @@ Format.asprintf "unbinding %a" Dcalc.Print.format_var var; + let ctx' = add_var pos var var_is_pure ctx in + let new_var = (find ~info:"variable that was just created" var ctx').var in + A.make_let_in new_var (translate_typ typ) + (translate_expr ctx ~append_esome:true expr) + (translate_scope_let ctx' next) + | ScopeLet { scope_let_kind = SubScopeVarDefinition; scope_let_pos = pos; _ } -> + Errors.raise_spanned_error + "Internal Error: found an SubScopeVarDefinition that does not satisfy the thunked \ + invariant when translating Dcalc to Lcalc without exceptions." + pos | ScopeLet { scope_let_kind = kind; From 72da935392cf91e06462d96d1f25399b38064311 Mon Sep 17 00:00:00 2001 From: Alain Date: Wed, 9 Feb 2022 11:50:04 +0100 Subject: [PATCH 082/102] chaging pretty printer for type to Dcalc.Print.format_typ --- compiler/lcalc/compile_without_exceptions.ml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index 4f9691107..5c1ca0d5b 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -540,9 +540,12 @@ let translate_program (prgm : D.program) : A.program = |> D.StructMap.mapi (fun n l -> if List.mem n inputs_structs then ListLabels.map l ~f:(fun (n, tau) -> - Cli.debug_print @@ Format.asprintf "Input type: %a" D.pp_typ (fst tau); Cli.debug_print - @@ Format.asprintf "Output type: %a" D.pp_typ (fst (translate_typ tau)); + @@ Format.asprintf "Input type: %a" (Dcalc.Print.format_typ prgm.decl_ctx) tau; + Cli.debug_print + @@ Format.asprintf "Output type: %a" + (Dcalc.Print.format_typ prgm.decl_ctx) + (translate_typ tau); (n, translate_typ tau)) else l); } From 8834034094f8afd236692a5577479145220b6fe2 Mon Sep 17 00:00:00 2001 From: Alain Date: Fri, 11 Feb 2022 09:39:01 +0100 Subject: [PATCH 083/102] disable beta-reduction --- compiler/lcalc/optimizations.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/lcalc/optimizations.ml b/compiler/lcalc/optimizations.ml index fe4e1d2c5..387defa04 100644 --- a/compiler/lcalc/optimizations.ml +++ b/compiler/lcalc/optimizations.ml @@ -94,7 +94,7 @@ let rec beta_expr (_ : unit) (e : expr Pos.marked) : expr Pos.marked Bindlib.box let iota_optimizations (p : program) : program = { p with scopes = List.map (fun (var, e) -> (var, Bindlib.unbox (iota_expr () e))) p.scopes } -let beta_optimizations (p : program) : program = +let _beta_optimizations (p : program) : program = { p with scopes = List.map (fun (var, e) -> (var, Bindlib.unbox (beta_expr () e))) p.scopes } let rec peephole_expr (_ : unit) (e : expr Pos.marked) : expr Pos.marked Bindlib.box = @@ -112,5 +112,5 @@ let rec peephole_expr (_ : unit) (e : expr Pos.marked) : expr Pos.marked Bindlib let peephole_optimizations (p : program) : program = { p with scopes = List.map (fun (var, e) -> (var, Bindlib.unbox (peephole_expr () e))) p.scopes } -let optimize_program (p : program) : program = - p |> iota_optimizations |> peephole_optimizations |> beta_optimizations +let optimize_program (p : program) : program = p |> iota_optimizations |> peephole_optimizations +(* |> beta_optimizations *) From cf28a583426d6a9fa6b1f4ffc43c7e74eb117a7e Mon Sep 17 00:00:00 2001 From: Alain Date: Fri, 11 Feb 2022 11:38:18 +0100 Subject: [PATCH 084/102] cut --> hoist binded representation few doc --- compiler/dcalc/binded_representation.ml | 135 +++++++++++++++ compiler/lcalc/compile_without_exceptions.ml | 165 +++---------------- 2 files changed, 162 insertions(+), 138 deletions(-) create mode 100644 compiler/dcalc/binded_representation.ml diff --git a/compiler/dcalc/binded_representation.ml b/compiler/dcalc/binded_representation.ml new file mode 100644 index 000000000..b5f933b41 --- /dev/null +++ b/compiler/dcalc/binded_representation.ml @@ -0,0 +1,135 @@ + +open Utils + +module D = Ast + +(** Alternative representation of the Dcalc Ast. It is currently used in the transformation without exceptions. We make heavy use of bindlib, binding each scope-let-variable and each scope explicitly. *) + + +(** In [Ast], [Ast.scope_lets] is defined as a list of kind, var, and boxed expression. This representation binds using bindlib the tail of the list with the variable defined in the let. *) +type scope_lets = + | Result of D.expr Pos.marked + | ScopeLet of { + scope_let_kind : D.scope_let_kind; + scope_let_typ : D.typ Pos.marked; + scope_let_expr : D.expr Pos.marked; + scope_let_next : (D.expr, scope_lets) Bindlib.binder; + scope_let_pos : Pos.t; + } + +(** As a consequence, the scope_body contains only a result and input/output signature, as the other elements are stored inside the scope_let. The binder present is the argument of type [scope_body_input_struct]. *) +type scope_body = { + scope_body_input_struct : D.StructName.t; + scope_body_output_struct : D.StructName.t; + scope_body_result : (D.expr, scope_lets) Bindlib.binder; +} + +(* finally, we do the same transformation for the whole program for the kinded lets. This permit us to use bindlib variables for scopes names. *) +type scopes = + | Nil + | ScopeDef of { + scope_name : D.ScopeName.t; + scope_body : scope_body; + scope_next : (D.expr, scopes) Bindlib.binder; + } + +let union = D.VarMap.union (fun _ _ _ -> Some ()) + + +(** free variables. For each construction, we define two free variables functions. The first one generates [unit D.VarMap.t], since there is no [D.VarSet.t]. And the second returns a list. The second one is better from pretty printing in debug. *) + +let rec fv_scope_lets scope_lets = + match scope_lets with + | Result e -> D.fv e + | ScopeLet { scope_let_expr = e; scope_let_next = next; _ } -> + let v, body = Bindlib.unbind next in + union (D.fv e) (D.VarMap.remove v (fv_scope_lets body)) + +let fv_scope_body { scope_body_result = binder; _ } = + let v, body = Bindlib.unbind binder in + D.VarMap.remove v (fv_scope_lets body) + +let rec fv_scopes scopes = + match scopes with + | Nil -> D.VarMap.empty + | ScopeDef { scope_body = body; scope_next = next; _ } -> + let v, next = Bindlib.unbind next in + + union (D.VarMap.remove v (fv_scopes next)) (fv_scope_body body) + +let _free_vars_scope_lets scope_lets = fv_scope_lets scope_lets |> D.VarMap.bindings |> List.map fst + +let _free_vars_scope_body scope_body = fv_scope_body scope_body |> D.VarMap.bindings |> List.map fst + +let free_vars_scopes scopes = fv_scopes scopes |> D.VarMap.bindings |> List.map fst + + +(** Actual transformation for scopes. It simply *) +let bind_scope_lets (acc : scope_lets Bindlib.box) (scope_let : D.scope_let) : + scope_lets Bindlib.box = + let pos = snd scope_let.D.scope_let_var in + + Cli.debug_print + @@ Format.asprintf "binding let %a. Variable occurs = %b" Print.format_var + (fst scope_let.D.scope_let_var) + (Bindlib.occur (fst scope_let.D.scope_let_var) acc); + + let binder = Bindlib.bind_var (fst scope_let.D.scope_let_var) acc in + Bindlib.box_apply2 + (fun expr binder -> + Cli.debug_print + @@ Format.asprintf "free variables in expression: %a" + (Format.pp_print_list Print.format_var) + (D.free_vars expr); + ScopeLet + { + scope_let_kind = scope_let.D.scope_let_kind; + scope_let_typ = scope_let.D.scope_let_typ; + scope_let_expr = expr; + scope_let_next = binder; + scope_let_pos = pos; + }) + scope_let.D.scope_let_expr binder + +let bind_scope_body (body : D.scope_body) : scope_body Bindlib.box = + + (* it is a fold_right and not a fold_left. *) + let body_result = + ListLabels.fold_right body.D.scope_body_lets + ~init:(Bindlib.box_apply (fun e -> Result e) body.D.scope_body_result) + ~f:(Fun.flip bind_scope_lets) + in + + Cli.debug_print @@ Format.asprintf "binding arg %a" Print.format_var body.D.scope_body_arg; + let scope_body_result = Bindlib.bind_var body.D.scope_body_arg body_result in + + Cli.debug_print + @@ Format.asprintf "isfinal term is closed: %b" (Bindlib.is_closed scope_body_result); + Bindlib.box_apply + (fun scope_body_result -> + Cli.debug_print + @@ Format.asprintf "rank of the final term: %i" (Bindlib.binder_rank scope_body_result); + { + scope_body_output_struct = body.D.scope_body_output_struct; + scope_body_input_struct = body.D.scope_body_input_struct; + scope_body_result; + }) + scope_body_result + +let bind_scope + ((scope_name, scope_var, scope_body) : D.ScopeName.t * D.expr Bindlib.var * D.scope_body) + (acc : scopes Bindlib.box) : scopes Bindlib.box = + Bindlib.box_apply2 + (fun scope_body scope_next -> ScopeDef { scope_name; scope_body; scope_next }) + (bind_scope_body scope_body) (Bindlib.bind_var scope_var acc) + +let bind_scopes (scopes : (D.ScopeName.t * D.expr Bindlib.var * D.scope_body) list) : + scopes Bindlib.box = + let result = ListLabels.fold_right scopes ~init:(Bindlib.box Nil) ~f:bind_scope in + + Cli.debug_print + @@ Format.asprintf "free variable in the program : [%a]" + (Format.pp_print_list Print.format_var) + (free_vars_scopes (Bindlib.unbox result)); + + result diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index 5c1ca0d5b..e8d5748e1 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -2,7 +2,7 @@ open Utils module D = Dcalc.Ast module A = Ast -(** hoisting *) +(*** hoisting *) (** The main idea around this pass is to compile Dcalc to Lcalc without using [raise EmptyError] nor [try _ with EmptyError -> _]. To do so, we use the same technique as in rust or erlang to handle @@ -10,41 +10,49 @@ module A = Ast [try e1 with EmtpyError -> e2] as [match e1 with | None -> e2 | Some x -> x]. When doing this naively, this requires to add matches and Some constructor everywhere. We apply - here an other technique where we generate what we call `cuts`. Cuts are expression whom could - minimally [raise EmptyError]. For instance + here an other technique where we generate what we call `hoists`. Hoists are expression whom could + minimally [raise EmptyError]. For instance in [let x = * 3 in x + 1], the sub-expression - [] can produce an empty error. So we make a cut with a new + [] can produce an empty error. So we make a hoist with a new variable [y] linked to the Dcalc expression [], and we return as the translated expression [let x = y * 3 in x + 1]. - The compilation of expressions is found in the functions [translate_and_cut ctx e] and - [translate_expr ctx e]. Every option-generating expresion when calling [translate_and_cut] will - be cutted and later handled by the [translate_expr] function. Every other cases is found in the - translate_and_cut function. *) + The compilation of expressions is found in the functions [translate_and_hoist ctx e] and + [translate_expr ctx e]. Every option-generating expression when calling [translate_and_hoist] will + be hoisted and later handled by the [translate_expr] function. Every other cases is found in the + translate_and_hoist function. *) -type cuts = D.expr Pos.marked A.VarMap.t -(** cuts *) -type info = { expr : A.expr Pos.marked Bindlib.box; var : A.expr Bindlib.var; is_pure : bool } -(** information about the Dcalc variable : what is the corresponding LCalc variable; an expression - build correctly using Bindlib, and a boolean `is_pure` indicating whenever the variable can be - an EmptyError and hence should be matched (false) or if it never can be EmptyError (true). *) +(** Hoists definition. It represent bindings between [A.Var.t] and [D.expr]. *) +type hoists = D.expr Pos.marked A.VarMap.t + -type ctx = info D.VarMap.t -(** information context about variables in the current scope *) +(** Information about each encontered Dcalc variable is stored inside a context : what is the corresponding LCalc variable; an expression corresponding to the variable + build correctly using Bindlib, and a boolean `is_pure` indicating whenever the variable can be + an EmptyError and hence should be matched (false) or if it never can be EmptyError (true). *) +type info = { expr : A.expr Pos.marked Bindlib.box; var : A.expr Bindlib.var; is_pure : bool } let pp_info (fmt : Format.formatter) (info : info) = Format.fprintf fmt "{var: %a; is_pure: %b}" Print.format_var info.var info.is_pure + -let pp_binding (fmt : Format.formatter) ((v, info) : D.Var.t * info) = - Format.fprintf fmt "%a:%a" Dcalc.Print.format_var v pp_info info +(** information context about variables in the current scope *) +type ctx = info D.VarMap.t let pp_ctx (fmt : Format.formatter) (ctx : ctx) = + + let pp_binding (fmt : Format.formatter) ((v, info) : D.Var.t * info) = + Format.fprintf fmt "%a: %a" Dcalc.Print.format_var v pp_info info + in + let pp_bindings = Format.pp_print_list ~pp_sep:(fun fmt () -> Format.pp_print_string fmt "; ") pp_binding in + Format.fprintf fmt "@[<2>[%a]@]" pp_bindings (D.VarMap.bindings ctx) + + (** [find ~info n ctx] is a warpper to ocaml's Map.find that handle errors in a slightly better way. *) let find ?(info : string = "none") (n : D.Var.t) (ctx : ctx) : info = let _ = @@ -61,6 +69,7 @@ let find ?(info : string = "none") (n : D.Var.t) (ctx : ctx) : info = Dcalc.Print.format_var n info) Pos.no_pos +(** [add_var pos var is_pure ctx] add to the context [ctx] the Dcalc variable var, creating a unique corresponding variable in Lcalc, with the corresponding expression, and the boolean is_pure. It is usefull for debuging purposes as it printing each of the Dcalc/Lcalc variable pairs. *) let add_var (pos : Pos.t) (var : D.Var.t) (is_pure : bool) (ctx : ctx) : ctx = let new_var = A.Var.make (Bindlib.name_of var, pos) in let expr = A.make_var (new_var, pos) in @@ -70,126 +79,6 @@ let add_var (pos : Pos.t) (var : D.Var.t) (is_pure : bool) (ctx : ctx) : ctx = D.VarMap.update var (fun _ -> Some { expr; var = new_var; is_pure }) ctx -(* internal representation of scopes. We make here heavy use of bindlib. *) - -type scope_lets = - | Result of D.expr Pos.marked - | ScopeLet of { - scope_let_kind : D.scope_let_kind; - scope_let_typ : D.typ Pos.marked; - scope_let_expr : D.expr Pos.marked; - scope_let_next : (D.expr, scope_lets) Bindlib.binder; - scope_let_pos : Pos.t; - } - -type scope_body = { - scope_body_input_struct : D.StructName.t; - scope_body_output_struct : D.StructName.t; - scope_body_result : (D.expr, scope_lets) Bindlib.binder; -} - -type scopes = - | Nil - | ScopeDef of { - scope_name : D.ScopeName.t; - scope_body : scope_body; - scope_next : (D.expr, scopes) Bindlib.binder; - } - -let union = D.VarMap.union (fun _ _ _ -> Some ()) - -let rec fv_scope_lets scope_lets = - match scope_lets with - | Result e -> D.fv e - | ScopeLet { scope_let_expr = e; scope_let_next = next; _ } -> - let v, body = Bindlib.unbind next in - union (D.fv e) (D.VarMap.remove v (fv_scope_lets body)) - -let fv_scope_body { scope_body_result = binder; _ } = - let v, body = Bindlib.unbind binder in - D.VarMap.remove v (fv_scope_lets body) - -let rec fv_scopes scopes = - match scopes with - | Nil -> D.VarMap.empty - | ScopeDef { scope_body = body; scope_next = next; _ } -> - let v, next = Bindlib.unbind next in - - union (D.VarMap.remove v (fv_scopes next)) (fv_scope_body body) - -let _free_vars_scope_lets scope_lets = fv_scope_lets scope_lets |> D.VarMap.bindings |> List.map fst - -let _free_vars_scope_body scope_body = fv_scope_body scope_body |> D.VarMap.bindings |> List.map fst - -let free_vars_scopes scopes = fv_scopes scopes |> D.VarMap.bindings |> List.map fst - -let bind_scope_lets (acc : scope_lets Bindlib.box) (scope_let : D.scope_let) : - scope_lets Bindlib.box = - let pos = snd scope_let.D.scope_let_var in - - Cli.debug_print - @@ Format.asprintf "binding let %a. Variable occurs = %b" Dcalc.Print.format_var - (fst scope_let.D.scope_let_var) - (Bindlib.occur (fst scope_let.D.scope_let_var) acc); - - let binder = Bindlib.bind_var (fst scope_let.D.scope_let_var) acc in - Bindlib.box_apply2 - (fun expr binder -> - Cli.debug_print - @@ Format.asprintf "free variables in expression: %a" - (Format.pp_print_list Dcalc.Print.format_var) - (D.free_vars expr); - ScopeLet - { - scope_let_kind = scope_let.D.scope_let_kind; - scope_let_typ = scope_let.D.scope_let_typ; - scope_let_expr = expr; - scope_let_next = binder; - scope_let_pos = pos; - }) - scope_let.D.scope_let_expr binder - -let bind_scope_body (body : D.scope_body) : scope_body Bindlib.box = - let body_result = - ListLabels.fold_right body.D.scope_body_lets - ~init:(Bindlib.box_apply (fun e -> Result e) body.D.scope_body_result) - ~f:(Fun.flip bind_scope_lets) - in - - Cli.debug_print @@ Format.asprintf "binding arg %a" Dcalc.Print.format_var body.D.scope_body_arg; - let scope_body_result = Bindlib.bind_var body.D.scope_body_arg body_result in - - Cli.debug_print - @@ Format.asprintf "isfinal term is closed: %b" (Bindlib.is_closed scope_body_result); - Bindlib.box_apply - (fun scope_body_result -> - Cli.debug_print - @@ Format.asprintf "rank of the final term: %i" (Bindlib.binder_rank scope_body_result); - { - scope_body_output_struct = body.D.scope_body_output_struct; - scope_body_input_struct = body.D.scope_body_input_struct; - scope_body_result; - }) - scope_body_result - -let bind_scope - ((scope_name, scope_var, scope_body) : D.ScopeName.t * D.expr Bindlib.var * D.scope_body) - (acc : scopes Bindlib.box) : scopes Bindlib.box = - Bindlib.box_apply2 - (fun scope_body scope_next -> ScopeDef { scope_name; scope_body; scope_next }) - (bind_scope_body scope_body) (Bindlib.bind_var scope_var acc) - -let bind_scopes (scopes : (D.ScopeName.t * D.expr Bindlib.var * D.scope_body) list) : - scopes Bindlib.box = - let result = ListLabels.fold_right scopes ~init:(Bindlib.box Nil) ~f:bind_scope in - - Cli.debug_print - @@ Format.asprintf "free variable in the program : [%a]" - (Format.pp_print_list Dcalc.Print.format_var) - (free_vars_scopes (Bindlib.unbox result)); - - result - (** [tau' = translate_typ tau] translate the a dcalc type into a lcalc type. Since positions where there is thunked expressions is exactly where we will put option From 77051cadba8e597c7acfd767eab6640e70372e7e Mon Sep 17 00:00:00 2001 From: Alain Date: Fri, 11 Feb 2022 11:40:24 +0100 Subject: [PATCH 085/102] fmt --- compiler/dcalc/binded_representation.ml | 21 +++++++------ compiler/lcalc/compile_without_exceptions.ml | 33 +++++++++----------- 2 files changed, 26 insertions(+), 28 deletions(-) diff --git a/compiler/dcalc/binded_representation.ml b/compiler/dcalc/binded_representation.ml index b5f933b41..279322447 100644 --- a/compiler/dcalc/binded_representation.ml +++ b/compiler/dcalc/binded_representation.ml @@ -1,12 +1,12 @@ - open Utils - module D = Ast -(** Alternative representation of the Dcalc Ast. It is currently used in the transformation without exceptions. We make heavy use of bindlib, binding each scope-let-variable and each scope explicitly. *) - +(** Alternative representation of the Dcalc Ast. It is currently used in the transformation without + exceptions. We make heavy use of bindlib, binding each scope-let-variable and each scope + explicitly. *) -(** In [Ast], [Ast.scope_lets] is defined as a list of kind, var, and boxed expression. This representation binds using bindlib the tail of the list with the variable defined in the let. *) +(** In [Ast], [Ast.scope_lets] is defined as a list of kind, var, and boxed expression. This + representation binds using bindlib the tail of the list with the variable defined in the let. *) type scope_lets = | Result of D.expr Pos.marked | ScopeLet of { @@ -17,12 +17,14 @@ type scope_lets = scope_let_pos : Pos.t; } -(** As a consequence, the scope_body contains only a result and input/output signature, as the other elements are stored inside the scope_let. The binder present is the argument of type [scope_body_input_struct]. *) type scope_body = { scope_body_input_struct : D.StructName.t; scope_body_output_struct : D.StructName.t; scope_body_result : (D.expr, scope_lets) Bindlib.binder; } +(** As a consequence, the scope_body contains only a result and input/output signature, as the other + elements are stored inside the scope_let. The binder present is the argument of type + [scope_body_input_struct]. *) (* finally, we do the same transformation for the whole program for the kinded lets. This permit us to use bindlib variables for scopes names. *) type scopes = @@ -35,8 +37,9 @@ type scopes = let union = D.VarMap.union (fun _ _ _ -> Some ()) - -(** free variables. For each construction, we define two free variables functions. The first one generates [unit D.VarMap.t], since there is no [D.VarSet.t]. And the second returns a list. The second one is better from pretty printing in debug. *) +(** free variables. For each construction, we define two free variables functions. The first one + generates [unit D.VarMap.t], since there is no [D.VarSet.t]. And the second returns a list. The + second one is better from pretty printing in debug. *) let rec fv_scope_lets scope_lets = match scope_lets with @@ -63,7 +66,6 @@ let _free_vars_scope_body scope_body = fv_scope_body scope_body |> D.VarMap.bind let free_vars_scopes scopes = fv_scopes scopes |> D.VarMap.bindings |> List.map fst - (** Actual transformation for scopes. It simply *) let bind_scope_lets (acc : scope_lets Bindlib.box) (scope_let : D.scope_let) : scope_lets Bindlib.box = @@ -92,7 +94,6 @@ let bind_scope_lets (acc : scope_lets Bindlib.box) (scope_let : D.scope_let) : scope_let.D.scope_let_expr binder let bind_scope_body (body : D.scope_body) : scope_body Bindlib.box = - (* it is a fold_right and not a fold_left. *) let body_result = ListLabels.fold_right body.D.scope_body_lets diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index e8d5748e1..c04a470af 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -10,37 +10,34 @@ module A = Ast [try e1 with EmtpyError -> e2] as [match e1 with | None -> e2 | Some x -> x]. When doing this naively, this requires to add matches and Some constructor everywhere. We apply - here an other technique where we generate what we call `hoists`. Hoists are expression whom could - minimally [raise EmptyError]. For instance in + here an other technique where we generate what we call `hoists`. Hoists are expression whom + could minimally [raise EmptyError]. For instance in [let x = * 3 in x + 1], the sub-expression [] can produce an empty error. So we make a hoist with a new variable [y] linked to the Dcalc expression [], and we return as the translated expression [let x = y * 3 in x + 1]. The compilation of expressions is found in the functions [translate_and_hoist ctx e] and - [translate_expr ctx e]. Every option-generating expression when calling [translate_and_hoist] will - be hoisted and later handled by the [translate_expr] function. Every other cases is found in the - translate_and_hoist function. *) + [translate_expr ctx e]. Every option-generating expression when calling [translate_and_hoist] + will be hoisted and later handled by the [translate_expr] function. Every other cases is found + in the translate_and_hoist function. *) - -(** Hoists definition. It represent bindings between [A.Var.t] and [D.expr]. *) type hoists = D.expr Pos.marked A.VarMap.t +(** Hoists definition. It represent bindings between [A.Var.t] and [D.expr]. *) - - -(** Information about each encontered Dcalc variable is stored inside a context : what is the corresponding LCalc variable; an expression corresponding to the variable - build correctly using Bindlib, and a boolean `is_pure` indicating whenever the variable can be - an EmptyError and hence should be matched (false) or if it never can be EmptyError (true). *) type info = { expr : A.expr Pos.marked Bindlib.box; var : A.expr Bindlib.var; is_pure : bool } +(** Information about each encontered Dcalc variable is stored inside a context : what is the + corresponding LCalc variable; an expression corresponding to the variable build correctly using + Bindlib, and a boolean `is_pure` indicating whenever the variable can be an EmptyError and hence + should be matched (false) or if it never can be EmptyError (true). *) + let pp_info (fmt : Format.formatter) (info : info) = Format.fprintf fmt "{var: %a; is_pure: %b}" Print.format_var info.var info.is_pure - -(** information context about variables in the current scope *) type ctx = info D.VarMap.t +(** information context about variables in the current scope *) let pp_ctx (fmt : Format.formatter) (ctx : ctx) = - let pp_binding (fmt : Format.formatter) ((v, info) : D.Var.t * info) = Format.fprintf fmt "%a: %a" Dcalc.Print.format_var v pp_info info in @@ -51,8 +48,6 @@ let pp_ctx (fmt : Format.formatter) (ctx : ctx) = Format.fprintf fmt "@[<2>[%a]@]" pp_bindings (D.VarMap.bindings ctx) - - (** [find ~info n ctx] is a warpper to ocaml's Map.find that handle errors in a slightly better way. *) let find ?(info : string = "none") (n : D.Var.t) (ctx : ctx) : info = let _ = @@ -69,7 +64,9 @@ let find ?(info : string = "none") (n : D.Var.t) (ctx : ctx) : info = Dcalc.Print.format_var n info) Pos.no_pos -(** [add_var pos var is_pure ctx] add to the context [ctx] the Dcalc variable var, creating a unique corresponding variable in Lcalc, with the corresponding expression, and the boolean is_pure. It is usefull for debuging purposes as it printing each of the Dcalc/Lcalc variable pairs. *) +(** [add_var pos var is_pure ctx] add to the context [ctx] the Dcalc variable var, creating a unique + corresponding variable in Lcalc, with the corresponding expression, and the boolean is_pure. It + is usefull for debuging purposes as it printing each of the Dcalc/Lcalc variable pairs. *) let add_var (pos : Pos.t) (var : D.Var.t) (is_pure : bool) (ctx : ctx) : ctx = let new_var = A.Var.make (Bindlib.name_of var, pos) in let expr = A.make_var (new_var, pos) in From 80fa3110ebe06cac774e4194c9373b50d8a67e76 Mon Sep 17 00:00:00 2001 From: Alain Date: Sat, 12 Feb 2022 08:08:13 +0100 Subject: [PATCH 086/102] documentation + finished translating cut to hoist + copyright inside the compile_without_exceptions --- compiler/dcalc/binded_representation.ml | 24 +++- compiler/dcalc/binded_representation.mli | 62 +++++++++ compiler/dcalc/print.ml | 4 +- compiler/lcalc/compile_without_exceptions.ml | 128 ++++++++++-------- compiler/lcalc/compile_without_exceptions.mli | 2 +- 5 files changed, 155 insertions(+), 65 deletions(-) create mode 100644 compiler/dcalc/binded_representation.mli diff --git a/compiler/dcalc/binded_representation.ml b/compiler/dcalc/binded_representation.ml index 279322447..3b5343cd6 100644 --- a/compiler/dcalc/binded_representation.ml +++ b/compiler/dcalc/binded_representation.ml @@ -1,3 +1,17 @@ +(* This file is part of the Catala compiler, a specification language for tax and social benefits + computation rules. Copyright (C) 2020-2022 Inria, contributor: Alain Delaët-Tixeuil + + + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + in compliance with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under the License + is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + or implied. See the License for the specific language governing permissions and limitations under + the License. *) + open Utils module D = Ast @@ -22,11 +36,7 @@ type scope_body = { scope_body_output_struct : D.StructName.t; scope_body_result : (D.expr, scope_lets) Bindlib.binder; } -(** As a consequence, the scope_body contains only a result and input/output signature, as the other - elements are stored inside the scope_let. The binder present is the argument of type - [scope_body_input_struct]. *) -(* finally, we do the same transformation for the whole program for the kinded lets. This permit us to use bindlib variables for scopes names. *) type scopes = | Nil | ScopeDef of { @@ -60,13 +70,13 @@ let rec fv_scopes scopes = union (D.VarMap.remove v (fv_scopes next)) (fv_scope_body body) -let _free_vars_scope_lets scope_lets = fv_scope_lets scope_lets |> D.VarMap.bindings |> List.map fst +let free_vars_scope_lets scope_lets = fv_scope_lets scope_lets |> D.VarMap.bindings |> List.map fst -let _free_vars_scope_body scope_body = fv_scope_body scope_body |> D.VarMap.bindings |> List.map fst +let free_vars_scope_body scope_body = fv_scope_body scope_body |> D.VarMap.bindings |> List.map fst let free_vars_scopes scopes = fv_scopes scopes |> D.VarMap.bindings |> List.map fst -(** Actual transformation for scopes. It simply *) +(** Actual transformation for scopes. *) let bind_scope_lets (acc : scope_lets Bindlib.box) (scope_let : D.scope_let) : scope_lets Bindlib.box = let pos = snd scope_let.D.scope_let_var in diff --git a/compiler/dcalc/binded_representation.mli b/compiler/dcalc/binded_representation.mli new file mode 100644 index 000000000..86929cb8b --- /dev/null +++ b/compiler/dcalc/binded_representation.mli @@ -0,0 +1,62 @@ +(* This file is part of the Catala compiler, a specification language for tax and social benefits + computation rules. Copyright (C) 2020-2022 Inria, contributor: Alain Delaët-Tixeuil + + + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + in compliance with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under the License + is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + or implied. See the License for the specific language governing permissions and limitations under + the License. *) + +module D = Ast + +(** Alternative representation of the Dcalc Ast. It is currently used in the transformation without + exceptions. We make heavy use of bindlib, binding each scope-let-variable and each scope + explicitly. *) + +(** In [Ast], [Ast.scope_lets] is defined as a list of kind, var, and boxed expression. This + representation binds using bindlib the tail of the list with the variable defined in the let. *) +type scope_lets = + | Result of D.expr Utils.Pos.marked + | ScopeLet of { + scope_let_kind : D.scope_let_kind; + scope_let_typ : D.typ Utils.Pos.marked; + scope_let_expr : D.expr Utils.Pos.marked; + scope_let_next : (D.expr, scope_lets) Bindlib.binder; + scope_let_pos : Utils.Pos.t; + } + +(** As a consequence, the scope_body contains only a result and input/output signature, as the other + elements are stored inside the scope_let. The binder present is the argument of type + [scope_body_input_struct]. *) + +type scope_body = { + scope_body_input_struct : D.StructName.t; + scope_body_output_struct : D.StructName.t; + scope_body_result : (D.expr, scope_lets) Bindlib.binder; +} + +(* finally, we do the same transformation for the whole program for the kinded lets. This permit us to use bindlib variables for scopes names. *) +type scopes = + | Nil + | ScopeDef of { + scope_name : D.ScopeName.t; + scope_body : scope_body; + scope_next : (D.expr, scopes) Bindlib.binder; + } + +(* List of variables not binded inside a scope_lets *) +val free_vars_scope_lets : scope_lets -> D.Var.t list + +(* List of variables not binded inside a scope_body. *) +val free_vars_scope_body : scope_body -> D.Var.t list + +(* List of variables not binded inside scopes*) +val free_vars_scopes : scopes -> D.Var.t list + +(* Transform a list of scopes into our representation of scopes. It requires that scopes are topologically-well-ordered, and ensure there is no free variables in the returned [scopes] *) +val bind_scopes : (D.ScopeName.t * D.expr Bindlib.var * D.scope_body) list -> scopes Bindlib.box diff --git a/compiler/dcalc/print.ml b/compiler/dcalc/print.ml index b3fe690f2..d5cfa35eb 100644 --- a/compiler/dcalc/print.ml +++ b/compiler/dcalc/print.ml @@ -272,8 +272,8 @@ let rec format_expr ?(debug : bool = false) (ctx : Ast.decl_ctx) (fmt : Format.f (Format.pp_print_list ~pp_sep:(fun fmt () -> Format.fprintf fmt "%a@ " format_punctuation ",") format_expr) - exceptions format_punctuation "|" format_expr just format_punctuation "⊢" format_expr cons - format_punctuation "⟩" + exceptions format_punctuation "|" format_expr just format_punctuation "⊢" format_expr + cons format_punctuation "⟩" | ErrorOnEmpty e' -> Format.fprintf fmt "error_empty@ %a" format_with_parens e' | EAssert e' -> Format.fprintf fmt "@[%a@ %a%a%a@]" format_keyword "assert" format_punctuation "(" diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index c04a470af..dc0f172a7 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -1,6 +1,21 @@ +(* This file is part of the Catala compiler, a specification language for tax and social benefits + computation rules. Copyright (C) 2020-2022 Inria, contributor: Alain Delaët-Tixeuil + + + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + in compliance with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under the License + is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + or implied. See the License for the specific language governing permissions and limitations under + the License. *) + open Utils module D = Dcalc.Ast module A = Ast +open Dcalc.Binded_representation (*** hoisting *) @@ -120,15 +135,15 @@ let disjoint_union_maps (pos : Pos.t) (cs : 'a A.VarMap.t list) : 'a A.VarMap.t List.fold_left disjoint_union A.VarMap.empty cs -(** [e' = translate_and_cut ctx e ] Translate the Dcalc expression e into an expression in Lcalc, - given we translate each cuts correctly. It ensures the equivalence between the execution of e +(** [e' = translate_and_hoist ctx e ] Translate the Dcalc expression e into an expression in Lcalc, + given we translate each hoists correctly. It ensures the equivalence between the execution of e and the execution of e' are equivalent in an environement where each variable v, where (v, e_v) - is in cuts, has the non-empty value in e_v. *) -let rec translate_and_cut (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindlib.box * cuts - = + is in hoists, has the non-empty value in e_v. *) +let rec translate_and_hoist (ctx : ctx) (e : D.expr Pos.marked) : + A.expr Pos.marked Bindlib.box * hoists = let pos = Pos.get_position e in match Pos.unmark e with - (* empty-producing/using terms. We cut those. (D.EVar in some cases, EApp(D.EVar _, [ELit LUnit]), + (* empty-producing/using terms. We hoist those. (D.EVar in some cases, EApp(D.EVar _, [ELit LUnit]), EDefault _, ELit LEmptyDefault) I'm unsure about assert. *) | D.EVar v -> (* todo: for now, every unpure (such that [is_pure] is [false] in the current context) is @@ -178,9 +193,9 @@ let rec translate_and_cut (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marke (* pure terms *) | D.ELit l -> (Bindlib.box (A.ELit (translate_lit l pos), pos), A.VarMap.empty) | D.EIfThenElse (e1, e2, e3) -> - let e1', c1 = translate_and_cut ctx e1 in - let e2', c2 = translate_and_cut ctx e2 in - let e3', c3 = translate_and_cut ctx e3 in + let e1', h1 = translate_and_hoist ctx e1 in + let e2', h2 = translate_and_hoist ctx e2 in + let e3', h3 = translate_and_hoist ctx e3 in let e' = Bindlib.box_apply3 (fun e1' e2' e3' -> (A.EIfThenElse (e1', e2', e3'), pos)) e1' e2' e3' @@ -188,11 +203,11 @@ let rec translate_and_cut (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marke (*(* equivalent code : *) let e' = let+ e1' = e1' and+ e2' = e2' and+ e3' = e3' in (A.EIfThenElse (e1', e2', e3'), pos) in *) - (e', disjoint_union_maps pos [ c1; c2; c3 ]) + (e', disjoint_union_maps pos [ h1; h2; h3 ]) | D.EAssert e1 -> (* same behavior as in the ICFP paper: if e1 is empty, then no error is raised. *) - let e1', c1 = translate_and_cut ctx e1 in - (Bindlib.box_apply (fun e1' -> (A.EAssert e1', pos)) e1', c1) + let e1', h1 = translate_and_hoist ctx e1 in + (Bindlib.box_apply (fun e1' -> (A.EAssert e1', pos)) e1', h1) | D.EAbs ((binder, pos_binder), ts) -> let vars, body = Bindlib.unmbind binder in let ctx, lc_vars = @@ -210,78 +225,77 @@ let rec translate_and_cut (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marke (* here we take the guess that if we cannot build the closure because one of the variable is empty, then we cannot build the function. *) - let new_body, cuts = translate_and_cut ctx body in + let new_body, hoists = translate_and_hoist ctx body in let new_binder = Bindlib.bind_mvar lc_vars new_body in ( Bindlib.box_apply (fun new_binder -> (A.EAbs ((new_binder, pos_binder), List.map translate_typ ts), pos)) new_binder, - cuts ) + hoists ) | EApp (e1, args) -> - (* general case is simple *) - let e1', c1 = translate_and_cut ctx e1 in - let args', c_args = args |> List.map (translate_and_cut ctx) |> List.split in + let e1', h1 = translate_and_hoist ctx e1 in + let args', h_args = args |> List.map (translate_and_hoist ctx) |> List.split in - let cuts = disjoint_union_maps pos (c1 :: c_args) in + let hoists = disjoint_union_maps pos (h1 :: h_args) in let e' = Bindlib.box_apply2 (fun e1' args' -> (A.EApp (e1', args'), pos)) e1' (Bindlib.box_list args') in - (e', cuts) + (e', hoists) | ETuple (args, s) -> - let args', c_args = args |> List.map (translate_and_cut ctx) |> List.split in + let args', h_args = args |> List.map (translate_and_hoist ctx) |> List.split in - let cuts = disjoint_union_maps pos c_args in - (Bindlib.box_apply (fun args' -> (A.ETuple (args', s), pos)) (Bindlib.box_list args'), cuts) + let hoists = disjoint_union_maps pos h_args in + (Bindlib.box_apply (fun args' -> (A.ETuple (args', s), pos)) (Bindlib.box_list args'), hoists) | ETupleAccess (e1, i, s, ts) -> - let e1', cuts = translate_and_cut ctx e1 in + let e1', hoists = translate_and_hoist ctx e1 in let e1' = Bindlib.box_apply (fun e1' -> (A.ETupleAccess (e1', i, s, ts), pos)) e1' in - (e1', cuts) + (e1', hoists) | EInj (e1, i, en, ts) -> - let e1', cuts = translate_and_cut ctx e1 in + let e1', hoists = translate_and_hoist ctx e1 in let e1' = Bindlib.box_apply (fun e1' -> (A.EInj (e1', i, en, ts), pos)) e1' in - (e1', cuts) + (e1', hoists) | EMatch (e1, cases, en) -> - let e1', c1 = translate_and_cut ctx e1 in - let cases', c_cases = cases |> List.map (translate_and_cut ctx) |> List.split in + let e1', h1 = translate_and_hoist ctx e1 in + let cases', h_cases = cases |> List.map (translate_and_hoist ctx) |> List.split in - let cuts = disjoint_union_maps pos (c1 :: c_cases) in + let hoists = disjoint_union_maps pos (h1 :: h_cases) in let e' = Bindlib.box_apply2 (fun e1' cases' -> (A.EMatch (e1', cases', en), pos)) e1' (Bindlib.box_list cases') in - (e', cuts) + (e', hoists) | EArray es -> - let es', cuts = es |> List.map (translate_and_cut ctx) |> List.split in + let es', hoists = es |> List.map (translate_and_hoist ctx) |> List.split in ( Bindlib.box_apply (fun es' -> (A.EArray es', pos)) (Bindlib.box_list es'), - disjoint_union_maps pos cuts ) + disjoint_union_maps pos hoists ) | EOp op -> (Bindlib.box (A.EOp op, pos), A.VarMap.empty) and translate_expr ?(append_esome = true) (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindlib.box = - let e', cs = translate_and_cut ctx e in - let cs = A.VarMap.bindings cs in + let e', hoists = translate_and_hoist ctx e in + let hoists = A.VarMap.bindings hoists in let _pos = Pos.get_position e in - (* build the cuts *) + (* build the hoists *) Cli.debug_print - @@ Format.asprintf "cut for the expression: [%a]" + @@ Format.asprintf "hoist for the expression: [%a]" (Format.pp_print_list Print.format_var) - (List.map fst cs); + (List.map fst hoists); - ListLabels.fold_left cs + ListLabels.fold_left hoists ~init:(if append_esome then A.make_some e' else e') - ~f:(fun acc (v, (c, pos_c)) -> - Cli.debug_print @@ Format.asprintf "cut using A.%a" Print.format_var v; + ~f:(fun acc (v, (hoist, pos_hoist)) -> + Cli.debug_print @@ Format.asprintf "hoist using A.%a" Print.format_var v; let c' : A.expr Pos.marked Bindlib.box = - match c with - (* Here we have to handle only the cases appearing in cuts, as defined the - [translate_and_cut] function. *) + match hoist with + (* Here we have to handle only the cases appearing in hoists, as defined the + [translate_and_hoist] function. *) | D.EVar v -> (find ~info:"should never happend" (Pos.unmark v) ctx).expr | D.EDefault (excep, just, cons) -> let excep' = List.map (translate_expr ctx) excep in @@ -289,36 +303,40 @@ and translate_expr ?(append_esome = true) (ctx : ctx) (e : D.expr Pos.marked) : let cons' = translate_expr ctx cons in (* calls handle_option. *) A.make_app - (A.make_var (A.handle_default_opt, pos_c)) + (A.make_var (A.handle_default_opt, pos_hoist)) [ - Bindlib.box_apply (fun excep' -> (A.EArray excep', pos_c)) (Bindlib.box_list excep'); + Bindlib.box_apply + (fun excep' -> (A.EArray excep', pos_hoist)) + (Bindlib.box_list excep'); just'; cons'; ] - pos_c - | D.ELit D.LEmptyError -> A.make_none pos_c + pos_hoist + | D.ELit D.LEmptyError -> A.make_none pos_hoist | D.EAssert arg -> let arg' = translate_expr ctx arg in (* [ match arg with | None -> raise NoValueProvided | Some v -> assert {{ v }} ] *) - let silent_var = A.Var.make ("_", pos_c) in - let x = A.Var.make ("assertion_argument", pos_c) in + let silent_var = A.Var.make ("_", pos_hoist) in + let x = A.Var.make ("assertion_argument", pos_hoist) in A.make_matchopt_with_abs_arms arg' (A.make_abs [| silent_var |] - (Bindlib.box (A.ERaise A.NoValueProvided, pos_c)) - pos_c [ (D.TAny, pos_c) ] pos_c) + (Bindlib.box (A.ERaise A.NoValueProvided, pos_hoist)) + pos_hoist [ (D.TAny, pos_hoist) ] pos_hoist) (A.make_abs [| x |] - (Bindlib.box_apply (fun arg -> (A.EAssert arg, pos_c)) (A.make_var (x, pos_c))) - pos_c [ (D.TAny, pos_c) ] pos_c) + (Bindlib.box_apply + (fun arg -> (A.EAssert arg, pos_hoist)) + (A.make_var (x, pos_hoist))) + pos_hoist [ (D.TAny, pos_hoist) ] pos_hoist) | _ -> Errors.raise_spanned_error - "Internal Error: An term was found in a position where it should not be" pos_c + "Internal Error: An term was found in a position where it should not be" pos_hoist in (* [ match {{ c' }} with | None -> None | Some {{ v }} -> {{ acc }} end ] *) Cli.debug_print @@ Format.asprintf "build matchopt using %a" Print.format_var v; - A.make_matchopt pos_c v (D.TAny, pos_c) c' (A.make_none pos_c) acc) + A.make_matchopt pos_hoist v (D.TAny, pos_hoist) c' (A.make_none pos_hoist) acc) let rec translate_scope_let (ctx : ctx) (lets : scope_lets) = match lets with diff --git a/compiler/lcalc/compile_without_exceptions.mli b/compiler/lcalc/compile_without_exceptions.mli index 61c6b7250..c11259473 100644 --- a/compiler/lcalc/compile_without_exceptions.mli +++ b/compiler/lcalc/compile_without_exceptions.mli @@ -1,5 +1,5 @@ (* This file is part of the Catala compiler, a specification language for tax and social benefits - computation rules. Copyright (C) 2020 Inria, contributor: Alain Delaët-Tixeuil + computation rules. Copyright (C) 2020-2022 Inria, contributor: Alain Delaët-Tixeuil Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except From 9a718c6ced4cf47a612db074d5ebe80414306944 Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Mon, 14 Feb 2022 12:07:35 +0100 Subject: [PATCH 087/102] Format comments --- compiler/dcalc/binded_representation.mli | 6 ++++-- compiler/dcalc/print.ml | 4 ++-- compiler/lcalc/compile_without_exceptions.ml | 4 ++-- compiler/scopelang/scope_to_dcalc.ml | 3 ++- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/compiler/dcalc/binded_representation.mli b/compiler/dcalc/binded_representation.mli index 86929cb8b..ff144d7fb 100644 --- a/compiler/dcalc/binded_representation.mli +++ b/compiler/dcalc/binded_representation.mli @@ -40,7 +40,8 @@ type scope_body = { scope_body_result : (D.expr, scope_lets) Bindlib.binder; } -(* finally, we do the same transformation for the whole program for the kinded lets. This permit us to use bindlib variables for scopes names. *) +(* finally, we do the same transformation for the whole program for the kinded lets. This permit us + to use bindlib variables for scopes names. *) type scopes = | Nil | ScopeDef of { @@ -58,5 +59,6 @@ val free_vars_scope_body : scope_body -> D.Var.t list (* List of variables not binded inside scopes*) val free_vars_scopes : scopes -> D.Var.t list -(* Transform a list of scopes into our representation of scopes. It requires that scopes are topologically-well-ordered, and ensure there is no free variables in the returned [scopes] *) +(* Transform a list of scopes into our representation of scopes. It requires that scopes are + topologically-well-ordered, and ensure there is no free variables in the returned [scopes] *) val bind_scopes : (D.ScopeName.t * D.expr Bindlib.var * D.scope_body) list -> scopes Bindlib.box diff --git a/compiler/dcalc/print.ml b/compiler/dcalc/print.ml index d5cfa35eb..b3fe690f2 100644 --- a/compiler/dcalc/print.ml +++ b/compiler/dcalc/print.ml @@ -272,8 +272,8 @@ let rec format_expr ?(debug : bool = false) (ctx : Ast.decl_ctx) (fmt : Format.f (Format.pp_print_list ~pp_sep:(fun fmt () -> Format.fprintf fmt "%a@ " format_punctuation ",") format_expr) - exceptions format_punctuation "|" format_expr just format_punctuation "⊢" format_expr - cons format_punctuation "⟩" + exceptions format_punctuation "|" format_expr just format_punctuation "⊢" format_expr cons + format_punctuation "⟩" | ErrorOnEmpty e' -> Format.fprintf fmt "error_empty@ %a" format_with_parens e' | EAssert e' -> Format.fprintf fmt "@[%a@ %a%a%a@]" format_keyword "assert" format_punctuation "(" diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index dc0f172a7..5380d4a46 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -143,8 +143,8 @@ let rec translate_and_hoist (ctx : ctx) (e : D.expr Pos.marked) : A.expr Pos.marked Bindlib.box * hoists = let pos = Pos.get_position e in match Pos.unmark e with - (* empty-producing/using terms. We hoist those. (D.EVar in some cases, EApp(D.EVar _, [ELit LUnit]), - EDefault _, ELit LEmptyDefault) I'm unsure about assert. *) + (* empty-producing/using terms. We hoist those. (D.EVar in some cases, EApp(D.EVar _, [ELit + LUnit]), EDefault _, ELit LEmptyDefault) I'm unsure about assert. *) | D.EVar v -> (* todo: for now, every unpure (such that [is_pure] is [false] in the current context) is thunked, hence matched in the next case. This assumption can change in the future, and this diff --git a/compiler/scopelang/scope_to_dcalc.ml b/compiler/scopelang/scope_to_dcalc.ml index 1c8aebee9..459b8ca77 100644 --- a/compiler/scopelang/scope_to_dcalc.ml +++ b/compiler/scopelang/scope_to_dcalc.ml @@ -491,7 +491,8 @@ let translate_rule (ctx : ctx) (rule : Ast.rule) (Dcalc.Ast.Var.make ("_", Pos.get_position e), Pos.get_position e); Dcalc.Ast.scope_let_typ = (Dcalc.Ast.TLit TUnit, Pos.get_position e); Dcalc.Ast.scope_let_expr = - (* To ensure that we throw an error if the value is not defined, we add an check "ErrorOnEmpty" here. *) + (* To ensure that we throw an error if the value is not defined, we add an check + "ErrorOnEmpty" here. *) Bindlib.box_apply (fun new_e -> Pos.same_pos_as From 33228692b3808db077e32f10d0d28b0f0e68e3f1 Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Mon, 14 Feb 2022 14:23:16 +0100 Subject: [PATCH 088/102] Correct assets --- french_law/js/french_law.js | 4171 ++++++----- .../law_source/allocations_familiales.ml | 6587 +++++++++-------- .../python/src/allocations_familiales.py | 5211 +++++++------ 3 files changed, 8545 insertions(+), 7424 deletions(-) diff --git a/french_law/js/french_law.js b/french_law/js/french_law.js index 2f0b55a06..92bb2aaef 100644 --- a/french_law/js/french_law.js +++ b/french_law/js/french_law.js @@ -4,27 +4,27 @@ globalThis!=="object"&&(this?b():(a.defineProperty(a.prototype,"_T_",{configurab b(){var b=this||self;b.globalThis=b;delete a.prototype._T_}}(Object));(function(u){"use strict";var -GC=u,GF=typeof -module==="object"&&module.exports||u,jp=214,jo=" is too large for shifting.",lb="Invalid_argument",jn="0.08",ep="Map.bal",jm="@[",kq=640,B="Code de la s\xc3\xa9curit\xc3\xa9 sociale",l3="Article L521-1",eI=123,la="577500",kp=152,k$="%ni",l2=43200.,gk="ml_z_overflow",l1="EMFILE",W=86400.,aE=2020,ko=139,aU=0xff,k_="ENOMEM",gt=-12,k9=-45,eH="Titre 5 : Dispositions particuli\xc3\xa8res \xc3\xa0 la Guadeloupe, \xc3\xa0 la Guyane, \xc3\xa0 la Martinique, \xc3\xa0 La R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy et \xc3\xa0 Saint-Martin",l0="559500",b0="Article 1",dA=122,jl="582700",lZ=992015837,k8="EPROTONOSUPPORT",k="0",k7="ENETRESET",lY="EACCES",k6="EINVAL",kn="0.5",k5="EDOM",bH=128,jk="Sys_blocked_io",km="fd ",k4="EFBIG",jj=548,gj="Chapitre 2 : Champ d'application",ji="0.0588",K=248,jh="EXDEV",eU=">",bm=153,lX=1027,lW="EINPROGRESS",k3="562800",bZ="Chapitre 5 : Prestations familiales et prestations assimil\xc3\xa9es",jg=246,k2=555,je=598,jf="%u",k1="resetLog",cJ=2011,e="AllocationsFamiliales",k0=3268,jd="EHOSTUNREACH",kl=633,jc="./securite_sociale_R.catala_fr",H="Livre 5 : Prestations familiales et prestations assimil\xc3\xa9es",eG=108,ax="2",bB=127,ds=1024,jb="@{",eF=-2147483648,U="1",eN=133,eT="e",gi="Montant de la base mensuelle des allocations familiales",ja=" : flags Open_rdonly and Open_wronly are not compatible",i$="D\xc3\xa9cret n\xc2\xb0 2019-1387 du 18 d\xc3\xa9cembre 2019 portant rel\xc3\xa8vement du salaire minimum de croissance",aA="-",lV=505,bV=803994948,kk="EAGAIN",gs=": Not a directory",i9=216,i_=" : file already exists",lU="smic",kZ=184,bF=0xffffff,cD=2012,kj="EDESTADDRREQ",kY="EISCONN",lR=-43,lS=612,ao="./securite_sociale_D.catala_fr",lT="EROFS",eE=86400,ki="Out_of_memory",lQ="inf",gr="index out of bounds",lP="EPIPE",i8="ENOEXEC",eD="_bigarr02",lO="Circulaire interminist\xc3\xa9rielle N\xc2\xb0 DSS/SD2B/2017/352 du 22 d\xc3\xa9cembre 2017 relative \xc3\xa0 la revalorisation au 1er janvier 2018 des plafonds de ressources d\xe2\x80\x99attribution de certaines prestations familiales servies en m\xc3\xa9tropole, en Guadeloupe, en Guyane, en Martinique, \xc3\xa0 la R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy, \xc3\xa0 Saint-Martin et \xc3\xa0 Mayotte",kh=0xffffffff,dz=111,gy=2147483647,kX=208,lN=180,i7="Martinique",kW=", characters ",i6="EPFNOSUPPORT",bh=0xffff,kg="EBUSY",eC=417088404,kf="ENETUNREACH",lM="ENOLCK",i4="ENOTTY",i5=12520,ke=400,kV="ESHUTDOWN",lL=619,i2=-46,i3="ENXIO",aK=3600,eB=143,L="Chapitre 1er : Allocations familiales",gx="AllocationFamilialesAvril2008",lK="ERANGE",cx=2016,kU="retrieveLog",bg="\xc3\xa2ge_minimum_alin\xc3\xa9a_1_l521_3",lJ="infinity",a0=1000,kd=142,q="",i1="^",bU=3600.,i0=86400000,kc=264,ah="Partie l\xc3\xa9gislative",cw=0x3f,dp=124,dg="./epilogue.catala_fr",gq="Article L512-3",v="./decrets_divers.catala_fr",N="Titre 2 : Prestations g\xc3\xa9n\xc3\xa9rales d'entretien",dy=112,iZ="Match_failure",kT=140,bW="Montant des plafonds de ressources",M="Annexe",kb=135,be=2021,ka="enfant_le_plus_\xc3\xa2g\xc3\xa9",eA=252,j$="EPROTOTYPE",bf=".",df="montant_initial_majoration",bA="+",j_="EINTR",iY="ESRCH",j9=0xf0,a1="12.",j8="Guadeloupe",lI="ESOCKTNOSUPPORT",gI=110,an="PrestationsFamiliales",gp=116,iX="%li",j6=576,j7="EALREADY",cF=2015,ez=365,bE="prise_en_compte",gh="Smic",gH=-32,bl=1023,j4=-1080,j5="EAFNOSUPPORT",ai="./securite_sociale_L.catala_fr",o="./prologue.catala_fr",eo=2299161,j3=969837588,gw="nan",lH=605,j2="ENFILE",iW=0xe0,j1=-1023,lG=117,kR="ECHILD",kS=0xdfff,dx="compl\xc3\xa9ment_d\xc3\xa9gressif",go="Article L755-12",kQ="ETOOMANYREFS",bj="/",lF="Assert_failure",en=2400000.5,iV="ENAMETOOLONG",lE="568400",j0=541,eM="ENOTDIR",lD="0.32",gv=1073741823,kP="ETIMEDOUT",iU="EMSGSIZE",em=250,dn=1582,kO=513,lC="ENOTCONN",iS=115,iT="ECONNREFUSED",kN="src/time_Zone.ml",lB=1e14,jZ="Arr\xc3\xaat\xc3\xa9 du 14 d\xc3\xa9cembre 2020 relatif au montant des plafonds de ressources de certaines prestations familiales et aux tranches du bar\xc3\xa8me applicable au recouvrement des indus et \xc3\xa0 la saisie des prestations",ey='"',kL="Guyane",kM="EWOULDBLOCK",iR="allocations_familiales",gg=1255,gn="<",lA="Fatal error: exception %s\n",jX=196,jY=0x800,cE=255,jW="EPERM",aJ=2019,gf="jsError",bd=0x8000,kK="Partie r\xc3\xa9glementaire - D\xc3\xa9crets en Conseil d'Etat",V="droit_ouvert_majoration",dw=146097,cI=256,jV=0.012,lz="Article L521-3",kJ="End_of_file",jU="M\xc3\xa9tropole",ex=156,gu="Failure",ly="ENOSPC",iQ=129,iP="\n",jT=204,dm="conditions_hors_\xc3\xa2ge",kI=218,eS="ENOENT",jS=534,J="Dispositions sp\xc3\xa9ciales relatives \xc3\xa0 Mayotte",jR=562,jQ="([^/]+)",lx=315,kH="ENETDOWN",gG="EnfantLePlus\xc3\x82g\xc3\xa9",gm=0xf,lw="EOVERFLOW",el=-48,kG=0xdc00,dl="montant_initial_m\xc3\xa9tropole_majoration",gF="ENOTEMPTY",iO="EBADF",al="camlinternalFormat.ml",jP="Division_by_zero",gl=520,iN="EMLINK",kF="Sys_error",lu=647,lv="x",lt=335,cv=2017,dr="Article D521-2",eR="Article D755-5",ge="Titre 1 : Champ d'application - G\xc3\xa9n\xc3\xa9ralit\xc3\xa9s",bD=60.,gd="EEXIST",cC=2014,gE="%d",kE="Printexc.handle_uncaught_exception",iM=32082,bY=1900,ek=121,jO="EADDRNOTAVAIL",lr="buffer.ml",ls="Cygwin",jN=119,dk="montant_avec_garde_altern\xc3\xa9e_majoration",jM="version_avril_2008",bT=120,ew=127686388,ca=103,lq="ENOBUFS",gc="16",cA=2013,cB=102,gb=512,lp=527,cH=113,iL=0x7ff0,t="D\xc3\xa9crets divers",ev=101,eL=132,iK="0x",iJ="D\xc3\xa9cret n\xc2\xb0 2020-1598 du 16 d\xc3\xa9cembre 2020 portant rel\xc3\xa8vement du salaire minimum de croissance",b$=1e7,n="Prologue",dj=254,aR=100,jK="ECONNABORTED",jL="EFAULT",kC="Article 7",kD="ENODEV",jJ=" : flags Open_text and Open_binary are not compatible",kB="%Li",jH="EIO",jI="EDEADLK",eQ="3",am="Partie r\xc3\xa9glementaire - D\xc3\xa9crets simples",iI=105,ln="169.",lo=230,iH="Instruction interminist\xc3\xa9rielle n\xc2\xb0 DSS/SD2B/2018/279 du 17 d\xc3\xa9cembre 2018 relative \xc3\xa0 la revalorisation au 1er janvier 2019 des plafonds de ressources d\xe2\x80\x99attribution de certaines prestations familiales servies en m\xc3\xa9tropole, en Guadeloupe, en Guyane, en Martinique, \xc3\xa0 la R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy, \xc3\xa0 Saint-Martin et \xc3\xa0 Mayotte",kA=591,bX=0.5,jG=584,a6="Article D521-1",jF="Instruction interministerielle no DSS/SD2B/2019/261 du 18 d\xc3\xa9cembre 2019 relative \xc3\xa0 la revalorisation au 1er janvier 2020 des plafonds de ressources d\xe2\x80\x99attribution de certaines prestations familiales servies en m\xc3\xa9tropole, en Guadeloupe, en Guyane, en Martinique, \xc3\xa0 La R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy, \xc3\xa0 Saint-Martin et \xc3\xa0 Mayotte",jE=188,bG="Livre 7 : R\xc3\xa9gimes divers - Dispositions diverses",aw="input",iG="str.ml",jD=160,lm="prestations_familiales",dv="est_enfant_le_plus_\xc3\xa2g\xc3\xa9",jC="0.0463",iF="D\xc3\xa9cret n\xc2\xb0 2018-1173 du 19 d\xc3\xa9cembre 2018 portant rel\xc3\xa8vement du salaire minimum de croissance",eK="_z",ll="computeAllocationsFamiliales",du="Unix.Unix_error",jA="0.55",jB="EHOSTDOWN",di="droit_ouvert",eu=109,ga="mkdir",jz="ENOTSOCK",kz=136,lk="Stack_overflow",ej=": No such file or directory",et="Interface du programme",lj="/static/",de="Titre 5 : D\xc3\xa9partements d'outre-mer",jy=-97,li=253,lh="Not_found",dh=1461,a5="InterfaceAllocationsFamiliales",f$=151,I="D\xc3\xa9cret n\xc2\xb02002-423 du 29 mars 2002 relatif aux prestations familiales \xc3\xa0 Mayotte",cz="1.",ky=32044,eJ=", ",iD=626,iE="win32",bi=2018,lg="Mayotte",jx="EOPNOTSUPP",iC="ENOPROTOOPT",gD=243,jw=2440588,gC="rmdir",kx="src/date.ml",lf=32752,jv="ECONNRESET",le="ELOOP",es=141,ju="ESPIPE",dd="\xc3\x89pilogue",kw="EADDRINUSE",ld=1026,bk="Article L521-2",kv="ENOSYS",eP="Invalid integer: ",er=2440587.5,jt="E2BIG",ku=359,iA="Pervasives.do_at_exit",iB="utf8",eq=155,kt=258,bC=" ",gB="Fatal error: exception ",a2=0x80,ks="Undefined_recursive_module",ay="output",js=569,jr=215,eO="src/calendar_builder.ml",iz="EISDIR",lc="_",cy="Montant du salaire minimum de croissance",gA="compare: functional value",f_="0.16",dq="droit_ouvert_forfaitaire",dt="0.",ei=134,kr="%i",gz=114,cG=529348384,jq=426;function -FH(d,b,e,c,f){if(c<=b)for(var +GB=u,GE=typeof +module==="object"&&module.exports||u,jo=214,jn=" is too large for shifting.",k$="Invalid_argument",jm="0.08",er="Map.bal",jl="@[",ko=640,B="Code de la s\xc3\xa9curit\xc3\xa9 sociale",l0="Article L521-1",eK=123,k_="577500",kn=152,k9="%ni",lZ=43200.,gk="ml_z_overflow",lY="EMFILE",W=86400.,aE=2020,km=139,aU=0xff,k8="ENOMEM",gu=-12,k7=-45,eJ="Titre 5 : Dispositions particuli\xc3\xa8res \xc3\xa0 la Guadeloupe, \xc3\xa0 la Guyane, \xc3\xa0 la Martinique, \xc3\xa0 La R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy et \xc3\xa0 Saint-Martin",lX="559500",b0="Article 1",dB=122,jk="582700",lW=992015837,k6="EPROTONOSUPPORT",k="0",k5="ENETRESET",lV="EACCES",k4="EINVAL",kl="0.5",k3="EDOM",bH=128,jj="Sys_blocked_io",kk="fd ",k2="EFBIG",ji=548,gj="Chapitre 2 : Champ d'application",jh="0.0588",I=248,jg="EXDEV",eW=">",bm=153,lU=1027,lT="EINPROGRESS",k1="562800",bZ="Chapitre 5 : Prestations familiales et prestations assimil\xc3\xa9es",jf=246,k0=555,jd=598,je="%u",kZ="resetLog",cJ=2011,f="AllocationsFamiliales",kY=3268,jc="EHOSTUNREACH",kj=633,jb="./securite_sociale_R.catala_fr",H="Livre 5 : Prestations familiales et prestations assimil\xc3\xa9es",eI=108,ax="2",bB=127,dt=1024,ja="@{",eH=-2147483648,U="1",eP=133,eV="e",gi="Montant de la base mensuelle des allocations familiales",i$=" : flags Open_rdonly and Open_wronly are not compatible",i_="D\xc3\xa9cret n\xc2\xb0 2019-1387 du 18 d\xc3\xa9cembre 2019 portant rel\xc3\xa8vement du salaire minimum de croissance",az="-",lS=505,bV=803994948,ki="EAGAIN",gt=": Not a directory",i8=216,i9=" : file already exists",lR="smic",kX=184,bF=0xffffff,cD=2012,kh="EDESTADDRREQ",kW="EISCONN",lO=-43,lP=612,ao="./securite_sociale_D.catala_fr",lQ="EROFS",eG=86400,kg="Out_of_memory",lN="inf",gs="index out of bounds",lM="EPIPE",i7="ENOEXEC",eF="_bigarr02",lL="Circulaire interminist\xc3\xa9rielle N\xc2\xb0 DSS/SD2B/2017/352 du 22 d\xc3\xa9cembre 2017 relative \xc3\xa0 la revalorisation au 1er janvier 2018 des plafonds de ressources d\xe2\x80\x99attribution de certaines prestations familiales servies en m\xc3\xa9tropole, en Guadeloupe, en Guyane, en Martinique, \xc3\xa0 la R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy, \xc3\xa0 Saint-Martin et \xc3\xa0 Mayotte",kf=0xffffffff,dA=111,gz=2147483647,kV=208,lK=180,i6="Martinique",kU=", characters ",i5="EPFNOSUPPORT",bh=0xffff,ke="EBUSY",eE=417088404,kd="ENETUNREACH",lJ="ENOLCK",i3="ENOTTY",i4=12520,gr=400,kT="ESHUTDOWN",lI=619,i1=-46,i2="ENXIO",aK=3600,eD=143,L="Chapitre 1er : Allocations familiales",gy="AllocationFamilialesAvril2008",lH="ERANGE",cx=2016,kS="retrieveLog",bg="\xc3\xa2ge_minimum_alin\xc3\xa9a_1_l521_3",lG="infinity",a0=1000,kc=142,p="",i0="^",bU=3600.,iZ=86400000,kb=264,ag="Partie l\xc3\xa9gislative",cw=0x3f,dq=124,dh="./epilogue.catala_fr",gq="Article L512-3",v="./decrets_divers.catala_fr",N="Titre 2 : Prestations g\xc3\xa9n\xc3\xa9rales d'entretien",dz=112,iY="Match_failure",kR=140,bW="Montant des plafonds de ressources",M="Annexe",ka=135,be=2021,j$="enfant_le_plus_\xc3\xa2g\xc3\xa9",eC=252,j_="EPROTOTYPE",bf=".",dg="montant_initial_majoration",bA="+",j9="EINTR",iX="ESRCH",j8=0xf0,a1="12.",j7="Guadeloupe",lF="ESOCKTNOSUPPORT",gJ=110,an="PrestationsFamiliales",gp=116,iW="%li",j5=576,j6="EALREADY",cF=2015,eB=365,bE="prise_en_compte",gh="Smic",gI=-32,bl=1023,j3=-1080,j4="EAFNOSUPPORT",ah="./securite_sociale_L.catala_fr",o="./prologue.catala_fr",eq=2299161,j2=969837588,gx="nan",lE=605,j1="ENFILE",iV=0xe0,j0=-1023,lD=117,kP="ECHILD",kQ=0xdfff,dy="compl\xc3\xa9ment_d\xc3\xa9gressif",go="Article L755-12",kO="ETOOMANYREFS",bj="/",lC="Assert_failure",ep=2400000.5,iU="ENAMETOOLONG",lB="568400",jZ=541,eO="ENOTDIR",lA="0.32",gw=1073741823,kN="ETIMEDOUT",iT="EMSGSIZE",eo=250,dp=1582,kM=513,lz="ENOTCONN",iR=115,iS="ECONNREFUSED",kL="src/time_Zone.ml",ly=1e14,jY="Arr\xc3\xaat\xc3\xa9 du 14 d\xc3\xa9cembre 2020 relatif au montant des plafonds de ressources de certaines prestations familiales et aux tranches du bar\xc3\xa8me applicable au recouvrement des indus et \xc3\xa0 la saisie des prestations",eA='"',kJ="Guyane",kK="EWOULDBLOCK",iQ="allocations_familiales",gg=1255,gn="<",lx="Fatal error: exception %s\n",jW=196,jX=0x800,cE=255,jV="EPERM",aJ=2019,gf="jsError",bd=0x8000,kI="Partie r\xc3\xa9glementaire - D\xc3\xa9crets en Conseil d'Etat",V="droit_ouvert_majoration",dx=146097,cI=256,jU=0.012,lw="Article L521-3",kH="End_of_file",jT="M\xc3\xa9tropole",ez=156,gv="Failure",lv="ENOSPC",iP=129,iO="\n",jS=204,dn="conditions_hors_\xc3\xa2ge",kG=218,eU="ENOENT",jR=534,K="Dispositions sp\xc3\xa9ciales relatives \xc3\xa0 Mayotte",jQ=562,jP="([^/]+)",lu=315,kF="ENETDOWN",gH="EnfantLePlus\xc3\x82g\xc3\xa9",gm=0xf,lt="EOVERFLOW",en=-48,kE=0xdc00,dm="montant_initial_m\xc3\xa9tropole_majoration",gG="ENOTEMPTY",iN="EBADF",al="camlinternalFormat.ml",jO="Division_by_zero",gl=520,iM="EMLINK",kD="Sys_error",lr=647,ls="x",lq=335,cv=2017,ds="Article D521-2",eT="Article D755-5",ge="Titre 1 : Champ d'application - G\xc3\xa9n\xc3\xa9ralit\xc3\xa9s",bD=60.,gd="EEXIST",cC=2014,gF="%d",kC="Printexc.handle_uncaught_exception",iL=32082,bY=1900,em=121,jN="EADDRNOTAVAIL",lp="buffer.ml",jM=119,dl="montant_avec_garde_altern\xc3\xa9e_majoration",jL="version_avril_2008",bT=120,ey=127686388,ca=103,lo="ENOBUFS",gc="16",cA=2013,cB=102,gb=512,ln=527,cH=113,iK=0x7ff0,t="D\xc3\xa9crets divers",ex=101,eN=132,iJ="0x",iI="D\xc3\xa9cret n\xc2\xb0 2020-1598 du 16 d\xc3\xa9cembre 2020 portant rel\xc3\xa8vement du salaire minimum de croissance",b$=1e7,n="Prologue",dk=254,aR=100,jJ="ECONNABORTED",jK="EFAULT",kA="Article 7",kB="ENODEV",jI=" : flags Open_text and Open_binary are not compatible",kz="%Li",jG="EIO",jH="EDEADLK",eS="3",am="Partie r\xc3\xa9glementaire - D\xc3\xa9crets simples",iH=105,ll="169.",lm=230,iG="Instruction interminist\xc3\xa9rielle n\xc2\xb0 DSS/SD2B/2018/279 du 17 d\xc3\xa9cembre 2018 relative \xc3\xa0 la revalorisation au 1er janvier 2019 des plafonds de ressources d\xe2\x80\x99attribution de certaines prestations familiales servies en m\xc3\xa9tropole, en Guadeloupe, en Guyane, en Martinique, \xc3\xa0 la R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy, \xc3\xa0 Saint-Martin et \xc3\xa0 Mayotte",ky=591,bX=0.5,jF=584,a7="Article D521-1",jE="Instruction interministerielle no DSS/SD2B/2019/261 du 18 d\xc3\xa9cembre 2019 relative \xc3\xa0 la revalorisation au 1er janvier 2020 des plafonds de ressources d\xe2\x80\x99attribution de certaines prestations familiales servies en m\xc3\xa9tropole, en Guadeloupe, en Guyane, en Martinique, \xc3\xa0 La R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy, \xc3\xa0 Saint-Martin et \xc3\xa0 Mayotte",jD=188,bG="Livre 7 : R\xc3\xa9gimes divers - Dispositions diverses",aw="input",iF="str.ml",jC=160,lk="prestations_familiales",dw="est_enfant_le_plus_\xc3\xa2g\xc3\xa9",jB="0.0463",iE="D\xc3\xa9cret n\xc2\xb0 2018-1173 du 19 d\xc3\xa9cembre 2018 portant rel\xc3\xa8vement du salaire minimum de croissance",eM="_z",lj="computeAllocationsFamiliales",dv="Unix.Unix_error",jz="0.55",jA="EHOSTDOWN",dj="droit_ouvert",ew=109,ga="mkdir",jy="ENOTSOCK",kx=136,li="Stack_overflow",el=": No such file or directory",ev="Interface du programme",lh="/static/",df="Titre 5 : D\xc3\xa9partements d'outre-mer",jx=-97,lg=253,lf="Not_found",di=1461,a6="InterfaceAllocationsFamiliales",f$=151,J="D\xc3\xa9cret n\xc2\xb02002-423 du 29 mars 2002 relatif aux prestations familiales \xc3\xa0 Mayotte",cz="1.",kw=32044,eL=", ",iD=626,bi=2018,le="Mayotte",jw="EOPNOTSUPP",iC="ENOPROTOOPT",gE=243,jv=2440588,gD="rmdir",kv="src/date.ml",ld=32752,ju="ECONNRESET",lc="ELOOP",eu=141,jt="ESPIPE",de="\xc3\x89pilogue",ku="EADDRINUSE",lb=1026,bk="Article L521-2",kt="ENOSYS",eR="Invalid integer: ",et=2440587.5,js="E2BIG",ks=359,iA="Pervasives.do_at_exit",iB="utf8",es=155,kr=258,bC=" ",gC="Fatal error: exception ",a2=0x80,kq="Undefined_recursive_module",ay="output",jr=569,jq=215,eQ="src/calendar_builder.ml",iz="EISDIR",la="_",cy="Montant du salaire minimum de croissance",gB="compare: functional value",f_="0.16",dr="droit_ouvert_forfaitaire",du="0.",ek=134,kp="%i",gA=114,cG=529348384,jp=426;function +FG(d,b,e,c,f){if(c<=b)for(var a=1;a<=f;a++)e[c+a]=d[b+a];else for(var a=f;a>=1;a--)e[c+a]=d[b+a];return 0}function -FK(e,f,d){var +FJ(e,f,d){var a=new Array(d+1);a[0]=0;for(var b=1,c=f+1;b<=d;b++,c++)a[b]=e[c];return a}function -e6(c,b,a){var +e8(c,b,a){var d=String.fromCharCode;if(b==0&&a<=4096&&a==c.length)return d.apply(null,c);var -e=q;for(;0=b.l||b.t==2&&c>=b.c.length)){b.c=d.t==4?e6(d.c,e,c):e==0&&d.c.length==c?d.c:d.c.substr(e,c);b.t=b.c.length==b.l?0:2}else -if(b.t==2&&f==b.c.length){b.c+=d.t==4?e6(d.c,e,c):e==0&&d.c.length==c?d.c:d.c.substr(e,c);b.t=b.c.length==b.l?0:2}else{if(b.t!=4)eV(b);var +b2(d,e,b,f,c){if(c==0)return 0;if(f==0&&(c>=b.l||b.t==2&&c>=b.c.length)){b.c=d.t==4?e8(d.c,e,c):e==0&&d.c.length==c?d.c:d.c.substr(e,c);b.t=b.c.length==b.l?0:2}else +if(b.t==2&&f==b.c.length){b.c+=d.t==4?e8(d.c,e,c):e==0&&d.c.length==c?d.c:d.c.substr(e,c);b.t=b.c.length==b.l?0:2}else{if(b.t!=4)eX(b);var g=d.c,h=b.c;if(d.t==4)if(f<=e)for(var a=0;a>=1;if(b==0)return d;a+=a;c++;if(c==9)a.slice(0,1)}}function +cP(b,a){if(b==0)return p;if(a.repeat)return a.repeat(b);var +d=p,c=0;for(;;){if(b&1)d+=a;b>>=1;if(b==0)return d;a+=a;c++;if(c==9)a.slice(0,1)}}function cb(a){if(a.t==2)a.c+=cP(a.l-a.c.length,"\0");else -a.c=e6(a.c,0,a.c.length);a.t=0}function -mb(a,b){if(a===b)return 1;a.t&6&&cb(a);b.t&6&&cb(b);return a.c==b.c?1:0}function +a.c=e8(a.c,0,a.c.length);a.t=0}function +l_(a,b){if(a===b)return 1;a.t&6&&cb(a);b.t&6&&cb(b);return a.c==b.c?1:0}function Gq(b,a){throw[0,b,a]}function -mv(a){if(a.length<24){for(var +mu(a){if(a.length<24){for(var b=0;bbB)return false;return true}else return!/[^\x00-\x7f]/.test(a)}function g4(e){for(var -j=q,c=q,g,f,h,a,b=0,i=e.length;bgb){c.substr(0,1);j+=c;c=q;j+=e.slice(b,d)}else -c+=e.slice(b,d);if(d==i)break;b=d}a=1;if(++b=0xd7ff&&a<0xe000)a=2}else{a=3;if(++b0x10ffff)a=3}}}}}if(a<4){b-=a;c+="\ufffd"}else -if(a>bh)c+=String.fromCharCode(0xd7c0+(a>>10),kG+(a&0x3FF));else -c+=String.fromCharCode(a);if(c.length>ds){c.substr(0,1);j+=c;c=q}}return j+c}function +j=p,c=p,g,f,h,a,b=0,i=e.length;bgb){c.substr(0,1);j+=c;c=p;j+=e.slice(b,d)}else +c+=e.slice(b,d);if(d==i)break;b=d}a=1;if(++b=0xd7ff&&a<0xe000)a=2}else{a=3;if(++b0x10ffff)a=3}}}}}if(a<4){b-=a;c+="\ufffd"}else +if(a>bh)c+=String.fromCharCode(0xd7c0+(a>>10),kE+(a&0x3FF));else +c+=String.fromCharCode(a);if(c.length>dt){c.substr(0,1);j+=c;c=p}}return j+c}function bn(c,a,b){this.t=c;this.c=a;this.l=b}bn.prototype.toString=function(){switch(this.t){case 9:return this.c;default:cb(this);case -0:if(mv(this.c)){this.t=9;return this.c}this.t=8;case +0:if(mu(this.c)){this.t=9;return this.c}this.t=8;case 8:return this.c}};bn.prototype.toUtf16=function(){var a=this.toString();if(this.t==9)return a;return g4(a)};bn.prototype.slice=function(){var a=this.t==4?this.c.slice():this.c;return new bn(this.t,a,this.l)};function -mc(a){return new +l$(a){return new bn(0,a,a.length)}function -a(a){return mc(a)}function +a(a){return l$(a)}function g0(c,b){Gq(c,a(b))}var X=[0];function -ac(a){g0(X.Invalid_argument,a)}function -l$(){ac(gr)}function -dC(a,b){switch(a.t&6){default:if(b>=a.c.length)return 0;case +ad(a){g0(X.Invalid_argument,a)}function +l8(){ad(gs)}function +dD(a,b){switch(a.t&6){default:if(b>=a.c.length)return 0;case 0:return a.c.charCodeAt(b);case 4:return a.c[b]}}function -b4(b,a){if(a>>>0>=b.l)l$();return dC(b,a)}function -aa(a,c,b){b&=aU;if(a.t!=4){if(c==a.c.length){a.c+=String.fromCharCode(b);if(c+1==a.l)a.t=0;return 0}eV(a)}a.c[c]=b;return 0}function -a3(b,a,c){if(a>>>0>=b.l)l$();return aa(b,a,c)}function -a7(c,a){if(c.fun)return a7(c.fun,a);if(typeof +b4(b,a){if(a>>>0>=b.l)l8();return dD(b,a)}function +aa(a,c,b){b&=aU;if(a.t!=4){if(c==a.c.length){a.c+=String.fromCharCode(b);if(c+1==a.l)a.t=0;return 0}eX(a)}a.c[c]=b;return 0}function +a3(b,a,c){if(a>>>0>=b.l)l8();return aa(b,a,c)}function +a8(c,a){if(c.fun)return a8(c.fun,a);if(typeof c!=="function")return c;var b=c.length|0;if(b===0)return c.apply(null,a);var e=a.length|0,d=b-e|0;if(d==0)return c.apply(null,a);else -if(d<0)return a7(c.apply(null,a.slice(0,b)),a.slice(b));else +if(d<0)return a8(c.apply(null,a.slice(0,b)),a.slice(b));else return function(){var e=arguments.length==0?1:arguments.length,d=new Array(a.length+e);for(var b=0;b>>0>=a.length-1)dB();return a}function -FP(a){if(isFinite(a)){if(Math.abs(a)>=2.2250738585072014e-308)return 0;if(a!=0)return 1;return 2}return isNaN(a)?4:3}function +b=0;b>>0>=a.length-1)dC();return a}function +FO(a){if(isFinite(a)){if(Math.abs(a)>=2.2250738585072014e-308)return 0;if(a!=0)return 1;return 2}return isNaN(a)?4:3}function bp(a){a.t&6&&cb(a);return a.c}var -GI=Math.log2&&Math.log2(1.1235582092889474E+307)==1020;function -GG(a){if(GI)return Math.floor(Math.log2(a));var +GH=Math.log2&&Math.log2(1.1235582092889474E+307)==1020;function +GF(a){if(GH)return Math.floor(Math.log2(a));var b=0;if(a==0)return-Infinity;if(a>=1)while(a>=2){a/=2;b++}else while(a<1){a*=2;b--}return b}function -gQ(c){var +gR(c){var a=new(u.Float32Array)(1);a[0]=c;var b=new(u.Int32Array)(a.buffer);return b[0]|0}var -ml=Math.pow(2,-24);function -e4(a){throw a}function -cO(){e4(X.Division_by_zero)}function +mi=Math.pow(2,-24);function +e6(a){throw a}function +cO(){e6(X.Division_by_zero)}function y(b,c,a){this.lo=b&bF;this.mi=c&bF;this.hi=a&bh}y.prototype.caml_custom="_j";y.prototype.copy=function(){return new y(this.lo,this.mi,this.hi)};y.prototype.ucompare=function(a){if(this.hi>a.hi)return 1;if(this.hia.mi)return 1;if(this.mia.lo)return 1;if(this.loc)return 1;if(ba.mi)return 1;if(this.mia.lo)return 1;if(this.lo>24),d=this.hi+a.hi+(c>>24);return new y(b,c,d)};y.prototype.sub=function(a){var b=this.lo-a.lo,c=this.mi-a.mi+(b>>24),d=this.hi-a.hi+(c>>24);return new y(b,c,d)};y.prototype.mul=function(a){var -b=this.lo*a.lo,c=(b*ml|0)+this.mi*a.lo+this.lo*a.mi,d=(c*ml|0)+this.hi*a.lo+this.mi*a.mi+this.lo*a.hi;return new +b=this.lo*a.lo,c=(b*mi|0)+this.mi*a.lo+this.lo*a.mi,d=(c*mi|0)+this.hi*a.lo+this.mi*a.mi+this.lo*a.hi;return new y(b,c,d)};y.prototype.isZero=function(){return(this.lo|this.mi|this.hi)==0};y.prototype.isNeg=function(){return this.hi<<16<0};y.prototype.and=function(a){return new y(this.lo&a.lo,this.mi&a.mi,this.hi&a.hi)};y.prototype.or=function(a){return new y(this.lo|a.lo,this.mi|a.mi,this.hi|a.hi)};y.prototype.xor=function(a){return new @@ -127,14 +127,14 @@ d=a.hi;if(a.hi&bd)a=a.neg();if(b.hi&bd)b=b.neg();var c=a.udivmod(b).modulus;if(d&bd)c=c.neg();return c};y.prototype.toInt=function(){return this.lo|this.mi<<24};y.prototype.toFloat=function(){return(this.hi<<16)*Math.pow(2,32)+this.mi*Math.pow(2,24)+this.lo};y.prototype.toArray=function(){return[this.hi>>8,this.hi&aU,this.mi>>16,this.mi>>8&aU,this.mi&aU,this.lo>>16,this.lo>>8&aU,this.lo&aU]};y.prototype.lo32=function(){return this.lo|(this.mi&aU)<<24};y.prototype.hi32=function(){return this.mi>>>8&bh|this.hi<<16};function b6(b,c,a){return new y(b,c,a)}function -eY(a){if(!isFinite(a)){if(isNaN(a))return b6(1,0,iL);return a>0?b6(0,0,iL):b6(0,0,0xfff0)}var +e0(a){if(!isFinite(a)){if(isNaN(a))return b6(1,0,iK);return a>0?b6(0,0,iK):b6(0,0,0xfff0)}var f=a==0&&1/a==-Infinity?bd:a>=0?0:bd;if(f)a=-a;var -b=GG(a)+bl;if(b<=0){b=0;a/=Math.pow(2,-ld)}else{a/=Math.pow(2,b-lX);if(a<16){a*=2;b-=1}if(b==0)a/=2}var +b=GF(a)+bl;if(b<=0){b=0;a/=Math.pow(2,-lb)}else{a/=Math.pow(2,b-lU);if(a<16){a*=2;b-=1}if(b==0)a/=2}var d=Math.pow(2,24),c=a|0;a=(a-c)*d;var e=a|0;a=(a-e)*d;var g=a|0;c=c&gm|f|b<<4;return b6(g,e,c)}function -dF(a){return a.toArray()}function -l_(c,b,g){c.write(32,b.dims.length);c.write(32,b.kind|b.layout<<8);if(b.caml_custom==eD)for(var +dG(a){return a.toArray()}function +l7(c,b,g){c.write(32,b.dims.length);c.write(32,b.kind|b.layout<<8);if(b.caml_custom==eF)for(var a=0;a>4;if(c==2047)return(f|g|b&gm)==0?b&bd?-Infinity:Infinity:NaN;var -e=Math.pow(2,-24),a=(f*e+g)*e+(b&gm);if(c>0){a+=16;a*=Math.pow(2,c-lX)}else -a*=Math.pow(2,-ld);if(b&bd)a=-a;return a}function -gJ(b){var +e=Math.pow(2,-24),a=(f*e+g)*e+(b&gm);if(c>0){a+=16;a*=Math.pow(2,c-lU)}else +a*=Math.pow(2,-lb);if(b&bd)a=-a;return a}function +gK(b){var d=b.length,c=1;for(var -a=0;a>>24&aU|(a&bh)<<8,a>>>16&bh)}function -gS(a){return a.hi32()}function -gT(a){return a.lo32()}var -FM=eD;function -b1(c,d,b,a){this.kind=c;this.layout=d;this.dims=b;this.data=a}b1.prototype.caml_custom=FM;b1.prototype.offset=function(b){var +gT(a){return a.hi32()}function +gU(a){return a.lo32()}var +FL=eF;function +b1(c,d,b,a){this.kind=c;this.layout=d;this.dims=b;this.data=a}b1.prototype.caml_custom=FL;b1.prototype.offset=function(b){var c=0;if(typeof b==="number")b=[b];if(!(b instanceof -Array))ac("bigarray.js: invalid offset");if(this.dims.length!=b.length)ac("Bigarray.get/set: bad number of dimensions");if(this.layout==0)for(var -a=0;a=this.dims[a])dB();c=c*this.dims[a]+b[a]}else +Array))ad("bigarray.js: invalid offset");if(this.dims.length!=b.length)ad("Bigarray.get/set: bad number of dimensions");if(this.layout==0)for(var +a=0;a=this.dims[a])dC();c=c*this.dims[a]+b[a]}else for(var -a=this.dims.length-1;a>=0;a--){if(b[a]<1||b[a]>this.dims[a])dB();c=c*this.dims[a]+(b[a]-1)}return c};b1.prototype.get=function(a){switch(this.kind){case +a=this.dims.length-1;a>=0;a--){if(b[a]<1||b[a]>this.dims[a])dC();c=c*this.dims[a]+(b[a]-1)}return c};b1.prototype.get=function(a){switch(this.kind){case 7:var -d=this.data[a*2+0],b=this.data[a*2+1];return mk(d,b);case +d=this.data[a*2+0],b=this.data[a*2+1];return mh(d,b);case 10:case 11:var -e=this.data[a*2+0],c=this.data[a*2+1];return[dj,e,c];default:return this.data[a]}};b1.prototype.set=function(a,b){switch(this.kind){case -7:this.data[a*2+0]=gT(b);this.data[a*2+1]=gS(b);break;case +e=this.data[a*2+0],c=this.data[a*2+1];return[dk,e,c];default:return this.data[a]}};b1.prototype.set=function(a,b){switch(this.kind){case +7:this.data[a*2+0]=gU(b);this.data[a*2+1]=gT(b);break;case 10:case 11:this.data[a*2+0]=b[1];this.data[a*2+1]=b[2];break;default:this.data[a]=b;break}return 0};b1.prototype.fill=function(b){switch(this.kind){case 7:var -c=gT(b),e=gS(b);if(c==e)this.data.fill(c);else +c=gU(b),e=gT(b);if(c==e)this.data.fill(c);else for(var a=0;a=this.dims[0])dB();return a};cK.prototype.get=function(a){return this.data[a]};cK.prototype.set=function(a,b){this.data[a]=b;return 0};cK.prototype.fill=function(a){this.data.fill(a);return 0};function -l6(c,d,a,b){var -e=l8(c);if(gJ(a)*e!=b.length)ac("length doesn't match dims");if(d==0&&a.length==1&&e==1)return new +ad("Ml_Bigarray_c_1_1.offset");if(a<0||a>=this.dims[0])dC();return a};cK.prototype.get=function(a){return this.data[a]};cK.prototype.set=function(a,b){this.data[a]=b;return 0};cK.prototype.fill=function(a){this.data.fill(a);return 0};function +l3(c,d,a,b){var +e=l5(c);if(gK(a)*e!=b.length)ad("length doesn't match dims");if(d==0&&a.length==1&&e==1)return new cK(c,d,a,b);return new b1(c,d,a,b)}function -b5(b){if(!X.Failure)X.Failure=[K,a(gu),-3];g0(X.Failure,b)}function -l7(b,v,r){var +b5(b){if(!X.Failure)X.Failure=[I,a(gv),-3];g0(X.Failure,b)}function +l4(b,v,r){var i=b.read32s();if(i<0||i>16)b5("input_value: wrong number of bigarray dimensions");var -p=b.read32s(),j=p&aU,o=p>>8&1,h=[];if(r==eD)for(var +p=b.read32s(),j=p&aU,o=p>>8&1,h=[];if(r==eF)for(var a=0;a>>32-15;a=a8(a,0x1b873593);b^=a;b=b<<13|b>>>32-13;return(b+(b<<2)|0)+(0xe6546b64|0)|0}function -FZ(a,b){a=at(a,gT(b));a=at(a,gS(b));return a}function -gO(a,b){return FZ(a,eY(b))}function -l9(c){var -b=gJ(c.dims),d=0;switch(c.kind){case +l=cN(dF(e));g.set(a,[dk,m,l])}break}v[0]=(4+i)*4;return l3(j,o,h,f)}function +l2(a,b,c){return a.compare(b,c)}function +a9(a,b){return Math.imul(a,b)}function +at(b,a){a=a9(a,0xcc9e2d51|0);a=a<<15|a>>>32-15;a=a9(a,0x1b873593);b^=a;b=b<<13|b>>>32-13;return(b+(b<<2)|0)+(0xe6546b64|0)|0}function +FY(a,b){a=at(a,gU(b));a=at(a,gT(b));return a}function +gP(a,b){return FY(a,e0(b))}function +l6(c){var +b=gK(c.dims),d=0;switch(c.kind){case 2:case 3:case 12:if(b>cI)b=cI;var @@ -339,45 +339,45 @@ a=0;a64)b=64;for(var -a=0;a32)b=32;for(var -a=0;a0?b(c,f,e):b(f,c,e);if(e&&a!=a)return d;if(+a!=+a)return+a;if((a|0)!=0)return a|0}return d}function -dG(a){return a +dH(a){return a instanceof bn}function -e1(a){return dG(a)}function -mf(a){if(typeof +e3(a){return dH(a)}function +mc(a){if(typeof a==="number")return a0;else -if(dG(a))return eA;else -if(e1(a))return 1252;else +if(dH(a))return eC;else +if(e3(a))return 1252;else if(a instanceof Array&&a[0]===a[0]>>>0&&a[0]<=cE){var -b=a[0]|0;return b==dj?0:b}else +b=a[0]|0;return b==dk?0:b}else if(a instanceof -String)return i5;else +String)return i4;else if(typeof -a=="string")return i5;else +a=="string")return i4;else if(a instanceof Number)return a0;else @@ -387,27 +387,27 @@ if(typeof a=="function")return 1247;else if(typeof a=="symbol")return 1251;return 1001}function -e0(a,b){if(ab.c?1:0}function -g2(a,b){return ma(a,b)}function +e2(a,b){if(ab.c?1:0}function +g2(a,b){return l9(a,b)}function cL(a,b,d){var e=[];for(;;){if(!(d&&a===b)){var -f=mf(a);if(f==em){a=a[1];continue}var -g=mf(b);if(g==em){b=b[1];continue}if(f!==g){if(f==a0){if(g==gg)return me(a,b,-1,d);return-1}if(g==a0){if(f==gg)return me(b,a,1,d);return 1}return fb)return 1}break;ca 246:case 254:default:if(a.length!=b.length)return a.length1)e.push(a,b,1);break}}if(e.length==0)return 0;var h=e.pop();b=e.pop();a=e.pop();if(h+10)if(c==0&&(b>=a.l||a.t==2&&b>=a.c.length))if(d==0){a.c=q;a.t=2}else{a.c=cP(b,String.fromCharCode(d));a.t=b==a.l?0:2}else{if(a.t!=4)eV(a);for(b+=c;c0)if(c==0&&(b>=a.l||a.t==2&&b>=a.c.length))if(d==0){a.c=p;a.t=2}else{a.c=cP(b,String.fromCharCode(d));a.t=b==a.l?0:2}else{if(a.t!=4)eX(a);for(b+=c;c31)ac("format_int: format too long");var -a={justify:bA,signstyle:aA,filler:bC,alternate:false,base:0,signedconv:false,width:0,uppercase:false,sign:1,prec:-1,conv:"f"};for(var +e=d.length;if(e>31)ad("format_int: format too long");var +a={justify:bA,signstyle:az,filler:bC,alternate:false,base:0,signedconv:false,width:0,uppercase:false,sign:1,prec:-1,conv:"f"};for(var c=0;c=0&&b<=9){a.width=a.width*10+b;c++}c--;break;case".":a.prec=0;c++;while(b=d.charCodeAt(c)-48,b>=0&&b<=9){a.prec=a.prec*10+b;c++}c--;case"d":case"i":a.signedconv=true;case"u":a.base=10;break;case"x":a.base=16;break;case"X":a.base=16;a.uppercase=true;break;case"o":a.base=8;break;case"e":case"f":case"g":a.signedconv=true;a.conv=b;break;case"E":case"F":case"G":a.signedconv=true;a.uppercase=true;a.conv=b.toLowerCase();break}}return a}function -gM(b,f){if(b.uppercase)f=f.toUpperCase();var -e=f.length;if(b.signedconv&&(b.sign<0||b.signstyle!=aA))e++;if(b.alternate){if(b.base==8)e+=1;if(b.base==16)e+=2}var -c=q;if(b.justify==bA&&b.filler==bC)for(var -d=e;d=0&&b<=9){a.width=a.width*10+b;c++}c--;break;case".":a.prec=0;c++;while(b=d.charCodeAt(c)-48,b>=0&&b<=9){a.prec=a.prec*10+b;c++}c--;case"d":case"i":a.signedconv=true;case"u":a.base=10;break;case"x":a.base=16;break;case"X":a.base=16;a.uppercase=true;break;case"o":a.base=8;break;case"e":case"f":case"g":a.signedconv=true;a.conv=b;break;case"E":case"F":case"G":a.signedconv=true;a.uppercase=true;a.conv=b.toLowerCase();break}}return a}function +gN(b,f){if(b.uppercase)f=f.toUpperCase();var +e=f.length;if(b.signedconv&&(b.sign<0||b.signstyle!=az))e++;if(b.alternate){if(b.base==8)e+=1;if(b.base==16)e+=2}var +c=p;if(b.justify==bA&&b.filler==bC)for(var +d=e;d20){c-=20;a/=Math.pow(10,c);a+=new Array(c+1).join(k);if(b>0)a=a+bf+new Array(b+1).join(k);return a}else return a.toFixed(b)}}var -a,e=gZ(i),d=e.prec<0?6:e.prec;if(c<0||c==0&&1/c==-Infinity){e.sign=-1;c=-c}if(isNaN(c)){a=gw;e.filler=bC}else -if(!isFinite(c)){a=lQ;e.filler=bC}else +a,e=gZ(i),d=e.prec<0?6:e.prec;if(c<0||c==0&&1/c==-Infinity){e.sign=-1;c=-c}if(isNaN(c)){a=gx;e.filler=bC}else +if(!isFinite(c)){a=lN;e.filler=bC}else switch(e.conv){case"e":var -a=c.toExponential(d),b=a.length;if(a.charAt(b-3)==eT)a=a.slice(0,b-1)+k+a.slice(b-1);break;case"f":a=j(c,d);break;case"g":d=d?d:1;a=c.toExponential(d-1);var -h=a.indexOf(eT),g=+a.slice(h+1);if(g<-4||c>=1e21||c.toFixed(0).length>d){var -b=h-1;while(a.charAt(b)==k)b--;if(a.charAt(b)==bf)b--;a=a.slice(0,b+1)+a.slice(h);b=a.length;if(a.charAt(b-3)==eT)a=a.slice(0,b-1)+k+a.slice(b-1);break}else{var +a=c.toExponential(d),b=a.length;if(a.charAt(b-3)==eV)a=a.slice(0,b-1)+k+a.slice(b-1);break;case"f":a=j(c,d);break;case"g":d=d?d:1;a=c.toExponential(d-1);var +h=a.indexOf(eV),g=+a.slice(h+1);if(g<-4||c>=1e21||c.toFixed(0).length>d){var +b=h-1;while(a.charAt(b)==k)b--;if(a.charAt(b)==bf)b--;a=a.slice(0,b+1)+a.slice(h);b=a.length;if(a.charAt(b-3)==eV)a=a.slice(0,b-1)+k+a.slice(b-1);break}else{var f=d;if(g<0){f-=g+1;a=c.toFixed(f)}else while(a=c.toFixed(f),a.length>d+1)f--;if(f){var -b=a.length-1;while(a.charAt(b)==k)b--;if(a.charAt(b)==bf)b--;a=a.slice(0,b+1)}}break}return gM(e,a)}function -eW(e,c){if(bp(e)==gE)return a(q+c);var +b=a.length-1;while(a.charAt(b)==k)b--;if(a.charAt(b)==bf)b--;a=a.slice(0,b+1)}}break}return gN(e,a)}function +eY(e,c){if(bp(e)==gF)return a(p+c);var b=gZ(e);if(c<0)if(b.signedconv){b.sign=-1;c=-c}else c>>>=0;var d=c.toString(b.base);if(b.prec>=0){b.filler=bC;var -f=b.prec-d.length;if(f>0)d=cP(f,k)+d}return gM(b,d)}var -mq=0;function -aG(){return mq++}function +f=b.prec-d.length;if(f>0)d=cP(f,k)+d}return gN(b,d)}var +mo=0;function +aA(){return mo++}function aV(a){return a.toUtf16()}function -dK(){return typeof +dL(){return typeof u.process!=="undefined"&&typeof u.process.versions!=="undefined"&&typeof u.process.versions.node!=="undefined"}function -GJ(){function -a(a){if(a.charAt(0)===bj)return[q,a.substring(1)];return}function +GI(){function +a(a){if(a.charAt(0)===bj)return[p,a.substring(1)];return}function b(c){var -g=/^([a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)?([\\/])?([\s\S]*?)$/,a=g.exec(c),b=a[1]||q,e=Boolean(b&&b.charAt(1)!==":");if(Boolean(a[2]||e)){var -d=a[1]||q,f=a[2]||q;return[d,c.substring(d.length+f.length)]}return}return dK()&&u.process&&u.process.platform?u.process.platform===iE?b:a:a}var -g6=GJ();function -mt(a){return a.slice(-1)!==bj?a+bj:a}if(dK()&&u.process&&u.process.cwd)var -dD=u.process.cwd().replace(/\\/g,bj);else +g=/^([a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)?([\\/])?([\s\S]*?)$/,a=g.exec(c),b=a[1]||p,e=Boolean(b&&b.charAt(1)!==":");if(Boolean(a[2]||e)){var +d=a[1]||p,f=a[2]||p;return[d,c.substring(d.length+f.length)]}return}return dL()&&u.process&&u.process.platform?u.process.platform==="win32"?b:a:a}var +g6=GI();function +ms(a){return a.slice(-1)!==bj?a+bj:a}if(dL()&&u.process&&u.process.cwd)var +dE=u.process.cwd().replace(/\\/g,bj);else var -dD="/static";dD=mt(dD);function -Gf(a){a=aV(a);if(!g6(a))a=dD+a;var +dE="/static";dE=ms(dE);function +Ge(a){a=aV(a);if(!g6(a))a=dE+a;var e=g6(a),d=e[1].split(bj),b=[];for(var c=0;c1)b.pop();break;case".":break;default:b.push(d[c]);break}b.unshift(e[0]);b.orig=a;return b}function -Gz(e){for(var -f=q,b=f,a,h,c=0,g=e.length;cgb){b.substr(0,1);f+=b;b=q;f+=e.slice(c,d)}else -b+=e.slice(c,d);if(d==g)break;c=d}if(a>6);b+=String.fromCharCode(a2|a&cw)}else -if(a<0xd800||a>=kS)b+=String.fromCharCode(iW|a>>12,a2|a>>6&cw,a2|a&cw);else -if(a>=0xdbff||c+1==g||(h=e.charCodeAt(c+1))kS)b+="\xef\xbf\xbd";else{c++;a=(a<<10)+h-0x35fdc00;b+=String.fromCharCode(j9|a>>18,a2|a>>12&cw,a2|a>>6&cw,a2|a&cw)}if(b.length>ds){b.substr(0,1);f+=b;b=q}}return f+b}function -FO(a){var -b=9;if(!mv(a))b=8,a=Gz(a);return new +Gy(e){for(var +f=p,b=f,a,h,c=0,g=e.length;cgb){b.substr(0,1);f+=b;b=p;f+=e.slice(c,d)}else +b+=e.slice(c,d);if(d==g)break;c=d}if(a>6);b+=String.fromCharCode(a2|a&cw)}else +if(a<0xd800||a>=kQ)b+=String.fromCharCode(iV|a>>12,a2|a>>6&cw,a2|a&cw);else +if(a>=0xdbff||c+1==g||(h=e.charCodeAt(c+1))kQ)b+="\xef\xbf\xbd";else{c++;a=(a<<10)+h-0x35fdc00;b+=String.fromCharCode(j8|a>>18,a2|a>>12&cw,a2|a>>6&cw,a2|a&cw)}if(b.length>dt){b.substr(0,1);f+=b;b=p}}return f+b}function +FN(a){var +b=9;if(!mu(a))b=8,a=Gy(a);return new bn(b,a,a.length)}function -aL(a){return FO(a)}var -GZ=[jt,lY,kk,iO,kg,kR,jI,k5,gd,jL,k4,j_,k6,jH,iz,l1,iN,iV,j2,kD,eS,i8,lM,k_,ly,kv,eM,gF,i4,i3,jW,lP,lK,lT,ju,iY,jh,kM,lW,j7,jz,kj,iU,j$,iC,k8,lI,jx,i6,j5,kw,jO,kH,kf,k7,jK,jv,lq,kY,lC,kV,kQ,kP,iT,jB,jd,le,lw];function +aL(a){return FN(a)}var +GX=[js,lV,ki,iN,ke,kP,jH,k3,gd,jK,k2,j9,k4,jG,iz,lY,iM,iU,j1,kB,eU,i7,lJ,k8,lv,kt,eO,gG,i3,i2,jV,lM,lH,lQ,jt,iX,jg,kK,lT,j6,jy,kh,iT,j_,iC,k6,lF,jw,i5,j4,ku,jN,kF,kd,k5,jJ,ju,lo,kW,lz,kT,kO,kN,iS,jA,jc,lc,lt];function cg(d,f,e,a){var -b=GZ.indexOf(d);if(b<0){if(a==null)a=-9999;b=[0,a]}var -c=[b,aL(f||q),aL(e||q)];return c}var -mp={};function -bK(a){return mp[a]}function +b=GX.indexOf(d);if(b<0){if(a==null)a=-9999;b=[0,a]}var +c=[b,aL(f||p),aL(e||p)];return c}var +mm={};function +bK(a){return mm[a]}function cf(b,a){throw[0,b].concat(a)}function -FN(a){return new +FM(a){return new bn(4,a,a.length)}function Q(a){g0(X.Sys_error,a)}function -Go(a){Q(a+ej)}function +Go(a){Q(a+el)}function aW(a){return a.l}function -l4(){}function +l1(){}function ar(a){this.data=a}ar.prototype=new -l4();ar.prototype.truncate=function(a){var -b=this.data;this.data=ab(a|0);b2(b,0,this.data,0,a)};ar.prototype.length=function(){return aW(this.data)};ar.prototype.write=function(b,d,g,a){var +l1();ar.prototype.truncate=function(a){var +b=this.data;this.data=ac(a|0);b2(b,0,this.data,0,a)};ar.prototype.length=function(){return aW(this.data)};ar.prototype.write=function(b,d,g,a){var c=this.length();if(b+a>=c){var -e=ab(b+a),f=this.data;this.data=e;b2(f,0,this.data,0,c)}b3(d,g,this.data,b,a);return 0};ar.prototype.read=function(c,a,d,b){var +e=ac(b+a),f=this.data;this.data=e;b2(f,0,this.data,0,c)}b3(d,g,this.data,b,a);return 0};ar.prototype.read=function(c,a,d,b){var e=this.length();b2(this.data,c,a,d,b);return 0};ar.prototype.read_one=function(a){return b4(this.data,a)};ar.prototype.close=function(){};ar.prototype.constructor=ar;function aF(b,a){this.content={};this.root=b;this.lookupFun=a}aF.prototype.nm=function(a){return this.root+a};aF.prototype.create_dir_if_needed=function(d){var -c=d.split(bj),b=q;for(var +c=d.split(bj),b=p;for(var a=0;a>1|1;if(h=0)}function -gP(d,b){var +a=c}e5[d]=a+1;return h==b[a+1]?b[a]:0}function +mg(a,b){return+(cL(a,b,false)>=0)}function +gQ(d,b){var e=b.length,a,c;for(a=0;a+4<=e;a+=4){c=b.charCodeAt(a)|b.charCodeAt(a+1)<<8|b.charCodeAt(a+2)<<16|b.charCodeAt(a+3)<<24;d=at(d,c)}c=0;switch(e&3){case 3:c=b.charCodeAt(a+2)<<16;case 2:c|=b.charCodeAt(a+1)<<8;case 1:c|=b.charCodeAt(a);d=at(d,c)}d^=e;return d}function -F0(a,b){return gP(a,bp(b))}function -FX(d,b){var +FZ(a,b){return gQ(a,bp(b))}function +FW(d,b){var e=b.length,a,c;for(a=0;a+4<=e;a+=4){c=b[a]|b[a+1]<<8|b[a+2]<<16|b[a+3]<<24;d=at(d,c)}c=0;switch(e&3){case 3:c=b[a+2]<<16;case 2:c|=b[a+1]<<8;case 1:c|=b[a];d=at(d,c)}d^=e;return d}function -mm(a){switch(a.t&6){default:cb(a);case +mj(a){switch(a.t&6){default:cb(a);case 0:return a.c;case 4:return a.c}}function -FW(b,c){var -a=mm(c);return typeof -a==="string"?gP(b,a):FX(b,a)}function -FY(a){a^=a>>>16;a=a8(a,0x85ebca6b|0);a^=a>>>13;a=a8(a,0xc2b2ae35|0);a^=a>>>16;return a}function -FV(j,l,n,m){var +FV(b,c){var +a=mj(c);return typeof +a==="string"?gQ(b,a):FW(b,a)}function +FX(a){a^=a>>>16;a=a9(a,0x85ebca6b|0);a^=a>>>13;a=a9(a,0xc2b2ae35|0);a^=a>>>16;return a}function +FU(j,l,n,m){var f,g,h,d,c,b,a,e,i;d=l;if(d<0||d>cI)d=cI;c=j;b=n;f=[m];g=0;h=1;while(g0){a=f[g++];if(a&&a.caml_custom){if(cM[a.caml_custom]&&cM[a.caml_custom].hash){var k=cM[a.caml_custom].hash(a);b=at(b,k);c--}}else if(a @@ -653,18 +653,18 @@ Array&&a[0]===(a[0]|0))switch(a[0]){case 248:b=at(b,a[2]);c--;break;case 250:f[--g]=a[1];break;default:var o=a.length-1<<10|a[0];b=at(b,o);for(e=1,i=a.length;e=d)break;f[h++]=a[e]}break}else -if(dG(a)){b=FW(b,a);c--}else -if(e1(a)){b=F0(b,a);c--}else +if(dH(a)){b=FV(b,a);c--}else +if(e3(a)){b=FZ(b,a);c--}else if(typeof -a==="string"){b=gP(b,a);c--}else +a==="string"){b=gQ(b,a);c--}else if(a===(a|0)){b=at(b,a+a+1);c--}else -if(a===+a){b=gO(b,a);c--}}b=FY(b);return b&0x3FFFFFFF}function -F1(a,c,l){if(!isFinite(a)){if(isNaN(a))return aL(gw);return aL(a>0?lJ:"-infinity")}var +if(a===+a){b=gP(b,a);c--}}b=FX(b);return b&0x3FFFFFFF}function +F0(a,c,l){if(!isFinite(a)){if(isNaN(a))return aL(gx);return aL(a>0?lG:"-infinity")}var i=a==0&&1/a==-Infinity?1:a>=0?0:1;if(i)a=-a;var d=0;if(a==0);else if(a<1)while(a<1&&d>-1022){a*=2;d--}else while(a>=2){a/=2;d++}var -j=d<0?q:bA,e=q;if(i)e=aA;else +j=d<0?p:bA,e=p;if(i)e=az;else switch(l){case 43:e=bA;break;case 32:e=bC;break;default:break}if(c>=0&&c<13){var @@ -672,44 +672,44 @@ g=Math.pow(2,c*4);a=Math.round(a*g)/g}var b=a.toString(16);if(c>=0){var h=b.indexOf(bf);if(h<0)b+=bf+cP(c,k);else{var f=h+1+c;if(b.length>24&bF,a>>31&bh)}function -Ga(a){return a.toInt()}function -F6(a){return+a.isNeg()}function -F9(a){return a.neg()}function -F4(g,c){var -a=gZ(g);if(a.signedconv&&F6(c)){a.sign=-1;c=F9(c)}var -b=q,h=F_(a.base),f="0123456789abcdef";do{var -e=c.udivmod(h);c=e.quotient;b=f.charAt(Ga(e.modulus))+b}while(!F7(c));if(a.prec>=0){a.filler=bC;var -d=a.prec-b.length;if(d>0)b=cP(d,k)+b}return gM(a,b)}function -F$(a,b){return a.or(b)}function -eZ(a){return a.toFloat()}function +F$(a){return a.toInt()}function +F5(a){return+a.isNeg()}function +F8(a){return a.neg()}function +F3(g,c){var +a=gZ(g);if(a.signedconv&&F5(c)){a.sign=-1;c=F8(c)}var +b=p,h=F9(a.base),f="0123456789abcdef";do{var +e=c.udivmod(h);c=e.quotient;b=f.charAt(F$(e.modulus))+b}while(!F6(c));if(a.prec>=0){a.filler=bC;var +d=a.prec-b.length;if(d>0)b=cP(d,k)+b}return gN(a,b)}function +F_(a,b){return a.or(b)}function +e1(a){return a.toFloat()}function cc(a){return a.slice(1)}function -Gd(c){var +Gc(c){var d=c.length,b=new Array(d+1);b[0]=0;for(var a=0;a0){var c=new Array(b);for(var -a=0;abl){a-=bl;b*=Math.pow(2,bl);if(a>bl){a-=bl;b*=Math.pow(2,bl)}}if(a<-bl){a+=bl;b*=Math.pow(2,-bl)}b*=Math.pow(2,a);return b}function -Ge(a,b){return+(cL(a,b,false)<=0)}function -gW(a,b){return+(cL(a,b,false)<0)}function -bJ(a,d){if(a<0)dB();var +a=0;abl){a-=bl;b*=Math.pow(2,bl);if(a>bl){a-=bl;b*=Math.pow(2,bl)}}if(a<-bl){a+=bl;b*=Math.pow(2,-bl)}b*=Math.pow(2,a);return b}function +Gd(a,b){return+(cL(a,b,false)<=0)}function +gX(a,b){return+(cL(a,b,false)<0)}function +bJ(a,d){if(a<0)dC();var a=a+1|0,b=new Array(a);b[0]=0;for(var c=1;c>>32-b,c)}function g(c,b,d,e,h,f,g){return a(b&d|~b&e,c,b,h,f,g)}function @@ -724,7 +724,7 @@ o=new Array(16);for(var e=0;e<4;e++)for(var m=0;m<4;m++)o[e*4+m]=k[e]>>8*m&0xFF;return o}return function(i,g,f){var -e=[],h=mm(i);if(typeof +e=[],h=mj(i);if(typeof h==="string"){var d=h;for(var a=0;a>2]=d.charCodeAt(b)|d.charCodeAt(b+1)<<8|d.charCodeAt(b+2)<<16|d.charC c=h;for(var a=0;a>2]=c[b]|c[b+1]<<8|c[b+2]<<16|c[b+3]<<24}for(;a>2]|=c[a+g]<<8*(a&3)}return Gu(k(e,f))}}();function -Gh(c,b,a){return Gg(bI(c),b,a)}var +Gg(c,b,a){return Gf(bI(c),b,a)}function +Gh(){return 0}var bq=new Array();function cd(c){var -a=bq[c];if(!a.opened)Q("Cannot flush a closed channel");if(!a.buffer||a.buffer==q)return 0;if(a.fd&&X.fds[a.fd]&&X.fds[a.fd].output){var +a=bq[c];if(!a.opened)Q("Cannot flush a closed channel");if(!a.buffer||a.buffer==p)return 0;if(a.fd&&X.fds[a.fd]&&X.fds[a.fd].output){var b=X.fds[a.fd].output;switch(b.length){case -2:b(c,a.buffer);break;default:b(a.buffer)}}a.buffer=q;return 0}function -ms(e,f){var +2:b(c,a.buffer);break;default:b(a.buffer)}}a.buffer=p;return 0}function +mq(e,f){var b=bq[e],d=a(f),c=E(d);b.file.write(b.offset,d,0,c);b.offset+=c;return 0}function -GD(a){var +GC(a){var a=g4(a),b=u;if(b.process&&b.process.stdout&&b.process.stdout.write)b.process.stderr.write(a);else{if(a.charCodeAt(a.length-1)==10)a=a.substr(0,a.length-1);var c=b.console;c&&c.error&&c.error(a)}}function -GE(a){var +GD(a){var a=g4(a),b=u;if(b.process&&b.process.stdout&&b.process.stdout.write)b.process.stdout.write(a);else{if(a.charCodeAt(a.length-1)==10)a=a.substr(0,a.length-1);var c=b.console;c&&c.log&&c.log(a)}}function -e8(c,e,d,a){if(X.fds===undefined)X.fds=new +e9(c,e,d,a){if(X.fds===undefined)X.fds=new Array();a=a?a:{};var b={};b.file=d;b.offset=a.append?d.length():0;b.flags=a;b.output=e;X.fds[c]=b;if(!X.fd_last_idx||c>X.fd_last_idx)X.fd_last_idx=c;return c}function -G1(c,b,g){var +GZ(c,b,g){var a={};while(b){switch(b[1]){case 0:a.rdonly=1;break;case 1:a.wronly=1;break;case @@ -760,45 +761,45 @@ a={};while(b){switch(b[1]){case 5:a.excl=1;break;case 6:a.binary=1;break;case 7:a.text=1;break;case -8:a.nonblock=1;break}b=b[2]}if(a.rdonly&&a.wronly)Q(bp(c)+ja);if(a.text&&a.binary)Q(bp(c)+jJ);var -d=mE(c),e=d.device.open(d.rest,a),f=X.fd_last_idx?X.fd_last_idx:0;return e8(f+1,ms,e,a)}e8(0,ms,new -ar(ab(0)));e8(1,GE,new -ar(ab(0)));e8(2,GD,new -ar(ab(0)));function +8:a.nonblock=1;break}b=b[2]}if(a.rdonly&&a.wronly)Q(bp(c)+i$);if(a.text&&a.binary)Q(bp(c)+jI);var +d=mD(c),e=d.device.open(d.rest,a),f=X.fd_last_idx?X.fd_last_idx:0;return e9(f+1,mq,e,a)}e9(0,mq,new +ar(ac(0)));e9(1,GD,new +ar(ac(0)));e9(2,GC,new +ar(ac(0)));function Gi(a){var -c=X.fds[a];if(c.flags.wronly)Q(km+a+" is writeonly");var -d=null;if(a==0&&dK()){var +c=X.fds[a];if(c.flags.wronly)Q(kk+a+" is writeonly");var +d=null;if(a==0&&dL()){var e=require("fs");d=function(){return aL(e.readFileSync(0,iB))}}var b={file:c.file,offset:c.offset,fd:a,opened:true,out:false,refill:d};bq[b.fd]=b;return b.fd}function -mn(c){var -b=X.fds[c];if(b.flags.rdonly)Q(km+c+" is readonly");var -a={file:b.file,offset:b.offset,fd:c,opened:true,out:true,buffer:q};bq[a.fd]=a;return a.fd}function +mk(c){var +b=X.fds[c];if(b.flags.rdonly)Q(kk+c+" is readonly");var +a={file:b.file,offset:b.offset,fd:c,opened:true,out:true,buffer:p};bq[a.fd]=a;return a.fd}function Gj(){var b=0;for(var a=0;a>>0)return a[0];else -if(dG(a))return eA;else -if(e1(a))return eA;else +if(dH(a))return eC;else +if(e3(a))return eC;else if(a instanceof Function||typeof @@ -806,52 +807,50 @@ a=="function")return 247;else if(a&&a.caml_custom)return cE;else return a0}function a4(b,c,a){if(a&&u.toplevelReloc)b=u.toplevelReloc(a);X[b+1]=c;if(a)X[a]=c}function -g1(a,b){mp[bp(a)]=b;return 0}function -Gr(a){a[2]=mq++;return a}function -g3(a,b){return mb(a,b)}function -Gt(){ac(gr)}function +g1(a,b){mm[bp(a)]=b;return 0}function +Gr(a){a[2]=mo++;return a}function +g3(a,b){return l_(a,b)}function +Gt(){ad(gs)}function D(b,a){if(a>>>0>=E(b))Gt();return cQ(b,a)}function -ad(a,b){return 1-g3(a,b)}function -Gv(){return 0x7FFFFFFF/4|0}var -GY=u.process&&u.process.platform&&u.process.platform==iE?ls:"Unix";function -Gw(){return[0,a(GY),32,0]}function -Gp(){e4(X.Not_found)}function -e7(c){var +ai(a,b){return 1-g3(a,b)}function +Gv(){return 0x7FFFFFFF/4|0}function +Gp(){e6(X.Not_found)}function +mr(c){var a=u,b=aV(c);if(a.process&&a.process.env&&a.process.env[b]!=undefined)return aL(a.process.env[b]);if(u.jsoo_static_env&&u.jsoo_static_env[b])return aL(u.jsoo_static_env[b]);Gp()}function -Gx(){if(u.crypto)if(typeof +Gw(){if(u.crypto)if(typeof u.crypto.getRandomValues==="function"){var a=new(u.Uint32Array)(1);u.crypto.getRandomValues(a);return[0,a[0]]}else if(u.crypto.randomBytes==="function"){var b=u.crypto.randomBytes(4),a=new(u.Uint32Array)(b);return[0,a[0]]}var c=new -Date().getTime(),d=c^kh*Math.random();return[0,d]}function -dJ(a){var +Date().getTime(),d=c^kf*Math.random();return[0,d]}function +dK(a){var b=1;while(a&&a.joo_tramp){a=a.joo_tramp.apply(null,a.joo_args);b++}return a}function aj(b,a){return{joo_tramp:b,joo_args:a}}function -Gy(c,a){if(typeof +Gx(c,a){if(typeof a==="function"){c.fun=a;return 0}if(a.fun){c.fun=a.fun;return 0}var b=a.length;while(b--)c[b]=a[b];return 0}function -mr(a){return a}function -i(a){if(a +mp(a){return a}function +c(a){if(a instanceof Array)return a;if(u.RangeError&&a instanceof -u.RangeError&&a.message&&a.message.match(/maximum call stack/i))return mr(X.Stack_overflow);if(u.InternalError&&a +u.RangeError&&a.message&&a.message.match(/maximum call stack/i))return mp(X.Stack_overflow);if(u.InternalError&&a instanceof -u.InternalError&&a.message&&a.message.match(/too much recursion/i))return mr(X.Stack_overflow);if(a +u.InternalError&&a.message&&a.message.match(/too much recursion/i))return mp(X.Stack_overflow);if(a instanceof u.Error&&bK(gf))return[0,bK(gf),a];return[0,X.Failure,aL(String(a))]}var r=function(A){"use strict";var -f=b$,ab=7,u=9007199254740992,I=p(u),N="0123456789abcdefghijklmnopqrstuvwxyz",g=GC.BigInt,G=typeof +f=b$,ab=7,u=9007199254740992,I=q(u),N="0123456789abcdefghijklmnopqrstuvwxyz",g=GB.BigInt,G=typeof g==="function";function d(a,b,c,f){if(typeof a==="undefined")return d[0];if(typeof b!=="undefined")return+b===10&&!c?e(a):af(a,b,c,f);return e(a)}function -a(b,a){this.value=b;this.sign=a;this.isSmall=false;this.caml_custom=eK}a.prototype=Object.create(d.prototype);function -b(a){this.value=a;this.sign=a<0;this.isSmall=true;this.caml_custom=eK}b.prototype=Object.create(d.prototype);function -c(a){this.value=a;this.caml_custom=eK}c.prototype=Object.create(d.prototype);function +a(b,a){this.value=b;this.sign=a;this.isSmall=false;this.caml_custom=eM}a.prototype=Object.create(d.prototype);function +b(a){this.value=a;this.sign=a<0;this.isSmall=true;this.caml_custom=eM}b.prototype=Object.create(d.prototype);function +c(a){this.value=a;this.caml_custom=eM}c.prototype=Object.create(d.prototype);function m(a){return-u0)a.push(0);return a.concat(c)}function D(b,c){var a=Math.max(b.length,c.length);if(a<=30)return M(b,c);a=Math.ceil(a/2);var f=b.slice(a),d=b.slice(0,a),i=c.slice(a),h=c.slice(0,a),e=D(d,h),g=D(f,i),k=D(v(d,f),v(h,i)),j=v(v(e,Y(y(y(k,e),g),a)),Y(g,2*a));s(j);return j}function -ak(a,b){return-(jV*a)-jV*b+0.000015*a*b>0}a.prototype.multiply=function(j){var +ak(a,b){return-(jU*a)-jU*b+0.000015*a*b>0}a.prototype.multiply=function(j){var h=e(j),c=this.value,b=h.value,i=this.sign!==h.sign,g;if(h.isSmall){if(b===0)return d[0];if(b===1)return this;if(b===-1)return this.negate();g=Math.abs(b);if(g=0;d--){j=g-1;if(b[d+h]!==l)j=Math.floor((b[d+h]*g+b[d+h-1])/l);c=0;e=0;m=i.length;for(a=0;a=x){b=b.multiply(j);a-=x-1}return b.multiply(h[a])};c.prototype.shiftLeft=b.prototype.shiftLeft=a.prototype.shiftLeft;a.prototype.shiftRight=function(d){var a,b=e(d).toJSNumber();if(!Z(b))throw new -Error(String(b)+jo);if(b<0)return this.shiftLeft(-b);var +Error(String(b)+jn);if(b<0)return this.shiftLeft(-b);var c=this;while(b>=x){if(c.isZero()||c.isNegative()&&c.isUnit())return c;a=i(c,j);c=a[1].isNegative()?a[0].prev():a[0];b-=x-1}a=i(c,h[b]);return a[1].isNegative()?a[0].prev():a[0]};c.prototype.shiftRight=b.prototype.shiftRight=a.prototype.shiftRight;function J(h,a,q){a=e(a);var m=h.isNegative(),p=a.isNegative(),l=m?h.not():h,o=p?a.not():a,b=0,c=0,k=null,n=null,f=[];while(!l.isZero()||!o.isZero()){k=i(l,j);b=k[1].toJSNumber();if(m)b=j-1-b;n=i(o,j);c=n[1].toJSNumber();if(p)c=j-1-c;l=k[0];o=n[0];f.push(q(b,c))}var @@ -1046,22 +1045,22 @@ c=0;c=i){if(c===U&&i===1)continue;throw new Error(c+" is not a valid digit in base "+g+bf)}}g=e(g);var -h=[],j=b[0]===aA;for(a=j?1:0;a=0;a--){b=b.add(e[a].times(c));c=c.times(f)}return g?b.negate():b}function -ai(b,a){a=a||N;if(b=0){e=c.divmod(b);c=e.quotient;var d=e.remainder;if(d.isNegative()){d=b.minus(d).abs();c=c.next()}g.push(d.toJSNumber())}g.push(c.toJSNumber());return{value:g.reverse(),isNegative:f}}function $(d,c,b){var -a=z(d,c);return(a.isNegative?aA:q)+a.value.map(function(a){return ai(a,b)}).join(q)}a.prototype.toArray=function(a){return z(this,a)};b.prototype.toArray=function(a){return z(this,a)};c.prototype.toArray=function(a){return z(this,a)};a.prototype.toString=function(a,f){if(a===A)a=10;if(a!==10)return $(this,a,f);var +a=z(d,c);return(a.isNegative?az:p)+a.value.map(function(a){return ai(a,b)}).join(p)}a.prototype.toArray=function(a){return z(this,a)};b.prototype.toArray=function(a){return z(this,a)};c.prototype.toArray=function(a){return z(this,a)};a.prototype.toString=function(a,f){if(a===A)a=10;if(a!==10)return $(this,a,f);var d=this.value,c=d.length,e=String(d[--c]),h="0000000",b;while(--c>=0){b=String(d[c]);e+=h.slice(b.length)+b}var -g=this.sign?aA:q;return g+e};b.prototype.toString=function(a,b){if(a===A)a=10;if(a!=10)return $(this,a,b);return String(this.value)};c.prototype.toString=b.prototype.toString;c.prototype.toJSON=a.prototype.toJSON=b.prototype.toJSON=function(){return this.toString()};a.prototype.valueOf=function(){return parseInt(this.toString(),10)};a.prototype.toJSNumber=a.prototype.valueOf;b.prototype.valueOf=function(){return this.value};b.prototype.toJSNumber=b.prototype.valueOf;c.prototype.valueOf=c.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};function +g=this.sign?az:p;return g+e};b.prototype.toString=function(a,b){if(a===A)a=10;if(a!=10)return $(this,a,b);return String(this.value)};c.prototype.toString=b.prototype.toString;c.prototype.toJSON=a.prototype.toJSON=b.prototype.toJSON=function(){return this.toString()};a.prototype.valueOf=function(){return parseInt(this.toString(),10)};a.prototype.toJSNumber=a.prototype.valueOf;b.prototype.valueOf=function(){return this.value};b.prototype.toJSNumber=b.prototype.valueOf;c.prototype.valueOf=c.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};function X(d){if(m(+d)){var n=+d;if(n===t(n))return G?new c(g(n)):new b(n);throw new -Error(eP+d)}var -q=d[0]===aA;if(q)d=d.slice(1);var +Error(eR+d)}var +q=d[0]===az;if(q)d=d.slice(1);var h=d.split(/e/i);if(h.length>2)throw new -Error(eP+h.join(eT));if(h.length===2){var +Error(eR+h.join(eV));if(h.length===2){var e=h[1];if(e[0]===bA)e=e.slice(1);e=+e;if(e!==t(e)||!m(e))throw new -Error(eP+e+" is not a valid exponent.");var +Error(eR+e+" is not a valid exponent.");var f=h[0],i=f.indexOf(bf);if(i>=0){e-=f.length-i-1;f=f.slice(0,i)+f.slice(i+1)}if(e<0)throw new Error("Cannot include negative exponent part for integers");f+=new Array(e+1).join(k);d=f}var r=/^([0-9][0-9]*)$/.test(d);if(!r)throw new -Error(eP+d);if(G)return new -c(g(q?aA+d:d));var +Error(eR+d);if(G)return new +c(g(q?az+d:d));var p=[],j=d.length,o=ab,l=j-o;while(j>0){p.push(+d.slice(l,j));l-=o;if(l<0)l=0;j-=o}s(p);return new a(p,q)}function ag(a){if(G)return new @@ -1106,106 +1105,106 @@ instanceof b||d instanceof c};d.randBetween=ah;d.fromArray=function(b,a,c){return W(b.map(e),e(a||10),c)};return d}();function -aH(a){var +aG(a){var b=a.toJSNumber()|0;if(a.equals(r(b)))return b;return a}function -mw(a){return aH(r(a).abs())}function -mx(a,b){return aH(r(a).add(r(b)))}function +mv(a){return aG(r(a).abs())}function +mw(a,b){return aG(r(a).add(r(b)))}function ch(a,b){return r(a).compare(r(b))}function -my(b,a){a=r(a);if(a.equals(r(0)))cO();return aH(r(b).divide(r(a)))}function -GU(b,a){a=r(a);if(a.equals(r(0)))cO();return aH(r(b).mod(a))}function -mz(a,b){return[0,my(a,b),GU(a,b)]}function -mA(a,b){return my(a,b)}function -GK(a,b){return r(a).equals(r(b))}function -GM(a,b){return aH(r.gcd(r(a),r(b)).abs())}function -GA(c,e,g){e=r(e);var +mx(b,a){a=r(a);if(a.equals(r(0)))cO();return aG(r(b).divide(r(a)))}function +GT(b,a){a=r(a);if(a.equals(r(0)))cO();return aG(r(b).mod(a))}function +my(a,b){return[0,mx(a,b),GT(a,b)]}function +mz(a,b){return mx(a,b)}function +GJ(a,b){return r(a).equals(r(b))}function +GL(a,b){return aG(r.gcd(r(a),r(b)).abs())}function +Gz(c,e,g){e=r(e);var a=e.toArray(Math.pow(2,32));c.write(8,a.isNegative?1:0);var f=a.value.length,d=f*4;c.write(32,d);for(var b=f-1;b>=0;b--){c.write(8,a.value[b]>>>0&aU);c.write(8,a.value[b]>>>8&aU);c.write(8,a.value[b]>>>16&aU);c.write(8,a.value[b]>>>24&aU)}g[0]=4*(1+((d+3)/4|0));g[1]=8*(1+((d+7)/8|0))}function -GB(b,g){var +GA(b,g){var e;switch(b.read8u()){case 1:e=true;break;case 0:e=false;break;default:b5("input_value: z (malformed input)")}var f=b.read32u(),c=r(0);for(var d=0;d>>0);c=a.shiftLeft(d*32).add(c)}if(e)c=c.negate();g[0]=f+4;return aH(c)}function -GN(d){var +a=r(b.read8u());a=a.add(b.read8u()<<8);a=a.add(b.read8u()<<16);a=a.add(b.read8u()<<24>>>0);c=a.shiftLeft(d*32).add(c)}if(e)c=c.negate();g[0]=f+4;return aG(c)}function +GM(d){var b=r(d).toArray(Math.pow(2,32)),a=0;for(var c=0;c=48&&a<=57)return a-48;if(a>=97&&a<=cB)return a-97+10;if(a>=65&&a<=70)return a-65+10}var -e=0;if(a[e]==aA)e++;for(;e=c)ac("Z.of_substring_base: invalid digit")}return aH(r(a,c))}function -ci(d,a,b,c){a=bp(a);if(b!=0||c!=a.length){if(a.length-b=c)ad("Z.of_substring_base: invalid digit")}return aG(r(a,c))}function +ci(d,a,b,c){a=bp(a);if(b!=0||c!=a.length){if(a.length-b=0?1:0}function -e9(a){a=r(a);if(!GL(a))e4(bK(gk));var -b=r(kh),d=a.and(b).toJSNumber(),c=a.shiftRight(32).and(b).toJSNumber(),e=mk(d,c);return e}function -e_(){return new +mC(a,b){return aG(r(a).subtract(r(b)))}function +GV(a){return aG(r(a).next())}function +GW(a){if(a==(a|0))return a|0;e6(bK(gk))}function +GK(a){a=r(a);return a.compare(r("9223372036854775807"))<=0&&a.compare(r("-9223372036854775808"))>=0?1:0}function +e_(a){a=r(a);if(!GK(a))e6(bK(gk));var +b=r(kf),d=a.and(b).toJSNumber(),c=a.shiftRight(32).and(b).toJSNumber(),e=mh(d,c);return e}function +e$(){return new Date().getTime()/a0}function cS(e){var a=new Date(e*a0),b=a.getTime(),d=new -Date(Date.UTC(a.getUTCFullYear(),0,1)).getTime(),c=Math.floor((b-d)/i0);return[0,a.getUTCSeconds(),a.getUTCMinutes(),a.getUTCHours(),a.getUTCDate(),a.getUTCMonth(),a.getUTCFullYear()-bY,a.getUTCDay(),c,false|0]}function -e$(){return 0}function -G0(h){var +Date(Date.UTC(a.getUTCFullYear(),0,1)).getTime(),c=Math.floor((b-d)/iZ);return[0,a.getUTCSeconds(),a.getUTCMinutes(),a.getUTCHours(),a.getUTCDate(),a.getUTCMonth(),a.getUTCFullYear()-bY,a.getUTCDay(),c,false|0]}function +fa(){return 0}function +GY(h){var a=new Date(h*a0),b=a.getTime(),e=new -Date(a.getFullYear(),0,1).getTime(),c=Math.floor((b-e)/i0),d=new +Date(a.getFullYear(),0,1).getTime(),c=Math.floor((b-e)/iZ),d=new Date(a.getFullYear(),0,1),f=new Date(a.getFullYear(),6,1),g=Math.max(d.getTimezoneOffset(),f.getTimezoneOffset());return[0,a.getSeconds(),a.getMinutes(),a.getHours(),a.getDate(),a.getMonth(),a.getFullYear()-bY,a.getDay(),c,a.getTimezoneOffset()f)a+=eJ;var +d=f;df)a+=eL;var c=e[d];if(typeof c=="number")a+=c.toString();else if(c instanceof -bn)a+=ey+c.toString()+ey;else +bn)a+=eA+c.toString()+eA;else if(typeof -c=="string")a+=ey+c.toString()+ey;else -a+=lc}a+=")"}else -if(b[0]==K)a+=b[1];return a}function -mg(a){if(a +c=="string")a+=eA+c.toString()+eA;else +a+=la}a+=")"}else +if(b[0]==I)a+=b[1];return a}function +md(a){if(a instanceof -Array&&(a[0]==0||a[0]==K)){var -c=bK(kE);if(c)c(a,false);else{var -d=FT(a),b=bK(iA);if(b)b(0);u.console.error(gB+d+iP)}}else +Array&&(a[0]==0||a[0]==I)){var +c=bK(kC);if(c)c(a,false);else{var +d=FS(a),b=bK(iA);if(b)b(0);u.console.error(gC+d+iO)}}else throw a}function Gs(){var -a=u;if(a.process&&a.process.on)a.process.on("uncaughtException",function(b,c){mg(b);a.process.exit(2)});else -if(a.addEventListener)a.addEventListener("error",function(a){if(a.error)mg(a.error)})}Gs();function -b(a,b){return a.length==1?a(b):a7(a,[b])}function -f(a,b,c){return a.length==2?a(b,c):a7(a,[b,c])}function -P(a,b,c,d){return a.length==3?a(b,c,d):a7(a,[b,c,d])}function -f9(a,b,c,d,e,f){return a.length==5?a(b,c,d,e,f):a7(a,[b,c,d,e,f])}function -FG(a,b,c,d,e,f,g,h){return a.length==7?a(b,c,d,e,f,g,h):a7(a,[b,c,d,e,f,g,h])}FU();var -fa=[K,a(ki),-1],ha=[K,a(kF),-2],dL=[K,a(gu),-3],g8=[K,a(lb),-4],hb=[K,a(jP),-6],az=[K,a(lh),-7],g_=[K,a(iZ),-8],g$=[K,a(lk),-9],F=[K,a(lF),-11],hc=[K,a(ks),gt],FF=[4,0,0,0,[12,45,[4,0,0,0,0]]],fl=[0,[11,a('File "'),[2,0,[11,a('", line '),[4,0,0,0,[11,a(kW),[4,0,0,0,[12,45,[4,0,0,0,[11,a(": "),[2,0,0]]]]]]]]]],a('File "%s", line %d, characters %d-%d: %s')],cr=[0,0,0],eh=[0,a(k1),a(kU),a(ll)];a4(11,hc,ks);a4(10,F,lF);a4(9,[K,a(jk),-10],jk);a4(8,g$,lk);a4(7,g_,iZ);a4(6,az,lh);a4(5,hb,jP);a4(4,[K,a(kJ),-5],kJ);a4(3,g8,lb);a4(2,dL,gu);a4(1,ha,kF);a4(0,fa,ki);var -mU=a("output_substring"),mR=a("%.12g"),mQ=a(bf),mO=a("true"),mP=a("false"),mF=a("Stdlib.Exit"),mH=b6(0,0,lf),mJ=b6(0,0,65520),mL=b6(1,0,lf),mY=a("\\\\"),mZ=a("\\'"),m0=a("\\b"),m1=a("\\t"),m2=a("\\n"),m3=a("\\r"),mX=a("Char.chr"),m4=a("hd"),m7=a("String.blit / Bytes.blit_string"),m6=a("Bytes.blit"),m5=a("String.sub / Bytes.sub"),m9=a("String.contains_from / Bytes.contains_from"),na=a("Array.blit"),m$=a("Array.sub"),nf=a("Map.remove_min_elt"),ng=[0,0,0,0],nh=[0,a("map.ml"),399,10],ni=[0,0,0],nb=a(ep),nc=a(ep),nd=a(ep),ne=a(ep),nj=a("Stdlib.Queue.Empty"),nl=a("CamlinternalLazy.Undefined"),ns=a("Buffer.add_substring/add_subbytes"),nr=a("Buffer.add: cannot grow buffer"),nq=[0,a(lr),93,2],np=[0,a(lr),94,2],nB=a("%c"),nC=a("%s"),nD=a(kr),nE=a(iX),nF=a(k$),nG=a(kB),nH=a("%f"),nI=a("%B"),nJ=a("%{"),nK=a("%}"),nL=a("%("),nM=a("%)"),nN=a("%a"),nO=a("%t"),nP=a("%?"),nQ=a("%r"),nR=a("%_r"),nS=[0,a(al),850,23],n3=[0,a(al),814,21],nV=[0,a(al),815,21],n4=[0,a(al),818,21],nW=[0,a(al),819,21],n5=[0,a(al),822,19],nX=[0,a(al),823,19],n6=[0,a(al),826,22],nY=[0,a(al),827,22],n7=[0,a(al),831,30],nZ=[0,a(al),832,30],n1=[0,a(al),836,26],nT=[0,a(al),837,26],n2=[0,a(al),846,28],nU=[0,a(al),847,28],n0=[0,a(al),851,23],o_=a(jf),o8=[0,a(al),1558,4],o9=a("Printf: bad conversion %["),o$=[0,a(al),1626,39],pa=[0,a(al),1649,31],pb=[0,a(al),1650,31],pc=a("Printf: bad conversion %_"),pd=a(jb),pe=a(jm),pf=a(jb),pg=a(jm),o6=a(gw),o4=a("neg_infinity"),o5=a(lJ),o3=a(bf),oY=[0,ca],oM=a("%+nd"),oN=a("% nd"),oP=a("%+ni"),oQ=a("% ni"),oR=a("%nx"),oS=a("%#nx"),oT=a("%nX"),oU=a("%#nX"),oV=a("%no"),oW=a("%#no"),oL=a("%nd"),oO=a(k$),oX=a("%nu"),oz=a("%+ld"),oA=a("% ld"),oC=a("%+li"),oD=a("% li"),oE=a("%lx"),oF=a("%#lx"),oG=a("%lX"),oH=a("%#lX"),oI=a("%lo"),oJ=a("%#lo"),oy=a("%ld"),oB=a(iX),oK=a("%lu"),om=a("%+Ld"),on=a("% Ld"),op=a("%+Li"),oq=a("% Li"),or=a("%Lx"),os=a("%#Lx"),ot=a("%LX"),ou=a("%#LX"),ov=a("%Lo"),ow=a("%#Lo"),ol=a("%Ld"),oo=a(kB),ox=a("%Lu"),n$=a("%+d"),oa=a("% d"),oc=a("%+i"),od=a("% i"),oe=a("%x"),of=a("%#x"),og=a("%X"),oh=a("%#X"),oi=a("%o"),oj=a("%#o"),n_=a(gE),ob=a(kr),ok=a(jf),nt=a("@]"),nu=a("@}"),nv=a("@?"),nw=a("@\n"),nx=a("@."),ny=a("@@"),nz=a("@%"),nA=a("@"),n8=a("CamlinternalFormat.Type_mismatch"),pk=a(q),pl=[0,[11,a(eJ),[2,0,[2,0,0]]],a(", %s%s")],pI=[0,[11,a(gB),[2,0,[12,10,0]]],a(lA)],pJ=[0,[11,a("Fatal error in uncaught exception handler: exception "),[2,0,[12,10,0]]],a("Fatal error in uncaught exception handler: exception %s\n")],pH=a("Fatal error: out of memory in uncaught exception handler"),pF=[0,[11,a(gB),[2,0,[12,10,0]]],a(lA)],pD=[0,[2,0,[12,10,0]],a("%s\n")],pv=a("Raised at"),pw=a("Re-raised at"),px=a("Raised by primitive operation at"),py=a("Called from"),pz=a(" (inlined)"),pB=a(q),pA=[0,[2,0,[12,32,[2,0,[11,a(' in file "'),[2,0,[12,34,[2,0,[11,a(", line "),[4,0,0,0,[11,a(kW),FF]]]]]]]]]],a('%s %s in file "%s"%s, line %d, characters %d-%d')],pC=[0,[2,0,[11,a(" unknown location"),0]],a("%s unknown location")],pq=a("Out of memory"),pr=a("Stack overflow"),ps=a("Pattern matching failed"),pt=a("Assertion failed"),pu=a("Undefined recursive module"),pm=[0,[12,40,[2,0,[2,0,[12,41,0]]]],a("(%s%s)")],pn=a(q),po=a(q),pp=[0,[12,40,[2,0,[12,41,0]]],a("(%s)")],pj=[0,[4,0,0,0,0],a(gE)],ph=[0,[3,0,0],a("%S")],pi=a(lc),pK=a(lv),FD=a("OCAMLRUNPARAM"),FB=a("CAMLRUNPARAM"),pL=a(q),p8=[3,0,3],p9=a(bf),p3=a(eU),p4=a("<\/"),p5=a(q),pZ=a(eU),p0=a(gn),p1=a(q),pX=a("\n"),pW=[0,a(q)],pS=a(q),pT=a(q),pU=a(q),pV=a(q),pQ=[0,a(q),0,a(q)],pP=a(q),pO=a("Stdlib.Format.String_tag"),qk=a(q),FA=a("TMPDIR"),Fz=a("TEMP"),ql=a(ls),qm=a("Win32"),qr=a(jt),qt=a(lY),qu=a(kk),qv=a(iO),qw=a(kg),qx=a(kR),qy=a(jI),qz=a(k5),qA=a(gd),qB=a(jL),qC=a(k4),qD=a(j_),qE=a(k6),qF=a(jH),qG=a(iz),qH=a(l1),qI=a(iN),qJ=a(iV),qK=a(j2),qL=a(kD),qM=a(eS),qN=a(i8),qO=a(lM),qP=a(k_),qQ=a(ly),qR=a(kv),qS=a(eM),qT=a(gF),qU=a(i4),qV=a(i3),qW=a(jW),qX=a(lP),qY=a(lK),qZ=a(lT),q0=a(ju),q1=a(iY),q2=a(jh),q3=a(kM),q4=a(lW),q5=a(j7),q6=a(jz),q7=a(kj),q8=a(iU),q9=a(j$),q_=a(iC),q$=a(k8),ra=a(lI),rb=a(jx),rc=a(i6),rd=a(j5),re=a(kw),rf=a(jO),rg=a(kH),rh=a(kf),ri=a(k7),rj=a(jK),rk=a(jv),rl=a(lq),rm=a(kY),rn=a(lC),ro=a(kV),rp=a(kQ),rq=a(kP),rr=a(iT),rs=a(jB),rt=a(jd),ru=a(le),rv=a(lw),rw=[0,[11,a("EUNKNOWNERR "),[4,0,0,0,0]],a("EUNKNOWNERR %d")],qs=[0,[11,a("Unix.Unix_error(Unix."),[2,0,[11,a(eJ),[3,0,[11,a(eJ),[3,0,[12,41,0]]]]]]],a("Unix.Unix_error(Unix.%s, %S, %S)")],qn=a(du),qo=a(q),qp=a(q),qq=a(du),rx=a("0.0.0.0"),ry=a("127.0.0.1"),Fy=a("::"),Fx=a("::1"),rO=a(q),rP=a(q),rV=[0,92],rX=a("\\( group not closed by \\)"),rW=[0,a(iG),gl,10],rY=a("[ class not closed by ]"),rZ=a("spurious \\) in regular expression"),rR=a("too many r* or r+ where r is nullable"),rS=a(q),rT=a(q),rQ=[0,a(iG),213,11],r5=[0,a(kN),52,4],r4=[0,a(kN),58,34],r3=a("Not a valid time zone"),uf=a("Not a month"),ud=a("Not a day"),ua=a("from_business: bad week"),ub=a("from_business: bad date"),tn=[0,a(kx),jN,4],tm=[0,a(kx),dA,4],tf=[0,-4713,12,31],tg=[0,k0,1,23],th=[0,dn,10,14],ti=[0,dn,10,5],td=a("Date.Out_of_bounds"),te=a("Date.Undefined"),tD=a("Date.Period.Not_computable"),tM=[0,31,59,90,bT,f$,181,212,gD,273,304,334,ez],uj=[0,a(eO),429,6],ui=[0,a(eO),lo,4],uh=[0,a(eO),167,6],ug=[0,a(eO),67,4],un=a("[a-zA-Z]+"),us=b6(1,0,0),uo=a("Z.Overflow"),up=a(gk),uw=a(q),ux=a("+inf"),uy=a("-inf"),uz=a(lQ),uA=a("undef"),uC=[0,a("q.ml"),486,25],uB=a("Q.of_string: invalid digit"),uu=a("impossible case"),uD=a("Runtime.EmptyError"),uE=a("Runtime.AssertionFailed"),uG=a("Runtime.ConflictError"),uI=a("Runtime.ImpossibleDate"),uK=a("Runtime.NoValueProvided"),Eo=[0,0],Ep=[1,0],Eq=[2,0],En=[0,a(dg),74,11,74,27,[0,a(et),[0,a(dd),[0,a(t),0]]]],Er=[0,a(a5),[0,a("enfants_\xc3\xa0_charge"),0]],EL=[0,a(dg),90,20,90,69,[0,a(et),[0,a(dd),[0,a(t),0]]]],Et=[0,a(a5),[0,a("allocations_familiales.personne_charge_effective_permanente_est_parent"),0]],Es=[0,a(o),90,10,90,57,[0,a(n),0]],EK=[0,a(dg),93,20,93,74,[0,a(et),[0,a(dd),[0,a(t),0]]]],Ev=[0,a(a5),[0,a("allocations_familiales.personne_charge_effective_permanente_remplit_titre_I"),0]],Eu=[0,a(o),91,10,91,62,[0,a(n),0]],Ex=[0,a(a5),[0,a("allocations_familiales.ressources_m\xc3\xa9nage"),0]],Ew=[0,a(o),92,10,92,27,[0,a(n),0]],Ez=[0,a(a5),[0,a("allocations_familiales.r\xc3\xa9sidence"),0]],Ey=[0,a(o),93,10,93,19,[0,a(n),0]],EB=[0,a(a5),[0,a("allocations_familiales.date_courante"),0]],EA=[0,a(o),96,10,96,23,[0,a(n),0]],ED=[0,a(a5),[0,a("allocations_familiales.enfants_\xc3\xa0_charge"),0]],EC=[0,a(o),99,10,99,26,[0,a(n),0]],EJ=[0,a(dg),96,20,96,66,[0,a(et),[0,a(dd),[0,a(t),0]]]],EF=[0,a(a5),[0,a("allocations_familiales.avait_enfant_\xc3\xa0_charge_avant_1er_janvier_2012"),0]],EE=[0,a(o),bT,10,bT,54,[0,a(n),0]],EG=[0,a(a5),[0,a(iR),[0,a(e),0]]],EH=[0,a(a5),[0,a(iR),[0,a(e),0]]],EI=[0,a(a5),[0,a("i_montant_vers\xc3\xa9"),0]],DR=[0,a(e),[0,a(dk),[0,a(aw),0]]],DS=[0,a(e),[0,a(dk),0]],DT=[0,a(e),[0,a(dk),[0,a(ay),0]]],DU=[0,a(e),[0,a(dk),0]],DB=[0,a(e),[0,a(bE),[0,a(aw),0]]],DC=[0,a(e),[0,a(bE),0]],DD=[0,a(e),[0,a(bE),[0,a(ay),0]]],DE=[0,a(e),[0,a(bE),0]],DF=a(cz),DK=a(kn),DL=a(dt),DG=[0,a(e),[0,a(df),[0,a(aw),0]]],DH=[0,a(e),[0,a(df),0]],DI=[0,a(e),[0,a(df),[0,a(ay),0]]],DJ=[0,a(e),[0,a(df),0]],DA=[0,a(o),kb,11,kb,49,[0,a(n),0]],Ds=a(a1),Dt=[0,a(ao),272,5,274,41,[0,a(dr),[0,a(L),[0,a(N),[0,a(H),[0,a(am),[0,a(B),0]]]]]]],Du=a(a1),Dv=a(cz),Dw=a(a1),Dn=a(a1),Do=[0,a(ao),262,5,kc,42,[0,a(dr),[0,a(L),[0,a(N),[0,a(H),[0,a(am),[0,a(B),0]]]]]]],Dp=a(a1),Dq=a(cz),Dr=a(a1),Dm=[0,a(o),eB,11,eB,52,[0,a(n),0]],Dl=a(k),Db=[0,a(e),[0,a(V),[0,a(aw),0]]],Dc=[0,a(e),[0,a(V),0]],Dd=[0,a(e),[0,a(V),[0,a(ay),0]]],De=[0,a(e),[0,a(V),0]],Df=a(U),Dg=a(gc),Dh=[0,a(ao),382,5,385,23,[0,a(eR),[0,a(bZ),[0,a(de),[0,a(bG),[0,a(am),[0,a(B),0]]]]]]],Di=a("0.0567"),C4=[0,a(e),[0,a(V),[0,a(aw),0]]],C5=[0,a(e),[0,a(V),0]],C6=[0,a(e),[0,a(V),[0,a(ay),0]]],C7=[0,a(e),[0,a(V),0]],C8=a(U),C9=a("11"),C_=a(gc),C$=[0,a(ao),373,5,376,42,[0,a(eR),[0,a(bZ),[0,a(de),[0,a(bG),[0,a(am),[0,a(B),0]]]]]]],Da=a("0.0369"),C3=[0,a(o),ei,11,ei,37,[0,a(n),0]],CZ=[0,a(e),[0,a(dl),[0,a(aw),0]]],C0=[0,a(e),[0,a(dl),0]],C1=[0,a(e),[0,a(dl),[0,a(ay),0]]],C2=[0,a(e),[0,a(dl),0]],CY=[0,a(o),ei,11,ei,37,[0,a(n),0]],CV=[8,0],CW=[0,a(v),lt,5,lt,24,[0,a(kC),[0,a(I),[0,a(J),[0,a(t),0]]]]],CT=a(U),CU=[0,a(ao),350,5,351,69,[0,a(eR),[0,a(bZ),[0,a(de),[0,a(bG),[0,a(am),[0,a(B),0]]]]]]],CS=[0,a(o),eu,11,eu,31,[0,a(n),0]],CL=[0,a(e),[0,a(dq),[0,a(aw),0]]],CM=[0,a(e),[0,a(dq),0]],CN=[0,a(e),[0,a(dq),[0,a(ay),0]]],CO=[0,a(e),[0,a(dq),0]],CP=a(U),CC=[0,a(e),[0,a(V),[0,a(aw),0]]],CD=[0,a(e),[0,a(V),0]],CE=[0,a(e),[0,a(V),[0,a(ay),0]]],CF=[0,a(e),[0,a(V),0]],CG=[0,a(dg),27,5,27,44,[0,a("R\xc3\xa8gles diverses"),[0,a(dd),[0,a(t),0]]]],CH=a(k),Cw=[0,a(e),[0,a(V),[0,a(aw),0]]],Cx=[0,a(e),[0,a(V),0]],Cy=[0,a(e),[0,a(V),[0,a(ay),0]]],Cz=[0,a(e),[0,a(V),0]],CA=[0,a(ao),eL,3,eL,41,[0,a(a6),[0,a(L),[0,a(N),[0,a(H),[0,a(am),[0,a(B),0]]]]]]],CB=a("0.04"),Cq=[0,a(e),[0,a(V),[0,a(aw),0]]],Cr=[0,a(e),[0,a(V),0]],Cs=[0,a(e),[0,a(V),[0,a(ay),0]]],Ct=[0,a(e),[0,a(V),0]],Cu=[0,a(ao),95,3,96,44,[0,a(a6),[0,a(L),[0,a(N),[0,a(H),[0,a(am),[0,a(B),0]]]]]]],Cv=a(jn),Ck=[0,a(e),[0,a(V),[0,a(aw),0]]],Cl=[0,a(e),[0,a(V),0]],Cm=[0,a(e),[0,a(V),[0,a(ay),0]]],Cn=[0,a(e),[0,a(V),0]],Co=[0,a(ao),55,3,55,41,[0,a(a6),[0,a(L),[0,a(N),[0,a(H),[0,a(am),[0,a(B),0]]]]]]],Cp=a(f_),Cj=[0,a(o),eN,11,eN,47,[0,a(n),0]],Ci=[0,a(o),eN,11,eN,47,[0,a(n),0]],B$=[0,a(ao),cH,3,cH,41,[0,a(a6),[0,a(L),[0,a(N),[0,a(H),[0,a(am),[0,a(B),0]]]]]]],Ca=a(U),Cb=a(jn),Cc=a(k),B7=[0,a(ao),74,3,75,44,[0,a(a6),[0,a(L),[0,a(N),[0,a(H),[0,a(am),[0,a(B),0]]]]]]],B8=a(U),B9=a(f_),B_=a(k),B3=[0,a(ao),35,3,35,41,[0,a(a6),[0,a(L),[0,a(N),[0,a(H),[0,a(am),[0,a(B),0]]]]]]],B4=a(U),B5=a(lD),B6=a(k),B2=[0,a(o),dz,11,dz,47,[0,a(n),0]],BV=[0,a(ao),cH,3,cH,41,[0,a(a6),[0,a(L),[0,a(N),[0,a(H),[0,a(am),[0,a(B),0]]]]]]],BW=a(ax),BX=a(ax),BY=a("0.1025"),BZ=a(k),BQ=[0,a(ao),74,3,75,44,[0,a(a6),[0,a(L),[0,a(N),[0,a(H),[0,a(am),[0,a(B),0]]]]]]],BR=a(ax),BS=a(ax),BT=a("0.205"),BU=a(k),BL=[0,a(ao),35,3,35,41,[0,a(a6),[0,a(L),[0,a(N),[0,a(H),[0,a(am),[0,a(B),0]]]]]]],BM=a(ax),BN=a(ax),BO=a("0.41"),BP=a(k),BK=[0,a(o),dy,11,dy,56,[0,a(n),0]],BG=[0,a(ao),gD,5,gD,43,[0,a(dr),[0,a(L),[0,a(N),[0,a(H),[0,a(am),[0,a(B),0]]]]]]],BH=a("0.0559"),BE=[0,a(ao),229,5,lo,46,[0,a(dr),[0,a(L),[0,a(N),[0,a(H),[0,a(am),[0,a(B),0]]]]]]],BF=a("0.1117"),BC=[0,a(ao),jr,5,jr,43,[0,a(dr),[0,a(L),[0,a(N),[0,a(H),[0,a(am),[0,a(B),0]]]]]]],BD=a("0.20234"),BB=[0,a(o),bH,11,bH,47,[0,a(n),0]],Bu=a(a1),Bv=[0,a(ao),170,5,171,68,[0,a(a6),[0,a(L),[0,a(N),[0,a(H),[0,a(am),[0,a(B),0]]]]]]],Bw=a(a1),Bx=a(cz),By=a(a1),Bp=a(a1),Bq=[0,a(ao),162,5,163,68,[0,a(a6),[0,a(L),[0,a(N),[0,a(H),[0,a(am),[0,a(B),0]]]]]]],Br=a(a1),Bs=a(cz),Bt=a(a1),Bo=[0,a(o),es,11,es,31,[0,a(n),0]],Bn=a(k),Bm=[0,a(o),es,11,es,31,[0,a(n),0]],Bg=[0,a(e),[0,a(bg),[0,a(aw),0]]],Bh=[0,a(e),[0,a(bg),0]],Bi=[0,a(e),[0,a(bg),[0,a(ay),0]]],Bj=[0,a(e),[0,a(bg),0]],Bk=[0,a(ai),313,5,lx,58,[0,a(lz),[0,a(L),[0,a(N),[0,a(H),[0,a(ah),[0,a(B),0]]]]]]],A9=[0,a(e),[0,a(dv),[0,a(aw),0]]],A_=[0,a(e),[0,a(dv),0]],A$=[0,a(e),[0,a(dv),[0,a(ay),0]]],Ba=[0,a(e),[0,a(dv),0]],Bb=[0,a(e),[0,a(bg),[0,a(aw),0]]],Bc=[0,a(e),[0,a(bg),0]],Bd=[0,a(e),[0,a(bg),[0,a(ay),0]]],Be=[0,a(e),[0,a(bg),0]],Bf=[0,a(ai),299,5,300,58,[0,a(lz),[0,a(L),[0,a(N),[0,a(H),[0,a(ah),[0,a(B),0]]]]]]],A8=[0,a(o),eL,11,eL,34,[0,a(n),0]],Ed=[8,0],Ee=a(U),Ef=[0,a(v),344,5,345,72,[0,a(kC),[0,a(I),[0,a(J),[0,a(t),0]]]]],Eb=a(U),Ec=[0,a(ai),406,5,407,72,[0,a(go),[0,a(bZ),[0,a(eH),[0,a(bG),[0,a(ah),[0,a(B),0]]]]]]],Ea=[0,a(o),eG,11,eG,28,[0,a(n),0]],D_=a(ax),D$=[0,a(ai),ev,5,ev,70,[0,a(l3),[0,a(L),[0,a(N),[0,a(H),[0,a(ah),[0,a(B),0]]]]]]],AV=[0,a(e),[0,a(bE),[0,a(aw),0]]],AW=[0,a(e),[0,a(bE),0]],AX=[0,a(e),[0,a(bE),[0,a(ay),0]]],AY=[0,a(e),[0,a(bE),0]],AZ=a(cz),A0=a(kn),A1=a(dt),AM=[0,a(v),lV,5,lV,49,[0,a(M),[0,a(I),[0,a(J),[0,a(t),0]]]]],AN=a(k),AO=a("5728"),AP=a(k),AI=[0,a(v),497,5,498,53,[0,a(M),[0,a(I),[0,a(J),[0,a(t),0]]]]],AJ=a(k),AK=a("0.0717"),AL=a(k),AE=[0,a(v),489,5,490,53,[0,a(M),[0,a(I),[0,a(J),[0,a(t),0]]]]],AF=a(k),AG=a("0.0847"),AH=a(k),AA=[0,a(v),481,5,482,53,[0,a(M),[0,a(I),[0,a(J),[0,a(t),0]]]]],AB=a(k),AC=a("0.0976"),AD=a(k),Aw=[0,a(v),473,5,474,53,[0,a(M),[0,a(I),[0,a(J),[0,a(t),0]]]]],Ax=a(k),Ay=a("0.115"),Az=a(k),As=[0,a(v),465,5,466,53,[0,a(M),[0,a(I),[0,a(J),[0,a(t),0]]]]],At=a(k),Au=a("0.1163"),Av=a(k),Ao=[0,a(v),457,5,458,53,[0,a(M),[0,a(I),[0,a(J),[0,a(t),0]]]]],Ap=a(k),Aq=a("0.122"),Ar=a(k),Ak=[0,a(v),449,5,450,53,[0,a(M),[0,a(I),[0,a(J),[0,a(t),0]]]]],Al=a(k),Am=a("0.1278"),An=a(k),Ag=[0,a(v),441,5,442,53,[0,a(M),[0,a(I),[0,a(J),[0,a(t),0]]]]],Ah=a(k),Ai=a("0.1335"),Aj=a(k),Ac=[0,a(v),433,5,434,53,[0,a(M),[0,a(I),[0,a(J),[0,a(t),0]]]]],Ad=a(k),Ae=a("0.1393"),Af=a(k),z_=[0,a(v),425,5,jq,53,[0,a(M),[0,a(I),[0,a(J),[0,a(t),0]]]]],z$=a(k),Aa=a("0.145"),Ab=a(k),z9=[0,a(o),ek,11,ek,54,[0,a(n),0]],z6=a(k),z7=a(ji),z8=a(k),z0=[0,a(v),j6,5,j6,69,[0,a(M),[0,a(I),[0,a(J),[0,a(t),0]]]]],z1=a(U),z2=a("0.3068"),z3=a(k),zW=[0,a(v),js,5,js,69,[0,a(M),[0,a(I),[0,a(J),[0,a(t),0]]]]],zX=a(U),zY=a("0.2936"),zZ=a(k),zS=[0,a(v),jR,5,jR,69,[0,a(M),[0,a(I),[0,a(J),[0,a(t),0]]]]],zT=a(U),zU=a("0.284"),zV=a(k),zO=[0,a(v),k2,5,k2,69,[0,a(M),[0,a(I),[0,a(J),[0,a(t),0]]]]],zP=a(U),zQ=a("0.2672"),zR=a(k),zK=[0,a(v),jj,5,jj,69,[0,a(M),[0,a(I),[0,a(J),[0,a(t),0]]]]],zL=a(U),zM=a("0.273"),zN=a(k),zG=[0,a(v),j0,5,j0,69,[0,a(M),[0,a(I),[0,a(J),[0,a(t),0]]]]],zH=a(U),zI=a("0.2555"),zJ=a(k),zC=[0,a(v),jS,5,jS,69,[0,a(M),[0,a(I),[0,a(J),[0,a(t),0]]]]],zD=a(U),zE=a("0.2496"),zF=a(k),zy=[0,a(v),lp,5,lp,69,[0,a(M),[0,a(I),[0,a(J),[0,a(t),0]]]]],zz=a(U),zA=a("0.2437"),zB=a(k),zu=[0,a(v),gl,5,gl,69,[0,a(M),[0,a(I),[0,a(J),[0,a(t),0]]]]],zv=a(U),zw=a("0.2379"),zx=a(k),zq=[0,a(v),kO,5,kO,69,[0,a(M),[0,a(I),[0,a(J),[0,a(t),0]]]]],zr=a(U),zs=a("0.232"),zt=a(k),zp=[0,a(o),dA,11,dA,55,[0,a(n),0]],zm=a(U),zn=a(lD),zo=a(k),zg=[0,a(v),lu,5,lu,69,[0,a(M),[0,a(I),[0,a(J),[0,a(t),0]]]]],zh=a(ax),zi=a("0.143"),zj=a(k),zc=[0,a(v),kq,5,kq,69,[0,a(M),[0,a(I),[0,a(J),[0,a(t),0]]]]],zd=a(ax),ze=a("0.1259"),zf=a(k),y_=[0,a(v),kl,5,kl,69,[0,a(M),[0,a(I),[0,a(J),[0,a(t),0]]]]],y$=a(ax),za=a("0.1089"),zb=a(k),y6=[0,a(v),iD,5,iD,69,[0,a(M),[0,a(I),[0,a(J),[0,a(t),0]]]]],y7=a(ax),y8=a("0.0918"),y9=a(k),y2=[0,a(v),lL,5,lL,69,[0,a(M),[0,a(I),[0,a(J),[0,a(t),0]]]]],y3=a(ax),y4=a("0.0842"),y5=a(k),yY=[0,a(v),lS,5,lS,69,[0,a(M),[0,a(I),[0,a(J),[0,a(t),0]]]]],yZ=a(ax),y0=a("0.0766"),y1=a(k),yU=[0,a(v),lH,5,lH,69,[0,a(M),[0,a(I),[0,a(J),[0,a(t),0]]]]],yV=a(ax),yW=a("0.069"),yX=a(k),yQ=[0,a(v),je,5,je,69,[0,a(M),[0,a(I),[0,a(J),[0,a(t),0]]]]],yR=a(ax),yS=a("0.075"),yT=a(k),yM=[0,a(v),kA,5,kA,69,[0,a(M),[0,a(I),[0,a(J),[0,a(t),0]]]]],yN=a(ax),yO=a("0.0539"),yP=a(k),yI=[0,a(v),jG,5,jG,69,[0,a(M),[0,a(I),[0,a(J),[0,a(t),0]]]]],yJ=a(ax),yK=a(jC),yL=a(k),yH=[0,a(o),eI,11,eI,56,[0,a(n),0]],yE=a(ax),yF=a(f_),yG=a(k),yv=a(U),yw=[0,a(ai),420,6,421,72,[0,a(go),[0,a(bZ),[0,a(eH),[0,a(bG),[0,a(ah),[0,a(B),0]]]]]]],yq=[0,a(an),[0,a(dm),[0,a(aw),0]]],yr=[0,a(an),[0,a(dm),0]],ys=[0,a(an),[0,a(dm),[0,a(ay),0]]],yt=[0,a(an),[0,a(dm),0]],yu=[0,a(ai),jN,5,125,59,[0,a(l3),[0,a(L),[0,a(N),[0,a(H),[0,a(ah),[0,a(B),0]]]]]]],yp=[0,a(o),bB,11,bB,35,[0,a(n),0]],yj=[0,a(v),lN,5,lN,69,[0,a(b0),[0,a(jZ),[0,a(bW),[0,a(t),0]]]]],yk=a(jl),yl=a("5827900"),yg=[0,a(v),bm,5,bm,69,[0,a(jF),[0,a(bW),[0,a(t),0]]]],yh=a(la),yi=a("5775900"),yd=[0,a(v),bT,5,bT,69,[0,a(iH),[0,a(bW),[0,a(t),0]]]],ye=a(lE),yf=a("5684900"),ya=[0,a(v),87,5,87,69,[0,a(lO),[0,a(bW),[0,a(t),0]]]],yb=a(k3),yc=a("5628600"),x$=[0,a(o),eq,11,eq,27,[0,a(n),0]],x9=a(l0),x_=a("5595000"),x4=[0,a(v),jX,5,jX,69,[0,a(b0),[0,a(jZ),[0,a(bW),[0,a(t),0]]]]],x5=a(jl),x6=a("8155800"),x1=[0,a(v),jD,5,jD,69,[0,a(jF),[0,a(bW),[0,a(t),0]]]],x2=a(la),x3=a("8083100"),xY=[0,a(v),bB,5,bB,69,[0,a(iH),[0,a(bW),[0,a(t),0]]]],xZ=a(lE),x0=a("7955800"),xV=[0,a(v),94,5,94,69,[0,a(lO),[0,a(bW),[0,a(t),0]]]],xW=a(k3),xX=a("7877000"),xU=[0,a(o),ex,11,ex,28,[0,a(n),0]],xS=a(l0),xT=a("7830000"),xL=[0,a(an),[0,a(di),[0,a(aw),0]]],xM=[0,a(an),[0,a(di),0]],xN=[0,a(an),[0,a(di),[0,a(ay),0]]],xO=[0,a(an),[0,a(di),0]],xI=[0,a(jc),83,19,83,69,[0,a("Article R521-1"),[0,a(L),[0,a(N),[0,a(H),[0,a(kK),[0,a(B),0]]]]]]],xH=a("14"),xG=[0,a(o),kp,11,kp,38,[0,a(n),0]],xi=[0,a(ai),269,5,270,48,[0,a(bk),[0,a(L),[0,a(N),[0,a(H),[0,a(ah),[0,a(B),0]]]]]]],xj=[0,0],xg=[0,a(ai),kt,5,259,56,[0,a(bk),[0,a(L),[0,a(N),[0,a(H),[0,a(ah),[0,a(B),0]]]]]]],xh=[1,0],xe=[0,a(ai),kI,5,kI,70,[0,a(bk),[0,a(L),[0,a(N),[0,a(H),[0,a(ah),[0,a(B),0]]]]]]],xf=[0,0],xc=[0,a(ai),kX,5,kX,69,[0,a(bk),[0,a(L),[0,a(N),[0,a(H),[0,a(ah),[0,a(B),0]]]]]]],xd=[0,0],xa=[0,a(ai),jE,5,jE,60,[0,a(bk),[0,a(L),[0,a(N),[0,a(H),[0,a(ah),[0,a(B),0]]]]]]],xb=[0,0],w$=[0,a(o),ca,11,ca,20,[0,a(n),0]],w_=[0,a(o),ca,11,ca,20,[0,a(n),0]],w7=[0,a(ai),263,5,kc,48,[0,a(bk),[0,a(L),[0,a(N),[0,a(H),[0,a(ah),[0,a(B),0]]]]]]],w8=[0,0],w5=[0,a(ai),li,5,dj,56,[0,a(bk),[0,a(L),[0,a(N),[0,a(H),[0,a(ah),[0,a(B),0]]]]]]],w6=[2,0],w3=[0,a(ai),jp,5,jp,70,[0,a(bk),[0,a(L),[0,a(N),[0,a(H),[0,a(ah),[0,a(B),0]]]]]]],w4=[1,0],w1=[0,a(ai),jT,5,jT,69,[0,a(bk),[0,a(L),[0,a(N),[0,a(H),[0,a(ah),[0,a(B),0]]]]]]],w2=[0,0],wZ=[0,a(ai),kZ,5,kZ,60,[0,a(bk),[0,a(L),[0,a(N),[0,a(H),[0,a(ah),[0,a(B),0]]]]]]],w0=[0,0],wY=[0,a(o),cB,11,cB,26,[0,a(n),0]],wX=[0,a(o),cB,11,cB,26,[0,a(n),0]],w9=[0,a(e),[0,a(bE),0]],xk=[0,a(e),[0,a("versement"),0]],xm=a(eQ),xl=[0,a(o),f$,11,f$,32,[0,a(n),0]],xn=[0,a(e),[0,a("nombre_enfants_l521_1"),0]],xp=a(eQ),xo=[0,a(o),bm,11,bm,41,[0,a(n),0]],xq=[0,a(e),[0,a("nombre_enfants_alin\xc3\xa9a_2_l521_3"),0]],xr=[0,a(e),[0,a(jM),[0,a(gx),0]]],xs=[0,a(e),[0,a(jM),[0,a(gx),0]]],xu=[0,a(e),[0,a("prestations_familiales.date_courante"),0]],xt=[0,a(o),70,10,70,23,[0,a(n),0]],xw=[1,0],xx=[0,a(e),[0,a("prestations_familiales.prestation_courante"),0]],xv=[0,a(o),71,10,71,29,[0,a(n),0]],xz=[0,a(e),[0,a("prestations_familiales.r\xc3\xa9sidence"),0]],xy=[0,a(o),72,10,72,19,[0,a(n),0]],xA=[0,a(e),[0,a(lm),[0,a(an),0]]],xB=[0,a(e),[0,a(lm),[0,a(an),0]]],xD=[0,a(e),[0,a("enfant_le_plus_\xc3\xa2g\xc3\xa9.enfants"),0]],xC=[0,a(o),84,10,84,17,[0,a(n),0]],xE=[0,a(e),[0,a(ka),[0,a(gG),0]]],xF=[0,a(e),[0,a(ka),[0,a(gG),0]]],xJ=[0,a(e),[0,a(bg),0]],xK=[0,a(o),aR,11,aR,61,[0,a(n),0]],xP=[0,a(e),[0,a("enfants_\xc3\xa0_charge_droit_ouvert_prestation_familiale"),0]],xQ=[0,a(e),[0,a(dv),0]],xR=[0,a(o),ex,11,ex,28,[0,a(n),0]],x7=[0,a(e),[0,a("plafond_II_d521_3"),0]],x8=[0,a(o),eq,11,eq,27,[0,a(n),0]],ym=[0,a(e),[0,a("plafond_I_d521_3"),0]],Ek=a(U),El=[0,a(ai),jq,5,427,71,[0,a(go),[0,a(bZ),[0,a(eH),[0,a(bG),[0,a(ah),[0,a(B),0]]]]]]],yn=[0,a(o),ko,11,ko,34,[0,a(n),0]],yo=[0,a(e),[0,a("droit_ouvert_compl\xc3\xa9ment"),0]],yx=[0,a(e),[0,a(dq),0]],yz=a(eQ),yA=a(eQ),yB=a(jC),Ej=a(k),yy=[0,a(o),dp,11,dp,64,[0,a(n),0]],yC=[0,a(e),[0,a("montant_initial_base_quatri\xc3\xa8me_enfant_et_plus_mayotte"),0]],yD=[0,a(o),eI,11,eI,56,[0,a(n),0]],zk=[0,a(e),[0,a("montant_initial_base_troisi\xc3\xa8me_enfant_mayotte"),0]],zl=[0,a(o),dA,11,dA,55,[0,a(n),0]],z4=[0,a(e),[0,a("montant_initial_base_deuxi\xc3\xa8me_enfant_mayotte"),0]],z5=[0,a(o),ek,11,ek,54,[0,a(n),0]],AQ=[0,a(e),[0,a("montant_initial_base_premier_enfant_mayotte"),0]],AR=[0,a(o),iS,11,iS,31,[0,a(n),0]],AS=[0,a(e),[0,a("nombre_total_enfants"),0]],AU=a(dt),AT=[0,a(o),gz,11,gz,31,[0,a(n),0]],A2=[0,a(e),[0,a("nombre_moyen_enfants"),0]],Eg=a(U),Eh=[0,a(ao),ku,5,360,71,[0,a(eR),[0,a(bZ),[0,a(de),[0,a(bG),[0,a(am),[0,a(B),0]]]]]]],Ei=a(ji),A4=a(k),A3=[0,a(o),gI,11,gI,46,[0,a(n),0]],A5=[0,a(e),[0,a("montant_initial_base_premier_enfant"),0]],A6=[0,a(o),eG,11,eG,28,[0,a(n),0]],A7=[0,a(e),[0,a("droit_ouvert_base"),0]],Bl=[0,a(e),[0,a(V),0]],Bz=[0,a(e),[0,a(dx),0]],BA=[0,a(o),bH,11,bH,47,[0,a(n),0]],BI=[0,a(e),[0,a("montant_vers\xc3\xa9_forfaitaire_par_enfant"),0]],BJ=[0,a(o),dy,11,dy,56,[0,a(n),0]],B0=[0,a(e),[0,a("montant_initial_base_troisi\xc3\xa8me_enfant_et_plus"),0]],B1=[0,a(o),dz,11,dz,47,[0,a(n),0]],Cd=[0,a(e),[0,a("montant_initial_base_deuxi\xc3\xa8me_enfant"),0]],Cf=a(dt),Cg=a(dt),Ce=[0,a(o),cH,11,cH,38,[0,a(n),0]],Ch=[0,a(e),[0,a("rapport_enfants_total_moyen"),0]],CI=[0,a(e),[0,a(dl),0]],CK=a(k),CJ=[0,a(o),iQ,11,iQ,36,[0,a(n),0]],CQ=[0,a(e),[0,a("montant_vers\xc3\xa9_forfaitaire"),0]],CR=[0,a(o),eu,11,eu,31,[0,a(n),0]],CX=[0,a(e),[0,a("montant_initial_base"),0]],Dj=[0,a(e),[0,a(df),0]],Dk=[0,a(o),eB,11,eB,52,[0,a(n),0]],Dx=[0,a(e),[0,a("montant_vers\xc3\xa9_compl\xc3\xa9ment_pour_forfaitaire"),0]],Dy=[0,a(o),gp,11,gp,43,[0,a(n),0]],Dz=[0,a(e),[0,a("montant_avec_garde_altern\xc3\xa9e_base"),0]],DM=[0,a(e),[0,a(dk),0]],D9=a(k),DN=[0,a(o),lG,11,lG,29,[0,a(n),0]],DO=[0,a(e),[0,a("montant_vers\xc3\xa9_base"),0]],DQ=a(k),D8=a(k),DP=[0,a(o),kz,11,kz,35,[0,a(n),0]],DV=[0,a(e),[0,a("montant_vers\xc3\xa9_majoration"),0]],DW=[0,a(o),kT,11,kT,58,[0,a(n),0]],DX=[0,a(e),[0,a("montant_base_compl\xc3\xa9ment_pour_base_et_majoration"),0]],DZ=[0,a(e),[0,a(dx),[0,a(aw),0]]],D0=[0,a(e),[0,a(dx),0]],D1=[0,a(e),[0,a(dx),[0,a(ay),0]]],D2=[0,a(e),[0,a(dx),0]],D7=a(k),DY=[0,a(o),kd,11,kd,59,[0,a(n),0]],D3=[0,a(e),[0,a("montant_vers\xc3\xa9_compl\xc3\xa9ment_pour_base_et_majoration"),0]],D6=a(k),D4=[0,a(o),iI,10,iI,23,[0,a(n),0]],D5=[0,a(e),[0,a("montant_vers\xc3\xa9"),0]],wK=[0,a(ai),60,5,62,32,[0,a(gq),[0,a(gj),[0,a(ge),[0,a(H),[0,a(ah),[0,a(B),0]]]]]]],wJ=[0,a(ai),49,5,50,50,[0,a(gq),[0,a(gj),[0,a(ge),[0,a(H),[0,a(ah),[0,a(B),0]]]]]]],wI=[0,a(o),65,10,65,22,[0,a(n),0]],wH=[0,a(o),65,10,65,22,[0,a(n),0]],wF=[0,a(ai),68,5,71,57,[0,a(gq),[0,a(gj),[0,a(ge),[0,a(H),[0,a(ah),[0,a(B),0]]]]]]],wE=[0,a(o),66,10,66,29,[0,a(n),0]],wp=[0,a(v),60,5,61,34,[0,a("Instruction interminist\xc3\xa9rielle n\xc2\xb0DSS/2B/2021/65 du 19 mars 2021 relative \xc3\xa0 la revalorisation au 1er avril 2021 des prestations familiales servies en m\xc3\xa9tropole, en Guadeloupe, en Guyane, en Martinique, \xc3\xa0 la R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy, \xc3\xa0 Saint-Martin et dans le d\xc3\xa9partement de Mayotte"),[0,a(gi),[0,a(t),0]]]],wq=a("41481"),wn=[0,a(v),44,5,45,34,[0,a("Instruction interminist\xc3\xa9rielle no DSS/SD2B/2020/33 du 18 f\xc3\xa9vrier 2020 relative \xc3\xa0 la revalorisation au 1er avril 2020 des prestations familiales servies en m\xc3\xa9tropole, en Guadeloupe, en Guyane, en Martinique, \xc3\xa0 La R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy, \xc3\xa0 Saint-Martin et dans le d\xc3\xa9partement de Mayotte"),[0,a(gi),[0,a(t),0]]]],wo=a("41404"),wl=[0,a(v),24,5,25,34,[0,a("Instruction minist\xc3\xa9rielle N\xc2\xb0DSS/SD2B/2019/65 du 25 mars 2019 relative \xc3\xa0 la revalorisation au 1er avril 2019 des prestations familiales servies en m\xc3\xa9tropole"),[0,a(gi),[0,a(t),0]]]],wm=a("41316"),wk=[0,a(o),74,10,74,24,[0,a(n),0]],wh=a("20"),wg=[0,a(o),68,10,68,22,[0,a(n),0]],wi=[0,a(an),[0,a("\xc3\xa2ge_l512_3_2"),0]],wj=[0,a(o),74,10,74,24,[0,a(n),0]],wr=[0,a(an),[0,a("base_mensuelle"),0]],wt=[0,a(an),[0,a("smic.date_courante"),0]],ws=[0,a(o),41,10,41,23,[0,a(n),0]],wv=[0,a(an),[0,a("smic.r\xc3\xa9sidence"),0]],wu=[0,a(o),42,10,42,19,[0,a(n),0]],ww=[0,a(an),[0,a(lU),[0,a(gh),0]]],wx=[0,a(an),[0,a(lU),[0,a(gh),0]]],wP=[0,0],wR=[1,0],wS=[2,0],wT=[3,0],wU=[4,0],wV=[5,0],wQ=[0,a(ai),354,5,ku,30,[0,a("Article L751-1"),[0,a("Chapitre 1er : G\xc3\xa9n\xc3\xa9ralit\xc3\xa9s"),[0,a(eH),[0,a(bG),[0,a(ah),[0,a(B),0]]]]]]],wy=[0,a(o),69,10,69,33,[0,a(n),0]],wz=[0,a(an),[0,a("r\xc3\xa9gime_outre_mer_l751_1"),0]],wM=[0,a(jc),i9,18,i9,41,[0,a("Article R755-0-2"),[0,a(bZ),[0,a(de),[0,a(bG),[0,a(kK),[0,a(B),0]]]]]]],wN=a(ln),wO=a(jA),wB=a(ln),wC=a(jA),wA=[0,a(o),67,11,67,27,[0,a(n),0]],wD=[0,a(an),[0,a("plafond_l512_3_2"),0]],wG=[0,a(an),[0,a(dm),0]],wL=[0,a(an),[0,a(di),0]],v$=[2,0],wa=a(k),wb=a(k),wc=[1,0],wd=a(U),v_=[0,a(o),85,10,85,21,[0,a(n),0]],we=[0,a(gG),[0,a("le_plus_\xc3\xa2g\xc3\xa9"),0]],v7=a(gc),v6=[0,a(o),81,10,81,37,[0,a(n),0]],v8=[0,a(gx),[0,a(bg),0]],v1=[8,0],v2=[0,a(v),lx,5,317,6,[0,a(b0),[0,a(iJ),[0,a(cy),[0,a(t),0]]]]],v3=a("774"),vR=[6,0],vU=[0,0],vV=[1,0],vW=[2,0],vX=[3,0],vY=[4,0],vZ=[5,0],v0=[7,0],vS=[0,a(v),297,5,306,6,[0,a(b0),[0,a(iJ),[0,a(cy),[0,a(t),0]]]]],vT=a("1025"),vO=[8,0],vP=[0,a(v),276,5,278,6,[0,a(b0),[0,a(i$),[0,a(cy),[0,a(t),0]]]]],vQ=a("766"),vE=[6,0],vH=[0,0],vI=[1,0],vJ=[2,0],vK=[3,0],vL=[4,0],vM=[5,0],vN=[7,0],vF=[0,a(v),kt,5,267,6,[0,a(b0),[0,a(i$),[0,a(cy),[0,a(t),0]]]]],vG=a("1015"),vB=[8,0],vC=[0,a(v),237,5,239,6,[0,a(b0),[0,a(iF),[0,a(cy),[0,a(t),0]]]]],vD=a("757"),vr=[6,0],vu=[0,0],vv=[1,0],vw=[2,0],vx=[3,0],vy=[4,0],vz=[5,0],vA=[7,0],vs=[0,a(v),219,5,228,6,[0,a(b0),[0,a(iF),[0,a(cy),[0,a(t),0]]]]],vt=a("1003"),vq=[0,a(o),43,10,43,22,[0,a(n),0]],vp=[0,a(o),43,10,43,22,[0,a(n),0]],v4=[0,a(gh),[0,a("brut_horaire"),0]],vg=a("a_d\xc3\xa9j\xc3\xa0_ouvert_droit_aux_allocations_familiales"),vh=a("prise_en_charge"),vi=a("\xc3\xa2ge"),vj=a("date_de_naissance"),vk=a("r\xc3\xa9muneration_mensuelle"),vl=a("obligation_scolaire"),vm=a("identifiant"),vn=[0,a("Enfant"),0],u9=a("PrestationAccueilJeuneEnfant"),u$=a(e),va=a("Compl\xc3\xa9mentFamilial"),vb=a("AllocationLogement"),vc=a("Allocation\xc3\x89ducationEnfantHandicap\xc3\xa9"),vd=a("AllocationSoutienFamilial"),ve=a("AllocationRentr\xc3\xa9eScolaire"),vf=a("AllocationJournali\xc3\xa8rePresenceParentale"),u_=[0,a("\xc3\x89l\xc3\xa9mentPrestationsFamiliales"),0],uY=a(j8),u0=a(kL),u1=a(i7),u2=a("LaR\xc3\xa9union"),u3=a("SaintBarth\xc3\xa9lemy"),u4=a("SaintMartin"),u5=a(jU),u6=a("SaintPierreEtMiquelon"),u7=a(lg),uZ=[0,a("Collectivit\xc3\xa9"),0],uU=a("Avant"),uW=a("Pendant"),uX=a("Apr\xc3\xa8s"),uV=[0,a("SituationObligationScolaire"),0],uO=a("GardeAltern\xc3\xa9ePartageAllocations"),uQ=a("GardeAltern\xc3\xa9eAllocataireUnique"),uR=a("EffectiveEtPermanente"),uS=a("ServicesSociauxAllocationVers\xc3\xa9e\xc3\x80LaFamille"),uT=a("ServicesSociauxAllocationVers\xc3\xa9eAuxServicesSociaux"),uP=[0,a("PriseEnCharge"),0],EM=a("Jsoo_runtime.Error.Exn"),EN=a(gf),Fr=a("Begin call"),Fs=a("End call"),Ft=a("Variable definition"),Fu=a("Decision taken"),E8=a("Confi\xc3\xa9 aux service sociaux, allocation vers\xc3\xa9e aux services sociaux"),E9=a("Confi\xc3\xa9 aux service sociaux, allocation vers\xc3\xa9e \xc3\xa0 la famille"),E_=a("Effective et permanente"),E$=a("Garde altern\xc3\xa9e, allocataire unique"),Fa=a("Garde altern\xc3\xa9e, partage des allocations"),Fc=[0,0],Fd=[1,0],Fe=[2,0],Ff=[3,0],Fg=[4,0],Fb=a("Unknown prise en charge"),EY=a(j8),EZ=a(kL),E0=a("La R\xc3\xa9union"),E1=a(i7),E2=a(lg),E3=a(jU),E4=a("Saint Barth\xc3\xa9lemy"),E5=a("Saint Martin"),E6=a("Saint Pierre et Miquelon"),Fh=[7,0],Fi=[5,0],Fj=[4,0],Fk=[6,0],Fl=[8,0],Fm=[2,0],Fn=[3,0],Fo=[1,0],Fp=[0,0],E7=a("unknown collectivite!"),EW=a(q),EU=[0,[4,0,0,0,[12,68,[4,0,0,0,[12,77,[4,0,0,0,[12,89,0]]]]]],a("%dD%dM%dY")],ET=[0,a(kU),a(k1),a(ll)];function +a=u;if(a.process&&a.process.on)a.process.on("uncaughtException",function(b,c){md(b);a.process.exit(2)});else +if(a.addEventListener)a.addEventListener("error",function(a){if(a.error)md(a.error)})}Gs();function +d(a,b){return a.length==1?a(b):a8(a,[b])}function +g(a,b,c){return a.length==2?a(b,c):a8(a,[b,c])}function +P(a,b,c,d){return a.length==3?a(b,c,d):a8(a,[b,c,d])}function +f9(a,b,c,d,e,f){return a.length==5?a(b,c,d,e,f):a8(a,[b,c,d,e,f])}function +FF(a,b,c,d,e,f,g,h){return a.length==7?a(b,c,d,e,f,g,h):a8(a,[b,c,d,e,f,g,h])}FT();var +fc=[I,a(kg),-1],ha=[I,a(kD),-2],dM=[I,a(gv),-3],g8=[I,a(k$),-4],hb=[I,a(jO),-6],aH=[I,a(lf),-7],g_=[I,a(iY),-8],g$=[I,a(li),-9],F=[I,a(lC),-11],hc=[I,a(kq),gu],FE=[4,0,0,0,[12,45,[4,0,0,0,0]]],fn=[0,[11,a('File "'),[2,0,[11,a('", line '),[4,0,0,0,[11,a(kU),[4,0,0,0,[12,45,[4,0,0,0,[11,a(": "),[2,0,0]]]]]]]]]],a('File "%s", line %d, characters %d-%d: %s')],cr=[0,0,0],ej=[0,a(kZ),a(kS),a(lj)];a4(11,hc,kq);a4(10,F,lC);a4(9,[I,a(jj),-10],jj);a4(8,g$,li);a4(7,g_,iY);a4(6,aH,lf);a4(5,hb,jO);a4(4,[I,a(kH),-5],kH);a4(3,g8,k$);a4(2,dM,gv);a4(1,ha,kD);a4(0,fc,kg);var +mT=a("output_substring"),mQ=a("%.12g"),mP=a(bf),mN=a("true"),mO=a("false"),mE=a("Stdlib.Exit"),mG=b6(0,0,ld),mI=b6(0,0,65520),mK=b6(1,0,ld),mW=a("\\\\"),mX=a("\\'"),mY=a("\\b"),mZ=a("\\t"),m0=a("\\n"),m1=a("\\r"),mV=a("Char.chr"),m2=a("hd"),m5=a("String.blit / Bytes.blit_string"),m4=a("Bytes.blit"),m3=a("String.sub / Bytes.sub"),m7=a("String.contains_from / Bytes.contains_from"),m_=a("Array.blit"),m9=a("Array.sub"),nd=a("Map.remove_min_elt"),ne=[0,0,0,0],nf=[0,a("map.ml"),gr,10],ng=[0,0,0],m$=a(er),na=a(er),nb=a(er),nc=a(er),nh=a("Stdlib.Queue.Empty"),nj=a("CamlinternalLazy.Undefined"),nq=a("Buffer.add_substring/add_subbytes"),np=a("Buffer.add: cannot grow buffer"),no=[0,a(lp),93,2],nn=[0,a(lp),94,2],nz=a("%c"),nA=a("%s"),nB=a(kp),nC=a(iW),nD=a(k9),nE=a(kz),nF=a("%f"),nG=a("%B"),nH=a("%{"),nI=a("%}"),nJ=a("%("),nK=a("%)"),nL=a("%a"),nM=a("%t"),nN=a("%?"),nO=a("%r"),nP=a("%_r"),nQ=[0,a(al),850,23],n1=[0,a(al),814,21],nT=[0,a(al),815,21],n2=[0,a(al),818,21],nU=[0,a(al),819,21],n3=[0,a(al),822,19],nV=[0,a(al),823,19],n4=[0,a(al),826,22],nW=[0,a(al),827,22],n5=[0,a(al),831,30],nX=[0,a(al),832,30],nZ=[0,a(al),836,26],nR=[0,a(al),837,26],n0=[0,a(al),846,28],nS=[0,a(al),847,28],nY=[0,a(al),851,23],o8=a(je),o6=[0,a(al),1558,4],o7=a("Printf: bad conversion %["),o9=[0,a(al),1626,39],o_=[0,a(al),1649,31],o$=[0,a(al),1650,31],pa=a("Printf: bad conversion %_"),pb=a(ja),pc=a(jl),pd=a(ja),pe=a(jl),o4=a(gx),o2=a("neg_infinity"),o3=a(lG),o1=a(bf),oW=[0,ca],oK=a("%+nd"),oL=a("% nd"),oN=a("%+ni"),oO=a("% ni"),oP=a("%nx"),oQ=a("%#nx"),oR=a("%nX"),oS=a("%#nX"),oT=a("%no"),oU=a("%#no"),oJ=a("%nd"),oM=a(k9),oV=a("%nu"),ox=a("%+ld"),oy=a("% ld"),oA=a("%+li"),oB=a("% li"),oC=a("%lx"),oD=a("%#lx"),oE=a("%lX"),oF=a("%#lX"),oG=a("%lo"),oH=a("%#lo"),ow=a("%ld"),oz=a(iW),oI=a("%lu"),ok=a("%+Ld"),ol=a("% Ld"),on=a("%+Li"),oo=a("% Li"),op=a("%Lx"),oq=a("%#Lx"),or=a("%LX"),os=a("%#LX"),ot=a("%Lo"),ou=a("%#Lo"),oj=a("%Ld"),om=a(kz),ov=a("%Lu"),n9=a("%+d"),n_=a("% d"),oa=a("%+i"),ob=a("% i"),oc=a("%x"),od=a("%#x"),oe=a("%X"),of=a("%#X"),og=a("%o"),oh=a("%#o"),n8=a(gF),n$=a(kp),oi=a(je),nr=a("@]"),ns=a("@}"),nt=a("@?"),nu=a("@\n"),nv=a("@."),nw=a("@@"),nx=a("@%"),ny=a("@"),n6=a("CamlinternalFormat.Type_mismatch"),pi=a(p),pj=[0,[11,a(eL),[2,0,[2,0,0]]],a(", %s%s")],pI=[0,[11,a(gC),[2,0,[12,10,0]]],a(lx)],pJ=[0,[11,a("Fatal error in uncaught exception handler: exception "),[2,0,[12,10,0]]],a("Fatal error in uncaught exception handler: exception %s\n")],pH=a("Fatal error: out of memory in uncaught exception handler"),pF=[0,[11,a(gC),[2,0,[12,10,0]]],a(lx)],pB=[0,[2,0,[12,10,0]],a("%s\n")],pt=a("Raised at"),pu=a("Re-raised at"),pv=a("Raised by primitive operation at"),pw=a("Called from"),px=a(" (inlined)"),pz=a(p),py=[0,[2,0,[12,32,[2,0,[11,a(' in file "'),[2,0,[12,34,[2,0,[11,a(", line "),[4,0,0,0,[11,a(kU),FE]]]]]]]]]],a('%s %s in file "%s"%s, line %d, characters %d-%d')],pA=[0,[2,0,[11,a(" unknown location"),0]],a("%s unknown location")],po=a("Out of memory"),pp=a("Stack overflow"),pq=a("Pattern matching failed"),pr=a("Assertion failed"),ps=a("Undefined recursive module"),pk=[0,[12,40,[2,0,[2,0,[12,41,0]]]],a("(%s%s)")],pl=a(p),pm=a(p),pn=[0,[12,40,[2,0,[12,41,0]]],a("(%s)")],ph=[0,[4,0,0,0,0],a(gF)],pf=[0,[3,0,0],a("%S")],pg=a(la),pC=[0,a(p),a("(Cannot print locations:\n bytecode executable program file not found)"),a("(Cannot print locations:\n bytecode executable program file appears to be corrupt)"),a("(Cannot print locations:\n bytecode executable program file has wrong magic number)"),a("(Cannot print locations:\n bytecode executable program file cannot be opened;\n -- too many open files. Try running with OCAMLRUNPARAM=b=2)")],pM=a("Fun.Finally_raised: "),pK=a("Stdlib.Fun.Finally_raised"),pN=a(ls),FC=a("OCAMLRUNPARAM"),FA=a("CAMLRUNPARAM"),pO=a(p),p$=[3,0,3],qa=a(bf),p6=a(eW),p7=a("<\/"),p8=a(p),p2=a(eW),p3=a(gn),p4=a(p),p0=a("\n"),pZ=[0,a(p)],pV=a(p),pW=a(p),pX=a(p),pY=a(p),pT=[0,a(p),0,a(p)],pS=a(p),pR=a("Stdlib.Format.String_tag"),qn=a(p),qs=a(js),qu=a(lV),qv=a(ki),qw=a(iN),qx=a(ke),qy=a(kP),qz=a(jH),qA=a(k3),qB=a(gd),qC=a(jK),qD=a(k2),qE=a(j9),qF=a(k4),qG=a(jG),qH=a(iz),qI=a(lY),qJ=a(iM),qK=a(iU),qL=a(j1),qM=a(kB),qN=a(eU),qO=a(i7),qP=a(lJ),qQ=a(k8),qR=a(lv),qS=a(kt),qT=a(eO),qU=a(gG),qV=a(i3),qW=a(i2),qX=a(jV),qY=a(lM),qZ=a(lH),q0=a(lQ),q1=a(jt),q2=a(iX),q3=a(jg),q4=a(kK),q5=a(lT),q6=a(j6),q7=a(jy),q8=a(kh),q9=a(iT),q_=a(j_),q$=a(iC),ra=a(k6),rb=a(lF),rc=a(jw),rd=a(i5),re=a(j4),rf=a(ku),rg=a(jN),rh=a(kF),ri=a(kd),rj=a(k5),rk=a(jJ),rl=a(ju),rm=a(lo),rn=a(kW),ro=a(lz),rp=a(kT),rq=a(kO),rr=a(kN),rs=a(iS),rt=a(jA),ru=a(jc),rv=a(lc),rw=a(lt),rx=[0,[11,a("EUNKNOWNERR "),[4,0,0,0,0]],a("EUNKNOWNERR %d")],qt=[0,[11,a("Unix.Unix_error(Unix."),[2,0,[11,a(eL),[3,0,[11,a(eL),[3,0,[12,41,0]]]]]]],a("Unix.Unix_error(Unix.%s, %S, %S)")],qo=a(dv),qp=a(p),qq=a(p),qr=a(dv),ry=a("0.0.0.0"),rz=a("127.0.0.1"),Fz=a("::"),Fy=a("::1"),rP=a(p),rQ=a(p),rW=[0,92],rY=a("\\( group not closed by \\)"),rX=[0,a(iF),gl,10],rZ=a("[ class not closed by ]"),r0=a("spurious \\) in regular expression"),rS=a("too many r* or r+ where r is nullable"),rT=a(p),rU=a(p),rR=[0,a(iF),213,11],r6=[0,a(kL),52,4],r5=[0,a(kL),58,34],r4=a("Not a valid time zone"),ug=a("Not a month"),ue=a("Not a day"),ub=a("from_business: bad week"),uc=a("from_business: bad date"),to=[0,a(kv),jM,4],tn=[0,a(kv),dB,4],tg=[0,-4713,12,31],th=[0,kY,1,23],ti=[0,dp,10,14],tj=[0,dp,10,5],te=a("Date.Out_of_bounds"),tf=a("Date.Undefined"),tE=a("Date.Period.Not_computable"),tN=[0,31,59,90,bT,f$,181,212,gE,273,304,334,eB],uk=[0,a(eQ),429,6],uj=[0,a(eQ),lm,4],ui=[0,a(eQ),167,6],uh=[0,a(eQ),67,4],uo=a("[a-zA-Z]+"),ut=b6(1,0,0),up=a("Z.Overflow"),uq=a(gk),ux=a(p),uy=a("+inf"),uz=a("-inf"),uA=a(lN),uB=a("undef"),uD=[0,a("q.ml"),486,25],uC=a("Q.of_string: invalid digit"),uv=a("impossible case"),uE=a("Runtime.EmptyError"),uF=a("Runtime.AssertionFailed"),uH=a("Runtime.ConflictError"),uJ=a("Runtime.ImpossibleDate"),uL=a("Runtime.NoValueProvided"),Ep=[0,0],Eq=[1,0],Er=[2,0],Eo=[0,a(dh),74,11,74,27,[0,a(ev),[0,a(de),[0,a(t),0]]]],Es=[0,a(a6),[0,a("enfants_\xc3\xa0_charge"),0]],EM=[0,a(dh),90,20,90,69,[0,a(ev),[0,a(de),[0,a(t),0]]]],Eu=[0,a(a6),[0,a("allocations_familiales.personne_charge_effective_permanente_est_parent"),0]],Et=[0,a(o),90,10,90,57,[0,a(n),0]],EL=[0,a(dh),93,20,93,74,[0,a(ev),[0,a(de),[0,a(t),0]]]],Ew=[0,a(a6),[0,a("allocations_familiales.personne_charge_effective_permanente_remplit_titre_I"),0]],Ev=[0,a(o),91,10,91,62,[0,a(n),0]],Ey=[0,a(a6),[0,a("allocations_familiales.ressources_m\xc3\xa9nage"),0]],Ex=[0,a(o),92,10,92,27,[0,a(n),0]],EA=[0,a(a6),[0,a("allocations_familiales.r\xc3\xa9sidence"),0]],Ez=[0,a(o),93,10,93,19,[0,a(n),0]],EC=[0,a(a6),[0,a("allocations_familiales.date_courante"),0]],EB=[0,a(o),96,10,96,23,[0,a(n),0]],EE=[0,a(a6),[0,a("allocations_familiales.enfants_\xc3\xa0_charge"),0]],ED=[0,a(o),99,10,99,26,[0,a(n),0]],EK=[0,a(dh),96,20,96,66,[0,a(ev),[0,a(de),[0,a(t),0]]]],EG=[0,a(a6),[0,a("allocations_familiales.avait_enfant_\xc3\xa0_charge_avant_1er_janvier_2012"),0]],EF=[0,a(o),bT,10,bT,54,[0,a(n),0]],EH=[0,a(a6),[0,a(iQ),[0,a(f),0]]],EI=[0,a(a6),[0,a(iQ),[0,a(f),0]]],EJ=[0,a(a6),[0,a("i_montant_vers\xc3\xa9"),0]],DS=[0,a(f),[0,a(dl),[0,a(aw),0]]],DT=[0,a(f),[0,a(dl),0]],DU=[0,a(f),[0,a(dl),[0,a(ay),0]]],DV=[0,a(f),[0,a(dl),0]],DC=[0,a(f),[0,a(bE),[0,a(aw),0]]],DD=[0,a(f),[0,a(bE),0]],DE=[0,a(f),[0,a(bE),[0,a(ay),0]]],DF=[0,a(f),[0,a(bE),0]],DG=a(cz),DL=a(kl),DM=a(du),DH=[0,a(f),[0,a(dg),[0,a(aw),0]]],DI=[0,a(f),[0,a(dg),0]],DJ=[0,a(f),[0,a(dg),[0,a(ay),0]]],DK=[0,a(f),[0,a(dg),0]],DB=[0,a(o),ka,11,ka,49,[0,a(n),0]],Dt=a(a1),Du=[0,a(ao),272,5,274,41,[0,a(ds),[0,a(L),[0,a(N),[0,a(H),[0,a(am),[0,a(B),0]]]]]]],Dv=a(a1),Dw=a(cz),Dx=a(a1),Do=a(a1),Dp=[0,a(ao),262,5,kb,42,[0,a(ds),[0,a(L),[0,a(N),[0,a(H),[0,a(am),[0,a(B),0]]]]]]],Dq=a(a1),Dr=a(cz),Ds=a(a1),Dn=[0,a(o),eD,11,eD,52,[0,a(n),0]],Dm=a(k),Dc=[0,a(f),[0,a(V),[0,a(aw),0]]],Dd=[0,a(f),[0,a(V),0]],De=[0,a(f),[0,a(V),[0,a(ay),0]]],Df=[0,a(f),[0,a(V),0]],Dg=a(U),Dh=a(gc),Di=[0,a(ao),382,5,385,23,[0,a(eT),[0,a(bZ),[0,a(df),[0,a(bG),[0,a(am),[0,a(B),0]]]]]]],Dj=a("0.0567"),C5=[0,a(f),[0,a(V),[0,a(aw),0]]],C6=[0,a(f),[0,a(V),0]],C7=[0,a(f),[0,a(V),[0,a(ay),0]]],C8=[0,a(f),[0,a(V),0]],C9=a(U),C_=a("11"),C$=a(gc),Da=[0,a(ao),373,5,376,42,[0,a(eT),[0,a(bZ),[0,a(df),[0,a(bG),[0,a(am),[0,a(B),0]]]]]]],Db=a("0.0369"),C4=[0,a(o),ek,11,ek,37,[0,a(n),0]],C0=[0,a(f),[0,a(dm),[0,a(aw),0]]],C1=[0,a(f),[0,a(dm),0]],C2=[0,a(f),[0,a(dm),[0,a(ay),0]]],C3=[0,a(f),[0,a(dm),0]],CZ=[0,a(o),ek,11,ek,37,[0,a(n),0]],CW=[8,0],CX=[0,a(v),lq,5,lq,24,[0,a(kA),[0,a(J),[0,a(K),[0,a(t),0]]]]],CU=a(U),CV=[0,a(ao),350,5,351,69,[0,a(eT),[0,a(bZ),[0,a(df),[0,a(bG),[0,a(am),[0,a(B),0]]]]]]],CT=[0,a(o),ew,11,ew,31,[0,a(n),0]],CM=[0,a(f),[0,a(dr),[0,a(aw),0]]],CN=[0,a(f),[0,a(dr),0]],CO=[0,a(f),[0,a(dr),[0,a(ay),0]]],CP=[0,a(f),[0,a(dr),0]],CQ=a(U),CD=[0,a(f),[0,a(V),[0,a(aw),0]]],CE=[0,a(f),[0,a(V),0]],CF=[0,a(f),[0,a(V),[0,a(ay),0]]],CG=[0,a(f),[0,a(V),0]],CH=[0,a(dh),27,5,27,44,[0,a("R\xc3\xa8gles diverses"),[0,a(de),[0,a(t),0]]]],CI=a(k),Cx=[0,a(f),[0,a(V),[0,a(aw),0]]],Cy=[0,a(f),[0,a(V),0]],Cz=[0,a(f),[0,a(V),[0,a(ay),0]]],CA=[0,a(f),[0,a(V),0]],CB=[0,a(ao),eN,3,eN,41,[0,a(a7),[0,a(L),[0,a(N),[0,a(H),[0,a(am),[0,a(B),0]]]]]]],CC=a("0.04"),Cr=[0,a(f),[0,a(V),[0,a(aw),0]]],Cs=[0,a(f),[0,a(V),0]],Ct=[0,a(f),[0,a(V),[0,a(ay),0]]],Cu=[0,a(f),[0,a(V),0]],Cv=[0,a(ao),95,3,96,44,[0,a(a7),[0,a(L),[0,a(N),[0,a(H),[0,a(am),[0,a(B),0]]]]]]],Cw=a(jm),Cl=[0,a(f),[0,a(V),[0,a(aw),0]]],Cm=[0,a(f),[0,a(V),0]],Cn=[0,a(f),[0,a(V),[0,a(ay),0]]],Co=[0,a(f),[0,a(V),0]],Cp=[0,a(ao),55,3,55,41,[0,a(a7),[0,a(L),[0,a(N),[0,a(H),[0,a(am),[0,a(B),0]]]]]]],Cq=a(f_),Ck=[0,a(o),eP,11,eP,47,[0,a(n),0]],Cj=[0,a(o),eP,11,eP,47,[0,a(n),0]],Ca=[0,a(ao),cH,3,cH,41,[0,a(a7),[0,a(L),[0,a(N),[0,a(H),[0,a(am),[0,a(B),0]]]]]]],Cb=a(U),Cc=a(jm),Cd=a(k),B8=[0,a(ao),74,3,75,44,[0,a(a7),[0,a(L),[0,a(N),[0,a(H),[0,a(am),[0,a(B),0]]]]]]],B9=a(U),B_=a(f_),B$=a(k),B4=[0,a(ao),35,3,35,41,[0,a(a7),[0,a(L),[0,a(N),[0,a(H),[0,a(am),[0,a(B),0]]]]]]],B5=a(U),B6=a(lA),B7=a(k),B3=[0,a(o),dA,11,dA,47,[0,a(n),0]],BW=[0,a(ao),cH,3,cH,41,[0,a(a7),[0,a(L),[0,a(N),[0,a(H),[0,a(am),[0,a(B),0]]]]]]],BX=a(ax),BY=a(ax),BZ=a("0.1025"),B0=a(k),BR=[0,a(ao),74,3,75,44,[0,a(a7),[0,a(L),[0,a(N),[0,a(H),[0,a(am),[0,a(B),0]]]]]]],BS=a(ax),BT=a(ax),BU=a("0.205"),BV=a(k),BM=[0,a(ao),35,3,35,41,[0,a(a7),[0,a(L),[0,a(N),[0,a(H),[0,a(am),[0,a(B),0]]]]]]],BN=a(ax),BO=a(ax),BP=a("0.41"),BQ=a(k),BL=[0,a(o),dz,11,dz,56,[0,a(n),0]],BH=[0,a(ao),gE,5,gE,43,[0,a(ds),[0,a(L),[0,a(N),[0,a(H),[0,a(am),[0,a(B),0]]]]]]],BI=a("0.0559"),BF=[0,a(ao),229,5,lm,46,[0,a(ds),[0,a(L),[0,a(N),[0,a(H),[0,a(am),[0,a(B),0]]]]]]],BG=a("0.1117"),BD=[0,a(ao),jq,5,jq,43,[0,a(ds),[0,a(L),[0,a(N),[0,a(H),[0,a(am),[0,a(B),0]]]]]]],BE=a("0.20234"),BC=[0,a(o),bH,11,bH,47,[0,a(n),0]],Bv=a(a1),Bw=[0,a(ao),170,5,171,68,[0,a(a7),[0,a(L),[0,a(N),[0,a(H),[0,a(am),[0,a(B),0]]]]]]],Bx=a(a1),By=a(cz),Bz=a(a1),Bq=a(a1),Br=[0,a(ao),162,5,163,68,[0,a(a7),[0,a(L),[0,a(N),[0,a(H),[0,a(am),[0,a(B),0]]]]]]],Bs=a(a1),Bt=a(cz),Bu=a(a1),Bp=[0,a(o),eu,11,eu,31,[0,a(n),0]],Bo=a(k),Bn=[0,a(o),eu,11,eu,31,[0,a(n),0]],Bh=[0,a(f),[0,a(bg),[0,a(aw),0]]],Bi=[0,a(f),[0,a(bg),0]],Bj=[0,a(f),[0,a(bg),[0,a(ay),0]]],Bk=[0,a(f),[0,a(bg),0]],Bl=[0,a(ah),313,5,lu,58,[0,a(lw),[0,a(L),[0,a(N),[0,a(H),[0,a(ag),[0,a(B),0]]]]]]],A_=[0,a(f),[0,a(dw),[0,a(aw),0]]],A$=[0,a(f),[0,a(dw),0]],Ba=[0,a(f),[0,a(dw),[0,a(ay),0]]],Bb=[0,a(f),[0,a(dw),0]],Bc=[0,a(f),[0,a(bg),[0,a(aw),0]]],Bd=[0,a(f),[0,a(bg),0]],Be=[0,a(f),[0,a(bg),[0,a(ay),0]]],Bf=[0,a(f),[0,a(bg),0]],Bg=[0,a(ah),299,5,300,58,[0,a(lw),[0,a(L),[0,a(N),[0,a(H),[0,a(ag),[0,a(B),0]]]]]]],A9=[0,a(o),eN,11,eN,34,[0,a(n),0]],Ee=[8,0],Ef=a(U),Eg=[0,a(v),344,5,345,72,[0,a(kA),[0,a(J),[0,a(K),[0,a(t),0]]]]],Ec=a(U),Ed=[0,a(ah),406,5,407,72,[0,a(go),[0,a(bZ),[0,a(eJ),[0,a(bG),[0,a(ag),[0,a(B),0]]]]]]],Eb=[0,a(o),eI,11,eI,28,[0,a(n),0]],D$=a(ax),Ea=[0,a(ah),ex,5,ex,70,[0,a(l0),[0,a(L),[0,a(N),[0,a(H),[0,a(ag),[0,a(B),0]]]]]]],AW=[0,a(f),[0,a(bE),[0,a(aw),0]]],AX=[0,a(f),[0,a(bE),0]],AY=[0,a(f),[0,a(bE),[0,a(ay),0]]],AZ=[0,a(f),[0,a(bE),0]],A0=a(cz),A1=a(kl),A2=a(du),AN=[0,a(v),lS,5,lS,49,[0,a(M),[0,a(J),[0,a(K),[0,a(t),0]]]]],AO=a(k),AP=a("5728"),AQ=a(k),AJ=[0,a(v),497,5,498,53,[0,a(M),[0,a(J),[0,a(K),[0,a(t),0]]]]],AK=a(k),AL=a("0.0717"),AM=a(k),AF=[0,a(v),489,5,490,53,[0,a(M),[0,a(J),[0,a(K),[0,a(t),0]]]]],AG=a(k),AH=a("0.0847"),AI=a(k),AB=[0,a(v),481,5,482,53,[0,a(M),[0,a(J),[0,a(K),[0,a(t),0]]]]],AC=a(k),AD=a("0.0976"),AE=a(k),Ax=[0,a(v),473,5,474,53,[0,a(M),[0,a(J),[0,a(K),[0,a(t),0]]]]],Ay=a(k),Az=a("0.115"),AA=a(k),At=[0,a(v),465,5,466,53,[0,a(M),[0,a(J),[0,a(K),[0,a(t),0]]]]],Au=a(k),Av=a("0.1163"),Aw=a(k),Ap=[0,a(v),457,5,458,53,[0,a(M),[0,a(J),[0,a(K),[0,a(t),0]]]]],Aq=a(k),Ar=a("0.122"),As=a(k),Al=[0,a(v),449,5,450,53,[0,a(M),[0,a(J),[0,a(K),[0,a(t),0]]]]],Am=a(k),An=a("0.1278"),Ao=a(k),Ah=[0,a(v),441,5,442,53,[0,a(M),[0,a(J),[0,a(K),[0,a(t),0]]]]],Ai=a(k),Aj=a("0.1335"),Ak=a(k),Ad=[0,a(v),433,5,434,53,[0,a(M),[0,a(J),[0,a(K),[0,a(t),0]]]]],Ae=a(k),Af=a("0.1393"),Ag=a(k),z$=[0,a(v),425,5,jp,53,[0,a(M),[0,a(J),[0,a(K),[0,a(t),0]]]]],Aa=a(k),Ab=a("0.145"),Ac=a(k),z_=[0,a(o),em,11,em,54,[0,a(n),0]],z7=a(k),z8=a(jh),z9=a(k),z1=[0,a(v),j5,5,j5,69,[0,a(M),[0,a(J),[0,a(K),[0,a(t),0]]]]],z2=a(U),z3=a("0.3068"),z4=a(k),zX=[0,a(v),jr,5,jr,69,[0,a(M),[0,a(J),[0,a(K),[0,a(t),0]]]]],zY=a(U),zZ=a("0.2936"),z0=a(k),zT=[0,a(v),jQ,5,jQ,69,[0,a(M),[0,a(J),[0,a(K),[0,a(t),0]]]]],zU=a(U),zV=a("0.284"),zW=a(k),zP=[0,a(v),k0,5,k0,69,[0,a(M),[0,a(J),[0,a(K),[0,a(t),0]]]]],zQ=a(U),zR=a("0.2672"),zS=a(k),zL=[0,a(v),ji,5,ji,69,[0,a(M),[0,a(J),[0,a(K),[0,a(t),0]]]]],zM=a(U),zN=a("0.273"),zO=a(k),zH=[0,a(v),jZ,5,jZ,69,[0,a(M),[0,a(J),[0,a(K),[0,a(t),0]]]]],zI=a(U),zJ=a("0.2555"),zK=a(k),zD=[0,a(v),jR,5,jR,69,[0,a(M),[0,a(J),[0,a(K),[0,a(t),0]]]]],zE=a(U),zF=a("0.2496"),zG=a(k),zz=[0,a(v),ln,5,ln,69,[0,a(M),[0,a(J),[0,a(K),[0,a(t),0]]]]],zA=a(U),zB=a("0.2437"),zC=a(k),zv=[0,a(v),gl,5,gl,69,[0,a(M),[0,a(J),[0,a(K),[0,a(t),0]]]]],zw=a(U),zx=a("0.2379"),zy=a(k),zr=[0,a(v),kM,5,kM,69,[0,a(M),[0,a(J),[0,a(K),[0,a(t),0]]]]],zs=a(U),zt=a("0.232"),zu=a(k),zq=[0,a(o),dB,11,dB,55,[0,a(n),0]],zn=a(U),zo=a(lA),zp=a(k),zh=[0,a(v),lr,5,lr,69,[0,a(M),[0,a(J),[0,a(K),[0,a(t),0]]]]],zi=a(ax),zj=a("0.143"),zk=a(k),zd=[0,a(v),ko,5,ko,69,[0,a(M),[0,a(J),[0,a(K),[0,a(t),0]]]]],ze=a(ax),zf=a("0.1259"),zg=a(k),y$=[0,a(v),kj,5,kj,69,[0,a(M),[0,a(J),[0,a(K),[0,a(t),0]]]]],za=a(ax),zb=a("0.1089"),zc=a(k),y7=[0,a(v),iD,5,iD,69,[0,a(M),[0,a(J),[0,a(K),[0,a(t),0]]]]],y8=a(ax),y9=a("0.0918"),y_=a(k),y3=[0,a(v),lI,5,lI,69,[0,a(M),[0,a(J),[0,a(K),[0,a(t),0]]]]],y4=a(ax),y5=a("0.0842"),y6=a(k),yZ=[0,a(v),lP,5,lP,69,[0,a(M),[0,a(J),[0,a(K),[0,a(t),0]]]]],y0=a(ax),y1=a("0.0766"),y2=a(k),yV=[0,a(v),lE,5,lE,69,[0,a(M),[0,a(J),[0,a(K),[0,a(t),0]]]]],yW=a(ax),yX=a("0.069"),yY=a(k),yR=[0,a(v),jd,5,jd,69,[0,a(M),[0,a(J),[0,a(K),[0,a(t),0]]]]],yS=a(ax),yT=a("0.075"),yU=a(k),yN=[0,a(v),ky,5,ky,69,[0,a(M),[0,a(J),[0,a(K),[0,a(t),0]]]]],yO=a(ax),yP=a("0.0539"),yQ=a(k),yJ=[0,a(v),jF,5,jF,69,[0,a(M),[0,a(J),[0,a(K),[0,a(t),0]]]]],yK=a(ax),yL=a(jB),yM=a(k),yI=[0,a(o),eK,11,eK,56,[0,a(n),0]],yF=a(ax),yG=a(f_),yH=a(k),yw=a(U),yx=[0,a(ah),420,6,421,72,[0,a(go),[0,a(bZ),[0,a(eJ),[0,a(bG),[0,a(ag),[0,a(B),0]]]]]]],yr=[0,a(an),[0,a(dn),[0,a(aw),0]]],ys=[0,a(an),[0,a(dn),0]],yt=[0,a(an),[0,a(dn),[0,a(ay),0]]],yu=[0,a(an),[0,a(dn),0]],yv=[0,a(ah),jM,5,125,59,[0,a(l0),[0,a(L),[0,a(N),[0,a(H),[0,a(ag),[0,a(B),0]]]]]]],yq=[0,a(o),bB,11,bB,35,[0,a(n),0]],yk=[0,a(v),lK,5,lK,69,[0,a(b0),[0,a(jY),[0,a(bW),[0,a(t),0]]]]],yl=a(jk),ym=a("5827900"),yh=[0,a(v),bm,5,bm,69,[0,a(jE),[0,a(bW),[0,a(t),0]]]],yi=a(k_),yj=a("5775900"),ye=[0,a(v),bT,5,bT,69,[0,a(iG),[0,a(bW),[0,a(t),0]]]],yf=a(lB),yg=a("5684900"),yb=[0,a(v),87,5,87,69,[0,a(lL),[0,a(bW),[0,a(t),0]]]],yc=a(k1),yd=a("5628600"),ya=[0,a(o),es,11,es,27,[0,a(n),0]],x_=a(lX),x$=a("5595000"),x5=[0,a(v),jW,5,jW,69,[0,a(b0),[0,a(jY),[0,a(bW),[0,a(t),0]]]]],x6=a(jk),x7=a("8155800"),x2=[0,a(v),jC,5,jC,69,[0,a(jE),[0,a(bW),[0,a(t),0]]]],x3=a(k_),x4=a("8083100"),xZ=[0,a(v),bB,5,bB,69,[0,a(iG),[0,a(bW),[0,a(t),0]]]],x0=a(lB),x1=a("7955800"),xW=[0,a(v),94,5,94,69,[0,a(lL),[0,a(bW),[0,a(t),0]]]],xX=a(k1),xY=a("7877000"),xV=[0,a(o),ez,11,ez,28,[0,a(n),0]],xT=a(lX),xU=a("7830000"),xM=[0,a(an),[0,a(dj),[0,a(aw),0]]],xN=[0,a(an),[0,a(dj),0]],xO=[0,a(an),[0,a(dj),[0,a(ay),0]]],xP=[0,a(an),[0,a(dj),0]],xJ=[0,a(jb),83,19,83,69,[0,a("Article R521-1"),[0,a(L),[0,a(N),[0,a(H),[0,a(kI),[0,a(B),0]]]]]]],xI=a("14"),xH=[0,a(o),kn,11,kn,38,[0,a(n),0]],xj=[0,a(ah),269,5,270,48,[0,a(bk),[0,a(L),[0,a(N),[0,a(H),[0,a(ag),[0,a(B),0]]]]]]],xk=[0,0],xh=[0,a(ah),kr,5,259,56,[0,a(bk),[0,a(L),[0,a(N),[0,a(H),[0,a(ag),[0,a(B),0]]]]]]],xi=[1,0],xf=[0,a(ah),kG,5,kG,70,[0,a(bk),[0,a(L),[0,a(N),[0,a(H),[0,a(ag),[0,a(B),0]]]]]]],xg=[0,0],xd=[0,a(ah),kV,5,kV,69,[0,a(bk),[0,a(L),[0,a(N),[0,a(H),[0,a(ag),[0,a(B),0]]]]]]],xe=[0,0],xb=[0,a(ah),jD,5,jD,60,[0,a(bk),[0,a(L),[0,a(N),[0,a(H),[0,a(ag),[0,a(B),0]]]]]]],xc=[0,0],xa=[0,a(o),ca,11,ca,20,[0,a(n),0]],w$=[0,a(o),ca,11,ca,20,[0,a(n),0]],w8=[0,a(ah),263,5,kb,48,[0,a(bk),[0,a(L),[0,a(N),[0,a(H),[0,a(ag),[0,a(B),0]]]]]]],w9=[0,0],w6=[0,a(ah),lg,5,dk,56,[0,a(bk),[0,a(L),[0,a(N),[0,a(H),[0,a(ag),[0,a(B),0]]]]]]],w7=[2,0],w4=[0,a(ah),jo,5,jo,70,[0,a(bk),[0,a(L),[0,a(N),[0,a(H),[0,a(ag),[0,a(B),0]]]]]]],w5=[1,0],w2=[0,a(ah),jS,5,jS,69,[0,a(bk),[0,a(L),[0,a(N),[0,a(H),[0,a(ag),[0,a(B),0]]]]]]],w3=[0,0],w0=[0,a(ah),kX,5,kX,60,[0,a(bk),[0,a(L),[0,a(N),[0,a(H),[0,a(ag),[0,a(B),0]]]]]]],w1=[0,0],wZ=[0,a(o),cB,11,cB,26,[0,a(n),0]],wY=[0,a(o),cB,11,cB,26,[0,a(n),0]],w_=[0,a(f),[0,a(bE),0]],xl=[0,a(f),[0,a("versement"),0]],xn=a(eS),xm=[0,a(o),f$,11,f$,32,[0,a(n),0]],xo=[0,a(f),[0,a("nombre_enfants_l521_1"),0]],xq=a(eS),xp=[0,a(o),bm,11,bm,41,[0,a(n),0]],xr=[0,a(f),[0,a("nombre_enfants_alin\xc3\xa9a_2_l521_3"),0]],xs=[0,a(f),[0,a(jL),[0,a(gy),0]]],xt=[0,a(f),[0,a(jL),[0,a(gy),0]]],xv=[0,a(f),[0,a("prestations_familiales.date_courante"),0]],xu=[0,a(o),70,10,70,23,[0,a(n),0]],xx=[1,0],xy=[0,a(f),[0,a("prestations_familiales.prestation_courante"),0]],xw=[0,a(o),71,10,71,29,[0,a(n),0]],xA=[0,a(f),[0,a("prestations_familiales.r\xc3\xa9sidence"),0]],xz=[0,a(o),72,10,72,19,[0,a(n),0]],xB=[0,a(f),[0,a(lk),[0,a(an),0]]],xC=[0,a(f),[0,a(lk),[0,a(an),0]]],xE=[0,a(f),[0,a("enfant_le_plus_\xc3\xa2g\xc3\xa9.enfants"),0]],xD=[0,a(o),84,10,84,17,[0,a(n),0]],xF=[0,a(f),[0,a(j$),[0,a(gH),0]]],xG=[0,a(f),[0,a(j$),[0,a(gH),0]]],xK=[0,a(f),[0,a(bg),0]],xL=[0,a(o),aR,11,aR,61,[0,a(n),0]],xQ=[0,a(f),[0,a("enfants_\xc3\xa0_charge_droit_ouvert_prestation_familiale"),0]],xR=[0,a(f),[0,a(dw),0]],xS=[0,a(o),ez,11,ez,28,[0,a(n),0]],x8=[0,a(f),[0,a("plafond_II_d521_3"),0]],x9=[0,a(o),es,11,es,27,[0,a(n),0]],yn=[0,a(f),[0,a("plafond_I_d521_3"),0]],El=a(U),Em=[0,a(ah),jp,5,427,71,[0,a(go),[0,a(bZ),[0,a(eJ),[0,a(bG),[0,a(ag),[0,a(B),0]]]]]]],yo=[0,a(o),km,11,km,34,[0,a(n),0]],yp=[0,a(f),[0,a("droit_ouvert_compl\xc3\xa9ment"),0]],yy=[0,a(f),[0,a(dr),0]],yA=a(eS),yB=a(eS),yC=a(jB),Ek=a(k),yz=[0,a(o),dq,11,dq,64,[0,a(n),0]],yD=[0,a(f),[0,a("montant_initial_base_quatri\xc3\xa8me_enfant_et_plus_mayotte"),0]],yE=[0,a(o),eK,11,eK,56,[0,a(n),0]],zl=[0,a(f),[0,a("montant_initial_base_troisi\xc3\xa8me_enfant_mayotte"),0]],zm=[0,a(o),dB,11,dB,55,[0,a(n),0]],z5=[0,a(f),[0,a("montant_initial_base_deuxi\xc3\xa8me_enfant_mayotte"),0]],z6=[0,a(o),em,11,em,54,[0,a(n),0]],AR=[0,a(f),[0,a("montant_initial_base_premier_enfant_mayotte"),0]],AS=[0,a(o),iR,11,iR,31,[0,a(n),0]],AT=[0,a(f),[0,a("nombre_total_enfants"),0]],AV=a(du),AU=[0,a(o),gA,11,gA,31,[0,a(n),0]],A3=[0,a(f),[0,a("nombre_moyen_enfants"),0]],Eh=a(U),Ei=[0,a(ao),ks,5,360,71,[0,a(eT),[0,a(bZ),[0,a(df),[0,a(bG),[0,a(am),[0,a(B),0]]]]]]],Ej=a(jh),A5=a(k),A4=[0,a(o),gJ,11,gJ,46,[0,a(n),0]],A6=[0,a(f),[0,a("montant_initial_base_premier_enfant"),0]],A7=[0,a(o),eI,11,eI,28,[0,a(n),0]],A8=[0,a(f),[0,a("droit_ouvert_base"),0]],Bm=[0,a(f),[0,a(V),0]],BA=[0,a(f),[0,a(dy),0]],BB=[0,a(o),bH,11,bH,47,[0,a(n),0]],BJ=[0,a(f),[0,a("montant_vers\xc3\xa9_forfaitaire_par_enfant"),0]],BK=[0,a(o),dz,11,dz,56,[0,a(n),0]],B1=[0,a(f),[0,a("montant_initial_base_troisi\xc3\xa8me_enfant_et_plus"),0]],B2=[0,a(o),dA,11,dA,47,[0,a(n),0]],Ce=[0,a(f),[0,a("montant_initial_base_deuxi\xc3\xa8me_enfant"),0]],Cg=a(du),Ch=a(du),Cf=[0,a(o),cH,11,cH,38,[0,a(n),0]],Ci=[0,a(f),[0,a("rapport_enfants_total_moyen"),0]],CJ=[0,a(f),[0,a(dm),0]],CL=a(k),CK=[0,a(o),iP,11,iP,36,[0,a(n),0]],CR=[0,a(f),[0,a("montant_vers\xc3\xa9_forfaitaire"),0]],CS=[0,a(o),ew,11,ew,31,[0,a(n),0]],CY=[0,a(f),[0,a("montant_initial_base"),0]],Dk=[0,a(f),[0,a(dg),0]],Dl=[0,a(o),eD,11,eD,52,[0,a(n),0]],Dy=[0,a(f),[0,a("montant_vers\xc3\xa9_compl\xc3\xa9ment_pour_forfaitaire"),0]],Dz=[0,a(o),gp,11,gp,43,[0,a(n),0]],DA=[0,a(f),[0,a("montant_avec_garde_altern\xc3\xa9e_base"),0]],DN=[0,a(f),[0,a(dl),0]],D_=a(k),DO=[0,a(o),lD,11,lD,29,[0,a(n),0]],DP=[0,a(f),[0,a("montant_vers\xc3\xa9_base"),0]],DR=a(k),D9=a(k),DQ=[0,a(o),kx,11,kx,35,[0,a(n),0]],DW=[0,a(f),[0,a("montant_vers\xc3\xa9_majoration"),0]],DX=[0,a(o),kR,11,kR,58,[0,a(n),0]],DY=[0,a(f),[0,a("montant_base_compl\xc3\xa9ment_pour_base_et_majoration"),0]],D0=[0,a(f),[0,a(dy),[0,a(aw),0]]],D1=[0,a(f),[0,a(dy),0]],D2=[0,a(f),[0,a(dy),[0,a(ay),0]]],D3=[0,a(f),[0,a(dy),0]],D8=a(k),DZ=[0,a(o),kc,11,kc,59,[0,a(n),0]],D4=[0,a(f),[0,a("montant_vers\xc3\xa9_compl\xc3\xa9ment_pour_base_et_majoration"),0]],D7=a(k),D5=[0,a(o),iH,10,iH,23,[0,a(n),0]],D6=[0,a(f),[0,a("montant_vers\xc3\xa9"),0]],wL=[0,a(ah),60,5,62,32,[0,a(gq),[0,a(gj),[0,a(ge),[0,a(H),[0,a(ag),[0,a(B),0]]]]]]],wK=[0,a(ah),49,5,50,50,[0,a(gq),[0,a(gj),[0,a(ge),[0,a(H),[0,a(ag),[0,a(B),0]]]]]]],wJ=[0,a(o),65,10,65,22,[0,a(n),0]],wI=[0,a(o),65,10,65,22,[0,a(n),0]],wG=[0,a(ah),68,5,71,57,[0,a(gq),[0,a(gj),[0,a(ge),[0,a(H),[0,a(ag),[0,a(B),0]]]]]]],wF=[0,a(o),66,10,66,29,[0,a(n),0]],wq=[0,a(v),60,5,61,34,[0,a("Instruction interminist\xc3\xa9rielle n\xc2\xb0DSS/2B/2021/65 du 19 mars 2021 relative \xc3\xa0 la revalorisation au 1er avril 2021 des prestations familiales servies en m\xc3\xa9tropole, en Guadeloupe, en Guyane, en Martinique, \xc3\xa0 la R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy, \xc3\xa0 Saint-Martin et dans le d\xc3\xa9partement de Mayotte"),[0,a(gi),[0,a(t),0]]]],wr=a("41481"),wo=[0,a(v),44,5,45,34,[0,a("Instruction interminist\xc3\xa9rielle no DSS/SD2B/2020/33 du 18 f\xc3\xa9vrier 2020 relative \xc3\xa0 la revalorisation au 1er avril 2020 des prestations familiales servies en m\xc3\xa9tropole, en Guadeloupe, en Guyane, en Martinique, \xc3\xa0 La R\xc3\xa9union, \xc3\xa0 Saint-Barth\xc3\xa9lemy, \xc3\xa0 Saint-Martin et dans le d\xc3\xa9partement de Mayotte"),[0,a(gi),[0,a(t),0]]]],wp=a("41404"),wm=[0,a(v),24,5,25,34,[0,a("Instruction minist\xc3\xa9rielle N\xc2\xb0DSS/SD2B/2019/65 du 25 mars 2019 relative \xc3\xa0 la revalorisation au 1er avril 2019 des prestations familiales servies en m\xc3\xa9tropole"),[0,a(gi),[0,a(t),0]]]],wn=a("41316"),wl=[0,a(o),74,10,74,24,[0,a(n),0]],wi=a("20"),wh=[0,a(o),68,10,68,22,[0,a(n),0]],wj=[0,a(an),[0,a("\xc3\xa2ge_l512_3_2"),0]],wk=[0,a(o),74,10,74,24,[0,a(n),0]],ws=[0,a(an),[0,a("base_mensuelle"),0]],wu=[0,a(an),[0,a("smic.date_courante"),0]],wt=[0,a(o),41,10,41,23,[0,a(n),0]],ww=[0,a(an),[0,a("smic.r\xc3\xa9sidence"),0]],wv=[0,a(o),42,10,42,19,[0,a(n),0]],wx=[0,a(an),[0,a(lR),[0,a(gh),0]]],wy=[0,a(an),[0,a(lR),[0,a(gh),0]]],wQ=[0,0],wS=[1,0],wT=[2,0],wU=[3,0],wV=[4,0],wW=[5,0],wR=[0,a(ah),354,5,ks,30,[0,a("Article L751-1"),[0,a("Chapitre 1er : G\xc3\xa9n\xc3\xa9ralit\xc3\xa9s"),[0,a(eJ),[0,a(bG),[0,a(ag),[0,a(B),0]]]]]]],wz=[0,a(o),69,10,69,33,[0,a(n),0]],wA=[0,a(an),[0,a("r\xc3\xa9gime_outre_mer_l751_1"),0]],wN=[0,a(jb),i8,18,i8,41,[0,a("Article R755-0-2"),[0,a(bZ),[0,a(df),[0,a(bG),[0,a(kI),[0,a(B),0]]]]]]],wO=a(ll),wP=a(jz),wC=a(ll),wD=a(jz),wB=[0,a(o),67,11,67,27,[0,a(n),0]],wE=[0,a(an),[0,a("plafond_l512_3_2"),0]],wH=[0,a(an),[0,a(dn),0]],wM=[0,a(an),[0,a(dj),0]],wa=[2,0],wb=a(k),wc=a(k),wd=[1,0],we=a(U),v$=[0,a(o),85,10,85,21,[0,a(n),0]],wf=[0,a(gH),[0,a("le_plus_\xc3\xa2g\xc3\xa9"),0]],v8=a(gc),v7=[0,a(o),81,10,81,37,[0,a(n),0]],v9=[0,a(gy),[0,a(bg),0]],v2=[8,0],v3=[0,a(v),lu,5,317,6,[0,a(b0),[0,a(iI),[0,a(cy),[0,a(t),0]]]]],v4=a("774"),vS=[6,0],vV=[0,0],vW=[1,0],vX=[2,0],vY=[3,0],vZ=[4,0],v0=[5,0],v1=[7,0],vT=[0,a(v),297,5,306,6,[0,a(b0),[0,a(iI),[0,a(cy),[0,a(t),0]]]]],vU=a("1025"),vP=[8,0],vQ=[0,a(v),276,5,278,6,[0,a(b0),[0,a(i_),[0,a(cy),[0,a(t),0]]]]],vR=a("766"),vF=[6,0],vI=[0,0],vJ=[1,0],vK=[2,0],vL=[3,0],vM=[4,0],vN=[5,0],vO=[7,0],vG=[0,a(v),kr,5,267,6,[0,a(b0),[0,a(i_),[0,a(cy),[0,a(t),0]]]]],vH=a("1015"),vC=[8,0],vD=[0,a(v),237,5,239,6,[0,a(b0),[0,a(iE),[0,a(cy),[0,a(t),0]]]]],vE=a("757"),vs=[6,0],vv=[0,0],vw=[1,0],vx=[2,0],vy=[3,0],vz=[4,0],vA=[5,0],vB=[7,0],vt=[0,a(v),219,5,228,6,[0,a(b0),[0,a(iE),[0,a(cy),[0,a(t),0]]]]],vu=a("1003"),vr=[0,a(o),43,10,43,22,[0,a(n),0]],vq=[0,a(o),43,10,43,22,[0,a(n),0]],v5=[0,a(gh),[0,a("brut_horaire"),0]],vh=a("a_d\xc3\xa9j\xc3\xa0_ouvert_droit_aux_allocations_familiales"),vi=a("prise_en_charge"),vj=a("\xc3\xa2ge"),vk=a("date_de_naissance"),vl=a("r\xc3\xa9muneration_mensuelle"),vm=a("obligation_scolaire"),vn=a("identifiant"),vo=[0,a("Enfant"),0],u_=a("PrestationAccueilJeuneEnfant"),va=a(f),vb=a("Compl\xc3\xa9mentFamilial"),vc=a("AllocationLogement"),vd=a("Allocation\xc3\x89ducationEnfantHandicap\xc3\xa9"),ve=a("AllocationSoutienFamilial"),vf=a("AllocationRentr\xc3\xa9eScolaire"),vg=a("AllocationJournali\xc3\xa8rePresenceParentale"),u$=[0,a("\xc3\x89l\xc3\xa9mentPrestationsFamiliales"),0],uZ=a(j7),u1=a(kJ),u2=a(i6),u3=a("LaR\xc3\xa9union"),u4=a("SaintBarth\xc3\xa9lemy"),u5=a("SaintMartin"),u6=a(jT),u7=a("SaintPierreEtMiquelon"),u8=a(le),u0=[0,a("Collectivit\xc3\xa9"),0],uV=a("Avant"),uX=a("Pendant"),uY=a("Apr\xc3\xa8s"),uW=[0,a("SituationObligationScolaire"),0],uP=a("GardeAltern\xc3\xa9ePartageAllocations"),uR=a("GardeAltern\xc3\xa9eAllocataireUnique"),uS=a("EffectiveEtPermanente"),uT=a("ServicesSociauxAllocationVers\xc3\xa9e\xc3\x80LaFamille"),uU=a("ServicesSociauxAllocationVers\xc3\xa9eAuxServicesSociaux"),uQ=[0,a("PriseEnCharge"),0],EN=a("Jsoo_runtime.Error.Exn"),EO=a(gf),Fs=a("Begin call"),Ft=a("End call"),Fu=a("Variable definition"),Fv=a("Decision taken"),E9=a("Confi\xc3\xa9 aux service sociaux, allocation vers\xc3\xa9e aux services sociaux"),E_=a("Confi\xc3\xa9 aux service sociaux, allocation vers\xc3\xa9e \xc3\xa0 la famille"),E$=a("Effective et permanente"),Fa=a("Garde altern\xc3\xa9e, allocataire unique"),Fb=a("Garde altern\xc3\xa9e, partage des allocations"),Fd=[0,0],Fe=[1,0],Ff=[2,0],Fg=[3,0],Fh=[4,0],Fc=a("Unknown prise en charge"),EZ=a(j7),E0=a(kJ),E1=a("La R\xc3\xa9union"),E2=a(i6),E3=a(le),E4=a(jT),E5=a("Saint Barth\xc3\xa9lemy"),E6=a("Saint Martin"),E7=a("Saint Pierre et Miquelon"),Fi=[7,0],Fj=[5,0],Fk=[4,0],Fl=[6,0],Fm=[8,0],Fn=[2,0],Fo=[3,0],Fp=[1,0],Fq=[0,0],E8=a("unknown collectivite!"),EX=a(p),EV=[0,[4,0,0,0,[12,68,[4,0,0,0,[12,77,[4,0,0,0,[12,89,0]]]]]],a("%dD%dM%dY")],EU=[0,a(kS),a(kZ),a(lj)];function Y(a){if(typeof a==="number")return 0;else switch(a[0]){case @@ -1289,67 +1288,68 @@ E=a[1];return[21,E,T(a[2],b)];case 23:var F=a[1];return[23,F,T(a[2],b)];default:var G=a[2],H=a[1];return[24,H,G,T(a[3],b)]}}function -bs(a){throw[0,dL,a]}function +fb(a,c,b){return a[1]===c?(a[1]=b,1):0}function +bs(a){throw[0,dM,a]}function ae(a){throw[0,g8,a]}var -g9=[K,mF,aG(0)];function -dM(b,a){return mj(b,a)?b:a}function -dN(a){return 0<=a?a:-a|0}var -mG=gy,mI=cN(mH),mK=cN(mJ),mM=cN(mL);function -a9(d,c){var -a=E(d),e=E(c),b=ab(a+e|0);b3(d,0,b,0,a);b3(c,0,b,a,e);return aB(b)}function -mN(a){return a?mO:mP}Gi(0);var -mS=mn(1),a_=mn(2);function -mT(b){function +g9=[I,mE,aA(0)];function +dN(b,a){return mg(b,a)?b:a}function +cT(a){return 0<=a?a:-a|0}var +mF=gz,mH=cN(mG),mJ=cN(mI),mL=cN(mK);function +a5(d,c){var +a=E(d),e=E(c),b=ac(a+e|0);b3(d,0,b,0,a);b3(c,0,b,a,e);return aB(b)}function +mM(a){return a?mN:mO}Gi(0);var +mR=mk(1),a_=mk(2);function +mS(b){function a(b){var a=b;for(;;){if(a){var -c=a[2],d=a[1];try{cd(d)}catch(a){a=i(a);if(a[1]!==ha)throw a;var -e=a}var -a=c;continue}return 0}}return a(Gj(0))}function -cT(b,a){return gX(b,a,0,E(a))}var -fb=[0,mT];function -mV(a){cT(a_,a);mo(a_,10);return cd(a_)}function -mW(c){var -a=[0,0],d=fb[1];fb[1]=function(e){if(1-a[1]){a[1]=1;b(c,0)}return b(d,0)};return 0}function -fc(a){return b(fb[1],0)}g1(a(iA),fc);function -cj(a){if(0<=a&&!(cE>>0){if(!(25>>0))c=1}else if(23!==b)c=1;return c?a+32|0:a}var -he=Gw(0)[1],hf=Gv(0),cU=(4*hf|0)-1|0;function +hf=Gv(0),cV=(4*hf|0)-1|0;function hg(c){var b=0,a=c;for(;;){if(a){var b=b+1|0,a=a[2];continue}return b}}function -hh(a){return a?a[1]:bs(m4)}function +hh(a){return a?a[1]:bs(m2)}function dO(d){var a=d,b=0;for(;;){if(a){var c=[0,a[1],b],a=a[2],b=c;continue}return b}}function -b7(c,a){if(a){var -d=a[2],e=b(c,a[1]);return[0,e,b7(c,d)]}return 0}function +b7(b,a){if(a){var +c=a[2],e=d(b,a[1]);return[0,e,b7(b,c)]}return 0}function a$(a,c){var -b=ab(a);FS(b,0,a,c);return b}function +b=ac(a);FR(b,0,a,c);return b}function hi(a){var -b=aW(a),c=ab(b);b2(a,0,c,0,b);return c}function +b=aW(a),c=ac(b);b2(a,0,c,0,b);return c}function dP(a){return aB(hi(a))}function hj(c,b,a){if(0<=b&&0<=a&&!((aW(c)-a|0)>>0))e=1}else +c=cT(k),a=E(b),d=D(b,0),e=0;if(58<=d){if(71<=d){if(!(5>>0))e=1}else if(65<=d)e=1}else{var -f=0;if(32!==d)if(43<=d)switch(d+lR|0){case +f=0;if(32!==d)if(43<=d)switch(d+lO|0){case 5:if(a<(c+2|0)&&1>>0){if(33>>0)p=1}else +n=cQ(k,j)+gI|0,p=0;if(59>>0){if(33>>0)p=1}else if(2===n)p=1;if(!p){var j=j+1|0;continue}var e=bI(k),a=[0,0],r=aW(e)-1|0,w=0;if(!(r<0)){var i=w;for(;;){var -f=dC(e,i),g=0;if(32<=f){var +f=dD(e,i),g=0;if(32<=f){var l=f-34|0,q=0;if(58>>0){if(93<=l)q=1}else if(56>>0){g=1;q=1}if(!q){var m=1;g=2}}else @@ -2076,10 +2083,10 @@ m=2;break}a[1]=a[1]+m|0;var z=i+1|0;if(r!==i){var i=z;continue}break}}if(a[1]===aW(e))var t=hi(e);else{var -b=ab(a[1]);a[1]=0;var +b=ac(a[1]);a[1]=0;var s=aW(e)-1|0,x=0;if(!(s<0)){var h=x;for(;;){var -c=dC(e,h),d=0;if(35<=c)if(92===c)d=2;else +c=dD(e,h),d=0;if(35<=c)if(92===c)d=2;else if(bB<=c)d=1;else d=3;else if(32<=c)if(34<=c)d=2;else @@ -2088,8 +2095,8 @@ if(14<=c)d=1;else switch(c){case 8:aa(b,a[1],92);a[1]++;aa(b,a[1],98);break;case 9:aa(b,a[1],92);a[1]++;aa(b,a[1],gp);break;case -10:aa(b,a[1],92);a[1]++;aa(b,a[1],gI);break;case -13:aa(b,a[1],92);a[1]++;aa(b,a[1],gz);break;default:d=1}switch(d){case +10:aa(b,a[1],92);a[1]++;aa(b,a[1],gJ);break;case +13:aa(b,a[1],92);a[1]++;aa(b,a[1],gA);break;default:d=1}switch(d){case 1:aa(b,a[1],92);a[1]++;aa(b,a[1],48+(c/aR|0)|0);a[1]++;aa(b,a[1],48+((c/10|0)%10|0)|0);a[1]++;aa(b,a[1],48+(c%10|0)|0);break;case 2:aa(b,a[1],92);a[1]++;aa(b,a[1],c);break;case 3:aa(b,a[1],c);break}a[1]++;var @@ -2099,11 +2106,11 @@ t=b}var o=aB(t)}var u=E(o),v=a$(u+2|0,34);b3(o,0,v,1,u);return aB(v)}}function hx(d,f){var -g=dN(f),e=oY[1];switch(d[2]){case +g=cT(f),e=oW[1];switch(d[2]){case 0:var b=cB;break;case 1:var -b=ev;break;case +b=ex;break;case 2:var b=69;break;case 3:var @@ -2119,258 +2126,258 @@ b=72;break;default:var b=70}var c=ht(16);co(c,37);switch(d[1]){case 0:break;case -1:co(c,43);break;default:co(c,32)}if(8<=d[2])co(c,35);co(c,46);au(c,a(q+g));co(c,b);return hv(c)}function +1:co(c,43);break;default:co(c,32)}if(8<=d[2])co(c,35);co(c,46);au(c,a(p+g));co(c,b);return hv(c)}function dT(m,a){if(13<=m){var g=[0,0],h=E(a)-1|0,n=0;if(!(h<0)){var -c=n;for(;;){if(!(9>>0))g[1]++;var +c=n;for(;;){if(!(9>>0))g[1]++;var q=c+1|0;if(h!==c){var c=q;continue}break}}var -i=g[1],j=ab(E(a)+((i-1|0)/3|0)|0),k=[0,0],d=function(a){a3(j,k[1],a);k[1]++;return 0},e=[0,((i-1|0)%3|0)+1|0],l=E(a)-1|0,o=0;if(!(l<0)){var +i=g[1],j=ac(E(a)+((i-1|0)/3|0)|0),k=[0,0],d=function(a){a3(j,k[1],a);k[1]++;return 0},e=[0,((i-1|0)%3|0)+1|0],l=E(a)-1|0,o=0;if(!(l<0)){var b=o;for(;;){var -f=cQ(a,b);if(9>>0)d(f);else{if(0===e[1]){d(95);e[1]=3}e[1]+=-1;d(f)}var +f=cQ(a,b);if(9>>0)d(f);else{if(0===e[1]){d(95);e[1]=3}e[1]+=-1;d(f)}var p=b+1|0;if(l!==b){var b=p;continue}break}}return aB(j)}return a}function -oZ(b,c){switch(b){case +oX(b,c){switch(b){case 1:var -a=n$;break;case +a=n9;break;case 2:var -a=oa;break;case +a=n_;break;case 4:var -a=oc;break;case +a=oa;break;case 5:var -a=od;break;case +a=ob;break;case 6:var -a=oe;break;case +a=oc;break;case 7:var -a=of;break;case +a=od;break;case 8:var -a=og;break;case +a=oe;break;case 9:var -a=oh;break;case +a=of;break;case 10:var -a=oi;break;case +a=og;break;case 11:var -a=oj;break;case +a=oh;break;case 0:case 13:var -a=n_;break;case +a=n8;break;case 3:case 14:var -a=ob;break;default:var -a=ok}return dT(b,eW(a,c))}function -o0(b,c){switch(b){case +a=n$;break;default:var +a=oi}return dT(b,eY(a,c))}function +oY(b,c){switch(b){case 1:var -a=oz;break;case +a=ox;break;case 2:var -a=oA;break;case +a=oy;break;case 4:var -a=oC;break;case +a=oA;break;case 5:var -a=oD;break;case +a=oB;break;case 6:var -a=oE;break;case +a=oC;break;case 7:var -a=oF;break;case +a=oD;break;case 8:var -a=oG;break;case +a=oE;break;case 9:var -a=oH;break;case +a=oF;break;case 10:var -a=oI;break;case +a=oG;break;case 11:var -a=oJ;break;case +a=oH;break;case 0:case 13:var -a=oy;break;case +a=ow;break;case 3:case 14:var -a=oB;break;default:var -a=oK}return dT(b,eW(a,c))}function -o1(b,c){switch(b){case +a=oz;break;default:var +a=oI}return dT(b,eY(a,c))}function +oZ(b,c){switch(b){case 1:var -a=oM;break;case +a=oK;break;case 2:var -a=oN;break;case +a=oL;break;case 4:var -a=oP;break;case +a=oN;break;case 5:var -a=oQ;break;case +a=oO;break;case 6:var -a=oR;break;case +a=oP;break;case 7:var -a=oS;break;case +a=oQ;break;case 8:var -a=oT;break;case +a=oR;break;case 9:var -a=oU;break;case +a=oS;break;case 10:var -a=oV;break;case +a=oT;break;case 11:var -a=oW;break;case +a=oU;break;case 0:case 13:var -a=oL;break;case +a=oJ;break;case 3:case 14:var -a=oO;break;default:var -a=oX}return dT(b,eW(a,c))}function -o2(b,c){switch(b){case +a=oM;break;default:var +a=oV}return dT(b,eY(a,c))}function +o0(b,c){switch(b){case 1:var -a=om;break;case +a=ok;break;case 2:var -a=on;break;case +a=ol;break;case 4:var -a=op;break;case +a=on;break;case 5:var -a=oq;break;case +a=oo;break;case 6:var -a=or;break;case +a=op;break;case 7:var -a=os;break;case +a=oq;break;case 8:var -a=ot;break;case +a=or;break;case 9:var -a=ou;break;case +a=os;break;case 10:var -a=ov;break;case +a=ot;break;case 11:var -a=ow;break;case +a=ou;break;case 0:case 13:var -a=ol;break;case +a=oj;break;case 3:case 14:var -a=oo;break;default:var -a=ox}return dT(b,F4(a,c))}function +a=om;break;default:var +a=ov}return dT(b,F3(a,c))}function bu(c,i,b){function j(d){switch(c[1]){case 0:var a=45;break;case 1:var a=43;break;default:var -a=32}return F1(b,i,a)}function +a=32}return F0(b,i,a)}function q(c){var -a=FP(b);return 3===a?b<0.?o4:o5:4<=a?o6:c}switch(c[2]){case +a=FO(b);return 3===a?b<0.?o2:o3:4<=a?o4:c}switch(c[2]){case 5:var -e=gN(hx(c,i),b),d=0,u=E(e);for(;;){if(d===u)var +e=gO(hx(c,i),b),d=0,u=E(e);for(;;){if(d===u)var p=0;else{var -k=D(e,d)+i2|0,l=0;if(23>>0){if(55===k)l=1}else +k=D(e,d)+i1|0,l=0;if(23>>0){if(55===k)l=1}else if(21>>0)l=1;if(!l){var d=d+1|0;continue}var p=1}var -v=p?e:a9(e,o3);return q(v)}case +v=p?e:a5(e,o1);return q(v)}case 6:return j(0);case 7:var h=bI(j(0)),f=aW(h);if(0===f)var o=h;else{var -m=ab(f),n=f-1|0,r=0;if(!(n<0)){var +m=ac(f),n=f-1|0,r=0;if(!(n<0)){var a=r;for(;;){var -g=dC(h,a),s=25>>0?g:g+gH|0;aa(m,a,s);var +g=dD(h,a),s=25>>0?g:g+gI|0;aa(m,a,s);var t=a+1|0;if(n!==a){var a=t;continue}break}}var o=m}return aB(o);case -8:return q(j(0));default:return gN(hx(c,i),b)}}function -dc(e,y,x,w){var -c=y,a=x,d=w;for(;;)if(typeof -d==="number")return b(c,a);else -switch(d[0]){case +8:return q(j(0));default:return gO(hx(c,i),b)}}function +dd(e,y,x,w){var +b=y,a=x,c=w;for(;;)if(typeof +c==="number")return d(b,a);else +switch(c[0]){case 0:var -z=d[1];return function(b){return G(c,[5,a,b],z)};case +z=c[1];return function(c){return G(b,[5,a,c],z)};case 1:var -A=d[1];return function(b){var -e=0;if(40<=b)if(92===b)var -d=mY;else -if(bB<=b)e=1;else +A=c[1];return function(c){var +e=0;if(40<=c)if(92===c)var +d=mW;else +if(bB<=c)e=1;else e=2;else -if(32<=b)if(39<=b)var -d=mZ;else +if(32<=c)if(39<=c)var +d=mX;else e=2;else -if(14<=b)e=1;else -switch(b){case +if(14<=c)e=1;else +switch(c){case 8:var -d=m0;break;case +d=mY;break;case 9:var -d=m1;break;case +d=mZ;break;case 10:var -d=m2;break;case +d=m0;break;case 13:var -d=m3;break;default:e=1}switch(e){case +d=m1;break;default:e=1}switch(e){case 1:var -f=ab(4);aa(f,0,92);aa(f,1,48+(b/aR|0)|0);aa(f,2,48+((b/10|0)%10|0)|0);aa(f,3,48+(b%10|0)|0);var +f=ac(4);aa(f,0,92);aa(f,1,48+(c/aR|0)|0);aa(f,2,48+((c/10|0)%10|0)|0);aa(f,3,48+(c%10|0)|0);var d=aB(f);break;case 2:var -g=ab(1);aa(g,0,b);var +g=ac(1);aa(g,0,c);var d=aB(g);break}var -h=E(d),i=a$(h+2|0,39);b3(d,0,i,1,h);return G(c,[4,a,aB(i)],A)};case +h=E(d),i=a$(h+2|0,39);b3(d,0,i,1,h);return G(b,[4,a,aB(i)],A)};case 2:var -B=d[2],C=d[1];return fi(c,a,B,C,function(a){return a});case -3:return fi(c,a,d[2],d[1],n9);case -4:return dU(c,a,d[4],d[2],d[3],oZ,d[1]);case -5:return dU(c,a,d[4],d[2],d[3],o0,d[1]);case -6:return dU(c,a,d[4],d[2],d[3],o1,d[1]);case -7:return dU(c,a,d[4],d[2],d[3],o2,d[1]);case +B=c[2],C=c[1];return fk(b,a,B,C,function(a){return a});case +3:return fk(b,a,c[2],c[1],n7);case +4:return dU(b,a,c[4],c[2],c[3],oX,c[1]);case +5:return dU(b,a,c[4],c[2],c[3],oY,c[1]);case +6:return dU(b,a,c[4],c[2],c[3],oZ,c[1]);case +7:return dU(b,a,c[4],c[2],c[3],o0,c[1]);case 8:var -i=d[4],j=d[3],k=d[2],h=d[1];if(typeof +i=c[4],j=c[3],k=c[2],h=c[1];if(typeof k==="number"){if(typeof -j==="number")return j?function(d,b){return G(c,[4,a,bu(h,d,b)],i)}:function(b){return G(c,[4,a,bu(h,fg(h),b)],i)};var -_=j[1];return function(b){return G(c,[4,a,bu(h,_,b)],i)}}else{if(0===k[0]){var +j==="number")return j?function(d,c){return G(b,[4,a,bu(h,d,c)],i)}:function(c){return G(b,[4,a,bu(h,fi(h),c)],i)};var +_=j[1];return function(c){return G(b,[4,a,bu(h,_,c)],i)}}else{if(0===k[0]){var n=k[2],o=k[1];if(typeof -j==="number")return j?function(d,b){return G(c,[4,a,aN(o,n,bu(h,d,b))],i)}:function(b){return G(c,[4,a,aN(o,n,bu(h,fg(h),b))],i)};var -$=j[1];return function(b){return G(c,[4,a,aN(o,n,bu(h,$,b))],i)}}var +j==="number")return j?function(d,c){return G(b,[4,a,aN(o,n,bu(h,d,c))],i)}:function(c){return G(b,[4,a,aN(o,n,bu(h,fi(h),c))],i)};var +$=j[1];return function(c){return G(b,[4,a,aN(o,n,bu(h,$,c))],i)}}var p=k[1];if(typeof -j==="number")return j?function(e,d,b){return G(c,[4,a,aN(p,e,bu(h,d,b))],i)}:function(d,b){return G(c,[4,a,aN(p,d,bu(h,fg(h),b))],i)};var -ac=j[1];return function(d,b){return G(c,[4,a,aN(p,d,bu(h,ac,b))],i)}}case -9:return fi(c,a,d[2],d[1],mN);case +j==="number")return j?function(e,d,c){return G(b,[4,a,aN(p,e,bu(h,d,c))],i)}:function(d,c){return G(b,[4,a,aN(p,d,bu(h,fi(h),c))],i)};var +ab=j[1];return function(d,c){return G(b,[4,a,aN(p,d,bu(h,ab,c))],i)}}case +9:return fk(b,a,c[2],c[1],mM);case 10:var -a=[7,a],d=d[1];continue;case +a=[7,a],c=c[1];continue;case 11:var -a=[2,a,d[1]],d=d[2];continue;case +a=[2,a,c[1]],c=c[2];continue;case 12:var -a=[3,a,d[1]],d=d[2];continue;case +a=[3,a,c[1]],c=c[2];continue;case 13:var -D=d[3],H=d[2],q=ht(16);fh(q,H);var -v=hv(q);return function(b){return G(c,[4,a,v],D)};case +D=c[3],H=c[2],q=ht(16);fj(q,H);var +v=hv(q);return function(c){return G(b,[4,a,v],D)};case 14:var -I=d[3],J=d[2];return function(d){var -e=d[1],b=R(e,Y(ag(J)));if(typeof -b[2]==="number")return G(c,a,T(b[1],I));throw ap};case +I=c[3],J=c[2];return function(d){var +e=d[1],c=R(e,Y(af(J)));if(typeof +c[2]==="number")return G(b,a,T(c[1],I));throw ap};case 15:var -K=d[1];return function(d,b){return G(c,[6,a,function(a){return f(d,a,b)}],K)};case +K=c[1];return function(d,c){return G(b,[6,a,function(a){return g(d,a,c)}],K)};case 16:var -L=d[1];return function(b){return G(c,[6,a,b],L)};case +L=c[1];return function(c){return G(b,[6,a,c],L)};case 17:var -a=[0,a,d[1]],d=d[2];continue;case +a=[0,a,c[1]],c=c[2];continue;case 18:var -m=d[1];if(0===m[0]){var -M=d[2],N=m[1][1],P=0,c=function(b,c,d){return function(a){return G(c,[1,b,[0,a]],d)}}(a,c,M),a=P,d=N;continue}var -Q=d[2],S=m[1][1],U=0,c=function(b,c,d){return function(a){return G(c,[1,b,[1,a]],d)}}(a,c,Q),a=U,d=S;continue;case -19:throw[0,F,o8];case +m=c[1];if(0===m[0]){var +M=c[2],N=m[1][1],P=0,b=function(b,c,d){return function(a){return G(c,[1,b,[0,a]],d)}}(a,b,M),a=P,c=N;continue}var +Q=c[2],S=m[1][1],U=0,b=function(b,c,d){return function(a){return G(c,[1,b,[1,a]],d)}}(a,b,Q),a=U,c=S;continue;case +19:throw[0,F,o6];case 20:var -V=d[3],W=[8,a,o9];return function(a){return G(c,W,V)};case +V=c[3],W=[8,a,o7];return function(a){return G(b,W,V)};case 21:var -X=d[2];return function(b){return G(c,[4,a,eW(o_,b)],X)};case +X=c[2];return function(c){return G(b,[4,a,eY(o8,c)],X)};case 22:var -Z=d[1];return function(b){return G(c,[5,a,b],Z)};case +Z=c[1];return function(c){return G(b,[5,a,c],Z)};case 23:var -g=d[2],l=d[1];if(typeof +f=c[2],l=c[1];if(typeof l==="number")switch(l){case -0:return e<50?O(e+1|0,c,a,g):aj(O,[0,c,a,g]);case -1:return e<50?O(e+1|0,c,a,g):aj(O,[0,c,a,g]);case -2:throw[0,F,o$];default:return e<50?O(e+1|0,c,a,g):aj(O,[0,c,a,g])}else +0:return e<50?O(e+1|0,b,a,f):aj(O,[0,b,a,f]);case +1:return e<50?O(e+1|0,b,a,f):aj(O,[0,b,a,f]);case +2:throw[0,F,o9];default:return e<50?O(e+1|0,b,a,f):aj(O,[0,b,a,f])}else switch(l[0]){case -0:return e<50?O(e+1|0,c,a,g):aj(O,[0,c,a,g]);case -1:return e<50?O(e+1|0,c,a,g):aj(O,[0,c,a,g]);case -2:return e<50?O(e+1|0,c,a,g):aj(O,[0,c,a,g]);case -3:return e<50?O(e+1|0,c,a,g):aj(O,[0,c,a,g]);case -4:return e<50?O(e+1|0,c,a,g):aj(O,[0,c,a,g]);case -5:return e<50?O(e+1|0,c,a,g):aj(O,[0,c,a,g]);case -6:return e<50?O(e+1|0,c,a,g):aj(O,[0,c,a,g]);case -7:return e<50?O(e+1|0,c,a,g):aj(O,[0,c,a,g]);case -8:return e<50?O(e+1|0,c,a,g):aj(O,[0,c,a,g]);case +0:return e<50?O(e+1|0,b,a,f):aj(O,[0,b,a,f]);case +1:return e<50?O(e+1|0,b,a,f):aj(O,[0,b,a,f]);case +2:return e<50?O(e+1|0,b,a,f):aj(O,[0,b,a,f]);case +3:return e<50?O(e+1|0,b,a,f):aj(O,[0,b,a,f]);case +4:return e<50?O(e+1|0,b,a,f):aj(O,[0,b,a,f]);case +5:return e<50?O(e+1|0,b,a,f):aj(O,[0,b,a,f]);case +6:return e<50?O(e+1|0,b,a,f):aj(O,[0,b,a,f]);case +7:return e<50?O(e+1|0,b,a,f):aj(O,[0,b,a,f]);case +8:return e<50?O(e+1|0,b,a,f):aj(O,[0,b,a,f]);case 9:var -u=l[2];return e<50?f6(e+1|0,c,a,u,g):aj(f6,[0,c,a,u,g]);case -10:return e<50?O(e+1|0,c,a,g):aj(O,[0,c,a,g]);default:return e<50?O(e+1|0,c,a,g):aj(O,[0,c,a,g])}default:var -r=d[3],s=d[1],t=b(d[2],0);return e<50?f5(e+1|0,c,a,r,s,t):aj(f5,[0,c,a,r,s,t])}}function +u=l[2];return e<50?f6(e+1|0,b,a,u,f):aj(f6,[0,b,a,u,f]);case +10:return e<50?O(e+1|0,b,a,f):aj(O,[0,b,a,f]);default:return e<50?O(e+1|0,b,a,f):aj(O,[0,b,a,f])}default:var +r=c[3],s=c[1],t=d(c[2],0);return e<50?f5(e+1|0,b,a,r,s,t):aj(f5,[0,b,a,r,s,t])}}function f6(e,d,c,a,b){if(typeof a==="number")return e<50?O(e+1|0,d,c,b):aj(O,[0,d,c,b]);else switch(a[0]){case @@ -2393,179 +2400,184 @@ m=a[1];return function(a){return aS(d,c,m,b)};case 8:var n=a[2];return function(a){return aS(d,c,n,b)};case 9:var -o=a[3],p=a[2],q=ak(ag(a[1]),p);return function(a){return aS(d,c,aC(q,o),b)};case +o=a[3],p=a[2],q=ak(af(a[1]),p);return function(a){return aS(d,c,aC(q,o),b)};case 10:var r=a[1];return function(e,a){return aS(d,c,r,b)};case 11:var s=a[1];return function(a){return aS(d,c,s,b)};case 12:var t=a[1];return function(a){return aS(d,c,t,b)};case -13:throw[0,F,pa];default:throw[0,F,pb]}}function +13:throw[0,F,o_];default:throw[0,F,o$]}}function O(d,b,e,a){var -c=[8,e,pc];return d<50?dc(d+1|0,b,c,a):aj(dc,[0,b,c,a])}function -f5(h,c,f,a,e,d){if(e){var -i=e[1];return function(e){return o7(c,f,a,i,b(d,e))}}var -g=[4,f,d];return h<50?dc(h+1|0,c,g,a):aj(dc,[0,c,g,a])}function -G(a,b,c){return dJ(dc(0,a,b,c))}function -aS(a,b,c,d){return dJ(f6(0,a,b,c,d))}function -o7(a,b,c,d,e){return dJ(f5(0,a,b,c,d,e))}function -fi(f,e,d,a,c){if(typeof -a==="number")return function(a){return G(f,[4,e,b(c,a)],d)};else{if(0===a[0]){var -g=a[2],h=a[1];return function(a){return G(f,[4,e,aN(h,g,b(c,a))],d)}}var -i=a[1];return function(g,a){return G(f,[4,e,aN(i,g,b(c,a))],d)}}}function -dU(g,e,d,h,c,b,a){if(typeof +c=[8,e,pa];return d<50?dd(d+1|0,b,c,a):aj(dd,[0,b,c,a])}function +f5(h,b,f,a,e,c){if(e){var +i=e[1];return function(e){return o5(b,f,a,i,d(c,e))}}var +g=[4,f,c];return h<50?dd(h+1|0,b,g,a):aj(dd,[0,b,g,a])}function +G(a,b,c){return dK(dd(0,a,b,c))}function +aS(a,b,c,d){return dK(f6(0,a,b,c,d))}function +o5(a,b,c,d,e){return dK(f5(0,a,b,c,d,e))}function +fk(f,e,c,a,b){if(typeof +a==="number")return function(a){return G(f,[4,e,d(b,a)],c)};else{if(0===a[0]){var +g=a[2],h=a[1];return function(a){return G(f,[4,e,aN(h,g,d(b,a))],c)}}var +i=a[1];return function(g,a){return G(f,[4,e,aN(i,g,d(b,a))],c)}}}function +dU(f,e,d,h,c,b,a){if(typeof h==="number"){if(typeof -c==="number")return c?function(h,c){return G(g,[4,e,cp(h,f(b,a,c))],d)}:function(c){return G(g,[4,e,f(b,a,c)],d)};var -l=c[1];return function(c){return G(g,[4,e,cp(l,f(b,a,c))],d)}}else{if(0===h[0]){var +c==="number")return c?function(h,c){return G(f,[4,e,cp(h,g(b,a,c))],d)}:function(c){return G(f,[4,e,g(b,a,c)],d)};var +l=c[1];return function(c){return G(f,[4,e,cp(l,g(b,a,c))],d)}}else{if(0===h[0]){var i=h[2],j=h[1];if(typeof -c==="number")return c?function(h,c){return G(g,[4,e,aN(j,i,cp(h,f(b,a,c)))],d)}:function(c){return G(g,[4,e,aN(j,i,f(b,a,c))],d)};var -m=c[1];return function(c){return G(g,[4,e,aN(j,i,cp(m,f(b,a,c)))],d)}}var +c==="number")return c?function(h,c){return G(f,[4,e,aN(j,i,cp(h,g(b,a,c)))],d)}:function(c){return G(f,[4,e,aN(j,i,g(b,a,c))],d)};var +m=c[1];return function(c){return G(f,[4,e,aN(j,i,cp(m,g(b,a,c)))],d)}}var k=h[1];if(typeof -c==="number")return c?function(i,h,c){return G(g,[4,e,aN(k,i,cp(h,f(b,a,c)))],d)}:function(h,c){return G(g,[4,e,aN(k,h,f(b,a,c))],d)};var -n=c[1];return function(h,c){return G(g,[4,e,aN(k,h,cp(n,f(b,a,c)))],d)}}}function -bv(c,f){var +c==="number")return c?function(i,h,c){return G(f,[4,e,aN(k,i,cp(h,g(b,a,c)))],d)}:function(h,c){return G(f,[4,e,aN(k,h,g(b,a,c))],d)};var +n=c[1];return function(h,c){return G(f,[4,e,aN(k,h,cp(n,g(b,a,c)))],d)}}}function +bv(b,f){var a=f;for(;;)if(typeof a==="number")return 0;else switch(a[0]){case 0:var -g=a[1],h=hw(a[2]);bv(c,g);return cT(c,h);case +g=a[1],h=hw(a[2]);bv(b,g);return cU(b,h);case 1:var -d=a[2],e=a[1];if(0===d[0]){var -i=d[1];bv(c,e);cT(c,pd);var +c=a[2],e=a[1];if(0===c[0]){var +i=c[1];bv(b,e);cU(b,pb);var a=i;continue}var -j=d[1];bv(c,e);cT(c,pe);var +j=c[1];bv(b,e);cU(b,pc);var a=j;continue;case 6:var -m=a[2];bv(c,a[1]);return b(m,c);case -7:bv(c,a[1]);return cd(c);case +m=a[2];bv(b,a[1]);return d(m,b);case +7:bv(b,a[1]);return cd(b);case 8:var -n=a[2];bv(c,a[1]);return ae(n);case +n=a[2];bv(b,a[1]);return ae(n);case 2:case 4:var -k=a[2];bv(c,a[1]);return cT(c,k);default:var -l=a[2];bv(c,a[1]);return mo(c,l)}}function -bL(c,f){var +k=a[2];bv(b,a[1]);return cU(b,k);default:var +l=a[2];bv(b,a[1]);return ml(b,l)}}function +bL(b,f){var a=f;for(;;)if(typeof a==="number")return 0;else switch(a[0]){case 0:var -g=a[1],h=hw(a[2]);bL(c,g);return cY(c,h);case +g=a[1],h=hw(a[2]);bL(b,g);return cZ(b,h);case 1:var -d=a[2],e=a[1];if(0===d[0]){var -i=d[1];bL(c,e);cY(c,pf);var +c=a[2],e=a[1];if(0===c[0]){var +i=c[1];bL(b,e);cZ(b,pd);var a=i;continue}var -j=d[1];bL(c,e);cY(c,pg);var +j=c[1];bL(b,e);cZ(b,pe);var a=j;continue;case 6:var -m=a[2];bL(c,a[1]);return cY(c,b(m,0));case +m=a[2];bL(b,a[1]);return cZ(b,d(m,0));case 7:var a=a[1];continue;case 8:var -n=a[2];bL(c,a[1]);return ae(n);case +n=a[2];bL(b,a[1]);return ae(n);case 2:case 4:var -k=a[2];bL(c,a[1]);return cY(c,k);default:var -l=a[2];bL(c,a[1]);return hs(c,l)}}function +k=a[2];bL(b,a[1]);return cZ(b,k);default:var +l=a[2];bL(b,a[1]);return hs(b,l)}}function hy(d,c){var a=c[1],b=0;return G(function(a){bv(d,a);return 0},b,a)}function -fj(a){return hy(a_,a)}function +fl(a){return hy(a_,a)}function aT(b){var a=b[1];return G(function(b){var -a=fe(64);bL(a,b);return hr(a)},0,a)}var -fk=[0,0];function -fm(i,h){var +a=fg(64);bL(a,b);return hr(a)},0,a)}var +fm=[0,0];function +fo(i,h){var a=i[1+h];if(1-(typeof -a==="number"?1:0)){if(dI(a)===eA)return b(aT(ph),a);if(dI(a)===li){var -d=gN(mR,a),c=0,g=E(d);for(;;){if(g<=c)return a9(d,mQ);var -e=D(d,c),f=0;if(48<=e){if(!(58<=e))f=1}else +a==="number"?1:0)){if(dJ(a)===eC)return d(aT(pf),a);if(dJ(a)===lg){var +c=gO(mQ,a),b=0,g=E(c);for(;;){if(g<=b)return a5(c,mP);var +e=D(c,b),f=0;if(48<=e){if(!(58<=e))f=1}else if(45===e)f=1;if(f){var -c=c+1|0;continue}return d}}return pi}return b(aT(pj),a)}function -hz(b,a){if(b.length-1<=a)return pk;var -c=hz(b,a+1|0),d=fm(b,a);return f(aT(pl),d,c)}function -fn(a){function +b=b+1|0;continue}return c}}return pg}return d(aT(ph),a)}function +hz(b,a){if(b.length-1<=a)return pi;var +c=hz(b,a+1|0),d=fo(b,a);return g(aT(pj),d,c)}function +dV(a){function p(f){var -c=f;for(;;){if(c){var -g=c[2],h=c[1];try{var -e=0,d=b(h,a);e=1}catch(a){}if(e&&d)return[0,d[1]];var -c=g;continue}return 0}}var -i=p(fk[1]);if(i)return i[1];if(a===fa)return pq;if(a===g$)return pr;if(a[1]===g_){var -d=a[2],j=d[3],q=d[2],r=d[1];return f9(aT(fl),r,q,j,j+5|0,ps)}if(a[1]===F){var -e=a[2],k=e[3],s=e[2],t=e[1];return f9(aT(fl),t,s,k,k+6|0,pt)}if(a[1]===hc){var -g=a[2],l=g[3],u=g[2],v=g[1];return f9(aT(fl),v,u,l,l+6|0,pu)}if(0===dI(a)){var +b=f;for(;;){if(b){var +g=b[2],h=b[1];try{var +e=0,c=d(h,a);e=1}catch(a){}if(e&&c)return[0,c[1]];var +b=g;continue}return 0}}var +i=p(fm[1]);if(i)return i[1];if(a===fc)return po;if(a===g$)return pp;if(a[1]===g_){var +c=a[2],j=c[3],q=c[2],r=c[1];return f9(aT(fn),r,q,j,j+5|0,pq)}if(a[1]===F){var +e=a[2],k=e[3],s=e[2],t=e[1];return f9(aT(fn),t,s,k,k+6|0,pr)}if(a[1]===hc){var +f=a[2],l=f[3],u=f[2],v=f[1];return f9(aT(fn),v,u,l,l+6|0,ps)}if(0===dJ(a)){var h=a.length-1,w=a[1][1];if(2>>0)var -m=hz(a,2),n=fm(a,1),c=f(aT(pm),n,m);else +m=hz(a,2),n=fo(a,1),b=g(aT(pk),n,m);else switch(h){case 0:var -c=pn;break;case +b=pl;break;case 1:var -c=po;break;default:var -o=fm(a,1),c=b(aT(pp),o)}return a9(w,c)}return a[1]}function -fo(t,s){var -e=FQ(s),g=e.length-1-1|0,p=0;if(!(g<0)){var -c=p;for(;;){var -a=af(e,c)[1+c],f=function(a){return function(b){return b?0===a?pv:pw:0===a?px:py}}(c);if(0===a[0])var -h=a[5],i=a[4],j=a[3],k=a[6]?pz:pB,l=a[2],m=a[7],n=f(a[1]),d=[0,FG(aT(pA),n,m,l,k,j,i,h)];else +b=pm;break;default:var +o=fo(a,1),b=d(aT(pn),o)}return a5(w,b)}return a[1]}function +fp(t,s){var +e=FP(s),g=e.length-1-1|0,p=0;if(!(g<0)){var +b=p;for(;;){var +a=ab(e,b)[1+b],f=function(a){return function(b){return b?0===a?pt:pu:0===a?pv:pw}}(b);if(0===a[0])var +h=a[5],i=a[4],j=a[3],k=a[6]?px:pz,l=a[2],m=a[7],n=f(a[1]),c=[0,FF(aT(py),n,m,l,k,j,i,h)];else if(a[1])var -d=0;else +c=0;else var -o=f(0),d=[0,b(aT(pC),o)];if(d){var -q=d[1];b(hy(t,pD),q)}var -r=c+1|0;if(g!==c){var -c=r;continue}break}}return 0}function -fp(a){fk[1]=[0,a,fk[1]];return 0}function -pE(c,a){var -d=fn(c);b(fj(pF),d);fo(a_,a);return cd(a_)}var -pG=gY(251,0);g1(a(kE),function(e,j){try{try{var -c=j?pG:mh(0);try{fc(0)}catch(a){}try{var -a=pE(e,c),d=a}catch(a){a=i(a);var -g=fn(e);b(fj(pI),g);fo(a_,c);var -h=fn(a);b(fj(pJ),h);fo(a_,mh(0));var -d=cd(a_)}var -f=d}catch(a){a=i(a);if(a!==fa)throw a;var -f=mV(pH)}return f}catch(a){return 0}});try{var -FE=e7(FD),hB=FE}catch(a){a=i(a);if(a!==az)throw a;try{var -FC=e7(FB),hA=FC}catch(a){a=i(a);if(a!==az)throw a;var -hA=pL}var +o=f(0),c=[0,d(aT(pA),o)];if(c){var +q=c[1];d(hy(t,pB),q)}var +r=b+1|0;if(g!==b){var +b=r;continue}break}}return 0}function +dW(c){for(;;){var +a=fm[1],b=1-fb(fm,a,[0,c,a]);if(b)continue;return b}}var +pD=pC.slice();function +pE(e,c){var +f=dV(e);d(fl(pF),f);fp(a_,c);var +a=Gh(0);if(a<0){var +b=cT(a);hd(ab(pD,b)[1+b])}return cd(a_)}var +pG=[0];g1(a(kC),function(f,j){try{try{var +b=j?pG:me(0);try{fe(0)}catch(a){}try{var +a=pE(f,b),e=a}catch(a){a=c(a);var +h=dV(f);d(fl(pI),h);fp(a_,b);var +i=dV(a);d(fl(pJ),i);fp(a_,me(0));var +e=cd(a_)}var +g=e}catch(a){a=c(a);if(a!==fc)throw a;var +g=hd(pH)}return g}catch(a){return 0}});var +pL=[I,pK,aA(0)];dW(function(a){return a[1]===pL?[0,a5(pM,dV(a[2]))]:0});try{var +FD=mr(FC),hB=FD}catch(a){a=c(a);if(a!==aH)throw a;try{var +FB=mr(FA),hA=FB}catch(a){a=c(a);if(a!==aH)throw a;var +hA=pO}var hB=hA}var -pM=m_(hB,82),dV=[jg,function(x){var -m=Gx(0),c=[0,bJ(55,0),0],i=0===m.length-1?[0,0]:m,j=i.length-1,b=0;for(;;){af(c[1],b)[1+b]=b;var +pP=m8(hB,82),dX=[jf,function(x){var +m=Gw(0),c=[0,bJ(55,0),0],i=0===m.length-1?[0,0]:m,j=i.length-1,b=0;for(;;){ab(c[1],b)[1+b]=b;var w=b+1|0;if(54!==b){var b=w;continue}var -g=[0,pK],k=54+dM(55,j)|0,s=0;if(!(k<0)){var +g=[0,pN],k=54+dN(55,j)|0,s=0;if(!(k<0)){var d=s;for(;;){var -e=d%55|0,l=Gl(d,j),t=af(i,l)[1+l],h=a9(g[1],a(q+t));g[1]=Gh(h,0,E(h));var -f=g[1],n=D(f,3)<<24,o=D(f,2)<<16,p=D(f,1)<<8,r=((D(f,0)+p|0)+o|0)+n|0,u=(af(c[1],e)[1+e]^r)&gv;af(c[1],e)[1+e]=u;var +e=d%55|0,l=Gl(d,j),t=ab(i,l)[1+l],h=a5(g[1],a(p+t));g[1]=Gg(h,0,E(h));var +f=g[1],n=D(f,3)<<24,o=D(f,2)<<16,q=D(f,1)<<8,r=((D(f,0)+q|0)+o|0)+n|0,u=(ab(c[1],e)[1+e]^r)&gw;ab(c[1],e)[1+e]=u;var v=d+1|0;if(k!==d){var d=v;continue}break}}c[2]=0;return c}}];function -pN(h,k){var -l=h?h[1]:pM,b=16;for(;;){if(!(k<=b)&&!(hf<(b*2|0))){var +pQ(h,k){var +l=h?h[1]:pP,b=16;for(;;){if(!(k<=b)&&!(hf<(b*2|0))){var b=b*2|0;continue}if(l){var -i=dI(dV),a=em===i?dV[1]:jg===i?no(dV):dV;a[2]=(a[2]+1|0)%55|0;var -c=a[2],d=af(a[1],c)[1+c],e=(a[2]+24|0)%55|0,f=(af(a[1],e)[1+e]+(d^(d>>>25|0)&31)|0)&gv,g=a[2];af(a[1],g)[1+g]=f;var +i=dJ(dX),a=eo===i?dX[1]:jf===i?nm(dX):dX;a[2]=(a[2]+1|0)%55|0;var +c=a[2],d=ab(a[1],c)[1+c],e=(a[2]+24|0)%55|0,f=(ab(a[1],e)[1+e]+(d^(d>>>25|0)&31)|0)&gw,g=a[2];ab(a[1],g)[1+g]=f;var j=f}else var j=0;return[0,0,bJ(b,0),j,b]}}function -ba(a){return FV(10,aR,0,a)}var -hE=[K,pO,aG(0)],hC=0,hD=-1;function -dW(a,b){a[13]=a[13]+b[3]|0;return hq(b,a[28])}var +ba(a){return FU(10,aR,0,a)}var +hE=[I,pR,aA(0)],hC=0,hD=-1;function +dY(a,b){a[13]=a[13]+b[3]|0;return hq(b,a[28])}var hF=1000000010;function fq(b,a){return P(b[17],a,0,E(a))}function -fr(a){return b(a[19],0)}function +fr(a){return d(a[19],0)}function hG(a,c,b){a[9]=a[9]-c|0;fq(a,b);a[11]=0;return 0}function -dX(c,a){var -b=ad(a,pP);return b?hG(c,E(a),a):b}function -b9(a,c,f){var -g=c[3],h=c[2];dX(a,c[1]);fr(a);a[11]=1;var -d=(a[6]-f|0)+h|0,e=a[8],i=Ge(e,d)?e:d;a[10]=i;a[9]=a[6]-a[10]|0;b(a[21],a[10]);return dX(a,g)}function -hH(b,a){return b9(b,pQ,a)}function -cq(a,c){var -d=c[2],e=c[3];dX(a,c[1]);a[9]=a[9]-d|0;b(a[20],d);return dX(a,e)}function -pR(a,j,c){if(typeof -c==="number")switch(c){case +dZ(c,a){var +b=ai(a,pS);return b?hG(c,E(a),a):b}function +b9(a,b,f){var +g=b[3],h=b[2];dZ(a,b[1]);fr(a);a[11]=1;var +c=(a[6]-f|0)+h|0,e=a[8],i=Gd(e,c)?e:c;a[10]=i;a[9]=a[6]-a[10]|0;d(a[21],a[10]);return dZ(a,g)}function +hH(b,a){return b9(b,pT,a)}function +cq(a,b){var +c=b[2],e=b[3];dZ(a,b[1]);a[9]=a[9]-c|0;d(a[20],c);return dZ(a,e)}function +pU(a,j,b){if(typeof +b==="number")switch(b){case 0:var s=cn(a[3]);if(s){var t=s[1][1],u=function(b,a){if(a){var -c=a[1],d=a[2];return gW(b,c)?[0,b,a]:[0,c,u(b,d)]}return[0,b,0]};t[1]=u(a[6]-a[9]|0,t[1]);return 0}return 0;case +c=a[1],d=a[2];return gX(b,c)?[0,b,a]:[0,c,u(b,d)]}return[0,b,0]};t[1]=u(a[6]-a[9]|0,t[1]);return 0}return 0;case 1:cm(a[2]);return 0;case 2:cm(a[3]);return 0;case 3:var @@ -2575,24 +2587,24 @@ w=a[10]!==(a[6]-a[9]|0)?1:0;if(w){var f=a[28],h=f[2];if(h){var n=h[1];if(h[2]){var K=h[2];f[1]=f[1]-1|0;f[2]=K;var -i=[0,n]}else{fd(f);var +i=[0,n]}else{ff(f);var i=[0,n]}}else var i=0;if(i){var r=i[1],M=r[1];a[12]=a[12]-r[3]|0;a[9]=a[9]+M|0;return 0}return 0}return w;default:var -x=cm(a[5]);return x?fq(a,b(a[25],x[1])):0}else -switch(c[0]){case -0:return hG(a,j,c[1]);case +x=cm(a[5]);return x?fq(a,d(a[25],x[1])):0}else +switch(b[0]){case +0:return hG(a,j,b[1]);case 1:var -d=c[2],g=c[1],y=d[1],N=d[2],z=cn(a[2]);if(z){var +c=b[2],g=b[1],y=c[1],N=c[2],z=cn(a[2]);if(z){var A=z[1],e=A[2];switch(A[1]){case 0:return cq(a,g);case -1:return b9(a,d,e);case -2:return b9(a,d,e);case -3:return a[9]<(j+E(y)|0)?b9(a,d,e):cq(a,g);case -4:return a[11]?cq(a,g):a[9]<(j+E(y)|0)?b9(a,d,e):((a[6]-e|0)+N|0)>>0))hH(a,q)}else fr(a)}var T=a[9]-S|0,U=1===I?1:a[9]>>3|0,cj(b4(b,a>>>3|0)|1<<(a&7)))}function -d1(b){var -a=fx(0);c0(a,b);return a}function -d2(c){var -b=ab(32),a=0;for(;;){a3(b,a,cj(b4(c,a)^cE));var +c1(b,a){return a3(b,a>>>3|0,cj(b4(b,a>>>3|0)|1<<(a&7)))}function +d3(b){var +a=fx(0);c1(a,b);return a}function +d4(c){var +b=ac(32),a=0;for(;;){a3(b,a,cj(b4(c,a)^cE));var d=a+1|0;if(31!==a){var a=d;continue}return b}}function fy(d,c){var -b=ab(32),a=0;for(;;){var +b=ac(32),a=0;for(;;){var e=b4(c,a);a3(b,a,cj(b4(d,a)|e));var f=a+1|0;if(31!==a){var a=f;continue}return b}}function -rB(c,b){try{var +rC(d,b){try{var a=0;for(;;){var -e=b4(b,a);if(0!==(b4(c,a)&e))throw g9;var -f=a+1|0;if(31!==a){var -a=f;continue}var -d=1;return d}}catch(a){a=i(a);if(a===g9)return 0;throw a}}function +f=b4(b,a);if(0!==(b4(d,a)&f))throw g9;var +g=a+1|0;if(31!==a){var +a=g;continue}var +e=1;return e}}catch(a){a=c(a);if(a===g9)return 0;throw a}}function hU(f,e){var a=0;for(;;){var -d=b4(e,a);if(0!==d){var -c=0;for(;;){if(0!==(d&1<>>0){if(!(25>>0))d=1}else if(23!==b)d=1;var -e=d?a+gH|0:a;return c0(c,e)},b);var +e=d?a+gI|0:a;return c1(c,e)},b);var d=c}else var d=b;var -h=f?d2(d):d;return dP(h)}throw[0,F,rQ]}var -hY=ab(cI),db=0;for(;;){a3(hY,db,hd(cj(db)));var -Fw=db+1|0;if(cE!==db){var -db=Fw;continue}dP(hY);var -d5=dR([0,g2]),hZ=function(a){var +h=f?d4(d):d;return dP(h)}throw[0,F,rR]}var +hY=ac(cI),dc=0;for(;;){a3(hY,dc,he(cj(dc)));var +Fx=dc+1|0;if(cE!==dc){var +dc=Fx;continue}dP(hY);var +d7=dR([0,g2]),hZ=function(a){var b=hr(a[1]);a[1][2]=0;var c=E(b);if(0===c)return 0;if(1===c){var -d=a[2];a[2]=[0,[0,D(b,0)],d];return 0}a[2]=[0,[1,b],a[2]];return 0},rU=d2(d1(10)),fD=z,fE=md,r0=function(b){var -e=E(b),z=[0,1];function +d=a[2];a[2]=[0,[0,D(b,0)],d];return 0}a[2]=[0,[1,b],a[2]];return 0},rV=d4(d3(10)),fD=z,fE=ma,r1=function(b){var +f=E(b),z=[0,1];function C(g){var -d=fx(0),a=g;for(;;){if(e<=a)bs(rY);if(93===D(b,a)&&g>>0)if(9<=r)var -j=[0,[9,k+el|0],g+1|0];else +j=[0,[9,k+en|0],g+1|0];else l=1;else if(r)l=2;else{var I=z[1];z[1]++;var -t=A(g+1|0),o=t[2],y=0,J=t[1];if((o+1|0)>>0)){if(q){var c=[6,c],d=d+1|0;continue}var c=[5,c],d=d+1|0;continue}if(21===q){var @@ -3014,69 +3026,69 @@ B=0;if(typeof c!=="number"&&0===c[0]){hs(h[1],c[1]);B=1}if(!B){hZ(h);h[2]=[0,c,h[2]]}var a=d;continue a}}}hZ(h);return[0,[3,dO(h[2])],a]}}function A(g){var -d=B(g),c=d[1],a=d[2];for(;;){if((a+2|0)<=e&&92===D(b,a)&&dp===D(b,a+1|0)){var -f=B(a+2|0),c=[4,c,f[1]],a=f[2];continue}return[0,c,a]}}var -G=A(0),O=G[1],H=G[2]===e?O:bs(rZ),g=[0,bJ(32,0)],c=[0,0],m=[0,d5[1]],n=[0,0],j=[0,1],o=[0,0],r=0;function -a(f,e){if(g[1].length-1<=c[1]){var -a=[0,g[1].length-1];for(;;){if(a[1]<=c[1]){a[1]=a[1]*2|0;continue}var -b=bJ(a[1],0);hp(g[1],0,b,0,g[1].length-1);g[1]=b;break}}var -h=hX(f,e),d=c[1];af(g[1],d)[1+d]=h;c[1]++;return 0}function -k(d){var -b=c[1];a(d3,0);return b}function +d=B(g),c=d[1],a=d[2];for(;;){if((a+2|0)<=f&&92===D(b,a)&&dq===D(b,a+1|0)){var +e=B(a+2|0),c=[4,c,e[1]],a=e[2];continue}return[0,c,a]}}var +G=A(0),O=G[1],H=G[2]===f?O:bs(r0),h=[0,bJ(32,0)],d=[0,0],m=[0,d7[1]],n=[0,0],j=[0,1],o=[0,0],r=0;function +a(f,e){if(h[1].length-1<=d[1]){var +a=[0,h[1].length-1];for(;;){if(a[1]<=d[1]){a[1]=a[1]*2|0;continue}var +b=bJ(a[1],0);hp(h[1],0,b,0,h[1].length-1);h[1]=b;break}}var +g=hX(f,e),c=d[1];ab(h[1],c)[1+c]=g;d[1]++;return 0}function +k(c){var +b=d[1];a(d5,0);return b}function l(a,c,b){var -d=hX(c,fA(b,a));af(g[1],a)[1+a]=d;return 0}function -h(b){try{var -a=f(d5[28],b,m[1]);return a}catch(a){a=i(a);if(a===az){var -c=n[1];m[1]=P(d5[4],b,c,m[1]);n[1]++;return c}throw a}}function +d=hX(c,fA(b,a));ab(h[1],a)[1+a]=d;return 0}function +i(b){try{var +a=g(d7[28],b,m[1]);return a}catch(a){a=c(a);if(a===aH){var +d=n[1];m[1]=P(d7[4],b,d,m[1]);n[1]++;return d}throw a}}function t(b){if(fB(b)){var -a=o[1];if(64<=a)bs(rR);o[1]++;return a}return-1}function -p(b,a){return rB(b,a)}function -d(b){if(typeof +a=o[1];if(64<=a)bs(rS);o[1]++;return a}return-1}function +p(b,a){return rC(b,a)}function +e(b){if(typeof b==="number")switch(b){case -0:return a(rE,0);case -1:return a(rF,0);default:return a(rG,0)}else +0:return a(rF,0);case +1:return a(rG,0);default:return a(rH,0)}else switch(b[0]){case -0:return a(d3,b[1]);case +0:return a(d5,b[1]);case 1:var -e=b[1],n=E(e);if(0===n)return 0;if(1===n)return a(d3,D(e,0));try{var -o=ho(e,0);d([1,rz(e,o)]);a(d3,0);var -v=d([1,rA(e,o+1|0)]);return v}catch(b){b=i(b);if(b===az)return a(rC,h(e));throw b}case +f=b[1],n=E(f);if(0===n)return 0;if(1===n)return a(d5,D(f,0));try{var +o=ho(f,0);e([1,rA(f,o)]);a(d5,0);var +v=e([1,rB(f,o+1|0)]);return v}catch(b){b=c(b);if(b===aH)return a(rD,i(f));throw b}case 2:var -p=b[1],w=b[2]?d2(p):p;return a(rD,h(dP(w)));case +p=b[1],w=b[2]?d4(p):p;return a(rE,i(dP(w)));case 3:return J(b[1]);case 4:var -x=b[2],y=b[1],z=k(0);d(y);var -A=k(0),B=c[1];d(x);var -C=c[1];l(z,d4,B);return l(A,fz,C);case +x=b[2],y=b[1],z=k(0);e(y);var +A=k(0),B=d[1];e(x);var +C=d[1];l(z,d6,B);return l(A,fz,C);case 5:var -q=b[1],f=t(q),r=k(0);if(0<=f)a(hV,f);d(q);if(0<=f)a(hW,f);a(fz,fA(r,c[1]));return l(r,d4,c[1]);case +q=b[1],g=t(q),r=k(0);if(0<=g)a(hV,g);e(q);if(0<=g)a(hW,g);a(fz,fA(r,d[1]));return l(r,d6,d[1]);case 6:var -s=b[1],g=t(s),F=c[1];d(s);if(0<=g)a(hW,g);var -G=k(0);if(0<=g)a(hV,g);a(fz,fA(F,c[1]));return l(G,d4,c[1]);case +s=b[1],h=t(s),F=d[1];e(s);if(0<=h)a(hW,h);var +G=k(0);if(0<=h)a(hV,h);a(fz,fA(F,d[1]));return l(G,d6,d[1]);case 7:var -H=b[1],I=k(0);d(H);return l(I,d4,c[1]);case +H=b[1],I=k(0);e(H);return l(I,d6,d[1]);case 8:var -m=b[1],K=b[2];a(rH,m);d(K);a(rI,m);j[1]=dM(j[1],m+1|0);return 0;default:var -u=b[1];a(rJ,u);j[1]=dM(j[1],u+1|0);return 0}}function +m=b[1],K=b[2];a(rI,m);e(K);a(rJ,m);j[1]=dN(j[1],m+1|0);return 0;default:var +u=b[1];a(rK,u);j[1]=dN(j[1],u+1|0);return 0}}function J(o){var b=o;for(;;){if(b){var c=b[1];if(typeof c!=="number")switch(c[0]){case 5:var -e=c[1],l=0;if(typeof -e==="number")l=1;else -switch(e[0]){case +d=c[1],l=0;if(typeof +d==="number")l=1;else +switch(d[0]){case 0:case 2:var -i=b[2],s=c1(i);if(p(bM(e),s)){a(rM,h(fC(r,e)));var -b=i;continue}break;default:l=1}break;case +h=b[2],s=c2(h);if(p(bM(d),s)){a(rN,i(fC(r,d)));var +b=h;continue}break;default:l=1}break;case 6:var f=c[1],m=0;if(typeof f==="number")m=1;else switch(f[0]){case 0:case 2:var -j=b[2],t=c1(j);if(p(bM(f),t)){a(rN,h(fC(r,f)));var +j=b[2],t=c2(j);if(p(bM(f),t)){a(rO,i(fC(r,f)));var b=j;continue}break;default:m=1}break;case 7:var g=c[1],n=0;if(typeof @@ -3084,88 +3096,88 @@ g==="number")n=1;else switch(g[0]){case 0:case 2:var -k=b[2],u=c1(k);if(p(bM(g),u)){a(rL,h(fC(r,g)));var +k=b[2],u=c2(k);if(p(bM(g),u)){a(rM,i(fC(r,g)));var b=k;continue}break;default:n=1}break}var -q=b[2];d(c);var -b=q;continue}return 0}}d(H);a(rK,0);var -u=bM(H);if(mb(u,bw))var +q=b[2];e(c);var +b=q;continue}return 0}}e(H);a(rL,0);var +u=bM(H);if(l_(u,bw))var v=-1;else{var s=a$(cI,0);hU(function(a){return a3(s,a,1)},u);var -v=h(dP(s))}var -w=bJ(n[1],rS),K=m[1];function -L(b,a){af(w,a)[1+a]=b;return 0}f(d5[12],L,K);var -q=c[1],x=g[1],I=0,M=o[1],N=j[1];if(0<=q&&!((x.length-1-q|0)<0)){var -y=FK(x,0,q);I=1}if(!I)var -y=ae(m$);return[0,y,w,rT,N,M,v]},d6=function(b,a){return Math.abs(b-a)<0.001?1:0},fF=function(b,a){return d6(b,a)?0:b>a===b?c:mC(b,a)}return mC(b,a)},io=function(a){return typeof -a==="number"?a:GX(a)},by=0,fQ=1,uq=-1,ip=function(a){return ci(0,a,0,E(a))},ur=function(b,a){return ci(b,a,0,E(a))},fR=function(a){if(typeof +c=b<>a===b?c:mB(b,a)}return mB(b,a)},io=function(a){return typeof +a==="number"?a:GW(a)},by=0,fQ=1,ur=-1,ip=function(a){return ci(0,a,0,E(a))},us=function(b,a){return ci(b,a,0,E(a))},fR=function(a){if(typeof a==="number")return a;var e=g5(a);if(63>g;f=1}if(!f)var -c=GV(a,b);var -i=GK(a,ct(c,b)),d=e9(c),h=i?d:F$(d,us);return gV(eZ(h),b)}return eZ(e9(a))},c9=function(a,b){if(a!==0&&b!==1){var -c=GM(a,b);if(c===1)return[0,a,b];var +c=GU(a,b);var +i=GJ(a,ct(c,b)),d=e_(c),h=i?d:F_(d,ut);return gW(e1(h),b)}return e1(e_(a))},c_=function(a,b){if(a!==0&&b!==1){var +c=GL(a,b);if(c===1)return[0,a,b];var d=im(b,c);return[0,im(a,c),d]}return[0,a,fQ]},iq=function(b,a){var -c=br(a);if(0===c)return[0,br(b),by];if(0>>0))switch(b){case 0:return 2;case -1:break;default:return 1}return 3}return a[1]===0?0:4},ut=function(a){var +1:break;default:return 1}return 3}return a[1]===0?0:4},uu=function(a){var b=a[2];return[0,cs(a[1]),b]},fU=function(b,a){if(b[2]!==0&&a[2]!==0){var -c=bS(b[2],a[2]);return c9(bS(b[1],a[1]),c)}return[0,a8(br(b[1]),br(a[1])),by]},fV=function(a){switch(a){case +c=bS(b[2],a[2]);return c_(bS(b[1],a[1]),c)}return[0,a9(br(b[1]),br(a[1])),by]},fV=function(a){switch(a){case 0:return 2;case 1:return 8;case -2:return 10;default:return 16}},fW=function(f,e,d,c){var -a=e;for(;;){if(d<=a)return 0;if(b(c,D(f,a)))return[0,a];var -a=a+1|0;continue}},c=[K,uD,aG(0)],s=[K,uK,aG(0)],uv=function(a){if(ad(a,uw)){if(ad(a,ux)){if(!ad(a,uy))return it;if(ad(a,uz)){if(ad(a,uA))try{var -l=ho(a,47),Z=ci(0,a,l+1|0,(E(a)-l|0)-1|0),_=iq(ci(0,a,0,l),Z);return _}catch(l){l=i(l);if(l===az){var +2:return 10;default:return 16}},fW=function(f,e,c,b){var +a=e;for(;;){if(c<=a)return 0;if(d(b,D(f,a)))return[0,a];var +a=a+1|0;continue}},b=[I,uE,aA(0)],s=[I,uL,aA(0)],uw=function(a){if(ai(a,ux)){if(ai(a,uy)){if(!ai(a,uz))return it;if(ai(a,uA)){if(ai(a,uB))try{var +l=ho(a,47),Z=ci(0,a,l+1|0,(E(a)-l|0)-1|0),_=iq(ci(0,a,0,l),Z);return _}catch(l){l=c(l);if(l===aH){var j=E(a),x=0;if(j<1)var s=[0,0,x];else{var -P=D(a,0)+lR|0,S=0;if(!(2

>>0)){var +P=D(a,0)+lO|0,S=0;if(!(2

>>0)){var T=0;switch(P){case 0:var R=[0,0,1];break;case @@ -3497,487 +3509,536 @@ R=[0,1,1]}if(!T){var Q=R;S=1}}if(!S)var Q=[0,0,x];var s=Q}var -c=s[2];if(j<(c+2|0))var -t=[0,2,c];else{var -Y=D(a,c),g=D(a,c+1|0),r=0;if(48===Y){var -h=0;if(89<=g){if(98===g)h=2;else -if(dz===g)h=1;else -if(bT!==g){r=1;h=3}}else -if(66===g)h=2;else -if(79===g)h=1;else -if(!(88<=g)){r=1;h=3}switch(h){case +d=s[2];if(j<(d+2|0))var +t=[0,2,d];else{var +Y=D(a,d),h=D(a,d+1|0),r=0;if(48===Y){var +i=0;if(89<=h){if(98===h)i=2;else +if(dA===h)i=1;else +if(bT!==h){r=1;i=3}}else +if(66===h)i=2;else +if(79===h)i=1;else +if(!(88<=h)){r=1;i=3}switch(i){case 3:break;case 0:var -q=[0,3,c+2|0];break;case +q=[0,3,d+2|0];break;case 1:var -q=[0,1,c+2|0];break;default:var -q=[0,0,c+2|0]}}else +q=[0,1,d+2|0];break;default:var +q=[0,0,d+2|0]}}else r=1;if(r)var -q=[0,2,c];var +q=[0,2,d];var t=q}var -d=t[2],b=t[1],U=2===b?function(a){if(69!==a&&ev!==a)return 0;return 1}:3<=b?function(a){if(80!==a&&dy!==a)return 0;return 1}:function(a){return 0},y=fW(a,d,j,U);if(y)var -z=y[1],A=z+1|0,e=z,B=io(ci(10,a,A,j-A|0));else +e=t[2],b=t[1],U=2===b?function(a){if(69!==a&&ex!==a)return 0;return 1}:3<=b?function(a){if(80!==a&&dz!==a)return 0;return 1}:function(a){return 0},y=fW(a,e,j,U);if(y)var +z=y[1],A=z+1|0,f=z,B=io(ci(10,a,A,j-A|0));else var -e=j,B=0;if(2<=b){var -C=fW(a,d,e,function(a){return 46===a?1:0});if(C){var +f=j,B=0;if(2<=b){var +C=fW(a,e,f,function(a){return 46===a?1:0});if(C){var u=C[1];if(2===b)var -G=1;else{if(!(3<=b))throw[0,F,uC];var +G=1;else{if(!(3<=b))throw[0,F,uD];var G=4}var -I=u+1|0,J=e-1|0,H=0;if(J - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 315; - start_column = 5; - end_line = 317; - end_column = 6; - law_headings = - [ - "Article 1"; - "Décret n° 2020-1598 du 16 décembre 2020 portant relèvement du salaire \ - minimum de croissance"; - "Montant du salaire minimum de croissance"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2021 1 1 - && date_courante_ <=@ date_of_numbers 2021 12 31 - && residence_ = Mayotte ()) - then money_of_cents_string "774" - else raise EmptyError); + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 315; + start_column = 5; + end_line = 317; + end_column = 6; + law_headings = + [ + "Article 1"; + "Décret n° 2020-1598 du 16 décembre 2020 portant relèvement du salaire \ + minimum de croissance"; + "Montant du salaire minimum de croissance"; + "Décrets divers"; + ]; + } + (date_courante_2011_ >=@ date_of_numbers 2021 1 1 + && date_courante_2011_ <=@ date_of_numbers 2021 12 31 + && residence_2012_ = Mayotte ()) + then money_of_cents_string "774" + else raise EmptyError + with EmptyError -> raise EmptyError); (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 297; - start_column = 5; - end_line = 306; - end_column = 6; - law_headings = - [ - "Article 1"; - "Décret n° 2020-1598 du 16 décembre 2020 portant relèvement du salaire \ - minimum de croissance"; - "Montant du salaire minimum de croissance"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2021 1 1 - && date_courante_ <=@ date_of_numbers 2021 12 31 - && (residence_ = Metropole () || residence_ = Guadeloupe () - || residence_ = Guyane () || residence_ = Martinique () - || residence_ = LaReunion () || residence_ = SaintBarthelemy () - || residence_ = SaintMartin () - || residence_ = SaintPierreEtMiquelon ())) - then money_of_cents_string "1025" - else raise EmptyError); + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 297; + start_column = 5; + end_line = 306; + end_column = 6; + law_headings = + [ + "Article 1"; + "Décret n° 2020-1598 du 16 décembre 2020 portant relèvement du salaire \ + minimum de croissance"; + "Montant du salaire minimum de croissance"; + "Décrets divers"; + ]; + } + (date_courante_2011_ >=@ date_of_numbers 2021 1 1 + && date_courante_2011_ <=@ date_of_numbers 2021 12 31 + && (residence_2012_ = Metropole () || residence_2012_ = Guadeloupe () + || residence_2012_ = Guyane () || residence_2012_ = Martinique () + || residence_2012_ = LaReunion () + || residence_2012_ = SaintBarthelemy () + || residence_2012_ = SaintMartin () + || residence_2012_ = SaintPierreEtMiquelon ())) + then money_of_cents_string "1025" + else raise EmptyError + with EmptyError -> raise EmptyError); (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 276; - start_column = 5; - end_line = 278; - end_column = 6; - law_headings = - [ - "Article 1"; - "Décret n° 2019-1387 du 18 décembre 2019 portant relèvement du salaire \ - minimum de croissance"; - "Montant du salaire minimum de croissance"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2020 1 1 - && date_courante_ <=@ date_of_numbers 2020 12 31 - && residence_ = Mayotte ()) - then money_of_cents_string "766" - else raise EmptyError); + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 276; + start_column = 5; + end_line = 278; + end_column = 6; + law_headings = + [ + "Article 1"; + "Décret n° 2019-1387 du 18 décembre 2019 portant relèvement du salaire \ + minimum de croissance"; + "Montant du salaire minimum de croissance"; + "Décrets divers"; + ]; + } + (date_courante_2011_ >=@ date_of_numbers 2020 1 1 + && date_courante_2011_ <=@ date_of_numbers 2020 12 31 + && residence_2012_ = Mayotte ()) + then money_of_cents_string "766" + else raise EmptyError + with EmptyError -> raise EmptyError); (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 258; - start_column = 5; - end_line = 267; - end_column = 6; - law_headings = - [ - "Article 1"; - "Décret n° 2019-1387 du 18 décembre 2019 portant relèvement du salaire \ - minimum de croissance"; - "Montant du salaire minimum de croissance"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2020 1 1 - && date_courante_ <=@ date_of_numbers 2020 12 31 - && (residence_ = Metropole () || residence_ = Guadeloupe () - || residence_ = Guyane () || residence_ = Martinique () - || residence_ = LaReunion () || residence_ = SaintBarthelemy () - || residence_ = SaintMartin () - || residence_ = SaintPierreEtMiquelon ())) - then money_of_cents_string "1015" - else raise EmptyError); + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 258; + start_column = 5; + end_line = 267; + end_column = 6; + law_headings = + [ + "Article 1"; + "Décret n° 2019-1387 du 18 décembre 2019 portant relèvement du salaire \ + minimum de croissance"; + "Montant du salaire minimum de croissance"; + "Décrets divers"; + ]; + } + (date_courante_2011_ >=@ date_of_numbers 2020 1 1 + && date_courante_2011_ <=@ date_of_numbers 2020 12 31 + && (residence_2012_ = Metropole () || residence_2012_ = Guadeloupe () + || residence_2012_ = Guyane () || residence_2012_ = Martinique () + || residence_2012_ = LaReunion () + || residence_2012_ = SaintBarthelemy () + || residence_2012_ = SaintMartin () + || residence_2012_ = SaintPierreEtMiquelon ())) + then money_of_cents_string "1015" + else raise EmptyError + with EmptyError -> raise EmptyError); (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 237; - start_column = 5; - end_line = 239; - end_column = 6; - law_headings = - [ - "Article 1"; - "Décret n° 2018-1173 du 19 décembre 2018 portant relèvement du salaire \ - minimum de croissance"; - "Montant du salaire minimum de croissance"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2019 1 1 - && date_courante_ <=@ date_of_numbers 2019 12 31 - && residence_ = Mayotte ()) - then money_of_cents_string "757" - else raise EmptyError); + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 237; + start_column = 5; + end_line = 239; + end_column = 6; + law_headings = + [ + "Article 1"; + "Décret n° 2018-1173 du 19 décembre 2018 portant relèvement du salaire \ + minimum de croissance"; + "Montant du salaire minimum de croissance"; + "Décrets divers"; + ]; + } + (date_courante_2011_ >=@ date_of_numbers 2019 1 1 + && date_courante_2011_ <=@ date_of_numbers 2019 12 31 + && residence_2012_ = Mayotte ()) + then money_of_cents_string "757" + else raise EmptyError + with EmptyError -> raise EmptyError); (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 219; - start_column = 5; - end_line = 228; - end_column = 6; - law_headings = - [ - "Article 1"; - "Décret n° 2018-1173 du 19 décembre 2018 portant relèvement du salaire \ - minimum de croissance"; - "Montant du salaire minimum de croissance"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2019 1 1 - && date_courante_ <=@ date_of_numbers 2019 12 31 - && (residence_ = Metropole () || residence_ = Guadeloupe () - || residence_ = Guyane () || residence_ = Martinique () - || residence_ = LaReunion () || residence_ = SaintBarthelemy () - || residence_ = SaintMartin () - || residence_ = SaintPierreEtMiquelon ())) - then money_of_cents_string "1003" - else raise EmptyError); + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 219; + start_column = 5; + end_line = 228; + end_column = 6; + law_headings = + [ + "Article 1"; + "Décret n° 2018-1173 du 19 décembre 2018 portant relèvement du salaire \ + minimum de croissance"; + "Montant du salaire minimum de croissance"; + "Décrets divers"; + ]; + } + (date_courante_2011_ >=@ date_of_numbers 2019 1 1 + && date_courante_2011_ <=@ date_of_numbers 2019 12 31 + && (residence_2012_ = Metropole () || residence_2012_ = Guadeloupe () + || residence_2012_ = Guyane () || residence_2012_ = Martinique () + || residence_2012_ = LaReunion () + || residence_2012_ = SaintBarthelemy () + || residence_2012_ = SaintMartin () + || residence_2012_ = SaintPierreEtMiquelon ())) + then money_of_cents_string "1003" + else raise EmptyError + with EmptyError -> raise EmptyError); |] (fun (_ : _) -> log_decision_taken @@ -469,11 +484,11 @@ let smic (smic_in : smic_in) = law_headings = [ "Prologue" ]; })) in - { brut_horaire_out = brut_horaire_ } + { brut_horaire_out = brut_horaire_2013_ } let allocation_familiales_avril2008 (allocation_familiales_avril2008_in : allocation_familiales_avril2008_in) = - let age_minimum_alinea_1_l521_3_ : integer = + let age_minimum_alinea_1_l521_3_2023_ : integer = log_variable_definition [ "AllocationFamilialesAvril2008"; "âge_minimum_alinéa_1_l521_3" ] embed_integer @@ -490,27 +505,32 @@ let allocation_familiales_avril2008 law_headings = [ "Prologue" ]; })) in - { age_minimum_alinea_1_l521_3_out = age_minimum_alinea_1_l521_3_ } + { age_minimum_alinea_1_l521_3_out = age_minimum_alinea_1_l521_3_2023_ } let enfant_le_plus_age (enfant_le_plus_age_in : enfant_le_plus_age_in) = - let enfants_ : enfant array = enfant_le_plus_age_in.enfants_in in - let le_plus_age_ : enfant = + let enfants_2025_ : enfant array = enfant_le_plus_age_in.enfants_in in + let le_plus_age_2026_ : enfant = log_variable_definition [ "EnfantLePlusÂgé"; "le_plus_âgé" ] embed_enfant (try - Array.fold_left - (fun (acc_ : _) (item_ : _) -> if acc_.age >! item_.age then acc_ else item_) - { - identifiant = ~-!(integer_of_string "1"); - obligation_scolaire = Pendant (); - remuneration_mensuelle = money_of_cents_string "0"; - date_de_naissance = date_of_numbers 1900 1 1; - age = integer_of_string "0"; - prise_en_charge = EffectiveEtPermanente (); - a_deja_ouvert_droit_aux_allocations_familiales = false; - } - enfants_ + try + try + Array.fold_left + (fun (acc_2027_ : _) (item_2028_ : _) -> + if acc_2027_.age >! item_2028_.age then acc_2027_ else item_2028_) + { + identifiant = ~-!(integer_of_string "1"); + obligation_scolaire = Pendant (); + remuneration_mensuelle = money_of_cents_string "0"; + date_de_naissance = date_of_numbers 1900 1 1; + age = integer_of_string "0"; + prise_en_charge = EffectiveEtPermanente (); + a_deja_ouvert_droit_aux_allocations_familiales = false; + } + enfants_2025_ + with EmptyError -> raise EmptyError + with EmptyError -> raise EmptyError with EmptyError -> raise (NoValueProvided @@ -523,15 +543,15 @@ let enfant_le_plus_age (enfant_le_plus_age_in : enfant_le_plus_age_in) = law_headings = [ "Prologue" ]; })) in - { le_plus_age_out = le_plus_age_ } + { le_plus_age_out = le_plus_age_2026_ } let prestations_familiales (prestations_familiales_in : prestations_familiales_in) = - let date_courante_ : date = prestations_familiales_in.date_courante_in in - let prestation_courante_ : element_prestations_familiales = + let date_courante_2030_ : date = prestations_familiales_in.date_courante_in in + let prestation_courante_2031_ : element_prestations_familiales = prestations_familiales_in.prestation_courante_in in - let residence_ : collectivite = prestations_familiales_in.residence_in in - let age_l512_3_2_ : integer = + let residence_2032_ : collectivite = prestations_familiales_in.residence_in in + let age_l512_3_2_2033_ : integer = log_variable_definition [ "PrestationsFamiliales"; "âge_l512_3_2" ] embed_integer @@ -548,7 +568,7 @@ let prestations_familiales (prestations_familiales_in : prestations_familiales_i law_headings = [ "Prologue" ]; })) in - let base_mensuelle_ : money = + let base_mensuelle_2034_ : money = log_variable_definition [ "PrestationsFamiliales"; "base_mensuelle" ] embed_money @@ -556,74 +576,81 @@ let prestations_familiales (prestations_familiales_in : prestations_familiales_i handle_default [| (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 60; - start_column = 5; - end_line = 61; - end_column = 34; - law_headings = - [ - "Instruction interministérielle n°DSS/2B/2021/65 du 19 mars 2021 relative \ - à la revalorisation au 1er avril 2021 des prestations familiales servies \ - en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à \ - Saint-Barthélemy, à Saint-Martin et dans le département de Mayotte"; - "Montant de la base mensuelle des allocations familiales"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2021 4 1 - && date_courante_ <@ date_of_numbers 2022 4 1) - then money_of_cents_string "41481" - else raise EmptyError); + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 60; + start_column = 5; + end_line = 61; + end_column = 34; + law_headings = + [ + "Instruction interministérielle n°DSS/2B/2021/65 du 19 mars 2021 \ + relative à la revalorisation au 1er avril 2021 des prestations \ + familiales servies en métropole, en Guadeloupe, en Guyane, en \ + Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et dans \ + le département de Mayotte"; + "Montant de la base mensuelle des allocations familiales"; + "Décrets divers"; + ]; + } + (date_courante_2030_ >=@ date_of_numbers 2021 4 1 + && date_courante_2030_ <@ date_of_numbers 2022 4 1) + then money_of_cents_string "41481" + else raise EmptyError + with EmptyError -> raise EmptyError); (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 44; - start_column = 5; - end_line = 45; - end_column = 34; - law_headings = - [ - "Instruction interministérielle no DSS/SD2B/2020/33 du 18 février 2020 \ - relative à la revalorisation au 1er avril 2020 des prestations \ - familiales servies en métropole, en Guadeloupe, en Guyane, en \ - Martinique, à La Réunion, à Saint-Barthélemy, à Saint-Martin et dans le \ - département de Mayotte"; - "Montant de la base mensuelle des allocations familiales"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2020 4 1 - && date_courante_ <@ date_of_numbers 2021 4 1) - then money_of_cents_string "41404" - else raise EmptyError); + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 44; + start_column = 5; + end_line = 45; + end_column = 34; + law_headings = + [ + "Instruction interministérielle no DSS/SD2B/2020/33 du 18 février 2020 \ + relative à la revalorisation au 1er avril 2020 des prestations \ + familiales servies en métropole, en Guadeloupe, en Guyane, en \ + Martinique, à La Réunion, à Saint-Barthélemy, à Saint-Martin et dans \ + le département de Mayotte"; + "Montant de la base mensuelle des allocations familiales"; + "Décrets divers"; + ]; + } + (date_courante_2030_ >=@ date_of_numbers 2020 4 1 + && date_courante_2030_ <@ date_of_numbers 2021 4 1) + then money_of_cents_string "41404" + else raise EmptyError + with EmptyError -> raise EmptyError); (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 24; - start_column = 5; - end_line = 25; - end_column = 34; - law_headings = - [ - "Instruction ministérielle N°DSS/SD2B/2019/65 du 25 mars 2019 relative à \ - la revalorisation au 1er avril 2019 des prestations familiales servies \ - en métropole"; - "Montant de la base mensuelle des allocations familiales"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2019 4 1 - && date_courante_ <@ date_of_numbers 2020 4 1) - then money_of_cents_string "41316" - else raise EmptyError); + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 24; + start_column = 5; + end_line = 25; + end_column = 34; + law_headings = + [ + "Instruction ministérielle N°DSS/SD2B/2019/65 du 25 mars 2019 relative \ + à la revalorisation au 1er avril 2019 des prestations familiales \ + servies en métropole"; + "Montant de la base mensuelle des allocations familiales"; + "Décrets divers"; + ]; + } + (date_courante_2030_ >=@ date_of_numbers 2019 4 1 + && date_courante_2030_ <@ date_of_numbers 2020 4 1) + then money_of_cents_string "41316" + else raise EmptyError + with EmptyError -> raise EmptyError); |] (fun (_ : _) -> log_decision_taken @@ -649,11 +676,13 @@ let prestations_familiales (prestations_familiales_in : prestations_familiales_i law_headings = [ "Prologue" ]; })) in - let smic_dot_date_courante_ : date = + let smic_dot_date_courante_2040_ : date = try log_variable_definition [ "PrestationsFamiliales"; "smic.date_courante" ] - embed_date date_courante_ + embed_date + (try try date_courante_2030_ with EmptyError -> raise EmptyError + with EmptyError -> raise EmptyError) with EmptyError -> raise (NoValueProvided @@ -666,11 +695,13 @@ let prestations_familiales (prestations_familiales_in : prestations_familiales_i law_headings = [ "Prologue" ]; }) in - let smic_dot_residence_ : collectivite = + let smic_dot_residence_2041_ : collectivite = try log_variable_definition [ "PrestationsFamiliales"; "smic.résidence" ] - embed_collectivite residence_ + embed_collectivite + (try try residence_2032_ with EmptyError -> raise EmptyError + with EmptyError -> raise EmptyError) with EmptyError -> raise (NoValueProvided @@ -683,45 +714,51 @@ let prestations_familiales (prestations_familiales_in : prestations_familiales_i law_headings = [ "Prologue" ]; }) in - let result_ : smic_out = + let result_2042_ : smic_out = log_end_call [ "PrestationsFamiliales"; "smic"; "Smic" ] (log_begin_call [ "PrestationsFamiliales"; "smic"; "Smic" ] smic - { date_courante_in = smic_dot_date_courante_; residence_in = smic_dot_residence_ }) + { + date_courante_in = smic_dot_date_courante_2040_; + residence_in = smic_dot_residence_2041_; + }) in - let smic_dot_brut_horaire_ : money = result_.brut_horaire_out in - let regime_outre_mer_l751_1_ : bool = + let smic_dot_brut_horaire_2043_ : money = result_2042_.brut_horaire_out in + let regime_outre_mer_l751_1_2044_ : bool = log_variable_definition [ "PrestationsFamiliales"; "régime_outre_mer_l751_1" ] embed_bool (try try - if - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 354; - start_column = 5; - end_line = 359; - end_column = 30; - law_headings = - [ - "Article L751-1"; - "Chapitre 1er : Généralités"; - "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la \ - Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin"; - "Livre 7 : Régimes divers - Dispositions diverses"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (residence_ = Guadeloupe () || residence_ = Guyane () || residence_ = Martinique () - || residence_ = LaReunion () || residence_ = SaintBarthelemy () - || residence_ = SaintMartin ()) - then true - else raise EmptyError + try + if + log_decision_taken + { + filename = "./securite_sociale_L.catala_fr"; + start_line = 354; + start_column = 5; + end_line = 359; + end_column = 30; + law_headings = + [ + "Article L751-1"; + "Chapitre 1er : Généralités"; + "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la \ + Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin"; + "Livre 7 : Régimes divers - Dispositions diverses"; + "Partie législative"; + "Code de la sécurité sociale"; + ]; + } + (residence_2032_ = Guadeloupe () || residence_2032_ = Guyane () + || residence_2032_ = Martinique () || residence_2032_ = LaReunion () + || residence_2032_ = SaintBarthelemy () + || residence_2032_ = SaintMartin ()) + then true + else raise EmptyError + with EmptyError -> raise EmptyError with EmptyError -> false with EmptyError -> raise @@ -735,35 +772,41 @@ let prestations_familiales (prestations_familiales_in : prestations_familiales_i law_headings = [ "Prologue" ]; })) in - let plafond_l512_3_2_ : money = + let plafond_l512_3_2_2045_ : money = log_variable_definition [ "PrestationsFamiliales"; "plafond_l512_3_2" ] embed_money (try try - if - log_decision_taken - { - filename = "./securite_sociale_R.catala_fr"; - start_line = 216; - start_column = 18; - end_line = 216; - end_column = 41; - law_headings = - [ - "Article R755-0-2"; - "Chapitre 5 : Prestations familiales et prestations assimilées"; - "Titre 5 : Départements d'outre-mer"; - "Livre 7 : Régimes divers - Dispositions diverses"; - "Partie réglementaire - Décrets en Conseil d'Etat"; - "Code de la sécurité sociale"; - ]; - } - regime_outre_mer_l751_1_ - then smic_dot_brut_horaire_ *$ decimal_of_string "0.55" *$ decimal_of_string "169." - else raise EmptyError - with EmptyError -> - smic_dot_brut_horaire_ *$ decimal_of_string "0.55" *$ decimal_of_string "169." + try + try + if + log_decision_taken + { + filename = "./securite_sociale_R.catala_fr"; + start_line = 216; + start_column = 18; + end_line = 216; + end_column = 41; + law_headings = + [ + "Article R755-0-2"; + "Chapitre 5 : Prestations familiales et prestations assimilées"; + "Titre 5 : Départements d'outre-mer"; + "Livre 7 : Régimes divers - Dispositions diverses"; + "Partie réglementaire - Décrets en Conseil d'Etat"; + "Code de la sécurité sociale"; + ]; + } + regime_outre_mer_l751_1_2044_ + then + smic_dot_brut_horaire_2043_ *$ decimal_of_string "0.55" *$ decimal_of_string "169." + else raise EmptyError + with EmptyError -> raise EmptyError + with EmptyError -> ( + try smic_dot_brut_horaire_2043_ *$ decimal_of_string "0.55" *$ decimal_of_string "169." + with EmptyError -> raise EmptyError) + with EmptyError -> raise EmptyError with EmptyError -> raise (NoValueProvided @@ -776,48 +819,50 @@ let prestations_familiales (prestations_familiales_in : prestations_familiales_i law_headings = [ "Prologue" ]; })) in - let conditions_hors_age_ : enfant -> bool = + let conditions_hors_age_2046_ : enfant -> bool = log_variable_definition [ "PrestationsFamiliales"; "conditions_hors_âge" ] unembeddable (try - fun (param_ : enfant) -> + fun (param_2047_ : enfant) -> try try - if - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 68; - start_column = 5; - end_line = 71; - end_column = 57; - law_headings = - [ - "Article L512-3"; - "Chapitre 2 : Champ d'application"; - "Titre 1 : Champ d'application - Généralités"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (((match param_.obligation_scolaire with - | Avant _ -> true - | Pendant _ -> false - | Apres _ -> false) - || (match param_.obligation_scolaire with - | Avant _ -> false - | Pendant _ -> true + try + if + log_decision_taken + { + filename = "./securite_sociale_L.catala_fr"; + start_line = 68; + start_column = 5; + end_line = 71; + end_column = 57; + law_headings = + [ + "Article L512-3"; + "Chapitre 2 : Champ d'application"; + "Titre 1 : Champ d'application - Généralités"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"; + ]; + } + (((match param_2047_.obligation_scolaire with + | Avant _ -> true + | Pendant _ -> false | Apres _ -> false) - || - match param_.obligation_scolaire with - | Avant _ -> false - | Pendant _ -> false - | Apres _ -> true) - && param_.remuneration_mensuelle <=$ plafond_l512_3_2_) - then true - else raise EmptyError + || (match param_2047_.obligation_scolaire with + | Avant _ -> false + | Pendant _ -> true + | Apres _ -> false) + || + match param_2047_.obligation_scolaire with + | Avant _ -> false + | Pendant _ -> false + | Apres _ -> true) + && param_2047_.remuneration_mensuelle <=$ plafond_l512_3_2_2045_) + then true + else raise EmptyError + with EmptyError -> raise EmptyError with EmptyError -> false with EmptyError -> raise @@ -842,72 +887,76 @@ let prestations_familiales (prestations_familiales_in : prestations_familiales_i law_headings = [ "Prologue" ]; })) in - let droit_ouvert_ : enfant -> bool = + let droit_ouvert_2057_ : enfant -> bool = log_variable_definition [ "PrestationsFamiliales"; "droit_ouvert" ] unembeddable (try - fun (param_ : enfant) -> + fun (param_2058_ : enfant) -> try handle_default [| (fun (_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 60; - start_column = 5; - end_line = 62; - end_column = 32; - law_headings = - [ - "Article L512-3"; - "Chapitre 2 : Champ d'application"; - "Titre 1 : Champ d'application - Généralités"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - ((match param_.obligation_scolaire with - | Avant _ -> false - | Pendant _ -> false - | Apres _ -> true) - && param_.remuneration_mensuelle <=$ plafond_l512_3_2_ - && param_.age false + | Pendant _ -> false + | Apres _ -> true) + && param_2058_.remuneration_mensuelle <=$ plafond_l512_3_2_2045_ + && param_2058_.age raise EmptyError); (fun (_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 49; - start_column = 5; - end_line = 50; - end_column = 50; - law_headings = - [ - "Article L512-3"; - "Chapitre 2 : Champ d'application"; - "Titre 1 : Champ d'application - Généralités"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - ((match param_.obligation_scolaire with - | Avant _ -> true - | Pendant _ -> false - | Apres _ -> false) - || - match param_.obligation_scolaire with - | Avant _ -> false - | Pendant _ -> true - | Apres _ -> false) - then true - else raise EmptyError); + try + if + log_decision_taken + { + filename = "./securite_sociale_L.catala_fr"; + start_line = 49; + start_column = 5; + end_line = 50; + end_column = 50; + law_headings = + [ + "Article L512-3"; + "Chapitre 2 : Champ d'application"; + "Titre 1 : Champ d'application - Généralités"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"; + ]; + } + ((match param_2058_.obligation_scolaire with + | Avant _ -> true + | Pendant _ -> false + | Apres _ -> false) + || + match param_2058_.obligation_scolaire with + | Avant _ -> false + | Pendant _ -> true + | Apres _ -> false) + then true + else raise EmptyError + with EmptyError -> raise EmptyError); |] (fun (_ : _) -> log_decision_taken @@ -945,171 +994,181 @@ let prestations_familiales (prestations_familiales_in : prestations_familiales_i })) in { - droit_ouvert_out = droit_ouvert_; - conditions_hors_age_out = conditions_hors_age_; - age_l512_3_2_out = age_l512_3_2_; - regime_outre_mer_l751_1_out = regime_outre_mer_l751_1_; - base_mensuelle_out = base_mensuelle_; + droit_ouvert_out = droit_ouvert_2057_; + conditions_hors_age_out = conditions_hors_age_2046_; + age_l512_3_2_out = age_l512_3_2_2033_; + regime_outre_mer_l751_1_out = regime_outre_mer_l751_1_2044_; + base_mensuelle_out = base_mensuelle_2034_; } let allocations_familiales (allocations_familiales_in : allocations_familiales_in) = - let personne_charge_effective_permanente_est_parent_ : bool = + let personne_charge_effective_permanente_est_parent_2073_ : bool = allocations_familiales_in.personne_charge_effective_permanente_est_parent_in in - let personne_charge_effective_permanente_remplit_titre__i_ : bool = + let personne_charge_effective_permanente_remplit_titre__i_2074_ : bool = allocations_familiales_in.personne_charge_effective_permanente_remplit_titre_I_in in - let ressources_menage_ : money = allocations_familiales_in.ressources_menage_in in - let residence_ : collectivite = allocations_familiales_in.residence_in in - let date_courante_ : date = allocations_familiales_in.date_courante_in in - let enfants_a_charge_ : enfant array = allocations_familiales_in.enfants_a_charge_in in - let avait_enfant_a_charge_avant_1er_janvier_2012_ : bool = + let ressources_menage_2075_ : money = allocations_familiales_in.ressources_menage_in in + let residence_2076_ : collectivite = allocations_familiales_in.residence_in in + let date_courante_2077_ : date = allocations_familiales_in.date_courante_in in + let enfants_a_charge_2078_ : enfant array = allocations_familiales_in.enfants_a_charge_in in + let avait_enfant_a_charge_avant_1er_janvier_2012_2079_ : bool = allocations_familiales_in.avait_enfant_a_charge_avant_1er_janvier_2012_in in - let prise_en_compte_ : enfant -> prise_en_compte = + let prise_en_compte_2080_ : enfant -> prise_en_compte = log_variable_definition [ "AllocationsFamiliales"; "prise_en_compte" ] unembeddable (try - fun (param_ : enfant) -> + fun (param_2081_ : enfant) -> try handle_default [| (fun (_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 263; - start_column = 5; - end_line = 264; - end_column = 48; - law_headings = - [ - "Article L521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (match param_.prise_en_charge with - | GardeAlterneePartageAllocations _ -> false - | GardeAlterneeAllocataireUnique _ -> false - | EffectiveEtPermanente _ -> false - | ServicesSociauxAllocationVerseeALaFamille _ -> true - | ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> false) - then Complete () - else raise EmptyError); + try + if + log_decision_taken + { + filename = "./securite_sociale_L.catala_fr"; + start_line = 263; + start_column = 5; + end_line = 264; + end_column = 48; + law_headings = + [ + "Article L521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"; + ]; + } + (match param_2081_.prise_en_charge with + | GardeAlterneePartageAllocations _ -> false + | GardeAlterneeAllocataireUnique _ -> false + | EffectiveEtPermanente _ -> false + | ServicesSociauxAllocationVerseeALaFamille _ -> true + | ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> false) + then Complete () + else raise EmptyError + with EmptyError -> raise EmptyError); (fun (_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 253; - start_column = 5; - end_line = 254; - end_column = 56; - law_headings = - [ - "Article L521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (match param_.prise_en_charge with - | GardeAlterneePartageAllocations _ -> false - | GardeAlterneeAllocataireUnique _ -> false - | EffectiveEtPermanente _ -> false - | ServicesSociauxAllocationVerseeALaFamille _ -> false - | ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> true) - then Zero () - else raise EmptyError); + try + if + log_decision_taken + { + filename = "./securite_sociale_L.catala_fr"; + start_line = 253; + start_column = 5; + end_line = 254; + end_column = 56; + law_headings = + [ + "Article L521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"; + ]; + } + (match param_2081_.prise_en_charge with + | GardeAlterneePartageAllocations _ -> false + | GardeAlterneeAllocataireUnique _ -> false + | EffectiveEtPermanente _ -> false + | ServicesSociauxAllocationVerseeALaFamille _ -> false + | ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> true) + then Zero () + else raise EmptyError + with EmptyError -> raise EmptyError); (fun (_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 214; - start_column = 5; - end_line = 214; - end_column = 70; - law_headings = - [ - "Article L521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (match param_.prise_en_charge with - | GardeAlterneePartageAllocations _ -> true - | GardeAlterneeAllocataireUnique _ -> false - | EffectiveEtPermanente _ -> false - | ServicesSociauxAllocationVerseeALaFamille _ -> false - | ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> false) - then Partagee () - else raise EmptyError); + try + if + log_decision_taken + { + filename = "./securite_sociale_L.catala_fr"; + start_line = 214; + start_column = 5; + end_line = 214; + end_column = 70; + law_headings = + [ + "Article L521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"; + ]; + } + (match param_2081_.prise_en_charge with + | GardeAlterneePartageAllocations _ -> true + | GardeAlterneeAllocataireUnique _ -> false + | EffectiveEtPermanente _ -> false + | ServicesSociauxAllocationVerseeALaFamille _ -> false + | ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> false) + then Partagee () + else raise EmptyError + with EmptyError -> raise EmptyError); (fun (_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 204; - start_column = 5; - end_line = 204; - end_column = 69; - law_headings = - [ - "Article L521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (match param_.prise_en_charge with - | GardeAlterneePartageAllocations _ -> false - | GardeAlterneeAllocataireUnique _ -> true - | EffectiveEtPermanente _ -> false - | ServicesSociauxAllocationVerseeALaFamille _ -> false - | ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> false) - then Complete () - else raise EmptyError); + try + if + log_decision_taken + { + filename = "./securite_sociale_L.catala_fr"; + start_line = 204; + start_column = 5; + end_line = 204; + end_column = 69; + law_headings = + [ + "Article L521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"; + ]; + } + (match param_2081_.prise_en_charge with + | GardeAlterneePartageAllocations _ -> false + | GardeAlterneeAllocataireUnique _ -> true + | EffectiveEtPermanente _ -> false + | ServicesSociauxAllocationVerseeALaFamille _ -> false + | ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> false) + then Complete () + else raise EmptyError + with EmptyError -> raise EmptyError); (fun (_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 184; - start_column = 5; - end_line = 184; - end_column = 60; - law_headings = - [ - "Article L521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (match param_.prise_en_charge with - | GardeAlterneePartageAllocations _ -> false - | GardeAlterneeAllocataireUnique _ -> false - | EffectiveEtPermanente _ -> true - | ServicesSociauxAllocationVerseeALaFamille _ -> false - | ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> false) - then Complete () - else raise EmptyError); + try + if + log_decision_taken + { + filename = "./securite_sociale_L.catala_fr"; + start_line = 184; + start_column = 5; + end_line = 184; + end_column = 60; + law_headings = + [ + "Article L521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"; + ]; + } + (match param_2081_.prise_en_charge with + | GardeAlterneePartageAllocations _ -> false + | GardeAlterneeAllocataireUnique _ -> false + | EffectiveEtPermanente _ -> true + | ServicesSociauxAllocationVerseeALaFamille _ -> false + | ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> false) + then Complete () + else raise EmptyError + with EmptyError -> raise EmptyError); |] (fun (_ : _) -> log_decision_taken @@ -1146,150 +1205,160 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let versement_ : enfant -> versement_allocations = + let versement_2114_ : enfant -> versement_allocations = log_variable_definition [ "AllocationsFamiliales"; "versement" ] unembeddable (try - fun (param_ : enfant) -> + fun (param_2115_ : enfant) -> try handle_default [| (fun (_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 269; - start_column = 5; - end_line = 270; - end_column = 48; - law_headings = - [ - "Article L521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (match param_.prise_en_charge with - | GardeAlterneePartageAllocations _ -> false - | GardeAlterneeAllocataireUnique _ -> false - | EffectiveEtPermanente _ -> false - | ServicesSociauxAllocationVerseeALaFamille _ -> true - | ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> false) - then Normal () - else raise EmptyError); + try + if + log_decision_taken + { + filename = "./securite_sociale_L.catala_fr"; + start_line = 269; + start_column = 5; + end_line = 270; + end_column = 48; + law_headings = + [ + "Article L521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"; + ]; + } + (match param_2115_.prise_en_charge with + | GardeAlterneePartageAllocations _ -> false + | GardeAlterneeAllocataireUnique _ -> false + | EffectiveEtPermanente _ -> false + | ServicesSociauxAllocationVerseeALaFamille _ -> true + | ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> false) + then Normal () + else raise EmptyError + with EmptyError -> raise EmptyError); (fun (_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 258; - start_column = 5; - end_line = 259; - end_column = 56; - law_headings = - [ - "Article L521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (match param_.prise_en_charge with - | GardeAlterneePartageAllocations _ -> false - | GardeAlterneeAllocataireUnique _ -> false - | EffectiveEtPermanente _ -> false - | ServicesSociauxAllocationVerseeALaFamille _ -> false - | ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> true) - then AllocationVerseeAuxServicesSociaux () - else raise EmptyError); + try + if + log_decision_taken + { + filename = "./securite_sociale_L.catala_fr"; + start_line = 258; + start_column = 5; + end_line = 259; + end_column = 56; + law_headings = + [ + "Article L521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"; + ]; + } + (match param_2115_.prise_en_charge with + | GardeAlterneePartageAllocations _ -> false + | GardeAlterneeAllocataireUnique _ -> false + | EffectiveEtPermanente _ -> false + | ServicesSociauxAllocationVerseeALaFamille _ -> false + | ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> true) + then AllocationVerseeAuxServicesSociaux () + else raise EmptyError + with EmptyError -> raise EmptyError); (fun (_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 218; - start_column = 5; - end_line = 218; - end_column = 70; - law_headings = - [ - "Article L521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (match param_.prise_en_charge with - | GardeAlterneePartageAllocations _ -> true - | GardeAlterneeAllocataireUnique _ -> false - | EffectiveEtPermanente _ -> false - | ServicesSociauxAllocationVerseeALaFamille _ -> false - | ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> false) - then Normal () - else raise EmptyError); + try + if + log_decision_taken + { + filename = "./securite_sociale_L.catala_fr"; + start_line = 218; + start_column = 5; + end_line = 218; + end_column = 70; + law_headings = + [ + "Article L521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"; + ]; + } + (match param_2115_.prise_en_charge with + | GardeAlterneePartageAllocations _ -> true + | GardeAlterneeAllocataireUnique _ -> false + | EffectiveEtPermanente _ -> false + | ServicesSociauxAllocationVerseeALaFamille _ -> false + | ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> false) + then Normal () + else raise EmptyError + with EmptyError -> raise EmptyError); (fun (_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 208; - start_column = 5; - end_line = 208; - end_column = 69; - law_headings = - [ - "Article L521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (match param_.prise_en_charge with - | GardeAlterneePartageAllocations _ -> false - | GardeAlterneeAllocataireUnique _ -> true - | EffectiveEtPermanente _ -> false - | ServicesSociauxAllocationVerseeALaFamille _ -> false - | ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> false) - then Normal () - else raise EmptyError); + try + if + log_decision_taken + { + filename = "./securite_sociale_L.catala_fr"; + start_line = 208; + start_column = 5; + end_line = 208; + end_column = 69; + law_headings = + [ + "Article L521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"; + ]; + } + (match param_2115_.prise_en_charge with + | GardeAlterneePartageAllocations _ -> false + | GardeAlterneeAllocataireUnique _ -> true + | EffectiveEtPermanente _ -> false + | ServicesSociauxAllocationVerseeALaFamille _ -> false + | ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> false) + then Normal () + else raise EmptyError + with EmptyError -> raise EmptyError); (fun (_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 188; - start_column = 5; - end_line = 188; - end_column = 60; - law_headings = - [ - "Article L521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (match param_.prise_en_charge with - | GardeAlterneePartageAllocations _ -> false - | GardeAlterneeAllocataireUnique _ -> false - | EffectiveEtPermanente _ -> true - | ServicesSociauxAllocationVerseeALaFamille _ -> false - | ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> false) - then Normal () - else raise EmptyError); + try + if + log_decision_taken + { + filename = "./securite_sociale_L.catala_fr"; + start_line = 188; + start_column = 5; + end_line = 188; + end_column = 60; + law_headings = + [ + "Article L521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"; + ]; + } + (match param_2115_.prise_en_charge with + | GardeAlterneePartageAllocations _ -> false + | GardeAlterneeAllocataireUnique _ -> false + | EffectiveEtPermanente _ -> true + | ServicesSociauxAllocationVerseeALaFamille _ -> false + | ServicesSociauxAllocationVerseeAuxServicesSociaux _ -> false) + then Normal () + else raise EmptyError + with EmptyError -> raise EmptyError); |] (fun (_ : _) -> log_decision_taken @@ -1326,7 +1395,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let nombre_enfants_l521_1_ : integer = + let nombre_enfants_l521_1_2148_ : integer = log_variable_definition [ "AllocationsFamiliales"; "nombre_enfants_l521_1" ] embed_integer @@ -1343,7 +1412,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let nombre_enfants_alinea_2_l521_3_ : integer = + let nombre_enfants_alinea_2_l521_3_2149_ : integer = log_variable_definition [ "AllocationsFamiliales"; "nombre_enfants_alinéa_2_l521_3" ] embed_integer @@ -1360,21 +1429,23 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let result_ : allocation_familiales_avril2008_out = + let result_2150_ : allocation_familiales_avril2008_out = log_end_call [ "AllocationsFamiliales"; "version_avril_2008"; "AllocationFamilialesAvril2008" ] (log_begin_call [ "AllocationsFamiliales"; "version_avril_2008"; "AllocationFamilialesAvril2008" ] allocation_familiales_avril2008 ()) in - let version_avril_2008_dot_age_minimum_alinea_1_l521_3_ : integer = - result_.age_minimum_alinea_1_l521_3_out + let version_avril_2008_dot_age_minimum_alinea_1_l521_3_2151_ : integer = + result_2150_.age_minimum_alinea_1_l521_3_out in - let prestations_familiales_dot_date_courante_ : date = + let prestations_familiales_dot_date_courante_2152_ : date = try log_variable_definition [ "AllocationsFamiliales"; "prestations_familiales.date_courante" ] - embed_date date_courante_ + embed_date + (try try date_courante_2077_ with EmptyError -> raise EmptyError + with EmptyError -> raise EmptyError) with EmptyError -> raise (NoValueProvided @@ -1387,11 +1458,13 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; }) in - let prestations_familiales_dot_prestation_courante_ : element_prestations_familiales = + let prestations_familiales_dot_prestation_courante_2153_ : element_prestations_familiales = try log_variable_definition [ "AllocationsFamiliales"; "prestations_familiales.prestation_courante" ] - embed_element_prestations_familiales (AllocationsFamiliales ()) + embed_element_prestations_familiales + (try try AllocationsFamiliales () with EmptyError -> raise EmptyError + with EmptyError -> raise EmptyError) with EmptyError -> raise (NoValueProvided @@ -1404,11 +1477,13 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; }) in - let prestations_familiales_dot_residence_ : collectivite = + let prestations_familiales_dot_residence_2154_ : collectivite = try log_variable_definition [ "AllocationsFamiliales"; "prestations_familiales.résidence" ] - embed_collectivite residence_ + embed_collectivite + (try try residence_2076_ with EmptyError -> raise EmptyError + with EmptyError -> raise EmptyError) with EmptyError -> raise (NoValueProvided @@ -1421,32 +1496,36 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; }) in - let result_ : prestations_familiales_out = + let result_2155_ : prestations_familiales_out = log_end_call [ "AllocationsFamiliales"; "prestations_familiales"; "PrestationsFamiliales" ] (log_begin_call [ "AllocationsFamiliales"; "prestations_familiales"; "PrestationsFamiliales" ] prestations_familiales { - date_courante_in = prestations_familiales_dot_date_courante_; - prestation_courante_in = prestations_familiales_dot_prestation_courante_; - residence_in = prestations_familiales_dot_residence_; + date_courante_in = prestations_familiales_dot_date_courante_2152_; + prestation_courante_in = prestations_familiales_dot_prestation_courante_2153_; + residence_in = prestations_familiales_dot_residence_2154_; }) in - let prestations_familiales_dot_droit_ouvert_ : enfant -> bool = result_.droit_ouvert_out in - let prestations_familiales_dot_conditions_hors_age_ : enfant -> bool = - result_.conditions_hors_age_out + let prestations_familiales_dot_droit_ouvert_2156_ : enfant -> bool = + result_2155_.droit_ouvert_out in - let prestations_familiales_dot_age_l512_3_2_ : integer = result_.age_l512_3_2_out in - let prestations_familiales_dot_regime_outre_mer_l751_1_ : bool = - result_.regime_outre_mer_l751_1_out + let prestations_familiales_dot_conditions_hors_age_2157_ : enfant -> bool = + result_2155_.conditions_hors_age_out in - let prestations_familiales_dot_base_mensuelle_ : money = result_.base_mensuelle_out in - let enfant_le_plus_age_dot_enfants_ : enfant array = + let prestations_familiales_dot_age_l512_3_2_2158_ : integer = result_2155_.age_l512_3_2_out in + let prestations_familiales_dot_regime_outre_mer_l751_1_2159_ : bool = + result_2155_.regime_outre_mer_l751_1_out + in + let prestations_familiales_dot_base_mensuelle_2160_ : money = result_2155_.base_mensuelle_out in + let enfant_le_plus_age_dot_enfants_2161_ : enfant array = try log_variable_definition [ "AllocationsFamiliales"; "enfant_le_plus_âgé.enfants" ] - (embed_array embed_enfant) enfants_a_charge_ + (embed_array embed_enfant) + (try try enfants_a_charge_2078_ with EmptyError -> raise EmptyError + with EmptyError -> raise EmptyError) with EmptyError -> raise (NoValueProvided @@ -1459,46 +1538,50 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; }) in - let result_ : enfant_le_plus_age_out = + let result_2162_ : enfant_le_plus_age_out = log_end_call [ "AllocationsFamiliales"; "enfant_le_plus_âgé"; "EnfantLePlusÂgé" ] (log_begin_call [ "AllocationsFamiliales"; "enfant_le_plus_âgé"; "EnfantLePlusÂgé" ] enfant_le_plus_age - { enfants_in = enfant_le_plus_age_dot_enfants_ }) + { enfants_in = enfant_le_plus_age_dot_enfants_2161_ }) in - let enfant_le_plus_age_dot_le_plus_age_ : enfant = result_.le_plus_age_out in - let age_minimum_alinea_1_l521_3_ : enfant -> integer = + let enfant_le_plus_age_dot_le_plus_age_2163_ : enfant = result_2162_.le_plus_age_out in + let age_minimum_alinea_1_l521_3_2164_ : enfant -> integer = log_variable_definition [ "AllocationsFamiliales"; "âge_minimum_alinéa_1_l521_3" ] unembeddable (try - fun (param_ : enfant) -> + fun (param_2165_ : enfant) -> try try - if - log_decision_taken - { - filename = "./securite_sociale_R.catala_fr"; - start_line = 83; - start_column = 19; - end_line = 83; - end_column = 69; - law_headings = - [ - "Article R521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie réglementaire - Décrets en Conseil d'Etat"; - "Code de la sécurité sociale"; - ]; - } - (param_.date_de_naissance +@ duration_of_numbers 11 0 0 - <=@ date_of_numbers 2008 4 30) - then version_avril_2008_dot_age_minimum_alinea_1_l521_3_ - else raise EmptyError - with EmptyError -> integer_of_string "14" + try + try + if + log_decision_taken + { + filename = "./securite_sociale_R.catala_fr"; + start_line = 83; + start_column = 19; + end_line = 83; + end_column = 69; + law_headings = + [ + "Article R521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets en Conseil d'Etat"; + "Code de la sécurité sociale"; + ]; + } + (param_2165_.date_de_naissance +@ duration_of_numbers 11 0 0 + <=@ date_of_numbers 2008 4 30) + then version_avril_2008_dot_age_minimum_alinea_1_l521_3_2151_ + else raise EmptyError + with EmptyError -> raise EmptyError + with EmptyError -> integer_of_string "14" + with EmptyError -> raise EmptyError with EmptyError -> raise (NoValueProvided @@ -1522,25 +1605,29 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let enfants_a_charge_droit_ouvert_prestation_familiale_ : enfant array = + let enfants_a_charge_droit_ouvert_prestation_familiale_2166_ : enfant array = log_variable_definition [ "AllocationsFamiliales"; "enfants_à_charge_droit_ouvert_prestation_familiale" ] (embed_array embed_enfant) (try - array_filter - (fun (enfant_ : _) -> - log_end_call - [ "PrestationsFamiliales"; "droit_ouvert" ] - (log_variable_definition - [ "PrestationsFamiliales"; "droit_ouvert"; "output" ] - unembeddable - (log_begin_call - [ "PrestationsFamiliales"; "droit_ouvert" ] - prestations_familiales_dot_droit_ouvert_ - (log_variable_definition - [ "PrestationsFamiliales"; "droit_ouvert"; "input" ] - unembeddable enfant_)))) - enfants_a_charge_ + try + try + array_filter + (fun (enfant_2167_ : _) -> + log_end_call + [ "PrestationsFamiliales"; "droit_ouvert" ] + (log_variable_definition + [ "PrestationsFamiliales"; "droit_ouvert"; "output" ] + unembeddable + (log_begin_call + [ "PrestationsFamiliales"; "droit_ouvert" ] + prestations_familiales_dot_droit_ouvert_2156_ + (log_variable_definition + [ "PrestationsFamiliales"; "droit_ouvert"; "input" ] + unembeddable enfant_2167_)))) + enfants_a_charge_2078_ + with EmptyError -> raise EmptyError + with EmptyError -> raise EmptyError with EmptyError -> raise (NoValueProvided @@ -1553,13 +1640,17 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let est_enfant_le_plus_age_ : enfant -> bool = + let est_enfant_le_plus_age_2168_ : enfant -> bool = log_variable_definition [ "AllocationsFamiliales"; "est_enfant_le_plus_âgé" ] unembeddable (try - fun (param_ : enfant) -> - try enfant_le_plus_age_dot_le_plus_age_ = param_ + fun (param_2169_ : enfant) -> + try + try + try enfant_le_plus_age_dot_le_plus_age_2163_ = param_2169_ + with EmptyError -> raise EmptyError + with EmptyError -> raise EmptyError with EmptyError -> raise (NoValueProvided @@ -1583,141 +1674,154 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let plafond__i_i_d521_3_ : money = + let plafond__i_i_d521_3_2170_ : money = log_variable_definition [ "AllocationsFamiliales"; "plafond_II_d521_3" ] embed_money (try - handle_default - [| - (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 196; - start_column = 5; - end_line = 196; - end_column = 69; - law_headings = - [ - "Article 1"; - "Arrêté du 14 décembre 2020 relatif au montant des plafonds de ressources \ - de certaines prestations familiales et aux tranches du barème applicable \ - au recouvrement des indus et à la saisie des prestations"; - "Montant des plafonds de ressources"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2021 1 1 - && date_courante_ <=@ date_of_numbers 2021 12 31) - then - money_of_cents_string "8155800" - +$ money_of_cents_string "582700" - *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_) - else raise EmptyError); - (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 160; - start_column = 5; - end_line = 160; - end_column = 69; - law_headings = - [ - "Instruction interministerielle no DSS/SD2B/2019/261 du 18 décembre 2019 \ - relative à la revalorisation au 1er janvier 2020 des plafonds de \ - ressources d’attribution de certaines prestations familiales servies en \ - métropole, en Guadeloupe, en Guyane, en Martinique, à La Réunion, à \ - Saint-Barthélemy, à Saint-Martin et à Mayotte"; - "Montant des plafonds de ressources"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2020 1 1 - && date_courante_ <=@ date_of_numbers 2020 12 31) - then - money_of_cents_string "8083100" - +$ money_of_cents_string "577500" - *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_) - else raise EmptyError); - (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 127; - start_column = 5; - end_line = 127; - end_column = 69; - law_headings = - [ - "Instruction interministérielle n° DSS/SD2B/2018/279 du 17 décembre 2018 \ - relative à la revalorisation au 1er janvier 2019 des plafonds de \ - ressources d’attribution de certaines prestations familiales servies en \ - métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à \ - Saint-Barthélemy, à Saint-Martin et à Mayotte"; - "Montant des plafonds de ressources"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2019 1 1 - && date_courante_ <=@ date_of_numbers 2019 12 31) - then - money_of_cents_string "7955800" - +$ money_of_cents_string "568400" - *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_) - else raise EmptyError); - (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 94; - start_column = 5; - end_line = 94; - end_column = 69; - law_headings = - [ - "Circulaire interministérielle N° DSS/SD2B/2017/352 du 22 décembre 2017 \ - relative à la revalorisation au 1er janvier 2018 des plafonds de \ - ressources d’attribution de certaines prestations familiales servies en \ - métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à \ - Saint-Barthélemy, à Saint-Martin et à Mayotte"; - "Montant des plafonds de ressources"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2018 1 1 - && date_courante_ <=@ date_of_numbers 2018 12 31) - then - money_of_cents_string "7877000" - +$ money_of_cents_string "562800" + try + handle_default + [| + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 196; + start_column = 5; + end_line = 196; + end_column = 69; + law_headings = + [ + "Article 1"; + "Arrêté du 14 décembre 2020 relatif au montant des plafonds de \ + ressources de certaines prestations familiales et aux tranches du \ + barème applicable au recouvrement des indus et à la saisie des \ + prestations"; + "Montant des plafonds de ressources"; + "Décrets divers"; + ]; + } + (date_courante_2077_ >=@ date_of_numbers 2021 1 1 + && date_courante_2077_ <=@ date_of_numbers 2021 12 31) + then + money_of_cents_string "8155800" + +$ money_of_cents_string "582700" + *$ decimal_of_integer + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_) + else raise EmptyError + with EmptyError -> raise EmptyError); + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 160; + start_column = 5; + end_line = 160; + end_column = 69; + law_headings = + [ + "Instruction interministerielle no DSS/SD2B/2019/261 du 18 décembre \ + 2019 relative à la revalorisation au 1er janvier 2020 des plafonds \ + de ressources d’attribution de certaines prestations familiales \ + servies en métropole, en Guadeloupe, en Guyane, en Martinique, à La \ + Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte"; + "Montant des plafonds de ressources"; + "Décrets divers"; + ]; + } + (date_courante_2077_ >=@ date_of_numbers 2020 1 1 + && date_courante_2077_ <=@ date_of_numbers 2020 12 31) + then + money_of_cents_string "8083100" + +$ money_of_cents_string "577500" + *$ decimal_of_integer + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_) + else raise EmptyError + with EmptyError -> raise EmptyError); + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 127; + start_column = 5; + end_line = 127; + end_column = 69; + law_headings = + [ + "Instruction interministérielle n° DSS/SD2B/2018/279 du 17 décembre \ + 2018 relative à la revalorisation au 1er janvier 2019 des plafonds \ + de ressources d’attribution de certaines prestations familiales \ + servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la \ + Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte"; + "Montant des plafonds de ressources"; + "Décrets divers"; + ]; + } + (date_courante_2077_ >=@ date_of_numbers 2019 1 1 + && date_courante_2077_ <=@ date_of_numbers 2019 12 31) + then + money_of_cents_string "7955800" + +$ money_of_cents_string "568400" + *$ decimal_of_integer + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_) + else raise EmptyError + with EmptyError -> raise EmptyError); + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 94; + start_column = 5; + end_line = 94; + end_column = 69; + law_headings = + [ + "Circulaire interministérielle N° DSS/SD2B/2017/352 du 22 décembre \ + 2017 relative à la revalorisation au 1er janvier 2018 des plafonds \ + de ressources d’attribution de certaines prestations familiales \ + servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la \ + Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte"; + "Montant des plafonds de ressources"; + "Décrets divers"; + ]; + } + (date_courante_2077_ >=@ date_of_numbers 2018 1 1 + && date_courante_2077_ <=@ date_of_numbers 2018 12 31) + then + money_of_cents_string "7877000" + +$ money_of_cents_string "562800" + *$ decimal_of_integer + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_) + else raise EmptyError + with EmptyError -> raise EmptyError); + |] + (fun (_ : _) -> + log_decision_taken + { + filename = "./prologue.catala_fr"; + start_line = 156; + start_column = 11; + end_line = 156; + end_column = 28; + law_headings = [ "Prologue" ]; + } + true) + (fun (_ : _) -> + try + money_of_cents_string "7830000" + +$ money_of_cents_string "559500" *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_) - else raise EmptyError); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 156; - start_column = 11; - end_line = 156; - end_column = 28; - law_headings = [ "Prologue" ]; - } - true) - (fun (_ : _) -> - money_of_cents_string "7830000" - +$ money_of_cents_string "559500" - *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_)) + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_) + with EmptyError -> raise EmptyError) + with EmptyError -> raise EmptyError with EmptyError -> raise (NoValueProvided @@ -1730,141 +1834,154 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let plafond__i_d521_3_ : money = + let plafond__i_d521_3_2177_ : money = log_variable_definition [ "AllocationsFamiliales"; "plafond_I_d521_3" ] embed_money (try - handle_default - [| - (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 180; - start_column = 5; - end_line = 180; - end_column = 69; - law_headings = - [ - "Article 1"; - "Arrêté du 14 décembre 2020 relatif au montant des plafonds de ressources \ - de certaines prestations familiales et aux tranches du barème applicable \ - au recouvrement des indus et à la saisie des prestations"; - "Montant des plafonds de ressources"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2021 1 1 - && date_courante_ <=@ date_of_numbers 2021 12 31) - then - money_of_cents_string "5827900" - +$ money_of_cents_string "582700" - *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_) - else raise EmptyError); - (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 153; - start_column = 5; - end_line = 153; - end_column = 69; - law_headings = - [ - "Instruction interministerielle no DSS/SD2B/2019/261 du 18 décembre 2019 \ - relative à la revalorisation au 1er janvier 2020 des plafonds de \ - ressources d’attribution de certaines prestations familiales servies en \ - métropole, en Guadeloupe, en Guyane, en Martinique, à La Réunion, à \ - Saint-Barthélemy, à Saint-Martin et à Mayotte"; - "Montant des plafonds de ressources"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2020 1 1 - && date_courante_ <=@ date_of_numbers 2020 12 31) - then - money_of_cents_string "5775900" - +$ money_of_cents_string "577500" - *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_) - else raise EmptyError); + try + handle_default + [| + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 180; + start_column = 5; + end_line = 180; + end_column = 69; + law_headings = + [ + "Article 1"; + "Arrêté du 14 décembre 2020 relatif au montant des plafonds de \ + ressources de certaines prestations familiales et aux tranches du \ + barème applicable au recouvrement des indus et à la saisie des \ + prestations"; + "Montant des plafonds de ressources"; + "Décrets divers"; + ]; + } + (date_courante_2077_ >=@ date_of_numbers 2021 1 1 + && date_courante_2077_ <=@ date_of_numbers 2021 12 31) + then + money_of_cents_string "5827900" + +$ money_of_cents_string "582700" + *$ decimal_of_integer + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_) + else raise EmptyError + with EmptyError -> raise EmptyError); + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 153; + start_column = 5; + end_line = 153; + end_column = 69; + law_headings = + [ + "Instruction interministerielle no DSS/SD2B/2019/261 du 18 décembre \ + 2019 relative à la revalorisation au 1er janvier 2020 des plafonds \ + de ressources d’attribution de certaines prestations familiales \ + servies en métropole, en Guadeloupe, en Guyane, en Martinique, à La \ + Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte"; + "Montant des plafonds de ressources"; + "Décrets divers"; + ]; + } + (date_courante_2077_ >=@ date_of_numbers 2020 1 1 + && date_courante_2077_ <=@ date_of_numbers 2020 12 31) + then + money_of_cents_string "5775900" + +$ money_of_cents_string "577500" + *$ decimal_of_integer + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_) + else raise EmptyError + with EmptyError -> raise EmptyError); + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 120; + start_column = 5; + end_line = 120; + end_column = 69; + law_headings = + [ + "Instruction interministérielle n° DSS/SD2B/2018/279 du 17 décembre \ + 2018 relative à la revalorisation au 1er janvier 2019 des plafonds \ + de ressources d’attribution de certaines prestations familiales \ + servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la \ + Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte"; + "Montant des plafonds de ressources"; + "Décrets divers"; + ]; + } + (date_courante_2077_ >=@ date_of_numbers 2019 1 1 + && date_courante_2077_ <=@ date_of_numbers 2019 12 31) + then + money_of_cents_string "5684900" + +$ money_of_cents_string "568400" + *$ decimal_of_integer + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_) + else raise EmptyError + with EmptyError -> raise EmptyError); + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 87; + start_column = 5; + end_line = 87; + end_column = 69; + law_headings = + [ + "Circulaire interministérielle N° DSS/SD2B/2017/352 du 22 décembre \ + 2017 relative à la revalorisation au 1er janvier 2018 des plafonds \ + de ressources d’attribution de certaines prestations familiales \ + servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la \ + Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte"; + "Montant des plafonds de ressources"; + "Décrets divers"; + ]; + } + (date_courante_2077_ >=@ date_of_numbers 2018 1 1 + && date_courante_2077_ <=@ date_of_numbers 2018 12 31) + then + money_of_cents_string "5628600" + +$ money_of_cents_string "562800" + *$ decimal_of_integer + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_) + else raise EmptyError + with EmptyError -> raise EmptyError); + |] (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 120; - start_column = 5; - end_line = 120; - end_column = 69; - law_headings = - [ - "Instruction interministérielle n° DSS/SD2B/2018/279 du 17 décembre 2018 \ - relative à la revalorisation au 1er janvier 2019 des plafonds de \ - ressources d’attribution de certaines prestations familiales servies en \ - métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à \ - Saint-Barthélemy, à Saint-Martin et à Mayotte"; - "Montant des plafonds de ressources"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2019 1 1 - && date_courante_ <=@ date_of_numbers 2019 12 31) - then - money_of_cents_string "5684900" - +$ money_of_cents_string "568400" - *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_) - else raise EmptyError); + log_decision_taken + { + filename = "./prologue.catala_fr"; + start_line = 155; + start_column = 11; + end_line = 155; + end_column = 27; + law_headings = [ "Prologue" ]; + } + true) (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 87; - start_column = 5; - end_line = 87; - end_column = 69; - law_headings = - [ - "Circulaire interministérielle N° DSS/SD2B/2017/352 du 22 décembre 2017 \ - relative à la revalorisation au 1er janvier 2018 des plafonds de \ - ressources d’attribution de certaines prestations familiales servies en \ - métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à \ - Saint-Barthélemy, à Saint-Martin et à Mayotte"; - "Montant des plafonds de ressources"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2018 1 1 - && date_courante_ <=@ date_of_numbers 2018 12 31) - then - money_of_cents_string "5628600" - +$ money_of_cents_string "562800" + try + money_of_cents_string "5595000" + +$ money_of_cents_string "559500" *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_) - else raise EmptyError); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 155; - start_column = 11; - end_line = 155; - end_column = 27; - law_headings = [ "Prologue" ]; - } - true) - (fun (_ : _) -> - money_of_cents_string "5595000" - +$ money_of_cents_string "559500" - *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_)) + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_) + with EmptyError -> raise EmptyError) + with EmptyError -> raise EmptyError with EmptyError -> raise (NoValueProvided @@ -1877,37 +1994,39 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let droit_ouvert_complement_ : bool = + let droit_ouvert_complement_2184_ : bool = log_variable_definition [ "AllocationsFamiliales"; "droit_ouvert_complément" ] embed_bool (try try try - if - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 426; - start_column = 5; - end_line = 427; - end_column = 71; - law_headings = - [ - "Article L755-12"; - "Chapitre 5 : Prestations familiales et prestations assimilées"; - "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la \ - Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin"; - "Livre 7 : Régimes divers - Dispositions diverses"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (prestations_familiales_dot_regime_outre_mer_l751_1_ - && array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - = integer_of_string "1") - then false - else raise EmptyError + try + if + log_decision_taken + { + filename = "./securite_sociale_L.catala_fr"; + start_line = 426; + start_column = 5; + end_line = 427; + end_column = 71; + law_headings = + [ + "Article L755-12"; + "Chapitre 5 : Prestations familiales et prestations assimilées"; + "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la \ + Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin"; + "Livre 7 : Régimes divers - Dispositions diverses"; + "Partie législative"; + "Code de la sécurité sociale"; + ]; + } + (prestations_familiales_dot_regime_outre_mer_l751_1_2159_ + && array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + = integer_of_string "1") + then false + else raise EmptyError + with EmptyError -> raise EmptyError with EmptyError -> true with EmptyError -> false with EmptyError -> @@ -1922,88 +2041,92 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let droit_ouvert_forfaitaire_ : enfant -> bool = + let droit_ouvert_forfaitaire_2185_ : enfant -> bool = log_variable_definition [ "AllocationsFamiliales"; "droit_ouvert_forfaitaire" ] unembeddable (try - fun (param_ : enfant) -> + fun (param_2186_ : enfant) -> try try try - if - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 420; - start_column = 6; - end_line = 421; - end_column = 72; - law_headings = - [ - "Article L755-12"; - "Chapitre 5 : Prestations familiales et prestations assimilées"; - "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à \ - la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin"; - "Livre 7 : Régimes divers - Dispositions diverses"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (prestations_familiales_dot_regime_outre_mer_l751_1_ - && array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - = integer_of_string "1") - then false - else raise EmptyError - with EmptyError -> - if - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 119; - start_column = 5; - end_line = 125; - end_column = 59; - law_headings = - [ - "Article L521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (array_length enfants_a_charge_ >=! nombre_enfants_alinea_2_l521_3_ - && param_.age = prestations_familiales_dot_age_l512_3_2_ - && param_.a_deja_ouvert_droit_aux_allocations_familiales - && log_end_call - [ "PrestationsFamiliales"; "conditions_hors_âge" ] - (log_variable_definition - [ "PrestationsFamiliales"; "conditions_hors_âge"; "output" ] - unembeddable - (log_begin_call - [ "PrestationsFamiliales"; "conditions_hors_âge" ] - prestations_familiales_dot_conditions_hors_age_ - (log_variable_definition - [ "PrestationsFamiliales"; "conditions_hors_âge"; "input" ] - unembeddable param_)))) - then true - else raise EmptyError - with EmptyError -> false - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 127; - start_column = 11; - end_line = 127; - end_column = 35; - law_headings = [ "Prologue" ]; - }) - with EmptyError -> - raise + try + if + log_decision_taken + { + filename = "./securite_sociale_L.catala_fr"; + start_line = 420; + start_column = 6; + end_line = 421; + end_column = 72; + law_headings = + [ + "Article L755-12"; + "Chapitre 5 : Prestations familiales et prestations assimilées"; + "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à \ + la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin"; + "Livre 7 : Régimes divers - Dispositions diverses"; + "Partie législative"; + "Code de la sécurité sociale"; + ]; + } + (prestations_familiales_dot_regime_outre_mer_l751_1_2159_ + && array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + = integer_of_string "1") + then false + else raise EmptyError + with EmptyError -> raise EmptyError + with EmptyError -> ( + try + if + log_decision_taken + { + filename = "./securite_sociale_L.catala_fr"; + start_line = 119; + start_column = 5; + end_line = 125; + end_column = 59; + law_headings = + [ + "Article L521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"; + ]; + } + (array_length enfants_a_charge_2078_ >=! nombre_enfants_alinea_2_l521_3_2149_ + && param_2186_.age = prestations_familiales_dot_age_l512_3_2_2158_ + && param_2186_.a_deja_ouvert_droit_aux_allocations_familiales + && log_end_call + [ "PrestationsFamiliales"; "conditions_hors_âge" ] + (log_variable_definition + [ "PrestationsFamiliales"; "conditions_hors_âge"; "output" ] + unembeddable + (log_begin_call + [ "PrestationsFamiliales"; "conditions_hors_âge" ] + prestations_familiales_dot_conditions_hors_age_2157_ + (log_variable_definition + [ "PrestationsFamiliales"; "conditions_hors_âge"; "input" ] + unembeddable param_2186_)))) + then true + else raise EmptyError + with EmptyError -> raise EmptyError) + with EmptyError -> false + with EmptyError -> + raise + (NoValueProvided + { + filename = "./prologue.catala_fr"; + start_line = 127; + start_column = 11; + end_line = 127; + end_column = 35; + law_headings = [ "Prologue" ]; + }) + with EmptyError -> + raise (NoValueProvided { filename = "./prologue.catala_fr"; @@ -2014,19 +2137,24 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let montant_initial_base_quatrieme_enfant_et_plus_mayotte_ : money = + let montant_initial_base_quatrieme_enfant_et_plus_mayotte_2187_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_initial_base_quatrième_enfant_et_plus_mayotte" ] embed_money (try - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "3" - then - prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.0463" - *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - -! integer_of_string "3") - else money_of_cents_string "0" + try + try + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >! integer_of_string "3" + then + prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.0463" + *$ decimal_of_integer + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + -! integer_of_string "3") + else money_of_cents_string "0" + with EmptyError -> raise EmptyError + with EmptyError -> raise EmptyError with EmptyError -> raise (NoValueProvided @@ -2039,301 +2167,335 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let montant_initial_base_troisieme_enfant_mayotte_ : money = + let montant_initial_base_troisieme_enfant_mayotte_2188_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_initial_base_troisième_enfant_mayotte" ] embed_money (try - handle_default - [| - (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 647; - start_column = 5; - end_line = 647; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2020 1 1 - && date_courante_ <=@ date_of_numbers 2020 12 31) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "2" - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.143" - else money_of_cents_string "0" - else raise EmptyError); - (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 640; - start_column = 5; - end_line = 640; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2019 1 1 - && date_courante_ <=@ date_of_numbers 2019 12 31) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "2" - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.1259" - else money_of_cents_string "0" - else raise EmptyError); - (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 633; - start_column = 5; - end_line = 633; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2018 1 1 - && date_courante_ <=@ date_of_numbers 2018 12 31) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "2" - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.1089" - else money_of_cents_string "0" - else raise EmptyError); - (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 626; - start_column = 5; - end_line = 626; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2017 1 1 - && date_courante_ <=@ date_of_numbers 2017 12 31) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "2" - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.0918" - else money_of_cents_string "0" - else raise EmptyError); + try + handle_default + [| + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 647; + start_column = 5; + end_line = 647; + end_column = 69; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ + à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_2077_ >=@ date_of_numbers 2020 1 1 + && date_courante_2077_ <=@ date_of_numbers 2020 12 31) + then + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >! integer_of_string "2" + then + prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.143" + else money_of_cents_string "0" + else raise EmptyError + with EmptyError -> raise EmptyError); + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 640; + start_column = 5; + end_line = 640; + end_column = 69; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ + à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_2077_ >=@ date_of_numbers 2019 1 1 + && date_courante_2077_ <=@ date_of_numbers 2019 12 31) + then + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >! integer_of_string "2" + then + prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.1259" + else money_of_cents_string "0" + else raise EmptyError + with EmptyError -> raise EmptyError); + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 633; + start_column = 5; + end_line = 633; + end_column = 69; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ + à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_2077_ >=@ date_of_numbers 2018 1 1 + && date_courante_2077_ <=@ date_of_numbers 2018 12 31) + then + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >! integer_of_string "2" + then + prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.1089" + else money_of_cents_string "0" + else raise EmptyError + with EmptyError -> raise EmptyError); + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 626; + start_column = 5; + end_line = 626; + end_column = 69; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ + à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_2077_ >=@ date_of_numbers 2017 1 1 + && date_courante_2077_ <=@ date_of_numbers 2017 12 31) + then + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >! integer_of_string "2" + then + prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.0918" + else money_of_cents_string "0" + else raise EmptyError + with EmptyError -> raise EmptyError); + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 619; + start_column = 5; + end_line = 619; + end_column = 69; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ + à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_2077_ >=@ date_of_numbers 2016 1 1 + && date_courante_2077_ <=@ date_of_numbers 2016 12 31) + then + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >! integer_of_string "2" + then + prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.0842" + else money_of_cents_string "0" + else raise EmptyError + with EmptyError -> raise EmptyError); + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 612; + start_column = 5; + end_line = 612; + end_column = 69; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ + à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_2077_ >=@ date_of_numbers 2015 1 1 + && date_courante_2077_ <=@ date_of_numbers 2015 12 31) + then + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >! integer_of_string "2" + then + prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.0766" + else money_of_cents_string "0" + else raise EmptyError + with EmptyError -> raise EmptyError); + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 605; + start_column = 5; + end_line = 605; + end_column = 69; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ + à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_2077_ >=@ date_of_numbers 2014 1 1 + && date_courante_2077_ <=@ date_of_numbers 2014 12 31) + then + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >! integer_of_string "2" + then + prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.069" + else money_of_cents_string "0" + else raise EmptyError + with EmptyError -> raise EmptyError); + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 598; + start_column = 5; + end_line = 598; + end_column = 69; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ + à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_2077_ >=@ date_of_numbers 2013 1 1 + && date_courante_2077_ <=@ date_of_numbers 2013 12 31) + then + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >! integer_of_string "2" + then + prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.075" + else money_of_cents_string "0" + else raise EmptyError + with EmptyError -> raise EmptyError); + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 591; + start_column = 5; + end_line = 591; + end_column = 69; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ + à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_2077_ >=@ date_of_numbers 2012 1 1 + && date_courante_2077_ <=@ date_of_numbers 2012 12 31) + then + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >! integer_of_string "2" + then + prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.0539" + else money_of_cents_string "0" + else raise EmptyError + with EmptyError -> raise EmptyError); + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 584; + start_column = 5; + end_line = 584; + end_column = 69; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ + à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_2077_ >=@ date_of_numbers 2011 1 1 + && date_courante_2077_ <=@ date_of_numbers 2011 12 31) + then + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >! integer_of_string "2" + then + prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.0463" + else money_of_cents_string "0" + else raise EmptyError + with EmptyError -> raise EmptyError); + |] (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 619; - start_column = 5; - end_line = 619; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2016 1 1 - && date_courante_ <=@ date_of_numbers 2016 12 31) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "2" - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.0842" - else money_of_cents_string "0" - else raise EmptyError); + log_decision_taken + { + filename = "./prologue.catala_fr"; + start_line = 123; + start_column = 11; + end_line = 123; + end_column = 56; + law_headings = [ "Prologue" ]; + } + true) (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 612; - start_column = 5; - end_line = 612; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2015 1 1 - && date_courante_ <=@ date_of_numbers 2015 12 31) - then + try if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ >! integer_of_string "2" - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.0766" + then prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.16" else money_of_cents_string "0" - else raise EmptyError); - (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 605; - start_column = 5; - end_line = 605; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2014 1 1 - && date_courante_ <=@ date_of_numbers 2014 12 31) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "2" - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.069" - else money_of_cents_string "0" - else raise EmptyError); - (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 598; - start_column = 5; - end_line = 598; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2013 1 1 - && date_courante_ <=@ date_of_numbers 2013 12 31) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "2" - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.075" - else money_of_cents_string "0" - else raise EmptyError); - (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 591; - start_column = 5; - end_line = 591; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2012 1 1 - && date_courante_ <=@ date_of_numbers 2012 12 31) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "2" - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.0539" - else money_of_cents_string "0" - else raise EmptyError); - (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 584; - start_column = 5; - end_line = 584; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2011 1 1 - && date_courante_ <=@ date_of_numbers 2011 12 31) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "2" - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.0463" - else money_of_cents_string "0" - else raise EmptyError); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 123; - start_column = 11; - end_line = 123; - end_column = 56; - law_headings = [ "Prologue" ]; - } - true) - (fun (_ : _) -> - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "2" - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.16" - else money_of_cents_string "0") + with EmptyError -> raise EmptyError) + with EmptyError -> raise EmptyError with EmptyError -> raise (NoValueProvided @@ -2346,301 +2508,335 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let montant_initial_base_deuxieme_enfant_mayotte_ : money = + let montant_initial_base_deuxieme_enfant_mayotte_2201_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_initial_base_deuxième_enfant_mayotte" ] embed_money (try - handle_default - [| - (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 576; - start_column = 5; - end_line = 576; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2020 1 1 - && date_courante_ <=@ date_of_numbers 2020 12 31) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "1" - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.3068" - else money_of_cents_string "0" - else raise EmptyError); - (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 569; - start_column = 5; - end_line = 569; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2019 1 1 - && date_courante_ <=@ date_of_numbers 2019 12 31) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "1" - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.2936" - else money_of_cents_string "0" - else raise EmptyError); - (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 562; - start_column = 5; - end_line = 562; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2018 1 1 - && date_courante_ <=@ date_of_numbers 2018 12 31) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "1" - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.284" - else money_of_cents_string "0" - else raise EmptyError); - (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 555; - start_column = 5; - end_line = 555; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2017 1 1 - && date_courante_ <=@ date_of_numbers 2017 12 31) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "1" - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.2672" - else money_of_cents_string "0" - else raise EmptyError); - (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 548; - start_column = 5; - end_line = 548; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2016 1 1 - && date_courante_ <=@ date_of_numbers 2016 12 31) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "1" - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.273" - else money_of_cents_string "0" - else raise EmptyError); - (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 541; - start_column = 5; - end_line = 541; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2015 1 1 - && date_courante_ <=@ date_of_numbers 2015 12 31) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "1" - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.2555" - else money_of_cents_string "0" - else raise EmptyError); - (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 534; - start_column = 5; - end_line = 534; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2014 1 1 - && date_courante_ <=@ date_of_numbers 2014 12 31) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "1" - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.2496" - else money_of_cents_string "0" - else raise EmptyError); - (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 527; - start_column = 5; - end_line = 527; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2013 1 1 - && date_courante_ <=@ date_of_numbers 2013 12 31) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "1" - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.2437" - else money_of_cents_string "0" - else raise EmptyError); + try + handle_default + [| + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 576; + start_column = 5; + end_line = 576; + end_column = 69; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ + à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_2077_ >=@ date_of_numbers 2020 1 1 + && date_courante_2077_ <=@ date_of_numbers 2020 12 31) + then + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >! integer_of_string "1" + then + prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.3068" + else money_of_cents_string "0" + else raise EmptyError + with EmptyError -> raise EmptyError); + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 569; + start_column = 5; + end_line = 569; + end_column = 69; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ + à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_2077_ >=@ date_of_numbers 2019 1 1 + && date_courante_2077_ <=@ date_of_numbers 2019 12 31) + then + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >! integer_of_string "1" + then + prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.2936" + else money_of_cents_string "0" + else raise EmptyError + with EmptyError -> raise EmptyError); + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 562; + start_column = 5; + end_line = 562; + end_column = 69; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ + à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_2077_ >=@ date_of_numbers 2018 1 1 + && date_courante_2077_ <=@ date_of_numbers 2018 12 31) + then + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >! integer_of_string "1" + then + prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.284" + else money_of_cents_string "0" + else raise EmptyError + with EmptyError -> raise EmptyError); + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 555; + start_column = 5; + end_line = 555; + end_column = 69; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ + à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_2077_ >=@ date_of_numbers 2017 1 1 + && date_courante_2077_ <=@ date_of_numbers 2017 12 31) + then + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >! integer_of_string "1" + then + prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.2672" + else money_of_cents_string "0" + else raise EmptyError + with EmptyError -> raise EmptyError); + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 548; + start_column = 5; + end_line = 548; + end_column = 69; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ + à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_2077_ >=@ date_of_numbers 2016 1 1 + && date_courante_2077_ <=@ date_of_numbers 2016 12 31) + then + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >! integer_of_string "1" + then + prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.273" + else money_of_cents_string "0" + else raise EmptyError + with EmptyError -> raise EmptyError); + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 541; + start_column = 5; + end_line = 541; + end_column = 69; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ + à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_2077_ >=@ date_of_numbers 2015 1 1 + && date_courante_2077_ <=@ date_of_numbers 2015 12 31) + then + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >! integer_of_string "1" + then + prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.2555" + else money_of_cents_string "0" + else raise EmptyError + with EmptyError -> raise EmptyError); + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 534; + start_column = 5; + end_line = 534; + end_column = 69; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ + à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_2077_ >=@ date_of_numbers 2014 1 1 + && date_courante_2077_ <=@ date_of_numbers 2014 12 31) + then + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >! integer_of_string "1" + then + prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.2496" + else money_of_cents_string "0" + else raise EmptyError + with EmptyError -> raise EmptyError); + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 527; + start_column = 5; + end_line = 527; + end_column = 69; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ + à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_2077_ >=@ date_of_numbers 2013 1 1 + && date_courante_2077_ <=@ date_of_numbers 2013 12 31) + then + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >! integer_of_string "1" + then + prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.2437" + else money_of_cents_string "0" + else raise EmptyError + with EmptyError -> raise EmptyError); + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 520; + start_column = 5; + end_line = 520; + end_column = 69; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ + à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_2077_ >=@ date_of_numbers 2012 1 1 + && date_courante_2077_ <=@ date_of_numbers 2012 12 31) + then + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >! integer_of_string "1" + then + prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.2379" + else money_of_cents_string "0" + else raise EmptyError + with EmptyError -> raise EmptyError); + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 513; + start_column = 5; + end_line = 513; + end_column = 69; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ + à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_2077_ >=@ date_of_numbers 2011 1 1 + && date_courante_2077_ <=@ date_of_numbers 2011 12 31) + then + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >! integer_of_string "1" + then + prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.232" + else money_of_cents_string "0" + else raise EmptyError + with EmptyError -> raise EmptyError); + |] (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 520; - start_column = 5; - end_line = 520; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2012 1 1 - && date_courante_ <=@ date_of_numbers 2012 12 31) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "1" - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.2379" - else money_of_cents_string "0" - else raise EmptyError); + log_decision_taken + { + filename = "./prologue.catala_fr"; + start_line = 122; + start_column = 11; + end_line = 122; + end_column = 55; + law_headings = [ "Prologue" ]; + } + true) (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 513; - start_column = 5; - end_line = 513; - end_column = 69; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2011 1 1 - && date_courante_ <=@ date_of_numbers 2011 12 31) - then + try if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ >! integer_of_string "1" - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.232" + then prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.32" else money_of_cents_string "0" - else raise EmptyError); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 122; - start_column = 11; - end_line = 122; - end_column = 55; - law_headings = [ "Prologue" ]; - } - true) - (fun (_ : _) -> - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "1" - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.32" - else money_of_cents_string "0") + with EmptyError -> raise EmptyError) + with EmptyError -> raise EmptyError with EmptyError -> raise (NoValueProvided @@ -2653,337 +2849,373 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let montant_initial_base_premier_enfant_mayotte_ : money = + let montant_initial_base_premier_enfant_mayotte_2214_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_initial_base_premier_enfant_mayotte" ] embed_money (try - handle_default - [| - (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 505; - start_column = 5; - end_line = 505; - end_column = 49; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - avait_enfant_a_charge_avant_1er_janvier_2012_ - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "0" - then money_of_cents_string "5728" - else money_of_cents_string "0" - else raise EmptyError); - (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 497; - start_column = 5; - end_line = 498; - end_column = 53; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2020 1 1 - && date_courante_ <=@ date_of_numbers 2020 12 31 - && not avait_enfant_a_charge_avant_1er_janvier_2012_) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "0" - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.0717" - else money_of_cents_string "0" - else raise EmptyError); - (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 489; - start_column = 5; - end_line = 490; - end_column = 53; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2019 1 1 - && date_courante_ <=@ date_of_numbers 2019 12 31 - && not avait_enfant_a_charge_avant_1er_janvier_2012_) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "0" - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.0847" - else money_of_cents_string "0" - else raise EmptyError); - (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 481; - start_column = 5; - end_line = 482; - end_column = 53; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2018 1 1 - && date_courante_ <=@ date_of_numbers 2018 12 31 - && not avait_enfant_a_charge_avant_1er_janvier_2012_) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "0" - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.0976" - else money_of_cents_string "0" - else raise EmptyError); - (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 473; - start_column = 5; - end_line = 474; - end_column = 53; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2017 1 1 - && date_courante_ <=@ date_of_numbers 2017 12 31 - && not avait_enfant_a_charge_avant_1er_janvier_2012_) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "0" - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.115" - else money_of_cents_string "0" - else raise EmptyError); - (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 465; - start_column = 5; - end_line = 466; - end_column = 53; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2016 1 1 - && date_courante_ <=@ date_of_numbers 2016 12 31 - && not avait_enfant_a_charge_avant_1er_janvier_2012_) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "0" - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.1163" - else money_of_cents_string "0" - else raise EmptyError); - (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 457; - start_column = 5; - end_line = 458; - end_column = 53; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2015 1 1 - && date_courante_ <=@ date_of_numbers 2015 12 31 - && not avait_enfant_a_charge_avant_1er_janvier_2012_) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "0" - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.122" - else money_of_cents_string "0" - else raise EmptyError); - (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 449; - start_column = 5; - end_line = 450; - end_column = 53; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2014 1 1 - && date_courante_ <=@ date_of_numbers 2014 12 31 - && not avait_enfant_a_charge_avant_1er_janvier_2012_) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "0" - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.1278" - else money_of_cents_string "0" - else raise EmptyError); - (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 441; - start_column = 5; - end_line = 442; - end_column = 53; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2013 1 1 - && date_courante_ <=@ date_of_numbers 2013 12 31 - && not avait_enfant_a_charge_avant_1er_janvier_2012_) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "0" - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.1335" - else money_of_cents_string "0" - else raise EmptyError); + try + handle_default + [| + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 505; + start_column = 5; + end_line = 505; + end_column = 49; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ + à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + avait_enfant_a_charge_avant_1er_janvier_2012_2079_ + then + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >! integer_of_string "0" + then money_of_cents_string "5728" + else money_of_cents_string "0" + else raise EmptyError + with EmptyError -> raise EmptyError); + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 497; + start_column = 5; + end_line = 498; + end_column = 53; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ + à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_2077_ >=@ date_of_numbers 2020 1 1 + && date_courante_2077_ <=@ date_of_numbers 2020 12 31 + && not avait_enfant_a_charge_avant_1er_janvier_2012_2079_) + then + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >! integer_of_string "0" + then + prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.0717" + else money_of_cents_string "0" + else raise EmptyError + with EmptyError -> raise EmptyError); + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 489; + start_column = 5; + end_line = 490; + end_column = 53; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ + à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_2077_ >=@ date_of_numbers 2019 1 1 + && date_courante_2077_ <=@ date_of_numbers 2019 12 31 + && not avait_enfant_a_charge_avant_1er_janvier_2012_2079_) + then + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >! integer_of_string "0" + then + prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.0847" + else money_of_cents_string "0" + else raise EmptyError + with EmptyError -> raise EmptyError); + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 481; + start_column = 5; + end_line = 482; + end_column = 53; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ + à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_2077_ >=@ date_of_numbers 2018 1 1 + && date_courante_2077_ <=@ date_of_numbers 2018 12 31 + && not avait_enfant_a_charge_avant_1er_janvier_2012_2079_) + then + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >! integer_of_string "0" + then + prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.0976" + else money_of_cents_string "0" + else raise EmptyError + with EmptyError -> raise EmptyError); + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 473; + start_column = 5; + end_line = 474; + end_column = 53; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ + à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_2077_ >=@ date_of_numbers 2017 1 1 + && date_courante_2077_ <=@ date_of_numbers 2017 12 31 + && not avait_enfant_a_charge_avant_1er_janvier_2012_2079_) + then + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >! integer_of_string "0" + then + prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.115" + else money_of_cents_string "0" + else raise EmptyError + with EmptyError -> raise EmptyError); + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 465; + start_column = 5; + end_line = 466; + end_column = 53; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ + à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_2077_ >=@ date_of_numbers 2016 1 1 + && date_courante_2077_ <=@ date_of_numbers 2016 12 31 + && not avait_enfant_a_charge_avant_1er_janvier_2012_2079_) + then + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >! integer_of_string "0" + then + prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.1163" + else money_of_cents_string "0" + else raise EmptyError + with EmptyError -> raise EmptyError); + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 457; + start_column = 5; + end_line = 458; + end_column = 53; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ + à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_2077_ >=@ date_of_numbers 2015 1 1 + && date_courante_2077_ <=@ date_of_numbers 2015 12 31 + && not avait_enfant_a_charge_avant_1er_janvier_2012_2079_) + then + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >! integer_of_string "0" + then + prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.122" + else money_of_cents_string "0" + else raise EmptyError + with EmptyError -> raise EmptyError); + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 449; + start_column = 5; + end_line = 450; + end_column = 53; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ + à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_2077_ >=@ date_of_numbers 2014 1 1 + && date_courante_2077_ <=@ date_of_numbers 2014 12 31 + && not avait_enfant_a_charge_avant_1er_janvier_2012_2079_) + then + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >! integer_of_string "0" + then + prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.1278" + else money_of_cents_string "0" + else raise EmptyError + with EmptyError -> raise EmptyError); + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 441; + start_column = 5; + end_line = 442; + end_column = 53; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ + à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_2077_ >=@ date_of_numbers 2013 1 1 + && date_courante_2077_ <=@ date_of_numbers 2013 12 31 + && not avait_enfant_a_charge_avant_1er_janvier_2012_2079_) + then + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >! integer_of_string "0" + then + prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.1335" + else money_of_cents_string "0" + else raise EmptyError + with EmptyError -> raise EmptyError); + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 433; + start_column = 5; + end_line = 434; + end_column = 53; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ + à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_2077_ >=@ date_of_numbers 2012 1 1 + && date_courante_2077_ <=@ date_of_numbers 2012 12 31 + && not avait_enfant_a_charge_avant_1er_janvier_2012_2079_) + then + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >! integer_of_string "0" + then + prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.1393" + else money_of_cents_string "0" + else raise EmptyError + with EmptyError -> raise EmptyError); + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 425; + start_column = 5; + end_line = 426; + end_column = 53; + law_headings = + [ + "Annexe"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ + à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (date_courante_2077_ >=@ date_of_numbers 2011 1 1 + && date_courante_2077_ <=@ date_of_numbers 2011 12 31 + && not avait_enfant_a_charge_avant_1er_janvier_2012_2079_) + then + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >! integer_of_string "0" + then + prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.145" + else money_of_cents_string "0" + else raise EmptyError + with EmptyError -> raise EmptyError); + |] (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 433; - start_column = 5; - end_line = 434; - end_column = 53; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2012 1 1 - && date_courante_ <=@ date_of_numbers 2012 12 31 - && not avait_enfant_a_charge_avant_1er_janvier_2012_) - then - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "0" - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.1393" - else money_of_cents_string "0" - else raise EmptyError); + log_decision_taken + { + filename = "./prologue.catala_fr"; + start_line = 121; + start_column = 11; + end_line = 121; + end_column = 54; + law_headings = [ "Prologue" ]; + } + true) (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 425; - start_column = 5; - end_line = 426; - end_column = 53; - law_headings = - [ - "Annexe"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (date_courante_ >=@ date_of_numbers 2011 1 1 - && date_courante_ <=@ date_of_numbers 2011 12 31 - && not avait_enfant_a_charge_avant_1er_janvier_2012_) - then + try if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ >! integer_of_string "0" - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.145" + then prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.0588" else money_of_cents_string "0" - else raise EmptyError); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 121; - start_column = 11; - end_line = 121; - end_column = 54; - law_headings = [ "Prologue" ]; - } - true) - (fun (_ : _) -> - if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "0" - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.0588" - else money_of_cents_string "0") + with EmptyError -> raise EmptyError) + with EmptyError -> raise EmptyError with EmptyError -> raise (NoValueProvided @@ -2996,11 +3228,17 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let nombre_total_enfants_ : decimal = + let nombre_total_enfants_2228_ : decimal = log_variable_definition [ "AllocationsFamiliales"; "nombre_total_enfants" ] embed_decimal - (try decimal_of_integer (array_length enfants_a_charge_droit_ouvert_prestation_familiale_) + (try + try + try + decimal_of_integer + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_) + with EmptyError -> raise EmptyError + with EmptyError -> raise EmptyError with EmptyError -> raise (NoValueProvided @@ -3013,32 +3251,36 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let nombre_moyen_enfants_ : decimal = + let nombre_moyen_enfants_2229_ : decimal = log_variable_definition [ "AllocationsFamiliales"; "nombre_moyen_enfants" ] embed_decimal (try - Array.fold_left - (fun (acc_ : decimal) (enfant_ : _) -> - acc_ - +& - match - log_end_call - [ "AllocationsFamiliales"; "prise_en_compte" ] - (log_variable_definition - [ "AllocationsFamiliales"; "prise_en_compte"; "output" ] - unembeddable - (log_begin_call - [ "AllocationsFamiliales"; "prise_en_compte" ] - prise_en_compte_ - (log_variable_definition - [ "AllocationsFamiliales"; "prise_en_compte"; "input" ] - unembeddable enfant_))) - with - | Complete _ -> decimal_of_string "1." - | Partagee _ -> decimal_of_string "0.5" - | Zero _ -> decimal_of_string "0.") - (decimal_of_string "0.") enfants_a_charge_droit_ouvert_prestation_familiale_ + try + try + Array.fold_left + (fun (acc_2230_ : decimal) (enfant_2231_ : _) -> + acc_2230_ + +& + match + log_end_call + [ "AllocationsFamiliales"; "prise_en_compte" ] + (log_variable_definition + [ "AllocationsFamiliales"; "prise_en_compte"; "output" ] + unembeddable + (log_begin_call + [ "AllocationsFamiliales"; "prise_en_compte" ] + prise_en_compte_2080_ + (log_variable_definition + [ "AllocationsFamiliales"; "prise_en_compte"; "input" ] + unembeddable enfant_2231_))) + with + | Complete _ -> decimal_of_string "1." + | Partagee _ -> decimal_of_string "0.5" + | Zero _ -> decimal_of_string "0.") + (decimal_of_string "0.") enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + with EmptyError -> raise EmptyError + with EmptyError -> raise EmptyError with EmptyError -> raise (NoValueProvided @@ -3051,36 +3293,40 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let montant_initial_base_premier_enfant_ : money = + let montant_initial_base_premier_enfant_2235_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_initial_base_premier_enfant" ] embed_money (try try - if - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 359; - start_column = 5; - end_line = 360; - end_column = 71; - law_headings = - [ - "Article D755-5"; - "Chapitre 5 : Prestations familiales et prestations assimilées"; - "Titre 5 : Départements d'outre-mer"; - "Livre 7 : Régimes divers - Dispositions diverses"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (prestations_familiales_dot_regime_outre_mer_l751_1_ - && array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - = integer_of_string "1") - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.0588" - else raise EmptyError - with EmptyError -> money_of_cents_string "0" + try + try + if + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 359; + start_column = 5; + end_line = 360; + end_column = 71; + law_headings = + [ + "Article D755-5"; + "Chapitre 5 : Prestations familiales et prestations assimilées"; + "Titre 5 : Départements d'outre-mer"; + "Livre 7 : Régimes divers - Dispositions diverses"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + (prestations_familiales_dot_regime_outre_mer_l751_1_2159_ + && array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + = integer_of_string "1") + then prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.0588" + else raise EmptyError + with EmptyError -> raise EmptyError + with EmptyError -> money_of_cents_string "0" + with EmptyError -> raise EmptyError with EmptyError -> raise (NoValueProvided @@ -3093,7 +3339,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let droit_ouvert_base_ : bool = + let droit_ouvert_base_2236_ : bool = log_variable_definition [ "AllocationsFamiliales"; "droit_ouvert_base" ] embed_bool @@ -3102,162 +3348,82 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i handle_default [| (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 344; - start_column = 5; - end_line = 345; - end_column = 72; - law_headings = - [ - "Article 7"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (residence_ = Mayotte () - && array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >=! integer_of_string "1") - then true - else raise EmptyError); + try + if + log_decision_taken + { + filename = "./decrets_divers.catala_fr"; + start_line = 344; + start_column = 5; + end_line = 345; + end_column = 72; + law_headings = + [ + "Article 7"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ + à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; + ]; + } + (residence_2076_ = Mayotte () + && array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >=! integer_of_string "1") + then true + else raise EmptyError + with EmptyError -> raise EmptyError); (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./securite_sociale_L.catala_fr"; + start_line = 406; + start_column = 5; + end_line = 407; + end_column = 72; + law_headings = + [ + "Article L755-12"; + "Chapitre 5 : Prestations familiales et prestations assimilées"; + "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à \ + la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin"; + "Livre 7 : Régimes divers - Dispositions diverses"; + "Partie législative"; + "Code de la sécurité sociale"; + ]; + } + (prestations_familiales_dot_regime_outre_mer_l751_1_2159_ + && array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >=! integer_of_string "1") + then true + else raise EmptyError + with EmptyError -> raise EmptyError); + |] + (fun (_ : _) -> + log_decision_taken + { + filename = "./prologue.catala_fr"; + start_line = 108; + start_column = 11; + end_line = 108; + end_column = 28; + law_headings = [ "Prologue" ]; + } + true) + (fun (_ : _) -> + try if log_decision_taken { filename = "./securite_sociale_L.catala_fr"; - start_line = 406; - start_column = 5; - end_line = 407; - end_column = 72; - law_headings = - [ - "Article L755-12"; - "Chapitre 5 : Prestations familiales et prestations assimilées"; - "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à \ - la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin"; - "Livre 7 : Régimes divers - Dispositions diverses"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (prestations_familiales_dot_regime_outre_mer_l751_1_ - && array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >=! integer_of_string "1") - then true - else raise EmptyError); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 108; - start_column = 11; - end_line = 108; - end_column = 28; - law_headings = [ "Prologue" ]; - } - true) - (fun (_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 101; - start_column = 5; - end_line = 101; - end_column = 70; - law_headings = - [ - "Article L521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >=! integer_of_string "2") - then true - else raise EmptyError) - with EmptyError -> false - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 108; - start_column = 11; - end_line = 108; - end_column = 28; - law_headings = [ "Prologue" ]; - })) - in - let droit_ouvert_majoration_ : enfant -> bool = - log_variable_definition - [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - unembeddable - (try - fun (param_ : enfant) -> - try - try - try - if - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 313; - start_column = 5; - end_line = 315; - end_column = 58; - law_headings = - [ - "Article L521-3"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie législative"; - "Code de la sécurité sociale"; - ]; - } - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >=! nombre_enfants_alinea_2_l521_3_ - && param_.age - >=! log_end_call - [ "AllocationsFamiliales"; "âge_minimum_alinéa_1_l521_3" ] - (log_variable_definition - [ - "AllocationsFamiliales"; "âge_minimum_alinéa_1_l521_3"; "output"; - ] - unembeddable - (log_begin_call - [ "AllocationsFamiliales"; "âge_minimum_alinéa_1_l521_3" ] - age_minimum_alinea_1_l521_3_ - (log_variable_definition - [ - "AllocationsFamiliales"; - "âge_minimum_alinéa_1_l521_3"; - "input"; - ] - unembeddable param_)))) - then true - else raise EmptyError - with EmptyError -> - if - log_decision_taken - { - filename = "./securite_sociale_L.catala_fr"; - start_line = 299; + start_line = 101; start_column = 5; - end_line = 300; - end_column = 58; + end_line = 101; + end_column = 70; law_headings = [ - "Article L521-3"; + "Article L521-1"; "Chapitre 1er : Allocations familiales"; "Titre 2 : Prestations générales d'entretien"; "Livre 5 : Prestations familiales et prestations assimilées"; @@ -3265,138 +3431,242 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Code de la sécurité sociale"; ]; } - ((not - (log_end_call - [ "AllocationsFamiliales"; "est_enfant_le_plus_âgé" ] - (log_variable_definition - [ "AllocationsFamiliales"; "est_enfant_le_plus_âgé"; "output" ] - unembeddable - (log_begin_call - [ "AllocationsFamiliales"; "est_enfant_le_plus_âgé" ] - est_enfant_le_plus_age_ - (log_variable_definition - [ "AllocationsFamiliales"; "est_enfant_le_plus_âgé"; "input" ] - unembeddable param_))))) - && param_.age - >=! log_end_call - [ "AllocationsFamiliales"; "âge_minimum_alinéa_1_l521_3" ] - (log_variable_definition - [ - "AllocationsFamiliales"; "âge_minimum_alinéa_1_l521_3"; "output"; - ] - unembeddable - (log_begin_call - [ "AllocationsFamiliales"; "âge_minimum_alinéa_1_l521_3" ] - age_minimum_alinea_1_l521_3_ - (log_variable_definition - [ - "AllocationsFamiliales"; - "âge_minimum_alinéa_1_l521_3"; - "input"; - ] - unembeddable param_)))) + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >=! integer_of_string "2") then true else raise EmptyError - with EmptyError -> false - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 132; - start_column = 11; - end_line = 132; - end_column = 34; - law_headings = [ "Prologue" ]; - }) + with EmptyError -> raise EmptyError) + with EmptyError -> false with EmptyError -> raise (NoValueProvided { filename = "./prologue.catala_fr"; - start_line = 132; + start_line = 108; start_column = 11; - end_line = 132; - end_column = 34; + end_line = 108; + end_column = 28; law_headings = [ "Prologue" ]; })) in - let complement_degressif_ : money -> money = + let droit_ouvert_majoration_2241_ : enfant -> bool = log_variable_definition - [ "AllocationsFamiliales"; "complément_dégressif" ] + [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] unembeddable (try - fun (param_ : money) -> + fun (param_2242_ : enfant) -> try - handle_default - [| - (fun (_ : _) -> + try + try + try if log_decision_taken { - filename = "./securite_sociale_D.catala_fr"; - start_line = 170; + filename = "./securite_sociale_L.catala_fr"; + start_line = 313; start_column = 5; - end_line = 171; - end_column = 68; + end_line = 315; + end_column = 58; law_headings = [ - "Article D521-1"; + "Article L521-3"; "Chapitre 1er : Allocations familiales"; "Titre 2 : Prestations générales d'entretien"; "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie réglementaire - Décrets simples"; + "Partie législative"; "Code de la sécurité sociale"; ]; } - (ressources_menage_ >$ plafond__i_i_d521_3_ - && ressources_menage_ - <=$ plafond__i_i_d521_3_ +$ (param_ *$ decimal_of_string "12.")) - then - (plafond__i_i_d521_3_ - +$ ((param_ *$ decimal_of_string "12.") -$ ressources_menage_)) - *$ (decimal_of_string "1." /& decimal_of_string "12.") - else raise EmptyError); - (fun (_ : _) -> + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >=! nombre_enfants_alinea_2_l521_3_2149_ + && param_2242_.age + >=! log_end_call + [ "AllocationsFamiliales"; "âge_minimum_alinéa_1_l521_3" ] + (log_variable_definition + [ + "AllocationsFamiliales"; + "âge_minimum_alinéa_1_l521_3"; + "output"; + ] + unembeddable + (log_begin_call + [ "AllocationsFamiliales"; "âge_minimum_alinéa_1_l521_3" ] + age_minimum_alinea_1_l521_3_2164_ + (log_variable_definition + [ + "AllocationsFamiliales"; + "âge_minimum_alinéa_1_l521_3"; + "input"; + ] + unembeddable param_2242_)))) + then true + else raise EmptyError + with EmptyError -> raise EmptyError + with EmptyError -> ( + try if log_decision_taken { - filename = "./securite_sociale_D.catala_fr"; - start_line = 162; + filename = "./securite_sociale_L.catala_fr"; + start_line = 299; start_column = 5; - end_line = 163; - end_column = 68; + end_line = 300; + end_column = 58; law_headings = [ - "Article D521-1"; + "Article L521-3"; "Chapitre 1er : Allocations familiales"; "Titre 2 : Prestations générales d'entretien"; "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie réglementaire - Décrets simples"; + "Partie législative"; "Code de la sécurité sociale"; ]; } - (ressources_menage_ >$ plafond__i_d521_3_ - && ressources_menage_ - <=$ plafond__i_d521_3_ +$ (param_ *$ decimal_of_string "12.")) - then - (plafond__i_d521_3_ - +$ ((param_ *$ decimal_of_string "12.") -$ ressources_menage_)) - *$ (decimal_of_string "1." /& decimal_of_string "12.") - else raise EmptyError); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 141; - start_column = 11; - end_line = 141; - end_column = 31; - law_headings = [ "Prologue" ]; - } - true) - (fun (_ : _) -> money_of_cents_string "0") + ((not + (log_end_call + [ "AllocationsFamiliales"; "est_enfant_le_plus_âgé" ] + (log_variable_definition + [ "AllocationsFamiliales"; "est_enfant_le_plus_âgé"; "output" ] + unembeddable + (log_begin_call + [ "AllocationsFamiliales"; "est_enfant_le_plus_âgé" ] + est_enfant_le_plus_age_2168_ + (log_variable_definition + [ + "AllocationsFamiliales"; "est_enfant_le_plus_âgé"; "input"; + ] + unembeddable param_2242_))))) + && param_2242_.age + >=! log_end_call + [ "AllocationsFamiliales"; "âge_minimum_alinéa_1_l521_3" ] + (log_variable_definition + [ + "AllocationsFamiliales"; + "âge_minimum_alinéa_1_l521_3"; + "output"; + ] + unembeddable + (log_begin_call + [ "AllocationsFamiliales"; "âge_minimum_alinéa_1_l521_3" ] + age_minimum_alinea_1_l521_3_2164_ + (log_variable_definition + [ + "AllocationsFamiliales"; + "âge_minimum_alinéa_1_l521_3"; + "input"; + ] + unembeddable param_2242_)))) + then true + else raise EmptyError + with EmptyError -> raise EmptyError) + with EmptyError -> false + with EmptyError -> + raise + (NoValueProvided + { + filename = "./prologue.catala_fr"; + start_line = 132; + start_column = 11; + end_line = 132; + end_column = 34; + law_headings = [ "Prologue" ]; + }) + with EmptyError -> + raise + (NoValueProvided + { + filename = "./prologue.catala_fr"; + start_line = 132; + start_column = 11; + end_line = 132; + end_column = 34; + law_headings = [ "Prologue" ]; + })) + in + let complement_degressif_2243_ : money -> money = + log_variable_definition + [ "AllocationsFamiliales"; "complément_dégressif" ] + unembeddable + (try + fun (param_2244_ : money) -> + try + try + handle_default + [| + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 170; + start_column = 5; + end_line = 171; + end_column = 68; + law_headings = + [ + "Article D521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + (ressources_menage_2075_ >$ plafond__i_i_d521_3_2170_ + && ressources_menage_2075_ + <=$ plafond__i_i_d521_3_2170_ + +$ (param_2244_ *$ decimal_of_string "12.")) + then + (plafond__i_i_d521_3_2170_ + +$ ((param_2244_ *$ decimal_of_string "12.") -$ ressources_menage_2075_)) + *$ (decimal_of_string "1." /& decimal_of_string "12.") + else raise EmptyError + with EmptyError -> raise EmptyError); + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 162; + start_column = 5; + end_line = 163; + end_column = 68; + law_headings = + [ + "Article D521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + (ressources_menage_2075_ >$ plafond__i_d521_3_2177_ + && ressources_menage_2075_ + <=$ plafond__i_d521_3_2177_ +$ (param_2244_ *$ decimal_of_string "12.") + ) + then + (plafond__i_d521_3_2177_ + +$ ((param_2244_ *$ decimal_of_string "12.") -$ ressources_menage_2075_)) + *$ (decimal_of_string "1." /& decimal_of_string "12.") + else raise EmptyError + with EmptyError -> raise EmptyError); + |] + (fun (_ : _) -> + log_decision_taken + { + filename = "./prologue.catala_fr"; + start_line = 141; + start_column = 11; + end_line = 141; + end_column = 31; + law_headings = [ "Prologue" ]; + } + true) + (fun (_ : _) -> money_of_cents_string "0") + with EmptyError -> raise EmptyError with EmptyError -> raise (NoValueProvided @@ -3420,7 +3690,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let montant_verse_forfaitaire_par_enfant_ : money = + let montant_verse_forfaitaire_par_enfant_2249_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_versé_forfaitaire_par_enfant" ] embed_money @@ -3428,72 +3698,78 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i handle_default [| (fun (_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 243; - start_column = 5; - end_line = 243; - end_column = 43; - law_headings = - [ - "Article D521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_ >$ plafond__i_i_d521_3_) - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.0559" - else raise EmptyError); + try + if + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 243; + start_column = 5; + end_line = 243; + end_column = 43; + law_headings = + [ + "Article D521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + (ressources_menage_2075_ >$ plafond__i_i_d521_3_2170_) + then prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.0559" + else raise EmptyError + with EmptyError -> raise EmptyError); (fun (_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 229; - start_column = 5; - end_line = 230; - end_column = 46; - law_headings = - [ - "Article D521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_ >$ plafond__i_d521_3_ - && ressources_menage_ <=$ plafond__i_i_d521_3_) - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.1117" - else raise EmptyError); + try + if + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 229; + start_column = 5; + end_line = 230; + end_column = 46; + law_headings = + [ + "Article D521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + (ressources_menage_2075_ >$ plafond__i_d521_3_2177_ + && ressources_menage_2075_ <=$ plafond__i_i_d521_3_2170_) + then prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.1117" + else raise EmptyError + with EmptyError -> raise EmptyError); (fun (_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 215; - start_column = 5; - end_line = 215; - end_column = 43; - law_headings = - [ - "Article D521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_ <=$ plafond__i_d521_3_) - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.20234" - else raise EmptyError); + try + if + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 215; + start_column = 5; + end_line = 215; + end_column = 43; + law_headings = + [ + "Article D521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + (ressources_menage_2075_ <=$ plafond__i_d521_3_2177_) + then prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.20234" + else raise EmptyError + with EmptyError -> raise EmptyError); |] (fun (_ : _) -> log_decision_taken @@ -3519,7 +3795,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let montant_initial_base_troisieme_enfant_et_plus_ : money = + let montant_initial_base_troisieme_enfant_et_plus_2255_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_initial_base_troisième_enfant_et_plus" ] embed_money @@ -3527,99 +3803,105 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i handle_default [| (fun (_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 113; - start_column = 3; - end_line = 113; - end_column = 41; - law_headings = - [ - "Article D521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_ >$ plafond__i_i_d521_3_) - then + try if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "2" + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 113; + start_column = 3; + end_line = 113; + end_column = 41; + law_headings = + [ + "Article D521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + (ressources_menage_2075_ >$ plafond__i_i_d521_3_2170_) then - prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.1025" - *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - -! integer_of_string "2") - else money_of_cents_string "0" - else raise EmptyError); + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >! integer_of_string "2" + then + prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.1025" + *$ decimal_of_integer + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + -! integer_of_string "2") + else money_of_cents_string "0" + else raise EmptyError + with EmptyError -> raise EmptyError); (fun (_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 74; - start_column = 3; - end_line = 75; - end_column = 44; - law_headings = - [ - "Article D521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_ >$ plafond__i_d521_3_ - && ressources_menage_ <=$ plafond__i_i_d521_3_) - then + try if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "2" - then - prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.205" - *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - -! integer_of_string "2") - else money_of_cents_string "0" - else raise EmptyError); - (fun (_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 35; - start_column = 3; - end_line = 35; - end_column = 41; - law_headings = - [ - "Article D521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_ <=$ plafond__i_d521_3_) - then + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 74; + start_column = 3; + end_line = 75; + end_column = 44; + law_headings = + [ + "Article D521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + (ressources_menage_2075_ >$ plafond__i_d521_3_2177_ + && ressources_menage_2075_ <=$ plafond__i_i_d521_3_2170_) + then + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >! integer_of_string "2" + then + prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.205" + *$ decimal_of_integer + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + -! integer_of_string "2") + else money_of_cents_string "0" + else raise EmptyError + with EmptyError -> raise EmptyError); + (fun (_ : _) -> + try if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "2" + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 35; + start_column = 3; + end_line = 35; + end_column = 41; + law_headings = + [ + "Article D521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + (ressources_menage_2075_ <=$ plafond__i_d521_3_2177_) then - prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.41" - *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - -! integer_of_string "2") - else money_of_cents_string "0" - else raise EmptyError); + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >! integer_of_string "2" + then + prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.41" + *$ decimal_of_integer + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + -! integer_of_string "2") + else money_of_cents_string "0" + else raise EmptyError + with EmptyError -> raise EmptyError); |] (fun (_ : _) -> log_decision_taken @@ -3645,7 +3927,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let montant_initial_base_deuxieme_enfant_ : money = + let montant_initial_base_deuxieme_enfant_2261_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_initial_base_deuxième_enfant" ] embed_money @@ -3653,87 +3935,93 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i handle_default [| (fun (_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 113; - start_column = 3; - end_line = 113; - end_column = 41; - law_headings = - [ - "Article D521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_ >$ plafond__i_i_d521_3_) - then + try if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "1" - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.08" - else money_of_cents_string "0" - else raise EmptyError); + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 113; + start_column = 3; + end_line = 113; + end_column = 41; + law_headings = + [ + "Article D521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + (ressources_menage_2075_ >$ plafond__i_i_d521_3_2170_) + then + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >! integer_of_string "1" + then prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.08" + else money_of_cents_string "0" + else raise EmptyError + with EmptyError -> raise EmptyError); (fun (_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 74; - start_column = 3; - end_line = 75; - end_column = 44; - law_headings = - [ - "Article D521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_ >$ plafond__i_d521_3_ - && ressources_menage_ <=$ plafond__i_i_d521_3_) - then + try if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "1" - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.16" - else money_of_cents_string "0" - else raise EmptyError); + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 74; + start_column = 3; + end_line = 75; + end_column = 44; + law_headings = + [ + "Article D521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + (ressources_menage_2075_ >$ plafond__i_d521_3_2177_ + && ressources_menage_2075_ <=$ plafond__i_i_d521_3_2170_) + then + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >! integer_of_string "1" + then prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.16" + else money_of_cents_string "0" + else raise EmptyError + with EmptyError -> raise EmptyError); (fun (_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 35; - start_column = 3; - end_line = 35; - end_column = 41; - law_headings = - [ - "Article D521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_ <=$ plafond__i_d521_3_) - then + try if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - >! integer_of_string "1" - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.32" - else money_of_cents_string "0" - else raise EmptyError); + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 35; + start_column = 3; + end_line = 35; + end_column = 41; + law_headings = + [ + "Article D521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + (ressources_menage_2075_ <=$ plafond__i_d521_3_2177_) + then + if + array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + >! integer_of_string "1" + then prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.32" + else money_of_cents_string "0" + else raise EmptyError + with EmptyError -> raise EmptyError); |] (fun (_ : _) -> log_decision_taken @@ -3759,13 +4047,17 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let rapport_enfants_total_moyen_ : decimal = + let rapport_enfants_total_moyen_2267_ : decimal = log_variable_definition [ "AllocationsFamiliales"; "rapport_enfants_total_moyen" ] embed_decimal (try - if nombre_total_enfants_ = decimal_of_string "0." then decimal_of_string "0." - else nombre_moyen_enfants_ /& nombre_total_enfants_ + try + try + if nombre_total_enfants_2228_ = decimal_of_string "0." then decimal_of_string "0." + else nombre_moyen_enfants_2229_ /& nombre_total_enfants_2228_ + with EmptyError -> raise EmptyError + with EmptyError -> raise EmptyError with EmptyError -> raise (NoValueProvided @@ -3778,142 +4070,161 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let montant_initial_metropole_majoration_ : enfant -> money = + let montant_initial_metropole_majoration_2268_ : enfant -> money = log_variable_definition [ "AllocationsFamiliales"; "montant_initial_métropole_majoration" ] unembeddable (try - fun (param_ : enfant) -> + fun (param_2269_ : enfant) -> try handle_default [| (fun (_ : _) -> - if - log_decision_taken - { - filename = "./epilogue.catala_fr"; - start_line = 27; - start_column = 5; - end_line = 27; - end_column = 44; - law_headings = [ "Règles diverses"; "Épilogue"; "Décrets divers" ]; - } - (not - (log_end_call - [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - (log_variable_definition - [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "output" ] - unembeddable - (log_begin_call - [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - droit_ouvert_majoration_ - (log_variable_definition - [ - "AllocationsFamiliales"; "droit_ouvert_majoration"; "input"; - ] - unembeddable param_))))) - then money_of_cents_string "0" - else raise EmptyError); + try + if + log_decision_taken + { + filename = "./epilogue.catala_fr"; + start_line = 27; + start_column = 5; + end_line = 27; + end_column = 44; + law_headings = [ "Règles diverses"; "Épilogue"; "Décrets divers" ]; + } + (not + (log_end_call + [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] + (log_variable_definition + [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "output" ] + unembeddable + (log_begin_call + [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] + droit_ouvert_majoration_2241_ + (log_variable_definition + [ + "AllocationsFamiliales"; + "droit_ouvert_majoration"; + "input"; + ] + unembeddable param_2269_))))) + then money_of_cents_string "0" + else raise EmptyError + with EmptyError -> raise EmptyError); (fun (_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 132; - start_column = 3; - end_line = 132; - end_column = 41; - law_headings = - [ - "Article D521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_ >$ plafond__i_i_d521_3_ - && log_end_call - [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - (log_variable_definition - [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "output" ] - unembeddable - (log_begin_call - [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - droit_ouvert_majoration_ - (log_variable_definition - [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "input" ] - unembeddable param_)))) - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.04" - else raise EmptyError); + try + if + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 132; + start_column = 3; + end_line = 132; + end_column = 41; + law_headings = + [ + "Article D521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + (ressources_menage_2075_ >$ plafond__i_i_d521_3_2170_ + && log_end_call + [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] + (log_variable_definition + [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "output" ] + unembeddable + (log_begin_call + [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] + droit_ouvert_majoration_2241_ + (log_variable_definition + [ + "AllocationsFamiliales"; "droit_ouvert_majoration"; "input"; + ] + unembeddable param_2269_)))) + then + prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.04" + else raise EmptyError + with EmptyError -> raise EmptyError); (fun (_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 95; - start_column = 3; - end_line = 96; - end_column = 44; - law_headings = - [ - "Article D521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - ((ressources_menage_ >$ plafond__i_d521_3_ - && ressources_menage_ <=$ plafond__i_i_d521_3_) - && log_end_call - [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - (log_variable_definition - [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "output" ] - unembeddable - (log_begin_call - [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - droit_ouvert_majoration_ - (log_variable_definition - [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "input" ] - unembeddable param_)))) - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.08" - else raise EmptyError); + try + if + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 95; + start_column = 3; + end_line = 96; + end_column = 44; + law_headings = + [ + "Article D521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + ((ressources_menage_2075_ >$ plafond__i_d521_3_2177_ + && ressources_menage_2075_ <=$ plafond__i_i_d521_3_2170_) + && log_end_call + [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] + (log_variable_definition + [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "output" ] + unembeddable + (log_begin_call + [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] + droit_ouvert_majoration_2241_ + (log_variable_definition + [ + "AllocationsFamiliales"; "droit_ouvert_majoration"; "input"; + ] + unembeddable param_2269_)))) + then + prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.08" + else raise EmptyError + with EmptyError -> raise EmptyError); (fun (_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 55; - start_column = 3; - end_line = 55; - end_column = 41; - law_headings = - [ - "Article D521-1"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_ <=$ plafond__i_d521_3_ - && log_end_call - [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - (log_variable_definition - [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "output" ] - unembeddable - (log_begin_call - [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - droit_ouvert_majoration_ - (log_variable_definition - [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "input" ] - unembeddable param_)))) - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.16" - else raise EmptyError); + try + if + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 55; + start_column = 3; + end_line = 55; + end_column = 41; + law_headings = + [ + "Article D521-1"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + (ressources_menage_2075_ <=$ plafond__i_d521_3_2177_ + && log_end_call + [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] + (log_variable_definition + [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "output" ] + unembeddable + (log_begin_call + [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] + droit_ouvert_majoration_2241_ + (log_variable_definition + [ + "AllocationsFamiliales"; "droit_ouvert_majoration"; "input"; + ] + unembeddable param_2269_)))) + then + prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.16" + else raise EmptyError + with EmptyError -> raise EmptyError); |] (fun (_ : _) -> log_decision_taken @@ -3950,178 +4261,91 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let montant_verse_forfaitaire_ : money = + let montant_verse_forfaitaire_2276_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_versé_forfaitaire" ] embed_money (try - montant_verse_forfaitaire_par_enfant_ - *$ decimal_of_integer - (Array.fold_left - (fun (acc_ : integer) (enfant_ : _) -> - if - log_end_call - [ "AllocationsFamiliales"; "droit_ouvert_forfaitaire" ] - (log_variable_definition - [ "AllocationsFamiliales"; "droit_ouvert_forfaitaire"; "output" ] - unembeddable - (log_begin_call - [ "AllocationsFamiliales"; "droit_ouvert_forfaitaire" ] - droit_ouvert_forfaitaire_ - (log_variable_definition - [ "AllocationsFamiliales"; "droit_ouvert_forfaitaire"; "input" ] - unembeddable enfant_))) - then acc_ +! integer_of_string "1" - else acc_) - (integer_of_string "0") enfants_a_charge_) - with EmptyError -> - raise - (NoValueProvided - { - filename = "./prologue.catala_fr"; - start_line = 129; - start_column = 11; - end_line = 129; - end_column = 36; - law_headings = [ "Prologue" ]; - })) - in - let montant_initial_base_ : money = - log_variable_definition - [ "AllocationsFamiliales"; "montant_initial_base" ] - embed_money - (try - handle_default - [| - (fun (_ : _) -> - if - log_decision_taken - { - filename = "./decrets_divers.catala_fr"; - start_line = 335; - start_column = 5; - end_line = 335; - end_column = 24; - law_headings = - [ - "Article 7"; - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à \ - Mayotte"; - "Dispositions spéciales relatives à Mayotte"; - "Décrets divers"; - ]; - } - (residence_ = Mayotte ()) - then - montant_initial_base_premier_enfant_mayotte_ - +$ (montant_initial_base_deuxieme_enfant_mayotte_ - +$ (montant_initial_base_troisieme_enfant_mayotte_ - +$ montant_initial_base_quatrieme_enfant_et_plus_mayotte_)) - else raise EmptyError); - (fun (_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 350; - start_column = 5; - end_line = 351; - end_column = 69; - law_headings = - [ - "Article D755-5"; - "Chapitre 5 : Prestations familiales et prestations assimilées"; - "Titre 5 : Départements d'outre-mer"; - "Livre 7 : Régimes divers - Dispositions diverses"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (prestations_familiales_dot_regime_outre_mer_l751_1_ - && array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - = integer_of_string "1") - then montant_initial_base_premier_enfant_ - else raise EmptyError); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 109; - start_column = 11; - end_line = 109; - end_column = 31; - law_headings = [ "Prologue" ]; - } - true) - (fun (_ : _) -> - montant_initial_base_deuxieme_enfant_ +$ montant_initial_base_troisieme_enfant_et_plus_) + try + try + montant_verse_forfaitaire_par_enfant_2249_ + *$ decimal_of_integer + (Array.fold_left + (fun (acc_2277_ : integer) (enfant_2278_ : _) -> + if + log_end_call + [ "AllocationsFamiliales"; "droit_ouvert_forfaitaire" ] + (log_variable_definition + [ "AllocationsFamiliales"; "droit_ouvert_forfaitaire"; "output" ] + unembeddable + (log_begin_call + [ "AllocationsFamiliales"; "droit_ouvert_forfaitaire" ] + droit_ouvert_forfaitaire_2185_ + (log_variable_definition + [ "AllocationsFamiliales"; "droit_ouvert_forfaitaire"; "input" ] + unembeddable enfant_2278_))) + then acc_2277_ +! integer_of_string "1" + else acc_2277_) + (integer_of_string "0") enfants_a_charge_2078_) + with EmptyError -> raise EmptyError + with EmptyError -> raise EmptyError with EmptyError -> raise (NoValueProvided { filename = "./prologue.catala_fr"; - start_line = 109; + start_line = 129; start_column = 11; - end_line = 109; - end_column = 31; + end_line = 129; + end_column = 36; law_headings = [ "Prologue" ]; })) in - let montant_initial_majoration_ : enfant -> money = + let montant_initial_base_2279_ : money = log_variable_definition - [ "AllocationsFamiliales"; "montant_initial_majoration" ] - unembeddable + [ "AllocationsFamiliales"; "montant_initial_base" ] + embed_money (try - fun (param_ : enfant) -> - try - handle_default - [| - (fun (_ : _) -> + try + handle_default + [| + (fun (_ : _) -> + try if log_decision_taken { - filename = "./securite_sociale_D.catala_fr"; - start_line = 382; + filename = "./decrets_divers.catala_fr"; + start_line = 335; start_column = 5; - end_line = 385; - end_column = 23; + end_line = 335; + end_column = 24; law_headings = [ - "Article D755-5"; - "Chapitre 5 : Prestations familiales et prestations assimilées"; - "Titre 5 : Départements d'outre-mer"; - "Livre 7 : Régimes divers - Dispositions diverses"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; + "Article 7"; + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales \ + à Mayotte"; + "Dispositions spéciales relatives à Mayotte"; + "Décrets divers"; ]; } - (log_end_call - [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - (log_variable_definition - [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "output" ] - unembeddable - (log_begin_call - [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - droit_ouvert_majoration_ - (log_variable_definition - [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "input" ] - unembeddable param_))) - && prestations_familiales_dot_regime_outre_mer_l751_1_ - && array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - = integer_of_string "1" - && param_.age >=! integer_of_string "16") - then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.0567" - else raise EmptyError); - (fun (_ : _) -> + (residence_2076_ = Mayotte ()) + then + montant_initial_base_premier_enfant_mayotte_2214_ + +$ (montant_initial_base_deuxieme_enfant_mayotte_2201_ + +$ (montant_initial_base_troisieme_enfant_mayotte_2188_ + +$ montant_initial_base_quatrieme_enfant_et_plus_mayotte_2187_)) + else raise EmptyError + with EmptyError -> raise EmptyError); + (fun (_ : _) -> + try if log_decision_taken { filename = "./securite_sociale_D.catala_fr"; - start_line = 373; + start_line = 350; start_column = 5; - end_line = 376; - end_column = 42; + end_line = 351; + end_column = 69; law_headings = [ "Article D755-5"; @@ -4132,52 +4356,172 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Code de la sécurité sociale"; ]; } - (log_end_call - [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - (log_variable_definition - [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "output" ] - unembeddable - (log_begin_call - [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - droit_ouvert_majoration_ - (log_variable_definition - [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "input" ] - unembeddable param_))) - && prestations_familiales_dot_regime_outre_mer_l751_1_ - && array_length enfants_a_charge_droit_ouvert_prestation_familiale_ - = integer_of_string "1" - && param_.age >=! integer_of_string "11" - && param_.age - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 134; - start_column = 11; - end_line = 134; - end_column = 37; - law_headings = [ "Prologue" ]; - } - true) - (fun (_ : _) -> - log_end_call - [ "AllocationsFamiliales"; "montant_initial_métropole_majoration" ] - (log_variable_definition - [ "AllocationsFamiliales"; "montant_initial_métropole_majoration"; "output" ] - unembeddable - (log_begin_call - [ "AllocationsFamiliales"; "montant_initial_métropole_majoration" ] - montant_initial_metropole_majoration_ - (log_variable_definition - [ - "AllocationsFamiliales"; - "montant_initial_métropole_majoration"; - "input"; - ] - unembeddable param_)))) + (prestations_familiales_dot_regime_outre_mer_l751_1_2159_ + && array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + = integer_of_string "1") + then montant_initial_base_premier_enfant_2235_ + else raise EmptyError + with EmptyError -> raise EmptyError); + |] + (fun (_ : _) -> + log_decision_taken + { + filename = "./prologue.catala_fr"; + start_line = 109; + start_column = 11; + end_line = 109; + end_column = 31; + law_headings = [ "Prologue" ]; + } + true) + (fun (_ : _) -> + try + montant_initial_base_deuxieme_enfant_2261_ + +$ montant_initial_base_troisieme_enfant_et_plus_2255_ + with EmptyError -> raise EmptyError) + with EmptyError -> raise EmptyError + with EmptyError -> + raise + (NoValueProvided + { + filename = "./prologue.catala_fr"; + start_line = 109; + start_column = 11; + end_line = 109; + end_column = 31; + law_headings = [ "Prologue" ]; + })) + in + let montant_initial_majoration_2284_ : enfant -> money = + log_variable_definition + [ "AllocationsFamiliales"; "montant_initial_majoration" ] + unembeddable + (try + fun (param_2285_ : enfant) -> + try + try + handle_default + [| + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 382; + start_column = 5; + end_line = 385; + end_column = 23; + law_headings = + [ + "Article D755-5"; + "Chapitre 5 : Prestations familiales et prestations assimilées"; + "Titre 5 : Départements d'outre-mer"; + "Livre 7 : Régimes divers - Dispositions diverses"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + (log_end_call + [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] + (log_variable_definition + [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "output" ] + unembeddable + (log_begin_call + [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] + droit_ouvert_majoration_2241_ + (log_variable_definition + [ + "AllocationsFamiliales"; "droit_ouvert_majoration"; "input"; + ] + unembeddable param_2285_))) + && prestations_familiales_dot_regime_outre_mer_l751_1_2159_ + && array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + = integer_of_string "1" + && param_2285_.age >=! integer_of_string "16") + then + prestations_familiales_dot_base_mensuelle_2160_ + *$ decimal_of_string "0.0567" + else raise EmptyError + with EmptyError -> raise EmptyError); + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 373; + start_column = 5; + end_line = 376; + end_column = 42; + law_headings = + [ + "Article D755-5"; + "Chapitre 5 : Prestations familiales et prestations assimilées"; + "Titre 5 : Départements d'outre-mer"; + "Livre 7 : Régimes divers - Dispositions diverses"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + (log_end_call + [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] + (log_variable_definition + [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "output" ] + unembeddable + (log_begin_call + [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] + droit_ouvert_majoration_2241_ + (log_variable_definition + [ + "AllocationsFamiliales"; "droit_ouvert_majoration"; "input"; + ] + unembeddable param_2285_))) + && prestations_familiales_dot_regime_outre_mer_l751_1_2159_ + && array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + = integer_of_string "1" + && param_2285_.age >=! integer_of_string "11" + && param_2285_.age raise EmptyError); + |] + (fun (_ : _) -> + log_decision_taken + { + filename = "./prologue.catala_fr"; + start_line = 134; + start_column = 11; + end_line = 134; + end_column = 37; + law_headings = [ "Prologue" ]; + } + true) + (fun (_ : _) -> + try + log_end_call + [ "AllocationsFamiliales"; "montant_initial_métropole_majoration" ] + (log_variable_definition + [ + "AllocationsFamiliales"; + "montant_initial_métropole_majoration"; + "output"; + ] + unembeddable + (log_begin_call + [ "AllocationsFamiliales"; "montant_initial_métropole_majoration" ] + montant_initial_metropole_majoration_2268_ + (log_variable_definition + [ + "AllocationsFamiliales"; + "montant_initial_métropole_majoration"; + "input"; + ] + unembeddable param_2285_))) + with EmptyError -> raise EmptyError) + with EmptyError -> raise EmptyError with EmptyError -> raise (NoValueProvided @@ -4201,84 +4545,90 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let montant_verse_complement_pour_forfaitaire_ : money = + let montant_verse_complement_pour_forfaitaire_2290_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_versé_complément_pour_forfaitaire" ] embed_money (try - handle_default - [| - (fun (_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 272; - start_column = 5; - end_line = 274; - end_column = 41; - law_headings = - [ - "Article D521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_ >$ plafond__i_i_d521_3_ - && ressources_menage_ - <=$ plafond__i_i_d521_3_ - +$ (montant_verse_forfaitaire_ *$ decimal_of_string "12.")) - then - (plafond__i_i_d521_3_ - +$ ((montant_verse_forfaitaire_ *$ decimal_of_string "12.") -$ ressources_menage_) - ) - *$ (decimal_of_string "1." /& decimal_of_string "12.") - else raise EmptyError); + try + handle_default + [| + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 272; + start_column = 5; + end_line = 274; + end_column = 41; + law_headings = + [ + "Article D521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + (ressources_menage_2075_ >$ plafond__i_i_d521_3_2170_ + && ressources_menage_2075_ + <=$ plafond__i_i_d521_3_2170_ + +$ (montant_verse_forfaitaire_2276_ *$ decimal_of_string "12.")) + then + (plafond__i_i_d521_3_2170_ + +$ ((montant_verse_forfaitaire_2276_ *$ decimal_of_string "12.") + -$ ressources_menage_2075_)) + *$ (decimal_of_string "1." /& decimal_of_string "12.") + else raise EmptyError + with EmptyError -> raise EmptyError); + (fun (_ : _) -> + try + if + log_decision_taken + { + filename = "./securite_sociale_D.catala_fr"; + start_line = 262; + start_column = 5; + end_line = 264; + end_column = 42; + law_headings = + [ + "Article D521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie réglementaire - Décrets simples"; + "Code de la sécurité sociale"; + ]; + } + (ressources_menage_2075_ >$ plafond__i_d521_3_2177_ + && ressources_menage_2075_ + <=$ plafond__i_d521_3_2177_ + +$ (montant_verse_forfaitaire_2276_ *$ decimal_of_string "12.")) + then + (plafond__i_d521_3_2177_ + +$ ((montant_verse_forfaitaire_2276_ *$ decimal_of_string "12.") + -$ ressources_menage_2075_)) + *$ (decimal_of_string "1." /& decimal_of_string "12.") + else raise EmptyError + with EmptyError -> raise EmptyError); + |] (fun (_ : _) -> - if - log_decision_taken - { - filename = "./securite_sociale_D.catala_fr"; - start_line = 262; - start_column = 5; - end_line = 264; - end_column = 42; - law_headings = - [ - "Article D521-2"; - "Chapitre 1er : Allocations familiales"; - "Titre 2 : Prestations générales d'entretien"; - "Livre 5 : Prestations familiales et prestations assimilées"; - "Partie réglementaire - Décrets simples"; - "Code de la sécurité sociale"; - ]; - } - (ressources_menage_ >$ plafond__i_d521_3_ - && ressources_menage_ - <=$ plafond__i_d521_3_ - +$ (montant_verse_forfaitaire_ *$ decimal_of_string "12.")) - then - (plafond__i_d521_3_ - +$ ((montant_verse_forfaitaire_ *$ decimal_of_string "12.") -$ ressources_menage_) - ) - *$ (decimal_of_string "1." /& decimal_of_string "12.") - else raise EmptyError); - |] - (fun (_ : _) -> - log_decision_taken - { - filename = "./prologue.catala_fr"; - start_line = 143; - start_column = 11; - end_line = 143; - end_column = 52; - law_headings = [ "Prologue" ]; - } - true) - (fun (_ : _) -> money_of_cents_string "0") + log_decision_taken + { + filename = "./prologue.catala_fr"; + start_line = 143; + start_column = 11; + end_line = 143; + end_column = 52; + law_headings = [ "Prologue" ]; + } + true) + (fun (_ : _) -> money_of_cents_string "0") + with EmptyError -> raise EmptyError with EmptyError -> raise (NoValueProvided @@ -4291,11 +4641,15 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let montant_avec_garde_alternee_base_ : money = + let montant_avec_garde_alternee_base_2295_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_avec_garde_alternée_base" ] embed_money - (try montant_initial_base_ *$ rapport_enfants_total_moyen_ + (try + try + try montant_initial_base_2279_ *$ rapport_enfants_total_moyen_2267_ + with EmptyError -> raise EmptyError + with EmptyError -> raise EmptyError with EmptyError -> raise (NoValueProvided @@ -4308,41 +4662,45 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let montant_avec_garde_alternee_majoration_ : enfant -> money = + let montant_avec_garde_alternee_majoration_2296_ : enfant -> money = log_variable_definition [ "AllocationsFamiliales"; "montant_avec_garde_alternée_majoration" ] unembeddable (try - fun (param_ : enfant) -> + fun (param_2297_ : enfant) -> try - log_end_call - [ "AllocationsFamiliales"; "montant_initial_majoration" ] - (log_variable_definition - [ "AllocationsFamiliales"; "montant_initial_majoration"; "output" ] - unembeddable - (log_begin_call - [ "AllocationsFamiliales"; "montant_initial_majoration" ] - montant_initial_majoration_ + try + try + log_end_call + [ "AllocationsFamiliales"; "montant_initial_majoration" ] + (log_variable_definition + [ "AllocationsFamiliales"; "montant_initial_majoration"; "output" ] + unembeddable + (log_begin_call + [ "AllocationsFamiliales"; "montant_initial_majoration" ] + montant_initial_majoration_2284_ + (log_variable_definition + [ "AllocationsFamiliales"; "montant_initial_majoration"; "input" ] + unembeddable param_2297_))) + *$ + match + log_end_call + [ "AllocationsFamiliales"; "prise_en_compte" ] (log_variable_definition - [ "AllocationsFamiliales"; "montant_initial_majoration"; "input" ] - unembeddable param_))) - *$ - match - log_end_call - [ "AllocationsFamiliales"; "prise_en_compte" ] - (log_variable_definition - [ "AllocationsFamiliales"; "prise_en_compte"; "output" ] - unembeddable - (log_begin_call - [ "AllocationsFamiliales"; "prise_en_compte" ] - prise_en_compte_ - (log_variable_definition - [ "AllocationsFamiliales"; "prise_en_compte"; "input" ] - unembeddable param_))) - with - | Complete _ -> decimal_of_string "1." - | Partagee _ -> decimal_of_string "0.5" - | Zero _ -> decimal_of_string "0." + [ "AllocationsFamiliales"; "prise_en_compte"; "output" ] + unembeddable + (log_begin_call + [ "AllocationsFamiliales"; "prise_en_compte" ] + prise_en_compte_2080_ + (log_variable_definition + [ "AllocationsFamiliales"; "prise_en_compte"; "input" ] + unembeddable param_2297_))) + with + | Complete _ -> decimal_of_string "1." + | Partagee _ -> decimal_of_string "0.5" + | Zero _ -> decimal_of_string "0." + with EmptyError -> raise EmptyError + with EmptyError -> raise EmptyError with EmptyError -> raise (NoValueProvided @@ -4366,12 +4724,17 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let montant_verse_base_ : money = + let montant_verse_base_2301_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_versé_base" ] embed_money (try - if droit_ouvert_base_ then montant_avec_garde_alternee_base_ else money_of_cents_string "0" + try + try + if droit_ouvert_base_2236_ then montant_avec_garde_alternee_base_2295_ + else money_of_cents_string "0" + with EmptyError -> raise EmptyError + with EmptyError -> raise EmptyError with EmptyError -> raise (NoValueProvided @@ -4384,34 +4747,40 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let montant_verse_majoration_ : money = + let montant_verse_majoration_2302_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_versé_majoration" ] embed_money (try - if droit_ouvert_base_ then - Array.fold_left - (fun (acc_ : money) (enfant_ : _) -> - acc_ - +$ log_end_call - [ "AllocationsFamiliales"; "montant_avec_garde_alternée_majoration" ] - (log_variable_definition - [ - "AllocationsFamiliales"; "montant_avec_garde_alternée_majoration"; "output"; - ] - unembeddable - (log_begin_call - [ "AllocationsFamiliales"; "montant_avec_garde_alternée_majoration" ] - montant_avec_garde_alternee_majoration_ - (log_variable_definition - [ - "AllocationsFamiliales"; - "montant_avec_garde_alternée_majoration"; - "input"; - ] - unembeddable enfant_)))) - (money_of_cents_string "0") enfants_a_charge_ - else money_of_cents_string "0" + try + try + if droit_ouvert_base_2236_ then + Array.fold_left + (fun (acc_2303_ : money) (enfant_2304_ : _) -> + acc_2303_ + +$ log_end_call + [ "AllocationsFamiliales"; "montant_avec_garde_alternée_majoration" ] + (log_variable_definition + [ + "AllocationsFamiliales"; + "montant_avec_garde_alternée_majoration"; + "output"; + ] + unembeddable + (log_begin_call + [ "AllocationsFamiliales"; "montant_avec_garde_alternée_majoration" ] + montant_avec_garde_alternee_majoration_2296_ + (log_variable_definition + [ + "AllocationsFamiliales"; + "montant_avec_garde_alternée_majoration"; + "input"; + ] + unembeddable enfant_2304_)))) + (money_of_cents_string "0") enfants_a_charge_2078_ + else money_of_cents_string "0" + with EmptyError -> raise EmptyError + with EmptyError -> raise EmptyError with EmptyError -> raise (NoValueProvided @@ -4424,11 +4793,15 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let montant_base_complement_pour_base_et_majoration_ : money = + let montant_base_complement_pour_base_et_majoration_2305_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_base_complément_pour_base_et_majoration" ] embed_money - (try montant_verse_base_ +$ montant_verse_majoration_ + (try + try + try montant_verse_base_2301_ +$ montant_verse_majoration_2302_ + with EmptyError -> raise EmptyError + with EmptyError -> raise EmptyError with EmptyError -> raise (NoValueProvided @@ -4441,24 +4814,28 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let montant_verse_complement_pour_base_et_majoration_ : money = + let montant_verse_complement_pour_base_et_majoration_2306_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_versé_complément_pour_base_et_majoration" ] embed_money (try - if droit_ouvert_complement_ then - log_end_call - [ "AllocationsFamiliales"; "complément_dégressif" ] - (log_variable_definition - [ "AllocationsFamiliales"; "complément_dégressif"; "output" ] - unembeddable - (log_begin_call - [ "AllocationsFamiliales"; "complément_dégressif" ] - complement_degressif_ - (log_variable_definition - [ "AllocationsFamiliales"; "complément_dégressif"; "input" ] - unembeddable montant_base_complement_pour_base_et_majoration_))) - else money_of_cents_string "0" + try + try + if droit_ouvert_complement_2184_ then + log_end_call + [ "AllocationsFamiliales"; "complément_dégressif" ] + (log_variable_definition + [ "AllocationsFamiliales"; "complément_dégressif"; "output" ] + unembeddable + (log_begin_call + [ "AllocationsFamiliales"; "complément_dégressif" ] + complement_degressif_2243_ + (log_variable_definition + [ "AllocationsFamiliales"; "complément_dégressif"; "input" ] + unembeddable montant_base_complement_pour_base_et_majoration_2305_))) + else money_of_cents_string "0" + with EmptyError -> raise EmptyError + with EmptyError -> raise EmptyError with EmptyError -> raise (NoValueProvided @@ -4471,18 +4848,22 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let montant_verse_ : money = + let montant_verse_2307_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_versé" ] embed_money (try - if droit_ouvert_base_ then - montant_verse_base_ - +$ (montant_verse_majoration_ - +$ (montant_verse_forfaitaire_ - +$ (montant_verse_complement_pour_base_et_majoration_ - +$ montant_verse_complement_pour_forfaitaire_))) - else money_of_cents_string "0" + try + try + if droit_ouvert_base_2236_ then + montant_verse_base_2301_ + +$ (montant_verse_majoration_2302_ + +$ (montant_verse_forfaitaire_2276_ + +$ (montant_verse_complement_pour_base_et_majoration_2306_ + +$ montant_verse_complement_pour_forfaitaire_2290_))) + else money_of_cents_string "0" + with EmptyError -> raise EmptyError + with EmptyError -> raise EmptyError with EmptyError -> raise (NoValueProvided @@ -4497,55 +4878,85 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i in let (_ : unit) = if - personne_charge_effective_permanente_est_parent_ - || (not personne_charge_effective_permanente_est_parent_) - && personne_charge_effective_permanente_remplit_titre__i_ + try + personne_charge_effective_permanente_est_parent_2073_ + || (not personne_charge_effective_permanente_est_parent_2073_) + && personne_charge_effective_permanente_remplit_titre__i_2074_ + with EmptyError -> + raise + (NoValueProvided + { + filename = "./securite_sociale_L.catala_fr"; + start_line = 230; + start_column = 5; + end_line = 234; + end_column = 6; + law_headings = + [ + "Article L521-2"; + "Chapitre 1er : Allocations familiales"; + "Titre 2 : Prestations générales d'entretien"; + "Livre 5 : Prestations familiales et prestations assimilées"; + "Partie législative"; + "Code de la sécurité sociale"; + ]; + }) then () else raise AssertionFailed in - { montant_verse_out = montant_verse_ } + { montant_verse_out = montant_verse_2307_ } let interface_allocations_familiales (interface_allocations_familiales_in : interface_allocations_familiales_in) = - let i_date_courante_ : date = interface_allocations_familiales_in.i_date_courante_in in - let i_enfants_ : enfant_entree array = interface_allocations_familiales_in.i_enfants_in in - let i_ressources_menage_ : money = interface_allocations_familiales_in.i_ressources_menage_in in - let i_residence_ : collectivite = interface_allocations_familiales_in.i_residence_in in - let i_personne_charge_effective_permanente_est_parent_ : bool = + let i_date_courante_2310_ : date = interface_allocations_familiales_in.i_date_courante_in in + let i_enfants_2311_ : enfant_entree array = interface_allocations_familiales_in.i_enfants_in in + let i_ressources_menage_2312_ : money = + interface_allocations_familiales_in.i_ressources_menage_in + in + let i_residence_2313_ : collectivite = interface_allocations_familiales_in.i_residence_in in + let i_personne_charge_effective_permanente_est_parent_2314_ : bool = interface_allocations_familiales_in.i_personne_charge_effective_permanente_est_parent_in in - let i_personne_charge_effective_permanente_remplit_titre__i_ : bool = + let i_personne_charge_effective_permanente_remplit_titre__i_2315_ : bool = interface_allocations_familiales_in.i_personne_charge_effective_permanente_remplit_titre_I_in in - let i_avait_enfant_a_charge_avant_1er_janvier_2012_ : bool = + let i_avait_enfant_a_charge_avant_1er_janvier_2012_2316_ : bool = interface_allocations_familiales_in.i_avait_enfant_a_charge_avant_1er_janvier_2012_in in - let enfants_a_charge_ : enfant array = + let enfants_a_charge_2317_ : enfant array = log_variable_definition [ "InterfaceAllocationsFamiliales"; "enfants_à_charge" ] (embed_array embed_enfant) (try - Array.map - (fun (enfant_ : _) -> - { - identifiant = enfant_.d_identifiant; - obligation_scolaire = - (if enfant_.d_date_de_naissance +@ duration_of_numbers 3 0 0 >=@ i_date_courante_ - then Avant () - else if - enfant_.d_date_de_naissance +@ duration_of_numbers 16 0 0 >=@ i_date_courante_ - then Pendant () - else Apres ()); - remuneration_mensuelle = enfant_.d_remuneration_mensuelle; - date_de_naissance = enfant_.d_date_de_naissance; - age = - year_of_date - (date_of_numbers 0 1 1 +@ (i_date_courante_ -@ enfant_.d_date_de_naissance)); - prise_en_charge = enfant_.d_prise_en_charge; - a_deja_ouvert_droit_aux_allocations_familiales = - enfant_.d_a_deja_ouvert_droit_aux_allocations_familiales; - }) - i_enfants_ + try + try + Array.map + (fun (enfant_2318_ : _) -> + { + identifiant = enfant_2318_.d_identifiant; + obligation_scolaire = + (if + enfant_2318_.d_date_de_naissance +@ duration_of_numbers 3 0 0 + >=@ i_date_courante_2310_ + then Avant () + else if + enfant_2318_.d_date_de_naissance +@ duration_of_numbers 16 0 0 + >=@ i_date_courante_2310_ + then Pendant () + else Apres ()); + remuneration_mensuelle = enfant_2318_.d_remuneration_mensuelle; + date_de_naissance = enfant_2318_.d_date_de_naissance; + age = + year_of_date + (date_of_numbers 0 1 1 + +@ (i_date_courante_2310_ -@ enfant_2318_.d_date_de_naissance)); + prise_en_charge = enfant_2318_.d_prise_en_charge; + a_deja_ouvert_droit_aux_allocations_familiales = + enfant_2318_.d_a_deja_ouvert_droit_aux_allocations_familiales; + }) + i_enfants_2311_ + with EmptyError -> raise EmptyError + with EmptyError -> raise EmptyError with EmptyError -> raise (NoValueProvided @@ -4558,7 +4969,7 @@ let interface_allocations_familiales law_headings = [ "Interface du programme"; "Épilogue"; "Décrets divers" ]; })) in - let allocations_familiales_dot_personne_charge_effective_permanente_est_parent_ : bool = + let allocations_familiales_dot_personne_charge_effective_permanente_est_parent_2319_ : bool = try log_variable_definition [ @@ -4567,19 +4978,21 @@ let interface_allocations_familiales ] embed_bool (try - if - log_decision_taken - { - filename = "./epilogue.catala_fr"; - start_line = 90; - start_column = 20; - end_line = 90; - end_column = 69; - law_headings = [ "Interface du programme"; "Épilogue"; "Décrets divers" ]; - } - i_personne_charge_effective_permanente_est_parent_ - then true - else raise EmptyError + try + if + log_decision_taken + { + filename = "./epilogue.catala_fr"; + start_line = 90; + start_column = 20; + end_line = 90; + end_column = 69; + law_headings = [ "Interface du programme"; "Épilogue"; "Décrets divers" ]; + } + i_personne_charge_effective_permanente_est_parent_2314_ + then true + else raise EmptyError + with EmptyError -> raise EmptyError with EmptyError -> false) with EmptyError -> raise @@ -4593,7 +5006,8 @@ let interface_allocations_familiales law_headings = [ "Prologue" ]; }) in - let allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i_ : bool = + let allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i_2320_ : bool + = try log_variable_definition [ @@ -4602,19 +5016,21 @@ let interface_allocations_familiales ] embed_bool (try - if - log_decision_taken - { - filename = "./epilogue.catala_fr"; - start_line = 93; - start_column = 20; - end_line = 93; - end_column = 74; - law_headings = [ "Interface du programme"; "Épilogue"; "Décrets divers" ]; - } - i_personne_charge_effective_permanente_remplit_titre__i_ - then true - else raise EmptyError + try + if + log_decision_taken + { + filename = "./epilogue.catala_fr"; + start_line = 93; + start_column = 20; + end_line = 93; + end_column = 74; + law_headings = [ "Interface du programme"; "Épilogue"; "Décrets divers" ]; + } + i_personne_charge_effective_permanente_remplit_titre__i_2315_ + then true + else raise EmptyError + with EmptyError -> raise EmptyError with EmptyError -> false) with EmptyError -> raise @@ -4628,11 +5044,13 @@ let interface_allocations_familiales law_headings = [ "Prologue" ]; }) in - let allocations_familiales_dot_ressources_menage_ : money = + let allocations_familiales_dot_ressources_menage_2321_ : money = try log_variable_definition [ "InterfaceAllocationsFamiliales"; "allocations_familiales.ressources_ménage" ] - embed_money i_ressources_menage_ + embed_money + (try try i_ressources_menage_2312_ with EmptyError -> raise EmptyError + with EmptyError -> raise EmptyError) with EmptyError -> raise (NoValueProvided @@ -4645,11 +5063,13 @@ let interface_allocations_familiales law_headings = [ "Prologue" ]; }) in - let allocations_familiales_dot_residence_ : collectivite = + let allocations_familiales_dot_residence_2322_ : collectivite = try log_variable_definition [ "InterfaceAllocationsFamiliales"; "allocations_familiales.résidence" ] - embed_collectivite i_residence_ + embed_collectivite + (try try i_residence_2313_ with EmptyError -> raise EmptyError + with EmptyError -> raise EmptyError) with EmptyError -> raise (NoValueProvided @@ -4662,11 +5082,13 @@ let interface_allocations_familiales law_headings = [ "Prologue" ]; }) in - let allocations_familiales_dot_date_courante_ : date = + let allocations_familiales_dot_date_courante_2323_ : date = try log_variable_definition [ "InterfaceAllocationsFamiliales"; "allocations_familiales.date_courante" ] - embed_date i_date_courante_ + embed_date + (try try i_date_courante_2310_ with EmptyError -> raise EmptyError + with EmptyError -> raise EmptyError) with EmptyError -> raise (NoValueProvided @@ -4679,11 +5101,13 @@ let interface_allocations_familiales law_headings = [ "Prologue" ]; }) in - let allocations_familiales_dot_enfants_a_charge_ : enfant array = + let allocations_familiales_dot_enfants_a_charge_2324_ : enfant array = try log_variable_definition [ "InterfaceAllocationsFamiliales"; "allocations_familiales.enfants_à_charge" ] - (embed_array embed_enfant) enfants_a_charge_ + (embed_array embed_enfant) + (try try enfants_a_charge_2317_ with EmptyError -> raise EmptyError + with EmptyError -> raise EmptyError) with EmptyError -> raise (NoValueProvided @@ -4696,7 +5120,7 @@ let interface_allocations_familiales law_headings = [ "Prologue" ]; }) in - let allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012_ : bool = + let allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012_2325_ : bool = try log_variable_definition [ @@ -4705,19 +5129,21 @@ let interface_allocations_familiales ] embed_bool (try - if - log_decision_taken - { - filename = "./epilogue.catala_fr"; - start_line = 96; - start_column = 20; - end_line = 96; - end_column = 66; - law_headings = [ "Interface du programme"; "Épilogue"; "Décrets divers" ]; - } - i_avait_enfant_a_charge_avant_1er_janvier_2012_ - then true - else raise EmptyError + try + if + log_decision_taken + { + filename = "./epilogue.catala_fr"; + start_line = 96; + start_column = 20; + end_line = 96; + end_column = 66; + law_headings = [ "Interface du programme"; "Épilogue"; "Décrets divers" ]; + } + i_avait_enfant_a_charge_avant_1er_janvier_2012_2316_ + then true + else raise EmptyError + with EmptyError -> raise EmptyError with EmptyError -> false) with EmptyError -> raise @@ -4731,7 +5157,7 @@ let interface_allocations_familiales law_headings = [ "Prologue" ]; }) in - let result_ : allocations_familiales_out = + let result_2326_ : allocations_familiales_out = log_end_call [ "InterfaceAllocationsFamiliales"; "allocations_familiales"; "AllocationsFamiliales" ] (log_begin_call @@ -4739,23 +5165,26 @@ let interface_allocations_familiales allocations_familiales { personne_charge_effective_permanente_est_parent_in = - allocations_familiales_dot_personne_charge_effective_permanente_est_parent_; + allocations_familiales_dot_personne_charge_effective_permanente_est_parent_2319_; personne_charge_effective_permanente_remplit_titre_I_in = - allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i_; - ressources_menage_in = allocations_familiales_dot_ressources_menage_; - residence_in = allocations_familiales_dot_residence_; - date_courante_in = allocations_familiales_dot_date_courante_; - enfants_a_charge_in = allocations_familiales_dot_enfants_a_charge_; + allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i_2320_; + ressources_menage_in = allocations_familiales_dot_ressources_menage_2321_; + residence_in = allocations_familiales_dot_residence_2322_; + date_courante_in = allocations_familiales_dot_date_courante_2323_; + enfants_a_charge_in = allocations_familiales_dot_enfants_a_charge_2324_; avait_enfant_a_charge_avant_1er_janvier_2012_in = - allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012_; + allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012_2325_; }) in - let allocations_familiales_dot_montant_verse_ : money = result_.montant_verse_out in - let i_montant_verse_ : money = + let allocations_familiales_dot_montant_verse_2327_ : money = result_2326_.montant_verse_out in + let i_montant_verse_2328_ : money = log_variable_definition [ "InterfaceAllocationsFamiliales"; "i_montant_versé" ] embed_money - (try allocations_familiales_dot_montant_verse_ + (try + try + try allocations_familiales_dot_montant_verse_2327_ with EmptyError -> raise EmptyError + with EmptyError -> raise EmptyError with EmptyError -> raise (NoValueProvided @@ -4768,4 +5197,4 @@ let interface_allocations_familiales law_headings = [ "Interface du programme"; "Épilogue"; "Décrets divers" ]; })) in - { i_montant_verse_out = i_montant_verse_ } + { i_montant_verse_out = i_montant_verse_2328_ } diff --git a/french_law/python/src/allocations_familiales.py b/french_law/python/src/allocations_familiales.py index 42a1b6121..239622b56 100644 --- a/french_law/python/src/allocations_familiales.py +++ b/french_law/python/src/allocations_familiales.py @@ -480,126 +480,150 @@ def smic(smic_in_1: SmicIn): residence_3 = smic_in_1.residence_in try: def local_var_16(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=219, start_column=5, end_line=228, end_column=6, - law_headings=["Article 1", - "Décret n° 2018-1173 du 19 décembre 2018 portant relèvement du salaire minimum de croissance", - "Montant du salaire minimum de croissance", - "Décrets divers"]), ((date_courante_2 >= - date_of_numbers(2019, 1, 1)) and ((date_courante_2 <= - date_of_numbers(2019, 12, 31)) and ((residence_3 == - Collectivite(Collectivite_Code.Metropole, Unit())) or - ((residence_3 == Collectivite(Collectivite_Code.Guadeloupe, - Unit())) or ((residence_3 == - Collectivite(Collectivite_Code.Guyane, Unit())) or - ((residence_3 == Collectivite(Collectivite_Code.Martinique, - Unit())) or ((residence_3 == - Collectivite(Collectivite_Code.LaReunion, Unit())) or - ((residence_3 == - Collectivite(Collectivite_Code.SaintBarthelemy, Unit())) or - ((residence_3 == Collectivite(Collectivite_Code.SaintMartin, - Unit())) or (residence_3 == - Collectivite(Collectivite_Code.SaintPierreEtMiquelon, - Unit())))))))))))): - return money_of_cents_string("1003") - else: + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=219, start_column=5, + end_line=228, end_column=6, law_headings=["Article 1", + "Décret n° 2018-1173 du 19 décembre 2018 portant relèvement du salaire minimum de croissance", + "Montant du salaire minimum de croissance", + "Décrets divers"]), ((date_courante_2 >= + date_of_numbers(2019, 1, 1)) and ((date_courante_2 <= + date_of_numbers(2019, 12, 31)) and ((residence_3 == + Collectivite(Collectivite_Code.Metropole, Unit())) or + ((residence_3 == + Collectivite(Collectivite_Code.Guadeloupe, Unit())) or + ((residence_3 == Collectivite(Collectivite_Code.Guyane, + Unit())) or ((residence_3 == + Collectivite(Collectivite_Code.Martinique, Unit())) or + ((residence_3 == + Collectivite(Collectivite_Code.LaReunion, Unit())) or + ((residence_3 == + Collectivite(Collectivite_Code.SaintBarthelemy, + Unit())) or ((residence_3 == + Collectivite(Collectivite_Code.SaintMartin, Unit())) or + (residence_3 == + Collectivite(Collectivite_Code.SaintPierreEtMiquelon, + Unit())))))))))))): + return money_of_cents_string("1003") + else: + raise EmptyError + except EmptyError: raise EmptyError def local_var_14(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=237, start_column=5, end_line=239, end_column=6, - law_headings=["Article 1", - "Décret n° 2018-1173 du 19 décembre 2018 portant relèvement du salaire minimum de croissance", - "Montant du salaire minimum de croissance", - "Décrets divers"]), ((date_courante_2 >= - date_of_numbers(2019, 1, 1)) and ((date_courante_2 <= - date_of_numbers(2019, 12, 31)) and (residence_3 == - Collectivite(Collectivite_Code.Mayotte, - Unit()))))): - return money_of_cents_string("757") - else: + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=237, start_column=5, + end_line=239, end_column=6, law_headings=["Article 1", + "Décret n° 2018-1173 du 19 décembre 2018 portant relèvement du salaire minimum de croissance", + "Montant du salaire minimum de croissance", + "Décrets divers"]), ((date_courante_2 >= + date_of_numbers(2019, 1, 1)) and ((date_courante_2 <= + date_of_numbers(2019, 12, 31)) and (residence_3 == + Collectivite(Collectivite_Code.Mayotte, + Unit()))))): + return money_of_cents_string("757") + else: + raise EmptyError + except EmptyError: raise EmptyError def local_var_12(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=258, start_column=5, end_line=267, end_column=6, - law_headings=["Article 1", - "Décret n° 2019-1387 du 18 décembre 2019 portant relèvement du salaire minimum de croissance", - "Montant du salaire minimum de croissance", - "Décrets divers"]), ((date_courante_2 >= - date_of_numbers(2020, 1, 1)) and ((date_courante_2 <= - date_of_numbers(2020, 12, 31)) and ((residence_3 == - Collectivite(Collectivite_Code.Metropole, Unit())) or - ((residence_3 == Collectivite(Collectivite_Code.Guadeloupe, - Unit())) or ((residence_3 == - Collectivite(Collectivite_Code.Guyane, Unit())) or - ((residence_3 == Collectivite(Collectivite_Code.Martinique, - Unit())) or ((residence_3 == - Collectivite(Collectivite_Code.LaReunion, Unit())) or - ((residence_3 == - Collectivite(Collectivite_Code.SaintBarthelemy, Unit())) or - ((residence_3 == Collectivite(Collectivite_Code.SaintMartin, - Unit())) or (residence_3 == - Collectivite(Collectivite_Code.SaintPierreEtMiquelon, - Unit())))))))))))): - return money_of_cents_string("1015") - else: + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=258, start_column=5, + end_line=267, end_column=6, law_headings=["Article 1", + "Décret n° 2019-1387 du 18 décembre 2019 portant relèvement du salaire minimum de croissance", + "Montant du salaire minimum de croissance", + "Décrets divers"]), ((date_courante_2 >= + date_of_numbers(2020, 1, 1)) and ((date_courante_2 <= + date_of_numbers(2020, 12, 31)) and ((residence_3 == + Collectivite(Collectivite_Code.Metropole, Unit())) or + ((residence_3 == + Collectivite(Collectivite_Code.Guadeloupe, Unit())) or + ((residence_3 == Collectivite(Collectivite_Code.Guyane, + Unit())) or ((residence_3 == + Collectivite(Collectivite_Code.Martinique, Unit())) or + ((residence_3 == + Collectivite(Collectivite_Code.LaReunion, Unit())) or + ((residence_3 == + Collectivite(Collectivite_Code.SaintBarthelemy, + Unit())) or ((residence_3 == + Collectivite(Collectivite_Code.SaintMartin, Unit())) or + (residence_3 == + Collectivite(Collectivite_Code.SaintPierreEtMiquelon, + Unit())))))))))))): + return money_of_cents_string("1015") + else: + raise EmptyError + except EmptyError: raise EmptyError def local_var_10(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=276, start_column=5, end_line=278, end_column=6, - law_headings=["Article 1", - "Décret n° 2019-1387 du 18 décembre 2019 portant relèvement du salaire minimum de croissance", - "Montant du salaire minimum de croissance", - "Décrets divers"]), ((date_courante_2 >= - date_of_numbers(2020, 1, 1)) and ((date_courante_2 <= - date_of_numbers(2020, 12, 31)) and (residence_3 == - Collectivite(Collectivite_Code.Mayotte, - Unit()))))): - return money_of_cents_string("766") - else: + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=276, start_column=5, + end_line=278, end_column=6, law_headings=["Article 1", + "Décret n° 2019-1387 du 18 décembre 2019 portant relèvement du salaire minimum de croissance", + "Montant du salaire minimum de croissance", + "Décrets divers"]), ((date_courante_2 >= + date_of_numbers(2020, 1, 1)) and ((date_courante_2 <= + date_of_numbers(2020, 12, 31)) and (residence_3 == + Collectivite(Collectivite_Code.Mayotte, + Unit()))))): + return money_of_cents_string("766") + else: + raise EmptyError + except EmptyError: raise EmptyError def local_var_8(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=297, start_column=5, end_line=306, end_column=6, - law_headings=["Article 1", - "Décret n° 2020-1598 du 16 décembre 2020 portant relèvement du salaire minimum de croissance", - "Montant du salaire minimum de croissance", - "Décrets divers"]), ((date_courante_2 >= - date_of_numbers(2021, 1, 1)) and ((date_courante_2 <= - date_of_numbers(2021, 12, 31)) and ((residence_3 == - Collectivite(Collectivite_Code.Metropole, Unit())) or - ((residence_3 == Collectivite(Collectivite_Code.Guadeloupe, - Unit())) or ((residence_3 == - Collectivite(Collectivite_Code.Guyane, Unit())) or - ((residence_3 == Collectivite(Collectivite_Code.Martinique, - Unit())) or ((residence_3 == - Collectivite(Collectivite_Code.LaReunion, Unit())) or - ((residence_3 == - Collectivite(Collectivite_Code.SaintBarthelemy, Unit())) or - ((residence_3 == Collectivite(Collectivite_Code.SaintMartin, - Unit())) or (residence_3 == - Collectivite(Collectivite_Code.SaintPierreEtMiquelon, - Unit())))))))))))): - return money_of_cents_string("1025") - else: + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=297, start_column=5, + end_line=306, end_column=6, law_headings=["Article 1", + "Décret n° 2020-1598 du 16 décembre 2020 portant relèvement du salaire minimum de croissance", + "Montant du salaire minimum de croissance", + "Décrets divers"]), ((date_courante_2 >= + date_of_numbers(2021, 1, 1)) and ((date_courante_2 <= + date_of_numbers(2021, 12, 31)) and ((residence_3 == + Collectivite(Collectivite_Code.Metropole, Unit())) or + ((residence_3 == + Collectivite(Collectivite_Code.Guadeloupe, Unit())) or + ((residence_3 == Collectivite(Collectivite_Code.Guyane, + Unit())) or ((residence_3 == + Collectivite(Collectivite_Code.Martinique, Unit())) or + ((residence_3 == + Collectivite(Collectivite_Code.LaReunion, Unit())) or + ((residence_3 == + Collectivite(Collectivite_Code.SaintBarthelemy, + Unit())) or ((residence_3 == + Collectivite(Collectivite_Code.SaintMartin, Unit())) or + (residence_3 == + Collectivite(Collectivite_Code.SaintPierreEtMiquelon, + Unit())))))))))))): + return money_of_cents_string("1025") + else: + raise EmptyError + except EmptyError: raise EmptyError def local_var_6(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=315, start_column=5, end_line=317, end_column=6, - law_headings=["Article 1", - "Décret n° 2020-1598 du 16 décembre 2020 portant relèvement du salaire minimum de croissance", - "Montant du salaire minimum de croissance", - "Décrets divers"]), ((date_courante_2 >= - date_of_numbers(2021, 1, 1)) and ((date_courante_2 <= - date_of_numbers(2021, 12, 31)) and (residence_3 == - Collectivite(Collectivite_Code.Mayotte, - Unit()))))): - return money_of_cents_string("774") - else: + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=315, start_column=5, + end_line=317, end_column=6, law_headings=["Article 1", + "Décret n° 2020-1598 du 16 décembre 2020 portant relèvement du salaire minimum de croissance", + "Montant du salaire minimum de croissance", + "Décrets divers"]), ((date_courante_2 >= + date_of_numbers(2021, 1, 1)) and ((date_courante_2 <= + date_of_numbers(2021, 12, 31)) and (residence_3 == + Collectivite(Collectivite_Code.Mayotte, + Unit()))))): + return money_of_cents_string("774") + else: + raise EmptyError + except EmptyError: raise EmptyError def local_var_18(_: Any): @@ -636,21 +660,31 @@ def allocation_familiales_avril2008(allocation_familiales_avril2008_in_22: Alloc def enfant_le_plus_age(enfant_le_plus_age_in_25: EnfantLePlusAgeIn): enfants_26 = enfant_le_plus_age_in_25.enfants_in try: - def local_var_29(acc_30: Any, item_31: Any): - if (acc_30.age > item_31.age): - return acc_30 - else: - return item_31 - local_var_28 = list_fold_left(local_var_29, - Enfant(identifiant=- integer_of_string("1"), - obligation_scolaire=SituationObligationScolaire(SituationObligationScolaire_Code.Pendant, - Unit()), remuneration_mensuelle=money_of_cents_string("0"), - date_de_naissance=date_of_numbers( - 1900, 1, 1), - age=integer_of_string("0"), - prise_en_charge=PriseEnCharge(PriseEnCharge_Code.EffectiveEtPermanente, - Unit()), a_deja_ouvert_droit_aux_allocations_familiales=False), - enfants_26) + try: + try: + def local_var_29(acc_30: Any, item_31: Any): + if (acc_30.age > item_31.age): + return acc_30 + else: + return item_31 + local_var_28 = list_fold_left(local_var_29, + Enfant(identifiant=- integer_of_string("1"), + obligation_scolaire=SituationObligationScolaire(SituationObligationScolaire_Code.Pendant, + Unit()), + remuneration_mensuelle=money_of_cents_string( + "0"), + date_de_naissance=date_of_numbers( + 1900, 1, 1), + age=integer_of_string( + "0"), + prise_en_charge=PriseEnCharge(PriseEnCharge_Code.EffectiveEtPermanente, + Unit()), + a_deja_ouvert_droit_aux_allocations_familiales=False), + enfants_26) + except EmptyError: + raise EmptyError + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=85, start_column=10, end_line=85, end_column=21, @@ -674,39 +708,51 @@ def prestations_familiales(prestations_familiales_in_32: PrestationsFamilialesIn "âge_l512_3_2"], local_var_37) try: def local_var_44(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=24, start_column=5, end_line=25, end_column=34, - law_headings=["Instruction ministérielle N°DSS/SD2B/2019/65 du 25 mars 2019 relative à la revalorisation au 1er avril 2019 des prestations familiales servies en métropole", - "Montant de la base mensuelle des allocations familiales", - "Décrets divers"]), ((date_courante_33 >= - date_of_numbers(2019, 4, 1)) and (date_courante_33 < - date_of_numbers(2020, 4, 1)))): - return money_of_cents_string("41316") - else: + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=24, start_column=5, + end_line=25, end_column=34, + law_headings=["Instruction ministérielle N°DSS/SD2B/2019/65 du 25 mars 2019 relative à la revalorisation au 1er avril 2019 des prestations familiales servies en métropole", + "Montant de la base mensuelle des allocations familiales", + "Décrets divers"]), ((date_courante_33 >= + date_of_numbers(2019, 4, 1)) and (date_courante_33 < + date_of_numbers(2020, 4, 1)))): + return money_of_cents_string("41316") + else: + raise EmptyError + except EmptyError: raise EmptyError def local_var_42(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=44, start_column=5, end_line=45, end_column=34, - law_headings=["Instruction interministérielle no DSS/SD2B/2020/33 du 18 février 2020 relative à la revalorisation au 1er avril 2020 des prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à La Réunion, à Saint-Barthélemy, à Saint-Martin et dans le département de Mayotte", - "Montant de la base mensuelle des allocations familiales", - "Décrets divers"]), ((date_courante_33 >= - date_of_numbers(2020, 4, 1)) and (date_courante_33 < - date_of_numbers(2021, 4, 1)))): - return money_of_cents_string("41404") - else: + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=44, start_column=5, + end_line=45, end_column=34, + law_headings=["Instruction interministérielle no DSS/SD2B/2020/33 du 18 février 2020 relative à la revalorisation au 1er avril 2020 des prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à La Réunion, à Saint-Barthélemy, à Saint-Martin et dans le département de Mayotte", + "Montant de la base mensuelle des allocations familiales", + "Décrets divers"]), ((date_courante_33 >= + date_of_numbers(2020, 4, 1)) and (date_courante_33 < + date_of_numbers(2021, 4, 1)))): + return money_of_cents_string("41404") + else: + raise EmptyError + except EmptyError: raise EmptyError def local_var_40(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=60, start_column=5, end_line=61, end_column=34, - law_headings=["Instruction interministérielle n°DSS/2B/2021/65 du 19 mars 2021 relative à la revalorisation au 1er avril 2021 des prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et dans le département de Mayotte", - "Montant de la base mensuelle des allocations familiales", - "Décrets divers"]), ((date_courante_33 >= - date_of_numbers(2021, 4, 1)) and (date_courante_33 < - date_of_numbers(2022, 4, 1)))): - return money_of_cents_string("41481") - else: + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=60, start_column=5, + end_line=61, end_column=34, + law_headings=["Instruction interministérielle n°DSS/2B/2021/65 du 19 mars 2021 relative à la revalorisation au 1er avril 2021 des prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et dans le département de Mayotte", + "Montant de la base mensuelle des allocations familiales", + "Décrets divers"]), ((date_courante_33 >= + date_of_numbers(2021, 4, 1)) and (date_courante_33 < + date_of_numbers(2022, 4, 1)))): + return money_of_cents_string("41481") + else: + raise EmptyError + except EmptyError: raise EmptyError def local_var_46(_: Any): @@ -725,127 +771,162 @@ def local_var_48(_: Any): base_mensuelle_38 = log_variable_definition(["PrestationsFamiliales", "base_mensuelle"], local_var_39) try: + try: + try: + local_var_52 = date_courante_33 + except EmptyError: + raise EmptyError + except EmptyError: + raise EmptyError local_var_51 = log_variable_definition(["PrestationsFamiliales", - "smic.date_courante"], date_courante_33) + "smic.date_courante"], local_var_52) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=41, start_column=10, end_line=41, end_column=23, law_headings=["Prologue"])) smic_dot_date_courante_50 = local_var_51 try: - local_var_53 = log_variable_definition(["PrestationsFamiliales", - "smic.résidence"], residence_35) + try: + try: + local_var_55 = residence_35 + except EmptyError: + raise EmptyError + except EmptyError: + raise EmptyError + local_var_54 = log_variable_definition(["PrestationsFamiliales", + "smic.résidence"], local_var_55) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=42, start_column=10, end_line=42, end_column=19, law_headings=["Prologue"])) - smic_dot_residence_52 = local_var_53 - result_54 = log_end_call(["PrestationsFamiliales", "smic", "Smic"], + smic_dot_residence_53 = local_var_54 + result_56 = log_end_call(["PrestationsFamiliales", "smic", "Smic"], log_begin_call(["PrestationsFamiliales", "smic", "Smic"], smic, SmicIn(date_courante_in=smic_dot_date_courante_50, - residence_in=smic_dot_residence_52))) - smic_dot_brut_horaire_55 = result_54.brut_horaire_out + residence_in=smic_dot_residence_53))) + smic_dot_brut_horaire_57 = result_56.brut_horaire_out try: try: - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=354, start_column=5, end_line=359, end_column=30, - law_headings=["Article L751-1", - "Chapitre 1er : Généralités", - "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin", - "Livre 7 : Régimes divers - Dispositions diverses", - "Partie législative", - "Code de la sécurité sociale"]), ((residence_35 == - Collectivite(Collectivite_Code.Guadeloupe, Unit())) or - ((residence_35 == Collectivite(Collectivite_Code.Guyane, - Unit())) or ((residence_35 == - Collectivite(Collectivite_Code.Martinique, Unit())) or - ((residence_35 == Collectivite(Collectivite_Code.LaReunion, - Unit())) or ((residence_35 == - Collectivite(Collectivite_Code.SaintBarthelemy, Unit())) or - (residence_35 == Collectivite(Collectivite_Code.SaintMartin, - Unit())))))))): - local_var_57 = True - else: + try: + if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=354, start_column=5, + end_line=359, end_column=30, + law_headings=["Article L751-1", + "Chapitre 1er : Généralités", + "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin", + "Livre 7 : Régimes divers - Dispositions diverses", + "Partie législative", + "Code de la sécurité sociale"]), ((residence_35 == + Collectivite(Collectivite_Code.Guadeloupe, Unit())) or + ((residence_35 == Collectivite(Collectivite_Code.Guyane, + Unit())) or ((residence_35 == + Collectivite(Collectivite_Code.Martinique, Unit())) or + ((residence_35 == + Collectivite(Collectivite_Code.LaReunion, Unit())) or + ((residence_35 == + Collectivite(Collectivite_Code.SaintBarthelemy, + Unit())) or (residence_35 == + Collectivite(Collectivite_Code.SaintMartin, + Unit())))))))): + local_var_59 = True + else: + raise EmptyError + except EmptyError: raise EmptyError except EmptyError: - local_var_57 = False + local_var_59 = False except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=69, start_column=10, end_line=69, end_column=33, law_headings=["Prologue"])) - regime_outre_mer_l751_1_56 = log_variable_definition(["PrestationsFamiliales", - "régime_outre_mer_l751_1"], local_var_57) + regime_outre_mer_l751_1_58 = log_variable_definition(["PrestationsFamiliales", + "régime_outre_mer_l751_1"], local_var_59) try: try: - if log_decision_taken(SourcePosition(filename="./securite_sociale_R.catala_fr", - start_line=216, start_column=18, end_line=216, end_column=41, - law_headings=["Article R755-0-2", - "Chapitre 5 : Prestations familiales et prestations assimilées", - "Titre 5 : Départements d'outre-mer", - "Livre 7 : Régimes divers - Dispositions diverses", - "Partie réglementaire - Décrets en Conseil d'Etat", - "Code de la sécurité sociale"]), regime_outre_mer_l751_1_56): - local_var_59 = ((smic_dot_brut_horaire_55 * - decimal_of_string("0.55")) * decimal_of_string("169.")) - else: - raise EmptyError + try: + try: + if log_decision_taken(SourcePosition(filename="./securite_sociale_R.catala_fr", + start_line=216, start_column=18, + end_line=216, end_column=41, + law_headings=["Article R755-0-2", + "Chapitre 5 : Prestations familiales et prestations assimilées", + "Titre 5 : Départements d'outre-mer", + "Livre 7 : Régimes divers - Dispositions diverses", + "Partie réglementaire - Décrets en Conseil d'Etat", + "Code de la sécurité sociale"]), regime_outre_mer_l751_1_58): + local_var_61 = ((smic_dot_brut_horaire_57 * + decimal_of_string("0.55")) * + decimal_of_string("169.")) + else: + raise EmptyError + except EmptyError: + raise EmptyError + except EmptyError: + try: + local_var_61 = ((smic_dot_brut_horaire_57 * + decimal_of_string("0.55")) * + decimal_of_string("169.")) + except EmptyError: + raise EmptyError except EmptyError: - local_var_59 = ((smic_dot_brut_horaire_55 * - decimal_of_string("0.55")) * decimal_of_string("169.")) + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=67, start_column=11, end_line=67, end_column=27, law_headings=["Prologue"])) - plafond_l512_3_2_58 = log_variable_definition(["PrestationsFamiliales", - "plafond_l512_3_2"], local_var_59) + plafond_l512_3_2_60 = log_variable_definition(["PrestationsFamiliales", + "plafond_l512_3_2"], local_var_61) try: - def local_var_61(param_62: Enfant): + def local_var_63(param_64: Enfant): try: try: - match_arg_529 = param_62.obligation_scolaire - if match_arg_529.code == SituationObligationScolaire_Code.Avant: - _ = match_arg_529.value - local_var_63 = True - elif match_arg_529.code == SituationObligationScolaire_Code.Pendant: - _ = match_arg_529.value - local_var_63 = False - elif match_arg_529.code == SituationObligationScolaire_Code.Apres: - _ = match_arg_529.value - local_var_63 = False - match_arg_530 = param_62.obligation_scolaire - if match_arg_530.code == SituationObligationScolaire_Code.Avant: - _ = match_arg_530.value - local_var_71 = False - elif match_arg_530.code == SituationObligationScolaire_Code.Pendant: - _ = match_arg_530.value - local_var_71 = False - elif match_arg_530.code == SituationObligationScolaire_Code.Apres: - _ = match_arg_530.value - local_var_71 = True - match_arg_531 = param_62.obligation_scolaire - if match_arg_531.code == SituationObligationScolaire_Code.Avant: - _ = match_arg_531.value - local_var_67 = False - elif match_arg_531.code == SituationObligationScolaire_Code.Pendant: - _ = match_arg_531.value - local_var_67 = True - elif match_arg_531.code == SituationObligationScolaire_Code.Apres: - _ = match_arg_531.value - local_var_67 = False - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=68, start_column=5, - end_line=71, end_column=57, - law_headings=["Article L512-3", - "Chapitre 2 : Champ d'application", - "Titre 1 : Champ d'application - Généralités", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), ((local_var_63 or - (local_var_67 or local_var_71)) and - (param_62.remuneration_mensuelle <= - plafond_l512_3_2_58))): - return True - else: + try: + match_arg_540 = param_64.obligation_scolaire + if match_arg_540.code == SituationObligationScolaire_Code.Avant: + _ = match_arg_540.value + local_var_65 = True + elif match_arg_540.code == SituationObligationScolaire_Code.Pendant: + _ = match_arg_540.value + local_var_65 = False + elif match_arg_540.code == SituationObligationScolaire_Code.Apres: + _ = match_arg_540.value + local_var_65 = False + match_arg_541 = param_64.obligation_scolaire + if match_arg_541.code == SituationObligationScolaire_Code.Avant: + _ = match_arg_541.value + local_var_73 = False + elif match_arg_541.code == SituationObligationScolaire_Code.Pendant: + _ = match_arg_541.value + local_var_73 = False + elif match_arg_541.code == SituationObligationScolaire_Code.Apres: + _ = match_arg_541.value + local_var_73 = True + match_arg_542 = param_64.obligation_scolaire + if match_arg_542.code == SituationObligationScolaire_Code.Avant: + _ = match_arg_542.value + local_var_69 = False + elif match_arg_542.code == SituationObligationScolaire_Code.Pendant: + _ = match_arg_542.value + local_var_69 = True + elif match_arg_542.code == SituationObligationScolaire_Code.Apres: + _ = match_arg_542.value + local_var_69 = False + if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=68, start_column=5, + end_line=71, end_column=57, + law_headings=["Article L512-3", + "Chapitre 2 : Champ d'application", + "Titre 1 : Champ d'application - Généralités", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), ((local_var_65 or + (local_var_69 or local_var_73)) and + (param_64.remuneration_mensuelle <= + plafond_l512_3_2_60))): + return True + else: + raise EmptyError + except EmptyError: raise EmptyError except EmptyError: return False @@ -857,83 +938,89 @@ def local_var_61(param_62: Enfant): raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=66, start_column=10, end_line=66, end_column=29, law_headings=["Prologue"])) - conditions_hors_age_60 = log_variable_definition(["PrestationsFamiliales", - "conditions_hors_âge"], local_var_61) + conditions_hors_age_62 = log_variable_definition(["PrestationsFamiliales", + "conditions_hors_âge"], local_var_63) try: - def local_var_76(param_77: Enfant): + def local_var_78(param_79: Enfant): try: - def local_var_84(_: Any): - match_arg_532 = param_77.obligation_scolaire - if match_arg_532.code == SituationObligationScolaire_Code.Avant: - _ = match_arg_532.value - local_var_90 = False - elif match_arg_532.code == SituationObligationScolaire_Code.Pendant: - _ = match_arg_532.value - local_var_90 = True - elif match_arg_532.code == SituationObligationScolaire_Code.Apres: - _ = match_arg_532.value - local_var_90 = False - match_arg_533 = param_77.obligation_scolaire - if match_arg_533.code == SituationObligationScolaire_Code.Avant: - _ = match_arg_533.value - local_var_86 = True - elif match_arg_533.code == SituationObligationScolaire_Code.Pendant: - _ = match_arg_533.value - local_var_86 = False - elif match_arg_533.code == SituationObligationScolaire_Code.Apres: - _ = match_arg_533.value - local_var_86 = False - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=49, start_column=5, - end_line=50, end_column=50, - law_headings=["Article L512-3", - "Chapitre 2 : Champ d'application", - "Titre 1 : Champ d'application - Généralités", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), (local_var_86 or - local_var_90)): - return True - else: + def local_var_86(_: Any): + try: + match_arg_543 = param_79.obligation_scolaire + if match_arg_543.code == SituationObligationScolaire_Code.Avant: + _ = match_arg_543.value + local_var_92 = False + elif match_arg_543.code == SituationObligationScolaire_Code.Pendant: + _ = match_arg_543.value + local_var_92 = True + elif match_arg_543.code == SituationObligationScolaire_Code.Apres: + _ = match_arg_543.value + local_var_92 = False + match_arg_544 = param_79.obligation_scolaire + if match_arg_544.code == SituationObligationScolaire_Code.Avant: + _ = match_arg_544.value + local_var_88 = True + elif match_arg_544.code == SituationObligationScolaire_Code.Pendant: + _ = match_arg_544.value + local_var_88 = False + elif match_arg_544.code == SituationObligationScolaire_Code.Apres: + _ = match_arg_544.value + local_var_88 = False + if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=49, start_column=5, + end_line=50, end_column=50, + law_headings=["Article L512-3", + "Chapitre 2 : Champ d'application", + "Titre 1 : Champ d'application - Généralités", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), (local_var_88 or + local_var_92)): + return True + else: + raise EmptyError + except EmptyError: raise EmptyError - def local_var_78(_: Any): - match_arg_534 = param_77.obligation_scolaire - if match_arg_534.code == SituationObligationScolaire_Code.Avant: - _ = match_arg_534.value - local_var_80 = False - elif match_arg_534.code == SituationObligationScolaire_Code.Pendant: - _ = match_arg_534.value - local_var_80 = False - elif match_arg_534.code == SituationObligationScolaire_Code.Apres: - _ = match_arg_534.value - local_var_80 = True - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=60, start_column=5, - end_line=62, end_column=32, - law_headings=["Article L512-3", - "Chapitre 2 : Champ d'application", - "Titre 1 : Champ d'application - Généralités", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), (local_var_80 and - ((param_77.remuneration_mensuelle <= - plafond_l512_3_2_58) and (param_77.age < - age_l512_3_2_36)))): - return True - else: + def local_var_80(_: Any): + try: + match_arg_545 = param_79.obligation_scolaire + if match_arg_545.code == SituationObligationScolaire_Code.Avant: + _ = match_arg_545.value + local_var_82 = False + elif match_arg_545.code == SituationObligationScolaire_Code.Pendant: + _ = match_arg_545.value + local_var_82 = False + elif match_arg_545.code == SituationObligationScolaire_Code.Apres: + _ = match_arg_545.value + local_var_82 = True + if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=60, start_column=5, + end_line=62, end_column=32, + law_headings=["Article L512-3", + "Chapitre 2 : Champ d'application", + "Titre 1 : Champ d'application - Généralités", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), (local_var_82 and + ((param_79.remuneration_mensuelle <= + plafond_l512_3_2_60) and (param_79.age < + age_l512_3_2_36)))): + return True + else: + raise EmptyError + except EmptyError: raise EmptyError - def local_var_94(_: Any): + def local_var_96(_: Any): return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", start_line=65, start_column=10, end_line=65, end_column=22, law_headings=["Prologue"]), True) - def local_var_96(_: Any): + def local_var_98(_: Any): return False - return handle_default([local_var_78, local_var_84], - local_var_94, local_var_96) + return handle_default([local_var_80, local_var_86], + local_var_96, local_var_98) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=65, start_column=10, end_line=65, @@ -942,191 +1029,207 @@ def local_var_96(_: Any): raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=65, start_column=10, end_line=65, end_column=22, law_headings=["Prologue"])) - droit_ouvert_75 = log_variable_definition(["PrestationsFamiliales", - "droit_ouvert"], local_var_76) - return PrestationsFamilialesOut(droit_ouvert_out=droit_ouvert_75, - conditions_hors_age_out=conditions_hors_age_60, + droit_ouvert_77 = log_variable_definition(["PrestationsFamiliales", + "droit_ouvert"], local_var_78) + return PrestationsFamilialesOut(droit_ouvert_out=droit_ouvert_77, + conditions_hors_age_out=conditions_hors_age_62, age_l512_3_2_out=age_l512_3_2_36, - regime_outre_mer_l751_1_out=regime_outre_mer_l751_1_56, + regime_outre_mer_l751_1_out=regime_outre_mer_l751_1_58, base_mensuelle_out=base_mensuelle_38) -def allocations_familiales(allocations_familiales_in_98: AllocationsFamilialesIn): - personne_charge_effective_permanente_est_parent_99 = allocations_familiales_in_98.personne_charge_effective_permanente_est_parent_in - personne_charge_effective_permanente_remplit_titre__i_100 = allocations_familiales_in_98.personne_charge_effective_permanente_remplit_titre_I_in - ressources_menage_101 = allocations_familiales_in_98.ressources_menage_in - residence_102 = allocations_familiales_in_98.residence_in - date_courante_103 = allocations_familiales_in_98.date_courante_in - enfants_a_charge_104 = allocations_familiales_in_98.enfants_a_charge_in - avait_enfant_a_charge_avant_1er_janvier_2012_105 = allocations_familiales_in_98.avait_enfant_a_charge_avant_1er_janvier_2012_in +def allocations_familiales(allocations_familiales_in_100: AllocationsFamilialesIn): + personne_charge_effective_permanente_est_parent_101 = allocations_familiales_in_100.personne_charge_effective_permanente_est_parent_in + personne_charge_effective_permanente_remplit_titre__i_102 = allocations_familiales_in_100.personne_charge_effective_permanente_remplit_titre_I_in + ressources_menage_103 = allocations_familiales_in_100.ressources_menage_in + residence_104 = allocations_familiales_in_100.residence_in + date_courante_105 = allocations_familiales_in_100.date_courante_in + enfants_a_charge_106 = allocations_familiales_in_100.enfants_a_charge_in + avait_enfant_a_charge_avant_1er_janvier_2012_107 = allocations_familiales_in_100.avait_enfant_a_charge_avant_1er_janvier_2012_in try: - def local_var_107(param_108: Enfant): + def local_var_109(param_110: Enfant): try: - def local_var_141(_: Any): - match_arg_535 = param_108.prise_en_charge - if match_arg_535.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: - _ = match_arg_535.value - local_var_143 = False - elif match_arg_535.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: - _ = match_arg_535.value - local_var_143 = False - elif match_arg_535.code == PriseEnCharge_Code.EffectiveEtPermanente: - _ = match_arg_535.value - local_var_143 = True - elif match_arg_535.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: - _ = match_arg_535.value - local_var_143 = False - elif match_arg_535.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: - _ = match_arg_535.value - local_var_143 = False - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=184, start_column=5, - end_line=184, end_column=60, - law_headings=["Article L521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), local_var_143): - return PriseEnCompte(PriseEnCompte_Code.Complete, - Unit()) - else: + def local_var_143(_: Any): + try: + match_arg_546 = param_110.prise_en_charge + if match_arg_546.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: + _ = match_arg_546.value + local_var_145 = False + elif match_arg_546.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: + _ = match_arg_546.value + local_var_145 = False + elif match_arg_546.code == PriseEnCharge_Code.EffectiveEtPermanente: + _ = match_arg_546.value + local_var_145 = True + elif match_arg_546.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: + _ = match_arg_546.value + local_var_145 = False + elif match_arg_546.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: + _ = match_arg_546.value + local_var_145 = False + if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=184, start_column=5, + end_line=184, end_column=60, + law_headings=["Article L521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), local_var_145): + return PriseEnCompte(PriseEnCompte_Code.Complete, + Unit()) + else: + raise EmptyError + except EmptyError: raise EmptyError - def local_var_133(_: Any): - match_arg_536 = param_108.prise_en_charge - if match_arg_536.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: - _ = match_arg_536.value - local_var_135 = False - elif match_arg_536.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: - _ = match_arg_536.value - local_var_135 = True - elif match_arg_536.code == PriseEnCharge_Code.EffectiveEtPermanente: - _ = match_arg_536.value - local_var_135 = False - elif match_arg_536.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: - _ = match_arg_536.value - local_var_135 = False - elif match_arg_536.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: - _ = match_arg_536.value - local_var_135 = False - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=204, start_column=5, - end_line=204, end_column=69, - law_headings=["Article L521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), local_var_135): - return PriseEnCompte(PriseEnCompte_Code.Complete, - Unit()) - else: + def local_var_135(_: Any): + try: + match_arg_547 = param_110.prise_en_charge + if match_arg_547.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: + _ = match_arg_547.value + local_var_137 = False + elif match_arg_547.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: + _ = match_arg_547.value + local_var_137 = True + elif match_arg_547.code == PriseEnCharge_Code.EffectiveEtPermanente: + _ = match_arg_547.value + local_var_137 = False + elif match_arg_547.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: + _ = match_arg_547.value + local_var_137 = False + elif match_arg_547.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: + _ = match_arg_547.value + local_var_137 = False + if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=204, start_column=5, + end_line=204, end_column=69, + law_headings=["Article L521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), local_var_137): + return PriseEnCompte(PriseEnCompte_Code.Complete, + Unit()) + else: + raise EmptyError + except EmptyError: raise EmptyError - def local_var_125(_: Any): - match_arg_537 = param_108.prise_en_charge - if match_arg_537.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: - _ = match_arg_537.value - local_var_127 = True - elif match_arg_537.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: - _ = match_arg_537.value - local_var_127 = False - elif match_arg_537.code == PriseEnCharge_Code.EffectiveEtPermanente: - _ = match_arg_537.value - local_var_127 = False - elif match_arg_537.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: - _ = match_arg_537.value - local_var_127 = False - elif match_arg_537.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: - _ = match_arg_537.value - local_var_127 = False - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=214, start_column=5, - end_line=214, end_column=70, - law_headings=["Article L521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), local_var_127): - return PriseEnCompte(PriseEnCompte_Code.Partagee, - Unit()) - else: + def local_var_127(_: Any): + try: + match_arg_548 = param_110.prise_en_charge + if match_arg_548.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: + _ = match_arg_548.value + local_var_129 = True + elif match_arg_548.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: + _ = match_arg_548.value + local_var_129 = False + elif match_arg_548.code == PriseEnCharge_Code.EffectiveEtPermanente: + _ = match_arg_548.value + local_var_129 = False + elif match_arg_548.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: + _ = match_arg_548.value + local_var_129 = False + elif match_arg_548.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: + _ = match_arg_548.value + local_var_129 = False + if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=214, start_column=5, + end_line=214, end_column=70, + law_headings=["Article L521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), local_var_129): + return PriseEnCompte(PriseEnCompte_Code.Partagee, + Unit()) + else: + raise EmptyError + except EmptyError: raise EmptyError - def local_var_117(_: Any): - match_arg_538 = param_108.prise_en_charge - if match_arg_538.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: - _ = match_arg_538.value - local_var_119 = False - elif match_arg_538.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: - _ = match_arg_538.value - local_var_119 = False - elif match_arg_538.code == PriseEnCharge_Code.EffectiveEtPermanente: - _ = match_arg_538.value - local_var_119 = False - elif match_arg_538.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: - _ = match_arg_538.value - local_var_119 = False - elif match_arg_538.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: - _ = match_arg_538.value - local_var_119 = True - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=253, start_column=5, - end_line=254, end_column=56, - law_headings=["Article L521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), local_var_119): - return PriseEnCompte(PriseEnCompte_Code.Zero, Unit()) - else: + def local_var_119(_: Any): + try: + match_arg_549 = param_110.prise_en_charge + if match_arg_549.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: + _ = match_arg_549.value + local_var_121 = False + elif match_arg_549.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: + _ = match_arg_549.value + local_var_121 = False + elif match_arg_549.code == PriseEnCharge_Code.EffectiveEtPermanente: + _ = match_arg_549.value + local_var_121 = False + elif match_arg_549.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: + _ = match_arg_549.value + local_var_121 = False + elif match_arg_549.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: + _ = match_arg_549.value + local_var_121 = True + if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=253, start_column=5, + end_line=254, end_column=56, + law_headings=["Article L521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), local_var_121): + return PriseEnCompte(PriseEnCompte_Code.Zero, + Unit()) + else: + raise EmptyError + except EmptyError: raise EmptyError - def local_var_109(_: Any): - match_arg_539 = param_108.prise_en_charge - if match_arg_539.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: - _ = match_arg_539.value - local_var_111 = False - elif match_arg_539.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: - _ = match_arg_539.value - local_var_111 = False - elif match_arg_539.code == PriseEnCharge_Code.EffectiveEtPermanente: - _ = match_arg_539.value - local_var_111 = False - elif match_arg_539.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: - _ = match_arg_539.value - local_var_111 = True - elif match_arg_539.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: - _ = match_arg_539.value - local_var_111 = False - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=263, start_column=5, - end_line=264, end_column=48, - law_headings=["Article L521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), local_var_111): - return PriseEnCompte(PriseEnCompte_Code.Complete, - Unit()) - else: + def local_var_111(_: Any): + try: + match_arg_550 = param_110.prise_en_charge + if match_arg_550.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: + _ = match_arg_550.value + local_var_113 = False + elif match_arg_550.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: + _ = match_arg_550.value + local_var_113 = False + elif match_arg_550.code == PriseEnCharge_Code.EffectiveEtPermanente: + _ = match_arg_550.value + local_var_113 = False + elif match_arg_550.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: + _ = match_arg_550.value + local_var_113 = True + elif match_arg_550.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: + _ = match_arg_550.value + local_var_113 = False + if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=263, start_column=5, + end_line=264, end_column=48, + law_headings=["Article L521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), local_var_113): + return PriseEnCompte(PriseEnCompte_Code.Complete, + Unit()) + else: + raise EmptyError + except EmptyError: raise EmptyError - def local_var_149(_: Any): + def local_var_151(_: Any): return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", start_line=102, start_column=11, end_line=102, end_column=26, law_headings=["Prologue"]), True) - def local_var_151(_: Any): + def local_var_153(_: Any): raise EmptyError - return handle_default([local_var_109, local_var_117, - local_var_125, local_var_133, local_var_141], - local_var_149, local_var_151) + return handle_default([local_var_111, local_var_119, + local_var_127, local_var_135, local_var_143], + local_var_151, local_var_153) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=102, start_column=11, end_line=102, @@ -1135,177 +1238,192 @@ def local_var_151(_: Any): raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=102, start_column=11, end_line=102, end_column=26, law_headings=["Prologue"])) - prise_en_compte_106 = log_variable_definition(["AllocationsFamiliales", - "prise_en_compte"], local_var_107) + prise_en_compte_108 = log_variable_definition(["AllocationsFamiliales", + "prise_en_compte"], local_var_109) try: - def local_var_154(param_155: Enfant): + def local_var_156(param_157: Enfant): try: - def local_var_188(_: Any): - match_arg_540 = param_155.prise_en_charge - if match_arg_540.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: - _ = match_arg_540.value - local_var_190 = False - elif match_arg_540.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: - _ = match_arg_540.value - local_var_190 = False - elif match_arg_540.code == PriseEnCharge_Code.EffectiveEtPermanente: - _ = match_arg_540.value - local_var_190 = True - elif match_arg_540.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: - _ = match_arg_540.value - local_var_190 = False - elif match_arg_540.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: - _ = match_arg_540.value - local_var_190 = False - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=188, start_column=5, - end_line=188, end_column=60, - law_headings=["Article L521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), local_var_190): - return VersementAllocations(VersementAllocations_Code.Normal, - Unit()) - else: + def local_var_190(_: Any): + try: + match_arg_551 = param_157.prise_en_charge + if match_arg_551.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: + _ = match_arg_551.value + local_var_192 = False + elif match_arg_551.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: + _ = match_arg_551.value + local_var_192 = False + elif match_arg_551.code == PriseEnCharge_Code.EffectiveEtPermanente: + _ = match_arg_551.value + local_var_192 = True + elif match_arg_551.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: + _ = match_arg_551.value + local_var_192 = False + elif match_arg_551.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: + _ = match_arg_551.value + local_var_192 = False + if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=188, start_column=5, + end_line=188, end_column=60, + law_headings=["Article L521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), local_var_192): + return VersementAllocations(VersementAllocations_Code.Normal, + Unit()) + else: + raise EmptyError + except EmptyError: raise EmptyError - def local_var_180(_: Any): - match_arg_541 = param_155.prise_en_charge - if match_arg_541.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: - _ = match_arg_541.value - local_var_182 = False - elif match_arg_541.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: - _ = match_arg_541.value - local_var_182 = True - elif match_arg_541.code == PriseEnCharge_Code.EffectiveEtPermanente: - _ = match_arg_541.value - local_var_182 = False - elif match_arg_541.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: - _ = match_arg_541.value - local_var_182 = False - elif match_arg_541.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: - _ = match_arg_541.value - local_var_182 = False - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=208, start_column=5, - end_line=208, end_column=69, - law_headings=["Article L521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), local_var_182): - return VersementAllocations(VersementAllocations_Code.Normal, - Unit()) - else: + def local_var_182(_: Any): + try: + match_arg_552 = param_157.prise_en_charge + if match_arg_552.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: + _ = match_arg_552.value + local_var_184 = False + elif match_arg_552.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: + _ = match_arg_552.value + local_var_184 = True + elif match_arg_552.code == PriseEnCharge_Code.EffectiveEtPermanente: + _ = match_arg_552.value + local_var_184 = False + elif match_arg_552.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: + _ = match_arg_552.value + local_var_184 = False + elif match_arg_552.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: + _ = match_arg_552.value + local_var_184 = False + if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=208, start_column=5, + end_line=208, end_column=69, + law_headings=["Article L521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), local_var_184): + return VersementAllocations(VersementAllocations_Code.Normal, + Unit()) + else: + raise EmptyError + except EmptyError: raise EmptyError - def local_var_172(_: Any): - match_arg_542 = param_155.prise_en_charge - if match_arg_542.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: - _ = match_arg_542.value - local_var_174 = True - elif match_arg_542.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: - _ = match_arg_542.value - local_var_174 = False - elif match_arg_542.code == PriseEnCharge_Code.EffectiveEtPermanente: - _ = match_arg_542.value - local_var_174 = False - elif match_arg_542.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: - _ = match_arg_542.value - local_var_174 = False - elif match_arg_542.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: - _ = match_arg_542.value - local_var_174 = False - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=218, start_column=5, - end_line=218, end_column=70, - law_headings=["Article L521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), local_var_174): - return VersementAllocations(VersementAllocations_Code.Normal, - Unit()) - else: + def local_var_174(_: Any): + try: + match_arg_553 = param_157.prise_en_charge + if match_arg_553.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: + _ = match_arg_553.value + local_var_176 = True + elif match_arg_553.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: + _ = match_arg_553.value + local_var_176 = False + elif match_arg_553.code == PriseEnCharge_Code.EffectiveEtPermanente: + _ = match_arg_553.value + local_var_176 = False + elif match_arg_553.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: + _ = match_arg_553.value + local_var_176 = False + elif match_arg_553.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: + _ = match_arg_553.value + local_var_176 = False + if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=218, start_column=5, + end_line=218, end_column=70, + law_headings=["Article L521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), local_var_176): + return VersementAllocations(VersementAllocations_Code.Normal, + Unit()) + else: + raise EmptyError + except EmptyError: raise EmptyError - def local_var_164(_: Any): - match_arg_543 = param_155.prise_en_charge - if match_arg_543.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: - _ = match_arg_543.value - local_var_166 = False - elif match_arg_543.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: - _ = match_arg_543.value - local_var_166 = False - elif match_arg_543.code == PriseEnCharge_Code.EffectiveEtPermanente: - _ = match_arg_543.value - local_var_166 = False - elif match_arg_543.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: - _ = match_arg_543.value - local_var_166 = False - elif match_arg_543.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: - _ = match_arg_543.value - local_var_166 = True - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=258, start_column=5, - end_line=259, end_column=56, - law_headings=["Article L521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), local_var_166): - return VersementAllocations(VersementAllocations_Code.AllocationVerseeAuxServicesSociaux, - Unit()) - else: + def local_var_166(_: Any): + try: + match_arg_554 = param_157.prise_en_charge + if match_arg_554.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: + _ = match_arg_554.value + local_var_168 = False + elif match_arg_554.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: + _ = match_arg_554.value + local_var_168 = False + elif match_arg_554.code == PriseEnCharge_Code.EffectiveEtPermanente: + _ = match_arg_554.value + local_var_168 = False + elif match_arg_554.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: + _ = match_arg_554.value + local_var_168 = False + elif match_arg_554.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: + _ = match_arg_554.value + local_var_168 = True + if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=258, start_column=5, + end_line=259, end_column=56, + law_headings=["Article L521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), local_var_168): + return VersementAllocations(VersementAllocations_Code.AllocationVerseeAuxServicesSociaux, + Unit()) + else: + raise EmptyError + except EmptyError: raise EmptyError - def local_var_156(_: Any): - match_arg_544 = param_155.prise_en_charge - if match_arg_544.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: - _ = match_arg_544.value - local_var_158 = False - elif match_arg_544.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: - _ = match_arg_544.value - local_var_158 = False - elif match_arg_544.code == PriseEnCharge_Code.EffectiveEtPermanente: - _ = match_arg_544.value - local_var_158 = False - elif match_arg_544.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: - _ = match_arg_544.value - local_var_158 = True - elif match_arg_544.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: - _ = match_arg_544.value - local_var_158 = False - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=269, start_column=5, - end_line=270, end_column=48, - law_headings=["Article L521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), local_var_158): - return VersementAllocations(VersementAllocations_Code.Normal, - Unit()) - else: + def local_var_158(_: Any): + try: + match_arg_555 = param_157.prise_en_charge + if match_arg_555.code == PriseEnCharge_Code.GardeAlterneePartageAllocations: + _ = match_arg_555.value + local_var_160 = False + elif match_arg_555.code == PriseEnCharge_Code.GardeAlterneeAllocataireUnique: + _ = match_arg_555.value + local_var_160 = False + elif match_arg_555.code == PriseEnCharge_Code.EffectiveEtPermanente: + _ = match_arg_555.value + local_var_160 = False + elif match_arg_555.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeALaFamille: + _ = match_arg_555.value + local_var_160 = True + elif match_arg_555.code == PriseEnCharge_Code.ServicesSociauxAllocationVerseeAuxServicesSociaux: + _ = match_arg_555.value + local_var_160 = False + if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=269, start_column=5, + end_line=270, end_column=48, + law_headings=["Article L521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), local_var_160): + return VersementAllocations(VersementAllocations_Code.Normal, + Unit()) + else: + raise EmptyError + except EmptyError: raise EmptyError - def local_var_196(_: Any): + def local_var_198(_: Any): return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", start_line=103, start_column=11, end_line=103, end_column=20, law_headings=["Prologue"]), True) - def local_var_198(_: Any): + def local_var_200(_: Any): raise EmptyError - return handle_default([local_var_156, local_var_164, - local_var_172, local_var_180, local_var_188], - local_var_196, local_var_198) + return handle_default([local_var_158, local_var_166, + local_var_174, local_var_182, local_var_190], + local_var_198, local_var_200) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=103, start_column=11, end_line=103, @@ -1314,102 +1432,135 @@ def local_var_198(_: Any): raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=103, start_column=11, end_line=103, end_column=20, law_headings=["Prologue"])) - versement_153 = log_variable_definition(["AllocationsFamiliales", - "versement"], local_var_154) + versement_155 = log_variable_definition(["AllocationsFamiliales", + "versement"], local_var_156) try: - local_var_201 = integer_of_string("3") + local_var_203 = integer_of_string("3") except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=151, start_column=11, end_line=151, end_column=32, law_headings=["Prologue"])) - nombre_enfants_l521_1_200 = log_variable_definition(["AllocationsFamiliales", - "nombre_enfants_l521_1"], local_var_201) + nombre_enfants_l521_1_202 = log_variable_definition(["AllocationsFamiliales", + "nombre_enfants_l521_1"], local_var_203) try: - local_var_203 = integer_of_string("3") + local_var_205 = integer_of_string("3") except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=153, start_column=11, end_line=153, end_column=41, law_headings=["Prologue"])) - nombre_enfants_alinea_2_l521_3_202 = log_variable_definition(["AllocationsFamiliales", - "nombre_enfants_alinéa_2_l521_3"], local_var_203) - result_204 = log_end_call(["AllocationsFamiliales", "version_avril_2008", + nombre_enfants_alinea_2_l521_3_204 = log_variable_definition(["AllocationsFamiliales", + "nombre_enfants_alinéa_2_l521_3"], local_var_205) + result_206 = log_end_call(["AllocationsFamiliales", "version_avril_2008", "AllocationFamilialesAvril2008"], log_begin_call(["AllocationsFamiliales", "version_avril_2008", "AllocationFamilialesAvril2008"], allocation_familiales_avril2008, AllocationFamilialesAvril2008In())) - version_avril_2008_dot_age_minimum_alinea_1_l521_3_205 = result_204.age_minimum_alinea_1_l521_3_out + version_avril_2008_dot_age_minimum_alinea_1_l521_3_207 = result_206.age_minimum_alinea_1_l521_3_out try: - local_var_207 = log_variable_definition(["AllocationsFamiliales", - "prestations_familiales.date_courante"], date_courante_103) + try: + try: + local_var_210 = date_courante_105 + except EmptyError: + raise EmptyError + except EmptyError: + raise EmptyError + local_var_209 = log_variable_definition(["AllocationsFamiliales", + "prestations_familiales.date_courante"], local_var_210) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=70, start_column=10, end_line=70, end_column=23, law_headings=["Prologue"])) - prestations_familiales_dot_date_courante_206 = local_var_207 + prestations_familiales_dot_date_courante_208 = local_var_209 try: - local_var_209 = log_variable_definition(["AllocationsFamiliales", - "prestations_familiales.prestation_courante"], - ElementPrestationsFamiliales(ElementPrestationsFamiliales_Code.AllocationsFamiliales, - Unit())) + try: + try: + local_var_213 = ElementPrestationsFamiliales(ElementPrestationsFamiliales_Code.AllocationsFamiliales, + Unit()) + except EmptyError: + raise EmptyError + except EmptyError: + raise EmptyError + local_var_212 = log_variable_definition(["AllocationsFamiliales", + "prestations_familiales.prestation_courante"], local_var_213) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=71, start_column=10, end_line=71, end_column=29, law_headings=["Prologue"])) - prestations_familiales_dot_prestation_courante_208 = local_var_209 + prestations_familiales_dot_prestation_courante_211 = local_var_212 try: - local_var_211 = log_variable_definition(["AllocationsFamiliales", - "prestations_familiales.résidence"], residence_102) + try: + try: + local_var_216 = residence_104 + except EmptyError: + raise EmptyError + except EmptyError: + raise EmptyError + local_var_215 = log_variable_definition(["AllocationsFamiliales", + "prestations_familiales.résidence"], local_var_216) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=72, start_column=10, end_line=72, end_column=19, law_headings=["Prologue"])) - prestations_familiales_dot_residence_210 = local_var_211 - result_212 = log_end_call(["AllocationsFamiliales", + prestations_familiales_dot_residence_214 = local_var_215 + result_217 = log_end_call(["AllocationsFamiliales", "prestations_familiales", "PrestationsFamiliales"], log_begin_call(["AllocationsFamiliales", "prestations_familiales", "PrestationsFamiliales"], prestations_familiales, - PrestationsFamilialesIn(date_courante_in=prestations_familiales_dot_date_courante_206, - prestation_courante_in=prestations_familiales_dot_prestation_courante_208, - residence_in=prestations_familiales_dot_residence_210))) - prestations_familiales_dot_droit_ouvert_213 = result_212.droit_ouvert_out - prestations_familiales_dot_conditions_hors_age_214 = result_212.conditions_hors_age_out - prestations_familiales_dot_age_l512_3_2_215 = result_212.age_l512_3_2_out - prestations_familiales_dot_regime_outre_mer_l751_1_216 = result_212.regime_outre_mer_l751_1_out - prestations_familiales_dot_base_mensuelle_217 = result_212.base_mensuelle_out + PrestationsFamilialesIn(date_courante_in=prestations_familiales_dot_date_courante_208, + prestation_courante_in=prestations_familiales_dot_prestation_courante_211, + residence_in=prestations_familiales_dot_residence_214))) + prestations_familiales_dot_droit_ouvert_218 = result_217.droit_ouvert_out + prestations_familiales_dot_conditions_hors_age_219 = result_217.conditions_hors_age_out + prestations_familiales_dot_age_l512_3_2_220 = result_217.age_l512_3_2_out + prestations_familiales_dot_regime_outre_mer_l751_1_221 = result_217.regime_outre_mer_l751_1_out + prestations_familiales_dot_base_mensuelle_222 = result_217.base_mensuelle_out try: - local_var_219 = log_variable_definition(["AllocationsFamiliales", - "enfant_le_plus_âgé.enfants"], enfants_a_charge_104) + try: + try: + local_var_225 = enfants_a_charge_106 + except EmptyError: + raise EmptyError + except EmptyError: + raise EmptyError + local_var_224 = log_variable_definition(["AllocationsFamiliales", + "enfant_le_plus_âgé.enfants"], local_var_225) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=84, start_column=10, end_line=84, end_column=17, law_headings=["Prologue"])) - enfant_le_plus_age_dot_enfants_218 = local_var_219 - result_220 = log_end_call(["AllocationsFamiliales", + enfant_le_plus_age_dot_enfants_223 = local_var_224 + result_226 = log_end_call(["AllocationsFamiliales", "enfant_le_plus_âgé", "EnfantLePlusÂgé"], log_begin_call(["AllocationsFamiliales", "enfant_le_plus_âgé", "EnfantLePlusÂgé"], enfant_le_plus_age, - EnfantLePlusAgeIn(enfants_in=enfant_le_plus_age_dot_enfants_218))) - enfant_le_plus_age_dot_le_plus_age_221 = result_220.le_plus_age_out + EnfantLePlusAgeIn(enfants_in=enfant_le_plus_age_dot_enfants_223))) + enfant_le_plus_age_dot_le_plus_age_227 = result_226.le_plus_age_out try: - def local_var_223(param_224: Enfant): + def local_var_229(param_230: Enfant): try: try: - if log_decision_taken(SourcePosition(filename="./securite_sociale_R.catala_fr", - start_line=83, start_column=19, - end_line=83, end_column=69, - law_headings=["Article R521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets en Conseil d'Etat", - "Code de la sécurité sociale"]), ((param_224.date_de_naissance + - duration_of_numbers(11, 0, 0)) <= - date_of_numbers(2008, 4, 30))): - return version_avril_2008_dot_age_minimum_alinea_1_l521_3_205 - else: - raise EmptyError + try: + try: + if log_decision_taken(SourcePosition(filename="./securite_sociale_R.catala_fr", + start_line=83, start_column=19, + end_line=83, end_column=69, + law_headings=["Article R521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets en Conseil d'Etat", + "Code de la sécurité sociale"]), ((param_230.date_de_naissance + + duration_of_numbers(11, 0, 0)) <= + date_of_numbers(2008, 4, 30))): + return version_avril_2008_dot_age_minimum_alinea_1_l521_3_207 + else: + raise EmptyError + except EmptyError: + raise EmptyError + except EmptyError: + return integer_of_string("14") except EmptyError: - return integer_of_string("14") + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=152, start_column=11, end_line=152, @@ -1418,29 +1569,45 @@ def local_var_223(param_224: Enfant): raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=152, start_column=11, end_line=152, end_column=38, law_headings=["Prologue"])) - age_minimum_alinea_1_l521_3_222 = log_variable_definition(["AllocationsFamiliales", - "âge_minimum_alinéa_1_l521_3"], local_var_223) + age_minimum_alinea_1_l521_3_228 = log_variable_definition(["AllocationsFamiliales", + "âge_minimum_alinéa_1_l521_3"], local_var_229) try: - def local_var_227(enfant_228: Any): - return log_end_call(["PrestationsFamiliales", "droit_ouvert"], - log_variable_definition(["PrestationsFamiliales", - "droit_ouvert", "output"], - log_begin_call(["PrestationsFamiliales", "droit_ouvert"], - prestations_familiales_dot_droit_ouvert_213, - log_variable_definition(["PrestationsFamiliales", - "droit_ouvert", "input"], enfant_228)))) - local_var_226 = list_filter(local_var_227, enfants_a_charge_104) + try: + try: + def local_var_233(enfant_234: Any): + return log_end_call(["PrestationsFamiliales", + "droit_ouvert"], + log_variable_definition(["PrestationsFamiliales", + "droit_ouvert", "output"], + log_begin_call(["PrestationsFamiliales", + "droit_ouvert"], + prestations_familiales_dot_droit_ouvert_218, + log_variable_definition(["PrestationsFamiliales", + "droit_ouvert", "input"], enfant_234)))) + local_var_232 = list_filter(local_var_233, + enfants_a_charge_106) + except EmptyError: + raise EmptyError + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=100, start_column=11, end_line=100, end_column=61, law_headings=["Prologue"])) - enfants_a_charge_droit_ouvert_prestation_familiale_225 = log_variable_definition(["AllocationsFamiliales", + enfants_a_charge_droit_ouvert_prestation_familiale_231 = log_variable_definition(["AllocationsFamiliales", "enfants_à_charge_droit_ouvert_prestation_familiale"], - local_var_226) + local_var_232) try: - def local_var_230(param_231: Enfant): + def local_var_236(param_237: Enfant): try: - return (enfant_le_plus_age_dot_le_plus_age_221 == param_231) + try: + try: + return (enfant_le_plus_age_dot_le_plus_age_227 == + param_237) + except EmptyError: + raise EmptyError + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=154, start_column=11, end_line=154, @@ -1449,230 +1616,285 @@ def local_var_230(param_231: Enfant): raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=154, start_column=11, end_line=154, end_column=33, law_headings=["Prologue"])) - est_enfant_le_plus_age_229 = log_variable_definition(["AllocationsFamiliales", - "est_enfant_le_plus_âgé"], local_var_230) + est_enfant_le_plus_age_235 = log_variable_definition(["AllocationsFamiliales", + "est_enfant_le_plus_âgé"], local_var_236) try: - def local_var_240(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=94, start_column=5, end_line=94, end_column=69, - law_headings=["Circulaire interministérielle N° DSS/SD2B/2017/352 du 22 décembre 2017 relative à la revalorisation au 1er janvier 2018 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", - "Montant des plafonds de ressources", - "Décrets divers"]), ((date_courante_103 >= - date_of_numbers(2018, 1, 1)) and (date_courante_103 <= - date_of_numbers(2018, 12, 31)))): - return (money_of_cents_string("7877000") + - (money_of_cents_string("562800") * - decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225)))) - else: - raise EmptyError + try: + def local_var_246(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=94, start_column=5, + end_line=94, end_column=69, + law_headings=["Circulaire interministérielle N° DSS/SD2B/2017/352 du 22 décembre 2017 relative à la revalorisation au 1er janvier 2018 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", + "Montant des plafonds de ressources", + "Décrets divers"]), ((date_courante_105 >= + date_of_numbers(2018, 1, 1)) and (date_courante_105 <= + date_of_numbers(2018, 12, 31)))): + return (money_of_cents_string("7877000") + + (money_of_cents_string("562800") * + decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231)))) + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_238(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=127, start_column=5, end_line=127, end_column=69, - law_headings=["Instruction interministérielle n° DSS/SD2B/2018/279 du 17 décembre 2018 relative à la revalorisation au 1er janvier 2019 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", - "Montant des plafonds de ressources", - "Décrets divers"]), ((date_courante_103 >= - date_of_numbers(2019, 1, 1)) and (date_courante_103 <= - date_of_numbers(2019, 12, 31)))): - return (money_of_cents_string("7955800") + - (money_of_cents_string("568400") * - decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225)))) - else: - raise EmptyError + def local_var_244(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=127, start_column=5, + end_line=127, end_column=69, + law_headings=["Instruction interministérielle n° DSS/SD2B/2018/279 du 17 décembre 2018 relative à la revalorisation au 1er janvier 2019 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", + "Montant des plafonds de ressources", + "Décrets divers"]), ((date_courante_105 >= + date_of_numbers(2019, 1, 1)) and (date_courante_105 <= + date_of_numbers(2019, 12, 31)))): + return (money_of_cents_string("7955800") + + (money_of_cents_string("568400") * + decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231)))) + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_236(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=160, start_column=5, end_line=160, end_column=69, - law_headings=["Instruction interministerielle no DSS/SD2B/2019/261 du 18 décembre 2019 relative à la revalorisation au 1er janvier 2020 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à La Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", - "Montant des plafonds de ressources", - "Décrets divers"]), ((date_courante_103 >= - date_of_numbers(2020, 1, 1)) and (date_courante_103 <= - date_of_numbers(2020, 12, 31)))): - return (money_of_cents_string("8083100") + - (money_of_cents_string("577500") * - decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225)))) - else: - raise EmptyError + def local_var_242(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=160, start_column=5, + end_line=160, end_column=69, + law_headings=["Instruction interministerielle no DSS/SD2B/2019/261 du 18 décembre 2019 relative à la revalorisation au 1er janvier 2020 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à La Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", + "Montant des plafonds de ressources", + "Décrets divers"]), ((date_courante_105 >= + date_of_numbers(2020, 1, 1)) and (date_courante_105 <= + date_of_numbers(2020, 12, 31)))): + return (money_of_cents_string("8083100") + + (money_of_cents_string("577500") * + decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231)))) + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_234(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=196, start_column=5, end_line=196, end_column=69, - law_headings=["Article 1", - "Arrêté du 14 décembre 2020 relatif au montant des plafonds de ressources de certaines prestations familiales et aux tranches du barème applicable au recouvrement des indus et à la saisie des prestations", - "Montant des plafonds de ressources", - "Décrets divers"]), ((date_courante_103 >= - date_of_numbers(2021, 1, 1)) and (date_courante_103 <= - date_of_numbers(2021, 12, 31)))): - return (money_of_cents_string("8155800") + - (money_of_cents_string("582700") * - decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225)))) - else: - raise EmptyError + def local_var_240(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=196, start_column=5, + end_line=196, end_column=69, + law_headings=["Article 1", + "Arrêté du 14 décembre 2020 relatif au montant des plafonds de ressources de certaines prestations familiales et aux tranches du barème applicable au recouvrement des indus et à la saisie des prestations", + "Montant des plafonds de ressources", + "Décrets divers"]), ((date_courante_105 >= + date_of_numbers(2021, 1, 1)) and (date_courante_105 <= + date_of_numbers(2021, 12, 31)))): + return (money_of_cents_string("8155800") + + (money_of_cents_string("582700") * + decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231)))) + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_242(_: Any): - return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", - start_line=156, start_column=11, end_line=156, end_column=28, - law_headings=["Prologue"]), True) + def local_var_248(_: Any): + return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", + start_line=156, start_column=11, + end_line=156, end_column=28, + law_headings=["Prologue"]), True) - def local_var_244(_: Any): - return (money_of_cents_string("7830000") + - (money_of_cents_string("559500") * - decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225)))) - local_var_233 = handle_default([local_var_234, local_var_236, - local_var_238, local_var_240], local_var_242, local_var_244) + def local_var_250(_: Any): + try: + return (money_of_cents_string("7830000") + + (money_of_cents_string("559500") * + decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231)))) + except EmptyError: + raise EmptyError + local_var_239 = handle_default([local_var_240, local_var_242, + local_var_244, local_var_246], local_var_248, local_var_250) + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=156, start_column=11, end_line=156, end_column=28, law_headings=["Prologue"])) - plafond__i_i_d521_3_232 = log_variable_definition(["AllocationsFamiliales", - "plafond_II_d521_3"], local_var_233) + plafond__i_i_d521_3_238 = log_variable_definition(["AllocationsFamiliales", + "plafond_II_d521_3"], local_var_239) try: - def local_var_254(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=87, start_column=5, end_line=87, end_column=69, - law_headings=["Circulaire interministérielle N° DSS/SD2B/2017/352 du 22 décembre 2017 relative à la revalorisation au 1er janvier 2018 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", - "Montant des plafonds de ressources", - "Décrets divers"]), ((date_courante_103 >= - date_of_numbers(2018, 1, 1)) and (date_courante_103 <= - date_of_numbers(2018, 12, 31)))): - return (money_of_cents_string("5628600") + - (money_of_cents_string("562800") * - decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225)))) - else: - raise EmptyError + try: + def local_var_260(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=87, start_column=5, + end_line=87, end_column=69, + law_headings=["Circulaire interministérielle N° DSS/SD2B/2017/352 du 22 décembre 2017 relative à la revalorisation au 1er janvier 2018 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", + "Montant des plafonds de ressources", + "Décrets divers"]), ((date_courante_105 >= + date_of_numbers(2018, 1, 1)) and (date_courante_105 <= + date_of_numbers(2018, 12, 31)))): + return (money_of_cents_string("5628600") + + (money_of_cents_string("562800") * + decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231)))) + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_252(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=120, start_column=5, end_line=120, end_column=69, - law_headings=["Instruction interministérielle n° DSS/SD2B/2018/279 du 17 décembre 2018 relative à la revalorisation au 1er janvier 2019 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", - "Montant des plafonds de ressources", - "Décrets divers"]), ((date_courante_103 >= - date_of_numbers(2019, 1, 1)) and (date_courante_103 <= - date_of_numbers(2019, 12, 31)))): - return (money_of_cents_string("5684900") + - (money_of_cents_string("568400") * - decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225)))) - else: - raise EmptyError + def local_var_258(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=120, start_column=5, + end_line=120, end_column=69, + law_headings=["Instruction interministérielle n° DSS/SD2B/2018/279 du 17 décembre 2018 relative à la revalorisation au 1er janvier 2019 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à la Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", + "Montant des plafonds de ressources", + "Décrets divers"]), ((date_courante_105 >= + date_of_numbers(2019, 1, 1)) and (date_courante_105 <= + date_of_numbers(2019, 12, 31)))): + return (money_of_cents_string("5684900") + + (money_of_cents_string("568400") * + decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231)))) + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_250(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=153, start_column=5, end_line=153, end_column=69, - law_headings=["Instruction interministerielle no DSS/SD2B/2019/261 du 18 décembre 2019 relative à la revalorisation au 1er janvier 2020 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à La Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", - "Montant des plafonds de ressources", - "Décrets divers"]), ((date_courante_103 >= - date_of_numbers(2020, 1, 1)) and (date_courante_103 <= - date_of_numbers(2020, 12, 31)))): - return (money_of_cents_string("5775900") + - (money_of_cents_string("577500") * - decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225)))) - else: - raise EmptyError + def local_var_256(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=153, start_column=5, + end_line=153, end_column=69, + law_headings=["Instruction interministerielle no DSS/SD2B/2019/261 du 18 décembre 2019 relative à la revalorisation au 1er janvier 2020 des plafonds de ressources d’attribution de certaines prestations familiales servies en métropole, en Guadeloupe, en Guyane, en Martinique, à La Réunion, à Saint-Barthélemy, à Saint-Martin et à Mayotte", + "Montant des plafonds de ressources", + "Décrets divers"]), ((date_courante_105 >= + date_of_numbers(2020, 1, 1)) and (date_courante_105 <= + date_of_numbers(2020, 12, 31)))): + return (money_of_cents_string("5775900") + + (money_of_cents_string("577500") * + decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231)))) + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_248(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=180, start_column=5, end_line=180, end_column=69, - law_headings=["Article 1", - "Arrêté du 14 décembre 2020 relatif au montant des plafonds de ressources de certaines prestations familiales et aux tranches du barème applicable au recouvrement des indus et à la saisie des prestations", - "Montant des plafonds de ressources", - "Décrets divers"]), ((date_courante_103 >= - date_of_numbers(2021, 1, 1)) and (date_courante_103 <= - date_of_numbers(2021, 12, 31)))): - return (money_of_cents_string("5827900") + - (money_of_cents_string("582700") * - decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225)))) - else: - raise EmptyError + def local_var_254(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=180, start_column=5, + end_line=180, end_column=69, + law_headings=["Article 1", + "Arrêté du 14 décembre 2020 relatif au montant des plafonds de ressources de certaines prestations familiales et aux tranches du barème applicable au recouvrement des indus et à la saisie des prestations", + "Montant des plafonds de ressources", + "Décrets divers"]), ((date_courante_105 >= + date_of_numbers(2021, 1, 1)) and (date_courante_105 <= + date_of_numbers(2021, 12, 31)))): + return (money_of_cents_string("5827900") + + (money_of_cents_string("582700") * + decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231)))) + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_256(_: Any): - return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", - start_line=155, start_column=11, end_line=155, end_column=27, - law_headings=["Prologue"]), True) + def local_var_262(_: Any): + return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", + start_line=155, start_column=11, + end_line=155, end_column=27, + law_headings=["Prologue"]), True) - def local_var_258(_: Any): - return (money_of_cents_string("5595000") + - (money_of_cents_string("559500") * - decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225)))) - local_var_247 = handle_default([local_var_248, local_var_250, - local_var_252, local_var_254], local_var_256, local_var_258) + def local_var_264(_: Any): + try: + return (money_of_cents_string("5595000") + + (money_of_cents_string("559500") * + decimal_of_integer(list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231)))) + except EmptyError: + raise EmptyError + local_var_253 = handle_default([local_var_254, local_var_256, + local_var_258, local_var_260], local_var_262, local_var_264) + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=155, start_column=11, end_line=155, end_column=27, law_headings=["Prologue"])) - plafond__i_d521_3_246 = log_variable_definition(["AllocationsFamiliales", - "plafond_I_d521_3"], local_var_247) + plafond__i_d521_3_252 = log_variable_definition(["AllocationsFamiliales", + "plafond_I_d521_3"], local_var_253) try: try: try: - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=426, start_column=5, - end_line=427, end_column=71, - law_headings=["Article L755-12", - "Chapitre 5 : Prestations familiales et prestations assimilées", - "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin", - "Livre 7 : Régimes divers - Dispositions diverses", - "Partie législative", - "Code de la sécurité sociale"]), (prestations_familiales_dot_regime_outre_mer_l751_1_216 and - (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) == - integer_of_string("1")))): - local_var_261 = False - else: + try: + if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=426, start_column=5, + end_line=427, end_column=71, + law_headings=["Article L755-12", + "Chapitre 5 : Prestations familiales et prestations assimilées", + "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin", + "Livre 7 : Régimes divers - Dispositions diverses", + "Partie législative", + "Code de la sécurité sociale"]), (prestations_familiales_dot_regime_outre_mer_l751_1_221 and + (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) == + integer_of_string("1")))): + local_var_267 = False + else: + raise EmptyError + except EmptyError: raise EmptyError except EmptyError: - local_var_261 = True + local_var_267 = True except EmptyError: - local_var_261 = False + local_var_267 = False except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=139, start_column=11, end_line=139, end_column=34, law_headings=["Prologue"])) - droit_ouvert_complement_260 = log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_complément"], local_var_261) + droit_ouvert_complement_266 = log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_complément"], local_var_267) try: - def local_var_263(param_264: Enfant): + def local_var_269(param_270: Enfant): try: try: try: - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=420, start_column=6, - end_line=421, end_column=72, - law_headings=["Article L755-12", - "Chapitre 5 : Prestations familiales et prestations assimilées", - "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin", - "Livre 7 : Régimes divers - Dispositions diverses", - "Partie législative", - "Code de la sécurité sociale"]), (prestations_familiales_dot_regime_outre_mer_l751_1_216 and - (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) == - integer_of_string("1")))): - return False - else: + try: + if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=420, start_column=6, + end_line=421, end_column=72, + law_headings=["Article L755-12", + "Chapitre 5 : Prestations familiales et prestations assimilées", + "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin", + "Livre 7 : Régimes divers - Dispositions diverses", + "Partie législative", + "Code de la sécurité sociale"]), (prestations_familiales_dot_regime_outre_mer_l751_1_221 and + (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) == + integer_of_string("1")))): + return False + else: + raise EmptyError + except EmptyError: raise EmptyError except EmptyError: - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=119, start_column=5, - end_line=125, end_column=59, - law_headings=["Article L521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), ((list_length(enfants_a_charge_104) >= - nombre_enfants_alinea_2_l521_3_202) and - ((param_264.age == - prestations_familiales_dot_age_l512_3_2_215) and - (param_264.a_deja_ouvert_droit_aux_allocations_familiales and - log_end_call(["PrestationsFamiliales", - "conditions_hors_âge"], - log_variable_definition(["PrestationsFamiliales", - "conditions_hors_âge", "output"], - log_begin_call(["PrestationsFamiliales", - "conditions_hors_âge"], - prestations_familiales_dot_conditions_hors_age_214, - log_variable_definition(["PrestationsFamiliales", - "conditions_hors_âge", "input"], - param_264)))))))): - return True - else: + try: + if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=119, start_column=5, + end_line=125, end_column=59, + law_headings=["Article L521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), ((list_length(enfants_a_charge_106) >= + nombre_enfants_alinea_2_l521_3_204) and + ((param_270.age == + prestations_familiales_dot_age_l512_3_2_220) and + (param_270.a_deja_ouvert_droit_aux_allocations_familiales and + log_end_call(["PrestationsFamiliales", + "conditions_hors_âge"], + log_variable_definition(["PrestationsFamiliales", + "conditions_hors_âge", "output"], + log_begin_call(["PrestationsFamiliales", + "conditions_hors_âge"], + prestations_familiales_dot_conditions_hors_age_219, + log_variable_definition(["PrestationsFamiliales", + "conditions_hors_âge", "input"], + param_270)))))))): + return True + else: + raise EmptyError + except EmptyError: raise EmptyError except EmptyError: return False @@ -1684,843 +1906,998 @@ def local_var_263(param_264: Enfant): raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=127, start_column=11, end_line=127, end_column=35, law_headings=["Prologue"])) - droit_ouvert_forfaitaire_262 = log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_forfaitaire"], local_var_263) + droit_ouvert_forfaitaire_268 = log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_forfaitaire"], local_var_269) try: - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("3")): - local_var_266 = ((prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.0463")) * - decimal_of_integer((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) - - integer_of_string("3")))) - else: - local_var_266 = money_of_cents_string("0") + try: + try: + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("3")): + local_var_272 = ((prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.0463")) * + decimal_of_integer((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) - + integer_of_string("3")))) + else: + local_var_272 = money_of_cents_string("0") + except EmptyError: + raise EmptyError + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=124, start_column=11, end_line=124, end_column=64, law_headings=["Prologue"])) - montant_initial_base_quatrieme_enfant_et_plus_mayotte_265 = log_variable_definition(["AllocationsFamiliales", + montant_initial_base_quatrieme_enfant_et_plus_mayotte_271 = log_variable_definition(["AllocationsFamiliales", "montant_initial_base_quatrième_enfant_et_plus_mayotte"], - local_var_266) + local_var_272) try: - def local_var_287(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=584, start_column=5, end_line=584, end_column=69, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_103 >= - date_of_numbers(2011, 1, 1)) and (date_courante_103 <= - date_of_numbers(2011, 12, 31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("2")): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.0463")) - else: - return money_of_cents_string("0") - else: - raise EmptyError - - def local_var_285(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=591, start_column=5, end_line=591, end_column=69, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_103 >= - date_of_numbers(2012, 1, 1)) and (date_courante_103 <= - date_of_numbers(2012, 12, 31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("2")): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.0539")) - else: - return money_of_cents_string("0") - else: - raise EmptyError + try: + def local_var_293(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=584, start_column=5, + end_line=584, end_column=69, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_105 >= + date_of_numbers(2011, 1, 1)) and (date_courante_105 <= + date_of_numbers(2011, 12, 31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("2")): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.0463")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_283(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=598, start_column=5, end_line=598, end_column=69, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_103 >= - date_of_numbers(2013, 1, 1)) and (date_courante_103 <= - date_of_numbers(2013, 12, 31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("2")): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.075")) - else: - return money_of_cents_string("0") - else: - raise EmptyError + def local_var_291(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=591, start_column=5, + end_line=591, end_column=69, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_105 >= + date_of_numbers(2012, 1, 1)) and (date_courante_105 <= + date_of_numbers(2012, 12, 31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("2")): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.0539")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_281(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=605, start_column=5, end_line=605, end_column=69, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_103 >= - date_of_numbers(2014, 1, 1)) and (date_courante_103 <= - date_of_numbers(2014, 12, 31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("2")): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.069")) - else: - return money_of_cents_string("0") - else: - raise EmptyError + def local_var_289(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=598, start_column=5, + end_line=598, end_column=69, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_105 >= + date_of_numbers(2013, 1, 1)) and (date_courante_105 <= + date_of_numbers(2013, 12, 31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("2")): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.075")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_279(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=612, start_column=5, end_line=612, end_column=69, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_103 >= - date_of_numbers(2015, 1, 1)) and (date_courante_103 <= - date_of_numbers(2015, 12, 31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("2")): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.0766")) - else: - return money_of_cents_string("0") - else: - raise EmptyError + def local_var_287(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=605, start_column=5, + end_line=605, end_column=69, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_105 >= + date_of_numbers(2014, 1, 1)) and (date_courante_105 <= + date_of_numbers(2014, 12, 31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("2")): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.069")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_277(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=619, start_column=5, end_line=619, end_column=69, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_103 >= - date_of_numbers(2016, 1, 1)) and (date_courante_103 <= - date_of_numbers(2016, 12, 31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("2")): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.0842")) - else: - return money_of_cents_string("0") - else: - raise EmptyError + def local_var_285(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=612, start_column=5, + end_line=612, end_column=69, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_105 >= + date_of_numbers(2015, 1, 1)) and (date_courante_105 <= + date_of_numbers(2015, 12, 31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("2")): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.0766")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_275(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=626, start_column=5, end_line=626, end_column=69, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_103 >= - date_of_numbers(2017, 1, 1)) and (date_courante_103 <= - date_of_numbers(2017, 12, 31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("2")): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.0918")) - else: - return money_of_cents_string("0") - else: - raise EmptyError + def local_var_283(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=619, start_column=5, + end_line=619, end_column=69, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_105 >= + date_of_numbers(2016, 1, 1)) and (date_courante_105 <= + date_of_numbers(2016, 12, 31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("2")): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.0842")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_273(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=633, start_column=5, end_line=633, end_column=69, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_103 >= - date_of_numbers(2018, 1, 1)) and (date_courante_103 <= - date_of_numbers(2018, 12, 31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("2")): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.1089")) - else: - return money_of_cents_string("0") - else: - raise EmptyError + def local_var_281(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=626, start_column=5, + end_line=626, end_column=69, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_105 >= + date_of_numbers(2017, 1, 1)) and (date_courante_105 <= + date_of_numbers(2017, 12, 31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("2")): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.0918")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_271(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=640, start_column=5, end_line=640, end_column=69, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_103 >= - date_of_numbers(2019, 1, 1)) and (date_courante_103 <= - date_of_numbers(2019, 12, 31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("2")): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.1259")) - else: - return money_of_cents_string("0") - else: - raise EmptyError + def local_var_279(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=633, start_column=5, + end_line=633, end_column=69, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_105 >= + date_of_numbers(2018, 1, 1)) and (date_courante_105 <= + date_of_numbers(2018, 12, 31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("2")): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.1089")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_269(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=647, start_column=5, end_line=647, end_column=69, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_103 >= - date_of_numbers(2020, 1, 1)) and (date_courante_103 <= - date_of_numbers(2020, 12, 31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("2")): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.143")) - else: - return money_of_cents_string("0") - else: - raise EmptyError + def local_var_277(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=640, start_column=5, + end_line=640, end_column=69, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_105 >= + date_of_numbers(2019, 1, 1)) and (date_courante_105 <= + date_of_numbers(2019, 12, 31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("2")): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.1259")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_289(_: Any): - return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", - start_line=123, start_column=11, end_line=123, end_column=56, - law_headings=["Prologue"]), True) + def local_var_275(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=647, start_column=5, + end_line=647, end_column=69, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_105 >= + date_of_numbers(2020, 1, 1)) and (date_courante_105 <= + date_of_numbers(2020, 12, 31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("2")): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.143")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_291(_: Any): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("2")): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.16")) - else: - return money_of_cents_string("0") - local_var_268 = handle_default([local_var_269, local_var_271, - local_var_273, local_var_275, local_var_277, local_var_279, - local_var_281, local_var_283, local_var_285, local_var_287], - local_var_289, local_var_291) + def local_var_295(_: Any): + return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", + start_line=123, start_column=11, + end_line=123, end_column=56, + law_headings=["Prologue"]), True) + + def local_var_297(_: Any): + try: + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("2")): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.16")) + else: + return money_of_cents_string("0") + except EmptyError: + raise EmptyError + local_var_274 = handle_default([local_var_275, local_var_277, + local_var_279, local_var_281, local_var_283, local_var_285, + local_var_287, local_var_289, local_var_291, local_var_293], + local_var_295, local_var_297) + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=123, start_column=11, end_line=123, end_column=56, law_headings=["Prologue"])) - montant_initial_base_troisieme_enfant_mayotte_267 = log_variable_definition(["AllocationsFamiliales", - "montant_initial_base_troisième_enfant_mayotte"], local_var_268) + montant_initial_base_troisieme_enfant_mayotte_273 = log_variable_definition(["AllocationsFamiliales", + "montant_initial_base_troisième_enfant_mayotte"], local_var_274) try: - def local_var_313(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=513, start_column=5, end_line=513, end_column=69, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_103 >= - date_of_numbers(2011, 1, 1)) and (date_courante_103 <= - date_of_numbers(2011, 12, 31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.232")) - else: - return money_of_cents_string("0") - else: - raise EmptyError + try: + def local_var_319(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=513, start_column=5, + end_line=513, end_column=69, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_105 >= + date_of_numbers(2011, 1, 1)) and (date_courante_105 <= + date_of_numbers(2011, 12, 31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("1")): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.232")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_311(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=520, start_column=5, end_line=520, end_column=69, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_103 >= - date_of_numbers(2012, 1, 1)) and (date_courante_103 <= - date_of_numbers(2012, 12, 31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.2379")) - else: - return money_of_cents_string("0") - else: - raise EmptyError + def local_var_317(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=520, start_column=5, + end_line=520, end_column=69, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_105 >= + date_of_numbers(2012, 1, 1)) and (date_courante_105 <= + date_of_numbers(2012, 12, 31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("1")): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.2379")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_309(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=527, start_column=5, end_line=527, end_column=69, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_103 >= - date_of_numbers(2013, 1, 1)) and (date_courante_103 <= - date_of_numbers(2013, 12, 31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.2437")) - else: - return money_of_cents_string("0") - else: - raise EmptyError + def local_var_315(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=527, start_column=5, + end_line=527, end_column=69, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_105 >= + date_of_numbers(2013, 1, 1)) and (date_courante_105 <= + date_of_numbers(2013, 12, 31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("1")): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.2437")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_307(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=534, start_column=5, end_line=534, end_column=69, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_103 >= - date_of_numbers(2014, 1, 1)) and (date_courante_103 <= - date_of_numbers(2014, 12, 31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.2496")) - else: - return money_of_cents_string("0") - else: - raise EmptyError + def local_var_313(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=534, start_column=5, + end_line=534, end_column=69, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_105 >= + date_of_numbers(2014, 1, 1)) and (date_courante_105 <= + date_of_numbers(2014, 12, 31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("1")): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.2496")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_305(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=541, start_column=5, end_line=541, end_column=69, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_103 >= - date_of_numbers(2015, 1, 1)) and (date_courante_103 <= - date_of_numbers(2015, 12, 31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.2555")) - else: - return money_of_cents_string("0") - else: - raise EmptyError + def local_var_311(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=541, start_column=5, + end_line=541, end_column=69, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_105 >= + date_of_numbers(2015, 1, 1)) and (date_courante_105 <= + date_of_numbers(2015, 12, 31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("1")): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.2555")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_303(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=548, start_column=5, end_line=548, end_column=69, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_103 >= - date_of_numbers(2016, 1, 1)) and (date_courante_103 <= - date_of_numbers(2016, 12, 31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.273")) - else: - return money_of_cents_string("0") - else: - raise EmptyError + def local_var_309(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=548, start_column=5, + end_line=548, end_column=69, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_105 >= + date_of_numbers(2016, 1, 1)) and (date_courante_105 <= + date_of_numbers(2016, 12, 31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("1")): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.273")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_301(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=555, start_column=5, end_line=555, end_column=69, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_103 >= - date_of_numbers(2017, 1, 1)) and (date_courante_103 <= - date_of_numbers(2017, 12, 31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.2672")) - else: - return money_of_cents_string("0") - else: - raise EmptyError + def local_var_307(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=555, start_column=5, + end_line=555, end_column=69, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_105 >= + date_of_numbers(2017, 1, 1)) and (date_courante_105 <= + date_of_numbers(2017, 12, 31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("1")): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.2672")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_299(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=562, start_column=5, end_line=562, end_column=69, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_103 >= - date_of_numbers(2018, 1, 1)) and (date_courante_103 <= - date_of_numbers(2018, 12, 31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.284")) - else: - return money_of_cents_string("0") - else: - raise EmptyError + def local_var_305(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=562, start_column=5, + end_line=562, end_column=69, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_105 >= + date_of_numbers(2018, 1, 1)) and (date_courante_105 <= + date_of_numbers(2018, 12, 31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("1")): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.284")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_297(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=569, start_column=5, end_line=569, end_column=69, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_103 >= - date_of_numbers(2019, 1, 1)) and (date_courante_103 <= - date_of_numbers(2019, 12, 31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.2936")) - else: - return money_of_cents_string("0") - else: - raise EmptyError + def local_var_303(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=569, start_column=5, + end_line=569, end_column=69, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_105 >= + date_of_numbers(2019, 1, 1)) and (date_courante_105 <= + date_of_numbers(2019, 12, 31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("1")): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.2936")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_295(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=576, start_column=5, end_line=576, end_column=69, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_103 >= - date_of_numbers(2020, 1, 1)) and (date_courante_103 <= - date_of_numbers(2020, 12, 31)))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.3068")) - else: - return money_of_cents_string("0") - else: - raise EmptyError + def local_var_301(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=576, start_column=5, + end_line=576, end_column=69, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_105 >= + date_of_numbers(2020, 1, 1)) and (date_courante_105 <= + date_of_numbers(2020, 12, 31)))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("1")): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.3068")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_315(_: Any): - return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", - start_line=122, start_column=11, end_line=122, end_column=55, - law_headings=["Prologue"]), True) + def local_var_321(_: Any): + return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", + start_line=122, start_column=11, + end_line=122, end_column=55, + law_headings=["Prologue"]), True) - def local_var_317(_: Any): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.32")) - else: - return money_of_cents_string("0") - local_var_294 = handle_default([local_var_295, local_var_297, - local_var_299, local_var_301, local_var_303, local_var_305, - local_var_307, local_var_309, local_var_311, local_var_313], - local_var_315, local_var_317) + def local_var_323(_: Any): + try: + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("1")): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.32")) + else: + return money_of_cents_string("0") + except EmptyError: + raise EmptyError + local_var_300 = handle_default([local_var_301, local_var_303, + local_var_305, local_var_307, local_var_309, local_var_311, + local_var_313, local_var_315, local_var_317, local_var_319], + local_var_321, local_var_323) + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=122, start_column=11, end_line=122, end_column=55, law_headings=["Prologue"])) - montant_initial_base_deuxieme_enfant_mayotte_293 = log_variable_definition(["AllocationsFamiliales", - "montant_initial_base_deuxième_enfant_mayotte"], local_var_294) + montant_initial_base_deuxieme_enfant_mayotte_299 = log_variable_definition(["AllocationsFamiliales", + "montant_initial_base_deuxième_enfant_mayotte"], local_var_300) try: - def local_var_341(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=425, start_column=5, end_line=426, end_column=53, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_103 >= - date_of_numbers(2011, 1, 1)) and ((date_courante_103 <= - date_of_numbers(2011, 12, 31)) and - not avait_enfant_a_charge_avant_1er_janvier_2012_105))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("0")): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.145")) - else: - return money_of_cents_string("0") - else: - raise EmptyError + try: + def local_var_347(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=425, start_column=5, + end_line=426, end_column=53, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_105 >= + date_of_numbers(2011, 1, 1)) and ((date_courante_105 <= + date_of_numbers(2011, 12, 31)) and + not avait_enfant_a_charge_avant_1er_janvier_2012_107))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("0")): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.145")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_339(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=433, start_column=5, end_line=434, end_column=53, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_103 >= - date_of_numbers(2012, 1, 1)) and ((date_courante_103 <= - date_of_numbers(2012, 12, 31)) and - not avait_enfant_a_charge_avant_1er_janvier_2012_105))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("0")): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.1393")) - else: - return money_of_cents_string("0") - else: - raise EmptyError + def local_var_345(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=433, start_column=5, + end_line=434, end_column=53, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_105 >= + date_of_numbers(2012, 1, 1)) and ((date_courante_105 <= + date_of_numbers(2012, 12, 31)) and + not avait_enfant_a_charge_avant_1er_janvier_2012_107))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("0")): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.1393")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_337(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=441, start_column=5, end_line=442, end_column=53, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_103 >= - date_of_numbers(2013, 1, 1)) and ((date_courante_103 <= - date_of_numbers(2013, 12, 31)) and - not avait_enfant_a_charge_avant_1er_janvier_2012_105))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("0")): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.1335")) - else: - return money_of_cents_string("0") - else: - raise EmptyError + def local_var_343(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=441, start_column=5, + end_line=442, end_column=53, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_105 >= + date_of_numbers(2013, 1, 1)) and ((date_courante_105 <= + date_of_numbers(2013, 12, 31)) and + not avait_enfant_a_charge_avant_1er_janvier_2012_107))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("0")): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.1335")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_335(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=449, start_column=5, end_line=450, end_column=53, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_103 >= - date_of_numbers(2014, 1, 1)) and ((date_courante_103 <= - date_of_numbers(2014, 12, 31)) and - not avait_enfant_a_charge_avant_1er_janvier_2012_105))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("0")): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.1278")) - else: - return money_of_cents_string("0") - else: - raise EmptyError + def local_var_341(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=449, start_column=5, + end_line=450, end_column=53, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_105 >= + date_of_numbers(2014, 1, 1)) and ((date_courante_105 <= + date_of_numbers(2014, 12, 31)) and + not avait_enfant_a_charge_avant_1er_janvier_2012_107))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("0")): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.1278")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_333(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=457, start_column=5, end_line=458, end_column=53, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_103 >= - date_of_numbers(2015, 1, 1)) and ((date_courante_103 <= - date_of_numbers(2015, 12, 31)) and - not avait_enfant_a_charge_avant_1er_janvier_2012_105))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("0")): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.122")) - else: - return money_of_cents_string("0") - else: - raise EmptyError + def local_var_339(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=457, start_column=5, + end_line=458, end_column=53, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_105 >= + date_of_numbers(2015, 1, 1)) and ((date_courante_105 <= + date_of_numbers(2015, 12, 31)) and + not avait_enfant_a_charge_avant_1er_janvier_2012_107))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("0")): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.122")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_331(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=465, start_column=5, end_line=466, end_column=53, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_103 >= - date_of_numbers(2016, 1, 1)) and ((date_courante_103 <= - date_of_numbers(2016, 12, 31)) and - not avait_enfant_a_charge_avant_1er_janvier_2012_105))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("0")): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.1163")) - else: - return money_of_cents_string("0") - else: - raise EmptyError + def local_var_337(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=465, start_column=5, + end_line=466, end_column=53, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_105 >= + date_of_numbers(2016, 1, 1)) and ((date_courante_105 <= + date_of_numbers(2016, 12, 31)) and + not avait_enfant_a_charge_avant_1er_janvier_2012_107))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("0")): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.1163")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_329(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=473, start_column=5, end_line=474, end_column=53, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_103 >= - date_of_numbers(2017, 1, 1)) and ((date_courante_103 <= - date_of_numbers(2017, 12, 31)) and - not avait_enfant_a_charge_avant_1er_janvier_2012_105))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("0")): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.115")) - else: - return money_of_cents_string("0") - else: - raise EmptyError + def local_var_335(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=473, start_column=5, + end_line=474, end_column=53, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_105 >= + date_of_numbers(2017, 1, 1)) and ((date_courante_105 <= + date_of_numbers(2017, 12, 31)) and + not avait_enfant_a_charge_avant_1er_janvier_2012_107))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("0")): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.115")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_327(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=481, start_column=5, end_line=482, end_column=53, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_103 >= - date_of_numbers(2018, 1, 1)) and ((date_courante_103 <= - date_of_numbers(2018, 12, 31)) and - not avait_enfant_a_charge_avant_1er_janvier_2012_105))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("0")): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.0976")) - else: - return money_of_cents_string("0") - else: - raise EmptyError + def local_var_333(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=481, start_column=5, + end_line=482, end_column=53, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_105 >= + date_of_numbers(2018, 1, 1)) and ((date_courante_105 <= + date_of_numbers(2018, 12, 31)) and + not avait_enfant_a_charge_avant_1er_janvier_2012_107))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("0")): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.0976")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_325(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=489, start_column=5, end_line=490, end_column=53, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_103 >= - date_of_numbers(2019, 1, 1)) and ((date_courante_103 <= - date_of_numbers(2019, 12, 31)) and - not avait_enfant_a_charge_avant_1er_janvier_2012_105))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("0")): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.0847")) - else: - return money_of_cents_string("0") - else: - raise EmptyError + def local_var_331(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=489, start_column=5, + end_line=490, end_column=53, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_105 >= + date_of_numbers(2019, 1, 1)) and ((date_courante_105 <= + date_of_numbers(2019, 12, 31)) and + not avait_enfant_a_charge_avant_1er_janvier_2012_107))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("0")): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.0847")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_323(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=497, start_column=5, end_line=498, end_column=53, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((date_courante_103 >= - date_of_numbers(2020, 1, 1)) and ((date_courante_103 <= - date_of_numbers(2020, 12, 31)) and - not avait_enfant_a_charge_avant_1er_janvier_2012_105))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("0")): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.0717")) - else: - return money_of_cents_string("0") - else: - raise EmptyError + def local_var_329(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=497, start_column=5, + end_line=498, end_column=53, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((date_courante_105 >= + date_of_numbers(2020, 1, 1)) and ((date_courante_105 <= + date_of_numbers(2020, 12, 31)) and + not avait_enfant_a_charge_avant_1er_janvier_2012_107))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("0")): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.0717")) + else: + return money_of_cents_string("0") + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_321(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=505, start_column=5, end_line=505, end_column=49, - law_headings=["Annexe", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), avait_enfant_a_charge_avant_1er_janvier_2012_105): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("0")): - return money_of_cents_string("5728") - else: - return money_of_cents_string("0") - else: - raise EmptyError + def local_var_327(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=505, start_column=5, + end_line=505, end_column=49, law_headings=["Annexe", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), avait_enfant_a_charge_avant_1er_janvier_2012_107): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("0")): + return money_of_cents_string("5728") + else: + return money_of_cents_string("0") + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_343(_: Any): - return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", - start_line=121, start_column=11, end_line=121, end_column=54, - law_headings=["Prologue"]), True) + def local_var_349(_: Any): + return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", + start_line=121, start_column=11, + end_line=121, end_column=54, + law_headings=["Prologue"]), True) - def local_var_345(_: Any): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("0")): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.0588")) - else: - return money_of_cents_string("0") - local_var_320 = handle_default([local_var_321, local_var_323, - local_var_325, local_var_327, local_var_329, local_var_331, - local_var_333, local_var_335, local_var_337, local_var_339, - local_var_341], local_var_343, local_var_345) + def local_var_351(_: Any): + try: + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("0")): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.0588")) + else: + return money_of_cents_string("0") + except EmptyError: + raise EmptyError + local_var_326 = handle_default([local_var_327, local_var_329, + local_var_331, local_var_333, local_var_335, local_var_337, + local_var_339, local_var_341, local_var_343, local_var_345, + local_var_347], local_var_349, local_var_351) + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=121, start_column=11, end_line=121, end_column=54, law_headings=["Prologue"])) - montant_initial_base_premier_enfant_mayotte_319 = log_variable_definition(["AllocationsFamiliales", - "montant_initial_base_premier_enfant_mayotte"], local_var_320) + montant_initial_base_premier_enfant_mayotte_325 = log_variable_definition(["AllocationsFamiliales", + "montant_initial_base_premier_enfant_mayotte"], local_var_326) try: - local_var_348 = decimal_of_integer(list_length( - enfants_a_charge_droit_ouvert_prestation_familiale_225)) + try: + try: + local_var_354 = decimal_of_integer(list_length( + enfants_a_charge_droit_ouvert_prestation_familiale_231)) + except EmptyError: + raise EmptyError + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=115, start_column=11, end_line=115, end_column=31, law_headings=["Prologue"])) - nombre_total_enfants_347 = log_variable_definition(["AllocationsFamiliales", - "nombre_total_enfants"], local_var_348) + nombre_total_enfants_353 = log_variable_definition(["AllocationsFamiliales", + "nombre_total_enfants"], local_var_354) try: - def local_var_351(acc_352: Decimal, enfant_353: Any): - match_arg_545 = log_end_call(["AllocationsFamiliales", - "prise_en_compte"], - log_variable_definition(["AllocationsFamiliales", - "prise_en_compte", "output"], - log_begin_call(["AllocationsFamiliales", "prise_en_compte"], - prise_en_compte_106, - log_variable_definition(["AllocationsFamiliales", - "prise_en_compte", "input"], - enfant_353)))) - if match_arg_545.code == PriseEnCompte_Code.Complete: - _ = match_arg_545.value - local_var_354 = decimal_of_string("1.") - elif match_arg_545.code == PriseEnCompte_Code.Partagee: - _ = match_arg_545.value - local_var_354 = decimal_of_string("0.5") - elif match_arg_545.code == PriseEnCompte_Code.Zero: - _ = match_arg_545.value - local_var_354 = decimal_of_string("0.") - return (acc_352 + local_var_354) - local_var_350 = list_fold_left(local_var_351, - decimal_of_string("0."), - enfants_a_charge_droit_ouvert_prestation_familiale_225) + try: + try: + def local_var_357(acc_358: Decimal, enfant_359: Any): + match_arg_556 = log_end_call(["AllocationsFamiliales", + "prise_en_compte"], + log_variable_definition(["AllocationsFamiliales", + "prise_en_compte", "output"], + log_begin_call(["AllocationsFamiliales", + "prise_en_compte"], prise_en_compte_108, + log_variable_definition(["AllocationsFamiliales", + "prise_en_compte", "input"], + enfant_359)))) + if match_arg_556.code == PriseEnCompte_Code.Complete: + _ = match_arg_556.value + local_var_360 = decimal_of_string("1.") + elif match_arg_556.code == PriseEnCompte_Code.Partagee: + _ = match_arg_556.value + local_var_360 = decimal_of_string("0.5") + elif match_arg_556.code == PriseEnCompte_Code.Zero: + _ = match_arg_556.value + local_var_360 = decimal_of_string("0.") + return (acc_358 + local_var_360) + local_var_356 = list_fold_left(local_var_357, + decimal_of_string("0."), + enfants_a_charge_droit_ouvert_prestation_familiale_231) + except EmptyError: + raise EmptyError + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=114, start_column=11, end_line=114, end_column=31, law_headings=["Prologue"])) - nombre_moyen_enfants_349 = log_variable_definition(["AllocationsFamiliales", - "nombre_moyen_enfants"], local_var_350) + nombre_moyen_enfants_355 = log_variable_definition(["AllocationsFamiliales", + "nombre_moyen_enfants"], local_var_356) try: try: - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=359, start_column=5, end_line=360, end_column=71, - law_headings=["Article D755-5", - "Chapitre 5 : Prestations familiales et prestations assimilées", - "Titre 5 : Départements d'outre-mer", - "Livre 7 : Régimes divers - Dispositions diverses", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (prestations_familiales_dot_regime_outre_mer_l751_1_216 and - (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) == - integer_of_string("1")))): - local_var_359 = (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.0588")) - else: - raise EmptyError + try: + try: + if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=359, start_column=5, + end_line=360, end_column=71, + law_headings=["Article D755-5", + "Chapitre 5 : Prestations familiales et prestations assimilées", + "Titre 5 : Départements d'outre-mer", + "Livre 7 : Régimes divers - Dispositions diverses", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), (prestations_familiales_dot_regime_outre_mer_l751_1_221 and + (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) == + integer_of_string("1")))): + local_var_365 = (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.0588")) + else: + raise EmptyError + except EmptyError: + raise EmptyError + except EmptyError: + local_var_365 = money_of_cents_string("0") except EmptyError: - local_var_359 = money_of_cents_string("0") + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=110, start_column=11, end_line=110, end_column=46, law_headings=["Prologue"])) - montant_initial_base_premier_enfant_358 = log_variable_definition(["AllocationsFamiliales", - "montant_initial_base_premier_enfant"], local_var_359) + montant_initial_base_premier_enfant_364 = log_variable_definition(["AllocationsFamiliales", + "montant_initial_base_premier_enfant"], local_var_365) try: try: - def local_var_364(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=406, start_column=5, - end_line=407, end_column=72, - law_headings=["Article L755-12", - "Chapitre 5 : Prestations familiales et prestations assimilées", - "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin", - "Livre 7 : Régimes divers - Dispositions diverses", - "Partie législative", - "Code de la sécurité sociale"]), (prestations_familiales_dot_regime_outre_mer_l751_1_216 and - (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) >= - integer_of_string("1")))): - return True - else: + def local_var_370(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=406, start_column=5, + end_line=407, end_column=72, + law_headings=["Article L755-12", + "Chapitre 5 : Prestations familiales et prestations assimilées", + "Titre 5 : Dispositions particulières à la Guadeloupe, à la Guyane, à la Martinique, à La Réunion, à Saint-Barthélemy et à Saint-Martin", + "Livre 7 : Régimes divers - Dispositions diverses", + "Partie législative", + "Code de la sécurité sociale"]), (prestations_familiales_dot_regime_outre_mer_l751_1_221 and + (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) >= + integer_of_string("1")))): + return True + else: + raise EmptyError + except EmptyError: raise EmptyError - def local_var_362(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=344, start_column=5, - end_line=345, end_column=72, law_headings=["Article 7", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), ((residence_102 == - Collectivite(Collectivite_Code.Mayotte, Unit())) and - (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) >= - integer_of_string("1")))): - return True - else: + def local_var_368(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=344, start_column=5, + end_line=345, end_column=72, + law_headings=["Article 7", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), ((residence_104 == + Collectivite(Collectivite_Code.Mayotte, Unit())) and + (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) >= + integer_of_string("1")))): + return True + else: + raise EmptyError + except EmptyError: raise EmptyError - def local_var_366(_: Any): + def local_var_372(_: Any): return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", start_line=108, start_column=11, end_line=108, end_column=28, law_headings=["Prologue"]), True) - def local_var_368(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=101, start_column=5, - end_line=101, end_column=70, - law_headings=["Article L521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) >= - integer_of_string("2"))): - return True - else: + def local_var_374(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=101, start_column=5, + end_line=101, end_column=70, + law_headings=["Article L521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) >= + integer_of_string("2"))): + return True + else: + raise EmptyError + except EmptyError: raise EmptyError - local_var_361 = handle_default([local_var_362, local_var_364], - local_var_366, local_var_368) + local_var_367 = handle_default([local_var_368, local_var_370], + local_var_372, local_var_374) except EmptyError: - local_var_361 = False + local_var_367 = False except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=108, start_column=11, end_line=108, end_column=28, law_headings=["Prologue"])) - droit_ouvert_base_360 = log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_base"], local_var_361) + droit_ouvert_base_366 = log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_base"], local_var_367) try: - def local_var_371(param_372: Enfant): + def local_var_377(param_378: Enfant): try: try: try: - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=313, start_column=5, - end_line=315, end_column=58, - law_headings=["Article L521-3", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), ((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) >= - nombre_enfants_alinea_2_l521_3_202) and - (param_372.age >= - log_end_call(["AllocationsFamiliales", - "âge_minimum_alinéa_1_l521_3"], - log_variable_definition(["AllocationsFamiliales", - "âge_minimum_alinéa_1_l521_3", "output"], - log_begin_call(["AllocationsFamiliales", - "âge_minimum_alinéa_1_l521_3"], - age_minimum_alinea_1_l521_3_222, - log_variable_definition(["AllocationsFamiliales", - "âge_minimum_alinéa_1_l521_3", "input"], - param_372))))))): - return True - else: + try: + if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=313, start_column=5, + end_line=315, end_column=58, + law_headings=["Article L521-3", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), ((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) >= + nombre_enfants_alinea_2_l521_3_204) and + (param_378.age >= + log_end_call(["AllocationsFamiliales", + "âge_minimum_alinéa_1_l521_3"], + log_variable_definition(["AllocationsFamiliales", + "âge_minimum_alinéa_1_l521_3", "output"], + log_begin_call(["AllocationsFamiliales", + "âge_minimum_alinéa_1_l521_3"], + age_minimum_alinea_1_l521_3_228, + log_variable_definition(["AllocationsFamiliales", + "âge_minimum_alinéa_1_l521_3", "input"], + param_378))))))): + return True + else: + raise EmptyError + except EmptyError: raise EmptyError except EmptyError: - if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", - start_line=299, start_column=5, - end_line=300, end_column=58, - law_headings=["Article L521-3", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie législative", - "Code de la sécurité sociale"]), (not log_end_call(["AllocationsFamiliales", - "est_enfant_le_plus_âgé"], - log_variable_definition(["AllocationsFamiliales", - "est_enfant_le_plus_âgé", "output"], - log_begin_call(["AllocationsFamiliales", - "est_enfant_le_plus_âgé"], - est_enfant_le_plus_age_229, - log_variable_definition(["AllocationsFamiliales", - "est_enfant_le_plus_âgé", "input"], - param_372)))) and (param_372.age >= - log_end_call(["AllocationsFamiliales", - "âge_minimum_alinéa_1_l521_3"], - log_variable_definition(["AllocationsFamiliales", - "âge_minimum_alinéa_1_l521_3", "output"], - log_begin_call(["AllocationsFamiliales", - "âge_minimum_alinéa_1_l521_3"], - age_minimum_alinea_1_l521_3_222, - log_variable_definition(["AllocationsFamiliales", - "âge_minimum_alinéa_1_l521_3", "input"], - param_372))))))): - return True - else: + try: + if log_decision_taken(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=299, start_column=5, + end_line=300, end_column=58, + law_headings=["Article L521-3", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", + "Code de la sécurité sociale"]), (not log_end_call(["AllocationsFamiliales", + "est_enfant_le_plus_âgé"], + log_variable_definition(["AllocationsFamiliales", + "est_enfant_le_plus_âgé", "output"], + log_begin_call(["AllocationsFamiliales", + "est_enfant_le_plus_âgé"], + est_enfant_le_plus_age_235, + log_variable_definition(["AllocationsFamiliales", + "est_enfant_le_plus_âgé", "input"], + param_378)))) and (param_378.age >= + log_end_call(["AllocationsFamiliales", + "âge_minimum_alinéa_1_l521_3"], + log_variable_definition(["AllocationsFamiliales", + "âge_minimum_alinéa_1_l521_3", "output"], + log_begin_call(["AllocationsFamiliales", + "âge_minimum_alinéa_1_l521_3"], + age_minimum_alinea_1_l521_3_228, + log_variable_definition(["AllocationsFamiliales", + "âge_minimum_alinéa_1_l521_3", "input"], + param_378))))))): + return True + else: + raise EmptyError + except EmptyError: raise EmptyError except EmptyError: return False @@ -2532,64 +2909,74 @@ def local_var_371(param_372: Enfant): raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=132, start_column=11, end_line=132, end_column=34, law_headings=["Prologue"])) - droit_ouvert_majoration_370 = log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration"], local_var_371) + droit_ouvert_majoration_376 = log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_majoration"], local_var_377) try: - def local_var_374(param_375: Money): + def local_var_380(param_381: Money): try: - def local_var_378(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=162, start_column=5, - end_line=163, end_column=68, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), ((ressources_menage_101 > - plafond__i_d521_3_246) and (ressources_menage_101 <= - (plafond__i_d521_3_246 + (param_375 * - decimal_of_string("12.")))))): - return ((plafond__i_d521_3_246 + ((param_375 * - decimal_of_string("12.")) - - ressources_menage_101)) * - (decimal_of_string("1.") / - decimal_of_string("12."))) - else: - raise EmptyError + try: + def local_var_384(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=162, start_column=5, + end_line=163, end_column=68, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), ((ressources_menage_103 > + plafond__i_d521_3_252) and + (ressources_menage_103 <= + (plafond__i_d521_3_252 + (param_381 * + decimal_of_string("12.")))))): + return ((plafond__i_d521_3_252 + + ((param_381 * decimal_of_string("12.")) - + ressources_menage_103)) * + (decimal_of_string("1.") / + decimal_of_string("12."))) + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_376(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=170, start_column=5, - end_line=171, end_column=68, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), ((ressources_menage_101 > - plafond__i_i_d521_3_232) and - (ressources_menage_101 <= (plafond__i_i_d521_3_232 + - (param_375 * - decimal_of_string("12.")))))): - return ((plafond__i_i_d521_3_232 + ((param_375 * - decimal_of_string("12.")) - - ressources_menage_101)) * - (decimal_of_string("1.") / - decimal_of_string("12."))) - else: - raise EmptyError + def local_var_382(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=170, start_column=5, + end_line=171, end_column=68, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), ((ressources_menage_103 > + plafond__i_i_d521_3_238) and + (ressources_menage_103 <= + (plafond__i_i_d521_3_238 + (param_381 * + decimal_of_string("12.")))))): + return ((plafond__i_i_d521_3_238 + + ((param_381 * decimal_of_string("12.")) - + ressources_menage_103)) * + (decimal_of_string("1.") / + decimal_of_string("12."))) + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_380(_: Any): - return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", - start_line=141, start_column=11, - end_line=141, end_column=31, - law_headings=["Prologue"]), True) + def local_var_386(_: Any): + return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", + start_line=141, start_column=11, + end_line=141, end_column=31, + law_headings=["Prologue"]), True) - def local_var_382(_: Any): - return money_of_cents_string("0") - return handle_default([local_var_376, local_var_378], - local_var_380, local_var_382) + def local_var_388(_: Any): + return money_of_cents_string("0") + return handle_default([local_var_382, local_var_384], + local_var_386, local_var_388) + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=141, start_column=11, end_line=141, @@ -2598,349 +2985,404 @@ def local_var_382(_: Any): raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=141, start_column=11, end_line=141, end_column=31, law_headings=["Prologue"])) - complement_degressif_373 = log_variable_definition(["AllocationsFamiliales", - "complément_dégressif"], local_var_374) + complement_degressif_379 = log_variable_definition(["AllocationsFamiliales", + "complément_dégressif"], local_var_380) try: - def local_var_390(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=215, start_column=5, end_line=215, end_column=43, - law_headings=["Article D521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (ressources_menage_101 <= - plafond__i_d521_3_246)): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.20234")) - else: + def local_var_396(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=215, start_column=5, + end_line=215, end_column=43, + law_headings=["Article D521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), (ressources_menage_103 <= + plafond__i_d521_3_252)): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.20234")) + else: + raise EmptyError + except EmptyError: raise EmptyError - def local_var_388(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=229, start_column=5, end_line=230, end_column=46, - law_headings=["Article D521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), ((ressources_menage_101 > - plafond__i_d521_3_246) and (ressources_menage_101 <= - plafond__i_i_d521_3_232))): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.1117")) - else: + def local_var_394(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=229, start_column=5, + end_line=230, end_column=46, + law_headings=["Article D521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), ((ressources_menage_103 > + plafond__i_d521_3_252) and (ressources_menage_103 <= + plafond__i_i_d521_3_238))): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.1117")) + else: + raise EmptyError + except EmptyError: raise EmptyError - def local_var_386(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=243, start_column=5, end_line=243, end_column=43, - law_headings=["Article D521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (ressources_menage_101 > - plafond__i_i_d521_3_232)): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.0559")) - else: + def local_var_392(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=243, start_column=5, + end_line=243, end_column=43, + law_headings=["Article D521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), (ressources_menage_103 > + plafond__i_i_d521_3_238)): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.0559")) + else: + raise EmptyError + except EmptyError: raise EmptyError - def local_var_392(_: Any): + def local_var_398(_: Any): return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", start_line=128, start_column=11, end_line=128, end_column=47, law_headings=["Prologue"]), True) - def local_var_394(_: Any): + def local_var_400(_: Any): raise EmptyError - local_var_385 = handle_default([local_var_386, local_var_388, - local_var_390], local_var_392, local_var_394) + local_var_391 = handle_default([local_var_392, local_var_394, + local_var_396], local_var_398, local_var_400) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=128, start_column=11, end_line=128, end_column=47, law_headings=["Prologue"])) - montant_verse_forfaitaire_par_enfant_384 = log_variable_definition(["AllocationsFamiliales", - "montant_versé_forfaitaire_par_enfant"], local_var_385) + montant_verse_forfaitaire_par_enfant_390 = log_variable_definition(["AllocationsFamiliales", + "montant_versé_forfaitaire_par_enfant"], local_var_391) try: - def local_var_402(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=35, start_column=3, end_line=35, end_column=41, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (ressources_menage_101 <= - plafond__i_d521_3_246)): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("2")): - return ((prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.41")) * - decimal_of_integer((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) - - integer_of_string("2")))) + def local_var_408(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=35, start_column=3, + end_line=35, end_column=41, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), (ressources_menage_103 <= + plafond__i_d521_3_252)): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("2")): + return ((prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.41")) * + decimal_of_integer((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) - + integer_of_string("2")))) + else: + return money_of_cents_string("0") else: - return money_of_cents_string("0") - else: + raise EmptyError + except EmptyError: raise EmptyError - def local_var_400(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=74, start_column=3, end_line=75, end_column=44, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), ((ressources_menage_101 > - plafond__i_d521_3_246) and (ressources_menage_101 <= - plafond__i_i_d521_3_232))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("2")): - return ((prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.205")) * - decimal_of_integer((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) - - integer_of_string("2")))) + def local_var_406(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=74, start_column=3, + end_line=75, end_column=44, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), ((ressources_menage_103 > + plafond__i_d521_3_252) and (ressources_menage_103 <= + plafond__i_i_d521_3_238))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("2")): + return ((prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.205")) * + decimal_of_integer((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) - + integer_of_string("2")))) + else: + return money_of_cents_string("0") else: - return money_of_cents_string("0") - else: + raise EmptyError + except EmptyError: raise EmptyError - def local_var_398(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=113, start_column=3, end_line=113, end_column=41, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (ressources_menage_101 > - plafond__i_i_d521_3_232)): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("2")): - return ((prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.1025")) * - decimal_of_integer((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) - - integer_of_string("2")))) + def local_var_404(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=113, start_column=3, + end_line=113, end_column=41, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), (ressources_menage_103 > + plafond__i_i_d521_3_238)): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("2")): + return ((prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.1025")) * + decimal_of_integer((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) - + integer_of_string("2")))) + else: + return money_of_cents_string("0") else: - return money_of_cents_string("0") - else: + raise EmptyError + except EmptyError: raise EmptyError - def local_var_404(_: Any): + def local_var_410(_: Any): return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", start_line=112, start_column=11, end_line=112, end_column=56, law_headings=["Prologue"]), True) - def local_var_406(_: Any): + def local_var_412(_: Any): raise EmptyError - local_var_397 = handle_default([local_var_398, local_var_400, - local_var_402], local_var_404, local_var_406) + local_var_403 = handle_default([local_var_404, local_var_406, + local_var_408], local_var_410, local_var_412) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=112, start_column=11, end_line=112, end_column=56, law_headings=["Prologue"])) - montant_initial_base_troisieme_enfant_et_plus_396 = log_variable_definition(["AllocationsFamiliales", - "montant_initial_base_troisième_enfant_et_plus"], local_var_397) + montant_initial_base_troisieme_enfant_et_plus_402 = log_variable_definition(["AllocationsFamiliales", + "montant_initial_base_troisième_enfant_et_plus"], local_var_403) try: - def local_var_414(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=35, start_column=3, end_line=35, end_column=41, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (ressources_menage_101 <= - plafond__i_d521_3_246)): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.32")) + def local_var_420(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=35, start_column=3, + end_line=35, end_column=41, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), (ressources_menage_103 <= + plafond__i_d521_3_252)): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("1")): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.32")) + else: + return money_of_cents_string("0") else: - return money_of_cents_string("0") - else: + raise EmptyError + except EmptyError: raise EmptyError - def local_var_412(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=74, start_column=3, end_line=75, end_column=44, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), ((ressources_menage_101 > - plafond__i_d521_3_246) and (ressources_menage_101 <= - plafond__i_i_d521_3_232))): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.16")) + def local_var_418(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=74, start_column=3, + end_line=75, end_column=44, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), ((ressources_menage_103 > + plafond__i_d521_3_252) and (ressources_menage_103 <= + plafond__i_i_d521_3_238))): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("1")): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.16")) + else: + return money_of_cents_string("0") else: - return money_of_cents_string("0") - else: + raise EmptyError + except EmptyError: raise EmptyError - def local_var_410(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=113, start_column=3, end_line=113, end_column=41, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (ressources_menage_101 > - plafond__i_i_d521_3_232)): - if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) > - integer_of_string("1")): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.08")) + def local_var_416(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=113, start_column=3, + end_line=113, end_column=41, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), (ressources_menage_103 > + plafond__i_i_d521_3_238)): + if (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) > + integer_of_string("1")): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.08")) + else: + return money_of_cents_string("0") else: - return money_of_cents_string("0") - else: + raise EmptyError + except EmptyError: raise EmptyError - def local_var_416(_: Any): + def local_var_422(_: Any): return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", start_line=111, start_column=11, end_line=111, end_column=47, law_headings=["Prologue"]), True) - def local_var_418(_: Any): + def local_var_424(_: Any): raise EmptyError - local_var_409 = handle_default([local_var_410, local_var_412, - local_var_414], local_var_416, local_var_418) + local_var_415 = handle_default([local_var_416, local_var_418, + local_var_420], local_var_422, local_var_424) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=111, start_column=11, end_line=111, end_column=47, law_headings=["Prologue"])) - montant_initial_base_deuxieme_enfant_408 = log_variable_definition(["AllocationsFamiliales", - "montant_initial_base_deuxième_enfant"], local_var_409) - try: - if (nombre_total_enfants_347 == - decimal_of_string("0.")): - local_var_421 = decimal_of_string("0.") - else: - local_var_421 = (nombre_moyen_enfants_349 / - nombre_total_enfants_347) - except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=113, start_column=11, end_line=113, end_column=38, - law_headings=["Prologue"])) - rapport_enfants_total_moyen_420 = log_variable_definition(["AllocationsFamiliales", - "rapport_enfants_total_moyen"], local_var_421) + montant_initial_base_deuxieme_enfant_414 = log_variable_definition(["AllocationsFamiliales", + "montant_initial_base_deuxième_enfant"], local_var_415) try: - def local_var_423(param_424: Enfant): + try: try: - def local_var_431(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=55, start_column=3, - end_line=55, end_column=41, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), ((ressources_menage_101 <= - plafond__i_d521_3_246) and - log_end_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "output"], - log_begin_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - droit_ouvert_majoration_370, - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "input"], - param_424)))))): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.16")) - else: + if (nombre_total_enfants_353 == + decimal_of_string("0.")): + local_var_427 = decimal_of_string("0.") + else: + local_var_427 = (nombre_moyen_enfants_355 / + nombre_total_enfants_353) + except EmptyError: + raise EmptyError + except EmptyError: + raise EmptyError + except EmptyError: + raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + start_line=113, start_column=11, end_line=113, end_column=38, + law_headings=["Prologue"])) + rapport_enfants_total_moyen_426 = log_variable_definition(["AllocationsFamiliales", + "rapport_enfants_total_moyen"], local_var_427) + try: + def local_var_429(param_430: Enfant): + try: + def local_var_437(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=55, start_column=3, + end_line=55, end_column=41, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), ((ressources_menage_103 <= + plafond__i_d521_3_252) and + log_end_call(["AllocationsFamiliales", + "droit_ouvert_majoration"], + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_majoration", "output"], + log_begin_call(["AllocationsFamiliales", + "droit_ouvert_majoration"], + droit_ouvert_majoration_376, + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_majoration", "input"], + param_430)))))): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.16")) + else: + raise EmptyError + except EmptyError: raise EmptyError - def local_var_429(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=95, start_column=3, - end_line=96, end_column=44, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (((ressources_menage_101 > - plafond__i_d521_3_246) and (ressources_menage_101 <= - plafond__i_i_d521_3_232)) and - log_end_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "output"], - log_begin_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - droit_ouvert_majoration_370, - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "input"], - param_424)))))): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.08")) - else: + def local_var_435(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=95, start_column=3, + end_line=96, end_column=44, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), (((ressources_menage_103 > + plafond__i_d521_3_252) and + (ressources_menage_103 <= + plafond__i_i_d521_3_238)) and + log_end_call(["AllocationsFamiliales", + "droit_ouvert_majoration"], + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_majoration", "output"], + log_begin_call(["AllocationsFamiliales", + "droit_ouvert_majoration"], + droit_ouvert_majoration_376, + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_majoration", "input"], + param_430)))))): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.08")) + else: + raise EmptyError + except EmptyError: raise EmptyError - def local_var_427(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=132, start_column=3, - end_line=132, end_column=41, - law_headings=["Article D521-1", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), ((ressources_menage_101 > - plafond__i_i_d521_3_232) and - log_end_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "output"], - log_begin_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - droit_ouvert_majoration_370, - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "input"], - param_424)))))): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.04")) - else: + def local_var_433(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=132, start_column=3, + end_line=132, end_column=41, + law_headings=["Article D521-1", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), ((ressources_menage_103 > + plafond__i_i_d521_3_238) and + log_end_call(["AllocationsFamiliales", + "droit_ouvert_majoration"], + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_majoration", "output"], + log_begin_call(["AllocationsFamiliales", + "droit_ouvert_majoration"], + droit_ouvert_majoration_376, + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_majoration", "input"], + param_430)))))): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.04")) + else: + raise EmptyError + except EmptyError: raise EmptyError - def local_var_425(_: Any): - if log_decision_taken(SourcePosition(filename="./epilogue.catala_fr", - start_line=27, start_column=5, - end_line=27, end_column=44, - law_headings=["Règles diverses", "Épilogue", - "Décrets divers"]), not log_end_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "output"], - log_begin_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - droit_ouvert_majoration_370, - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "input"], - param_424))))): - return money_of_cents_string("0") - else: + def local_var_431(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./epilogue.catala_fr", + start_line=27, start_column=5, + end_line=27, end_column=44, + law_headings=["Règles diverses", "Épilogue", + "Décrets divers"]), not log_end_call(["AllocationsFamiliales", + "droit_ouvert_majoration"], + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_majoration", "output"], + log_begin_call(["AllocationsFamiliales", + "droit_ouvert_majoration"], + droit_ouvert_majoration_376, + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_majoration", "input"], + param_430))))): + return money_of_cents_string("0") + else: + raise EmptyError + except EmptyError: raise EmptyError - def local_var_433(_: Any): + def local_var_439(_: Any): return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", start_line=133, start_column=11, end_line=133, end_column=47, law_headings=["Prologue"]), True) - def local_var_435(_: Any): + def local_var_441(_: Any): raise EmptyError - return handle_default([local_var_425, local_var_427, - local_var_429, local_var_431], local_var_433, - local_var_435) + return handle_default([local_var_431, local_var_433, + local_var_435, local_var_437], local_var_439, + local_var_441) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=133, start_column=11, end_line=133, @@ -2949,158 +3391,194 @@ def local_var_435(_: Any): raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=133, start_column=11, end_line=133, end_column=47, law_headings=["Prologue"])) - montant_initial_metropole_majoration_422 = log_variable_definition(["AllocationsFamiliales", - "montant_initial_métropole_majoration"], local_var_423) - try: - def local_var_439(acc_440: Integer, enfant_441: Any): - if log_end_call(["AllocationsFamiliales", - "droit_ouvert_forfaitaire"], - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_forfaitaire", "output"], - log_begin_call(["AllocationsFamiliales", - "droit_ouvert_forfaitaire"], droit_ouvert_forfaitaire_262, - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_forfaitaire", "input"], - enfant_441)))): - return (acc_440 + integer_of_string("1")) - else: - return acc_440 - local_var_438 = (montant_verse_forfaitaire_par_enfant_384 * - decimal_of_integer(list_fold_left(local_var_439, - integer_of_string("0"), enfants_a_charge_104))) - except EmptyError: - raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=129, start_column=11, end_line=129, end_column=36, - law_headings=["Prologue"])) - montant_verse_forfaitaire_437 = log_variable_definition(["AllocationsFamiliales", - "montant_versé_forfaitaire"], local_var_438) + montant_initial_metropole_majoration_428 = log_variable_definition(["AllocationsFamiliales", + "montant_initial_métropole_majoration"], local_var_429) try: - def local_var_446(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=350, start_column=5, end_line=351, end_column=69, - law_headings=["Article D755-5", - "Chapitre 5 : Prestations familiales et prestations assimilées", - "Titre 5 : Départements d'outre-mer", - "Livre 7 : Régimes divers - Dispositions diverses", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (prestations_familiales_dot_regime_outre_mer_l751_1_216 and - (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) == - integer_of_string("1")))): - return montant_initial_base_premier_enfant_358 - else: - raise EmptyError - - def local_var_444(_: Any): - if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", - start_line=335, start_column=5, end_line=335, end_column=24, - law_headings=["Article 7", - "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", - "Dispositions spéciales relatives à Mayotte", - "Décrets divers"]), (residence_102 == - Collectivite(Collectivite_Code.Mayotte, - Unit()))): - return (montant_initial_base_premier_enfant_mayotte_319 + - (montant_initial_base_deuxieme_enfant_mayotte_293 + - (montant_initial_base_troisieme_enfant_mayotte_267 + - montant_initial_base_quatrieme_enfant_et_plus_mayotte_265))) - else: + try: + try: + def local_var_445(acc_446: Integer, enfant_447: Any): + if log_end_call(["AllocationsFamiliales", + "droit_ouvert_forfaitaire"], + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_forfaitaire", "output"], + log_begin_call(["AllocationsFamiliales", + "droit_ouvert_forfaitaire"], + droit_ouvert_forfaitaire_268, + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_forfaitaire", "input"], + enfant_447)))): + return (acc_446 + integer_of_string("1")) + else: + return acc_446 + local_var_444 = (montant_verse_forfaitaire_par_enfant_390 * + decimal_of_integer(list_fold_left(local_var_445, + integer_of_string("0"), enfants_a_charge_106))) + except EmptyError: raise EmptyError - - def local_var_448(_: Any): - return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", - start_line=109, start_column=11, end_line=109, end_column=31, - law_headings=["Prologue"]), True) - - def local_var_450(_: Any): - return (montant_initial_base_deuxieme_enfant_408 + - montant_initial_base_troisieme_enfant_et_plus_396) - local_var_443 = handle_default([local_var_444, local_var_446], - local_var_448, local_var_450) + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", - start_line=109, start_column=11, end_line=109, end_column=31, + start_line=129, start_column=11, end_line=129, end_column=36, law_headings=["Prologue"])) - montant_initial_base_442 = log_variable_definition(["AllocationsFamiliales", - "montant_initial_base"], local_var_443) + montant_verse_forfaitaire_443 = log_variable_definition(["AllocationsFamiliales", + "montant_versé_forfaitaire"], local_var_444) try: - def local_var_453(param_454: Enfant): - try: - def local_var_457(_: Any): + try: + def local_var_452(_: Any): + try: if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=373, start_column=5, - end_line=376, end_column=42, + start_line=350, start_column=5, + end_line=351, end_column=69, law_headings=["Article D755-5", "Chapitre 5 : Prestations familiales et prestations assimilées", "Titre 5 : Départements d'outre-mer", "Livre 7 : Régimes divers - Dispositions diverses", "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (log_end_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "output"], - log_begin_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - droit_ouvert_majoration_370, - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "input"], - param_454)))) and - (prestations_familiales_dot_regime_outre_mer_l751_1_216 and - ((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) == - integer_of_string("1")) and ((param_454.age >= - integer_of_string("11")) and (param_454.age < - integer_of_string("16"))))))): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.0369")) + "Code de la sécurité sociale"]), (prestations_familiales_dot_regime_outre_mer_l751_1_221 and + (list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) == + integer_of_string("1")))): + return montant_initial_base_premier_enfant_364 else: raise EmptyError + except EmptyError: + raise EmptyError - def local_var_455(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=382, start_column=5, - end_line=385, end_column=23, - law_headings=["Article D755-5", - "Chapitre 5 : Prestations familiales et prestations assimilées", - "Titre 5 : Départements d'outre-mer", - "Livre 7 : Régimes divers - Dispositions diverses", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), (log_end_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "output"], - log_begin_call(["AllocationsFamiliales", - "droit_ouvert_majoration"], - droit_ouvert_majoration_370, - log_variable_definition(["AllocationsFamiliales", - "droit_ouvert_majoration", "input"], - param_454)))) and - (prestations_familiales_dot_regime_outre_mer_l751_1_216 and - ((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_225) == - integer_of_string("1")) and (param_454.age >= - integer_of_string("16")))))): - return (prestations_familiales_dot_base_mensuelle_217 * - decimal_of_string("0.0567")) + def local_var_450(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./decrets_divers.catala_fr", + start_line=335, start_column=5, + end_line=335, end_column=24, + law_headings=["Article 7", + "Décret n°2002-423 du 29 mars 2002 relatif aux prestations familiales à Mayotte", + "Dispositions spéciales relatives à Mayotte", + "Décrets divers"]), (residence_104 == + Collectivite(Collectivite_Code.Mayotte, + Unit()))): + return (montant_initial_base_premier_enfant_mayotte_325 + + (montant_initial_base_deuxieme_enfant_mayotte_299 + + (montant_initial_base_troisieme_enfant_mayotte_273 + + montant_initial_base_quatrieme_enfant_et_plus_mayotte_271))) else: raise EmptyError + except EmptyError: + raise EmptyError - def local_var_459(_: Any): - return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", - start_line=134, start_column=11, - end_line=134, end_column=37, - law_headings=["Prologue"]), True) + def local_var_454(_: Any): + return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", + start_line=109, start_column=11, + end_line=109, end_column=31, + law_headings=["Prologue"]), True) + + def local_var_456(_: Any): + try: + return (montant_initial_base_deuxieme_enfant_414 + + montant_initial_base_troisieme_enfant_et_plus_402) + except EmptyError: + raise EmptyError + local_var_449 = handle_default([local_var_450, local_var_452], + local_var_454, local_var_456) + except EmptyError: + raise EmptyError + except EmptyError: + raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", + start_line=109, start_column=11, end_line=109, end_column=31, + law_headings=["Prologue"])) + montant_initial_base_448 = log_variable_definition(["AllocationsFamiliales", + "montant_initial_base"], local_var_449) + try: + def local_var_459(param_460: Enfant): + try: + try: + def local_var_463(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=373, start_column=5, + end_line=376, end_column=42, + law_headings=["Article D755-5", + "Chapitre 5 : Prestations familiales et prestations assimilées", + "Titre 5 : Départements d'outre-mer", + "Livre 7 : Régimes divers - Dispositions diverses", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), (log_end_call(["AllocationsFamiliales", + "droit_ouvert_majoration"], + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_majoration", "output"], + log_begin_call(["AllocationsFamiliales", + "droit_ouvert_majoration"], + droit_ouvert_majoration_376, + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_majoration", "input"], + param_460)))) and + (prestations_familiales_dot_regime_outre_mer_l751_1_221 and + ((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) == + integer_of_string("1")) and + ((param_460.age >= + integer_of_string("11")) and (param_460.age < + integer_of_string("16"))))))): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.0369")) + else: + raise EmptyError + except EmptyError: + raise EmptyError + + def local_var_461(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=382, start_column=5, + end_line=385, end_column=23, + law_headings=["Article D755-5", + "Chapitre 5 : Prestations familiales et prestations assimilées", + "Titre 5 : Départements d'outre-mer", + "Livre 7 : Régimes divers - Dispositions diverses", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), (log_end_call(["AllocationsFamiliales", + "droit_ouvert_majoration"], + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_majoration", "output"], + log_begin_call(["AllocationsFamiliales", + "droit_ouvert_majoration"], + droit_ouvert_majoration_376, + log_variable_definition(["AllocationsFamiliales", + "droit_ouvert_majoration", "input"], + param_460)))) and + (prestations_familiales_dot_regime_outre_mer_l751_1_221 and + ((list_length(enfants_a_charge_droit_ouvert_prestation_familiale_231) == + integer_of_string("1")) and (param_460.age >= + integer_of_string("16")))))): + return (prestations_familiales_dot_base_mensuelle_222 * + decimal_of_string("0.0567")) + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_461(_: Any): - return log_end_call(["AllocationsFamiliales", - "montant_initial_métropole_majoration"], - log_variable_definition(["AllocationsFamiliales", - "montant_initial_métropole_majoration", "output"], - log_begin_call(["AllocationsFamiliales", - "montant_initial_métropole_majoration"], - montant_initial_metropole_majoration_422, - log_variable_definition(["AllocationsFamiliales", - "montant_initial_métropole_majoration", "input"], - param_454)))) - return handle_default([local_var_455, local_var_457], - local_var_459, local_var_461) + def local_var_465(_: Any): + return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", + start_line=134, start_column=11, + end_line=134, end_column=37, + law_headings=["Prologue"]), True) + + def local_var_467(_: Any): + try: + return log_end_call(["AllocationsFamiliales", + "montant_initial_métropole_majoration"], + log_variable_definition(["AllocationsFamiliales", + "montant_initial_métropole_majoration", + "output"], + log_begin_call(["AllocationsFamiliales", + "montant_initial_métropole_majoration"], + montant_initial_metropole_majoration_428, + log_variable_definition(["AllocationsFamiliales", + "montant_initial_métropole_majoration", + "input"], param_460)))) + except EmptyError: + raise EmptyError + return handle_default([local_var_461, local_var_463], + local_var_465, local_var_467) + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=134, start_column=11, end_line=134, @@ -3109,102 +3587,132 @@ def local_var_461(_: Any): raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=134, start_column=11, end_line=134, end_column=37, law_headings=["Prologue"])) - montant_initial_majoration_452 = log_variable_definition(["AllocationsFamiliales", - "montant_initial_majoration"], local_var_453) + montant_initial_majoration_458 = log_variable_definition(["AllocationsFamiliales", + "montant_initial_majoration"], local_var_459) try: - def local_var_467(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=262, start_column=5, end_line=264, end_column=42, - law_headings=["Article D521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), ((ressources_menage_101 > - plafond__i_d521_3_246) and (ressources_menage_101 <= - (plafond__i_d521_3_246 + (montant_verse_forfaitaire_437 * - decimal_of_string("12.")))))): - return ((plafond__i_d521_3_246 + - ((montant_verse_forfaitaire_437 * - decimal_of_string("12.")) - ressources_menage_101)) * - (decimal_of_string("1.") / decimal_of_string("12."))) - else: - raise EmptyError + try: + def local_var_473(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=262, start_column=5, + end_line=264, end_column=42, + law_headings=["Article D521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), ((ressources_menage_103 > + plafond__i_d521_3_252) and (ressources_menage_103 <= + (plafond__i_d521_3_252 + + (montant_verse_forfaitaire_443 * + decimal_of_string("12.")))))): + return ((plafond__i_d521_3_252 + + ((montant_verse_forfaitaire_443 * + decimal_of_string("12.")) - + ressources_menage_103)) * + (decimal_of_string("1.") / + decimal_of_string("12."))) + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_465(_: Any): - if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", - start_line=272, start_column=5, end_line=274, end_column=41, - law_headings=["Article D521-2", - "Chapitre 1er : Allocations familiales", - "Titre 2 : Prestations générales d'entretien", - "Livre 5 : Prestations familiales et prestations assimilées", - "Partie réglementaire - Décrets simples", - "Code de la sécurité sociale"]), ((ressources_menage_101 > - plafond__i_i_d521_3_232) and (ressources_menage_101 <= - (plafond__i_i_d521_3_232 + (montant_verse_forfaitaire_437 * - decimal_of_string("12.")))))): - return ((plafond__i_i_d521_3_232 + - ((montant_verse_forfaitaire_437 * - decimal_of_string("12.")) - ressources_menage_101)) * - (decimal_of_string("1.") / decimal_of_string("12."))) - else: - raise EmptyError + def local_var_471(_: Any): + try: + if log_decision_taken(SourcePosition(filename="./securite_sociale_D.catala_fr", + start_line=272, start_column=5, + end_line=274, end_column=41, + law_headings=["Article D521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie réglementaire - Décrets simples", + "Code de la sécurité sociale"]), ((ressources_menage_103 > + plafond__i_i_d521_3_238) and + (ressources_menage_103 <= (plafond__i_i_d521_3_238 + + (montant_verse_forfaitaire_443 * + decimal_of_string("12.")))))): + return ((plafond__i_i_d521_3_238 + + ((montant_verse_forfaitaire_443 * + decimal_of_string("12.")) - + ressources_menage_103)) * + (decimal_of_string("1.") / + decimal_of_string("12."))) + else: + raise EmptyError + except EmptyError: + raise EmptyError - def local_var_469(_: Any): - return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", - start_line=143, start_column=11, end_line=143, end_column=52, - law_headings=["Prologue"]), True) + def local_var_475(_: Any): + return log_decision_taken(SourcePosition(filename="./prologue.catala_fr", + start_line=143, start_column=11, + end_line=143, end_column=52, + law_headings=["Prologue"]), True) - def local_var_471(_: Any): - return money_of_cents_string("0") - local_var_464 = handle_default([local_var_465, local_var_467], - local_var_469, local_var_471) + def local_var_477(_: Any): + return money_of_cents_string("0") + local_var_470 = handle_default([local_var_471, local_var_473], + local_var_475, local_var_477) + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=143, start_column=11, end_line=143, end_column=52, law_headings=["Prologue"])) - montant_verse_complement_pour_forfaitaire_463 = log_variable_definition(["AllocationsFamiliales", - "montant_versé_complément_pour_forfaitaire"], local_var_464) + montant_verse_complement_pour_forfaitaire_469 = log_variable_definition(["AllocationsFamiliales", + "montant_versé_complément_pour_forfaitaire"], local_var_470) try: - local_var_474 = (montant_initial_base_442 * - rapport_enfants_total_moyen_420) + try: + try: + local_var_480 = (montant_initial_base_448 * + rapport_enfants_total_moyen_426) + except EmptyError: + raise EmptyError + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=116, start_column=11, end_line=116, end_column=43, law_headings=["Prologue"])) - montant_avec_garde_alternee_base_473 = log_variable_definition(["AllocationsFamiliales", - "montant_avec_garde_alternée_base"], local_var_474) + montant_avec_garde_alternee_base_479 = log_variable_definition(["AllocationsFamiliales", + "montant_avec_garde_alternée_base"], local_var_480) try: - def local_var_476(param_477: Enfant): + def local_var_482(param_483: Enfant): try: - match_arg_546 = log_end_call(["AllocationsFamiliales", - "prise_en_compte"], + try: + try: + match_arg_557 = log_end_call(["AllocationsFamiliales", + "prise_en_compte"], + log_variable_definition(["AllocationsFamiliales", + "prise_en_compte", "output"], + log_begin_call(["AllocationsFamiliales", + "prise_en_compte"], prise_en_compte_108, + log_variable_definition(["AllocationsFamiliales", + "prise_en_compte", "input"], + param_483)))) + if match_arg_557.code == PriseEnCompte_Code.Complete: + _ = match_arg_557.value + local_var_484 = decimal_of_string("1.") + elif match_arg_557.code == PriseEnCompte_Code.Partagee: + _ = match_arg_557.value + local_var_484 = decimal_of_string("0.5") + elif match_arg_557.code == PriseEnCompte_Code.Zero: + _ = match_arg_557.value + local_var_484 = decimal_of_string("0.") + return (log_end_call(["AllocationsFamiliales", + "montant_initial_majoration"], log_variable_definition(["AllocationsFamiliales", - "prise_en_compte", "output"], - log_begin_call(["AllocationsFamiliales", "prise_en_compte"], - prise_en_compte_106, + "montant_initial_majoration", "output"], + log_begin_call(["AllocationsFamiliales", + "montant_initial_majoration"], + montant_initial_majoration_458, log_variable_definition(["AllocationsFamiliales", - "prise_en_compte", "input"], - param_477)))) - if match_arg_546.code == PriseEnCompte_Code.Complete: - _ = match_arg_546.value - local_var_478 = decimal_of_string("1.") - elif match_arg_546.code == PriseEnCompte_Code.Partagee: - _ = match_arg_546.value - local_var_478 = decimal_of_string("0.5") - elif match_arg_546.code == PriseEnCompte_Code.Zero: - _ = match_arg_546.value - local_var_478 = decimal_of_string("0.") - return (log_end_call(["AllocationsFamiliales", - "montant_initial_majoration"], - log_variable_definition(["AllocationsFamiliales", - "montant_initial_majoration", "output"], - log_begin_call(["AllocationsFamiliales", - "montant_initial_majoration"], - montant_initial_majoration_452, - log_variable_definition(["AllocationsFamiliales", - "montant_initial_majoration", "input"], param_477)))) * - local_var_478) + "montant_initial_majoration", "input"], + param_483)))) * local_var_484) + except EmptyError: + raise EmptyError + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=135, start_column=11, end_line=135, @@ -3213,242 +3721,335 @@ def local_var_476(param_477: Enfant): raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=135, start_column=11, end_line=135, end_column=49, law_headings=["Prologue"])) - montant_avec_garde_alternee_majoration_475 = log_variable_definition(["AllocationsFamiliales", - "montant_avec_garde_alternée_majoration"], local_var_476) + montant_avec_garde_alternee_majoration_481 = log_variable_definition(["AllocationsFamiliales", + "montant_avec_garde_alternée_majoration"], local_var_482) try: - if droit_ouvert_base_360: - local_var_483 = montant_avec_garde_alternee_base_473 - else: - local_var_483 = money_of_cents_string("0") + try: + try: + if droit_ouvert_base_366: + local_var_489 = montant_avec_garde_alternee_base_479 + else: + local_var_489 = money_of_cents_string("0") + except EmptyError: + raise EmptyError + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=117, start_column=11, end_line=117, end_column=29, law_headings=["Prologue"])) - montant_verse_base_482 = log_variable_definition(["AllocationsFamiliales", - "montant_versé_base"], local_var_483) + montant_verse_base_488 = log_variable_definition(["AllocationsFamiliales", + "montant_versé_base"], local_var_489) try: - if droit_ouvert_base_360: - def local_var_486(acc_487: Money, enfant_488: Any): - return (acc_487 + log_end_call(["AllocationsFamiliales", - "montant_avec_garde_alternée_majoration"], - log_variable_definition(["AllocationsFamiliales", - "montant_avec_garde_alternée_majoration", "output"], - log_begin_call(["AllocationsFamiliales", - "montant_avec_garde_alternée_majoration"], - montant_avec_garde_alternee_majoration_475, - log_variable_definition(["AllocationsFamiliales", - "montant_avec_garde_alternée_majoration", "input"], - enfant_488))))) - local_var_485 = list_fold_left(local_var_486, - money_of_cents_string("0"), enfants_a_charge_104) - else: - local_var_485 = money_of_cents_string("0") + try: + try: + if droit_ouvert_base_366: + def local_var_492(acc_493: Money, enfant_494: Any): + return (acc_493 + + log_end_call(["AllocationsFamiliales", + "montant_avec_garde_alternée_majoration"], + log_variable_definition(["AllocationsFamiliales", + "montant_avec_garde_alternée_majoration", + "output"], + log_begin_call(["AllocationsFamiliales", + "montant_avec_garde_alternée_majoration"], + montant_avec_garde_alternee_majoration_481, + log_variable_definition(["AllocationsFamiliales", + "montant_avec_garde_alternée_majoration", + "input"], enfant_494))))) + local_var_491 = list_fold_left(local_var_492, + money_of_cents_string("0"), enfants_a_charge_106) + else: + local_var_491 = money_of_cents_string("0") + except EmptyError: + raise EmptyError + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=136, start_column=11, end_line=136, end_column=35, law_headings=["Prologue"])) - montant_verse_majoration_484 = log_variable_definition(["AllocationsFamiliales", - "montant_versé_majoration"], local_var_485) + montant_verse_majoration_490 = log_variable_definition(["AllocationsFamiliales", + "montant_versé_majoration"], local_var_491) try: - local_var_490 = (montant_verse_base_482 + - montant_verse_majoration_484) + try: + try: + local_var_496 = (montant_verse_base_488 + + montant_verse_majoration_490) + except EmptyError: + raise EmptyError + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=140, start_column=11, end_line=140, end_column=58, law_headings=["Prologue"])) - montant_base_complement_pour_base_et_majoration_489 = log_variable_definition(["AllocationsFamiliales", - "montant_base_complément_pour_base_et_majoration"], local_var_490) + montant_base_complement_pour_base_et_majoration_495 = log_variable_definition(["AllocationsFamiliales", + "montant_base_complément_pour_base_et_majoration"], local_var_496) try: - if droit_ouvert_complement_260: - local_var_492 = log_end_call(["AllocationsFamiliales", - "complément_dégressif"], - log_variable_definition(["AllocationsFamiliales", - "complément_dégressif", "output"], - log_begin_call(["AllocationsFamiliales", - "complément_dégressif"], complement_degressif_373, - log_variable_definition(["AllocationsFamiliales", - "complément_dégressif", "input"], - montant_base_complement_pour_base_et_majoration_489)))) - else: - local_var_492 = money_of_cents_string("0") + try: + try: + if droit_ouvert_complement_266: + local_var_498 = log_end_call(["AllocationsFamiliales", + "complément_dégressif"], + log_variable_definition(["AllocationsFamiliales", + "complément_dégressif", "output"], + log_begin_call(["AllocationsFamiliales", + "complément_dégressif"], complement_degressif_379, + log_variable_definition(["AllocationsFamiliales", + "complément_dégressif", "input"], + montant_base_complement_pour_base_et_majoration_495)))) + else: + local_var_498 = money_of_cents_string("0") + except EmptyError: + raise EmptyError + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=142, start_column=11, end_line=142, end_column=59, law_headings=["Prologue"])) - montant_verse_complement_pour_base_et_majoration_491 = log_variable_definition(["AllocationsFamiliales", - "montant_versé_complément_pour_base_et_majoration"], local_var_492) + montant_verse_complement_pour_base_et_majoration_497 = log_variable_definition(["AllocationsFamiliales", + "montant_versé_complément_pour_base_et_majoration"], local_var_498) try: - if droit_ouvert_base_360: - local_var_494 = (montant_verse_base_482 + - (montant_verse_majoration_484 + - (montant_verse_forfaitaire_437 + - (montant_verse_complement_pour_base_et_majoration_491 + - montant_verse_complement_pour_forfaitaire_463)))) - else: - local_var_494 = money_of_cents_string("0") + try: + try: + if droit_ouvert_base_366: + local_var_500 = (montant_verse_base_488 + + (montant_verse_majoration_490 + + (montant_verse_forfaitaire_443 + + (montant_verse_complement_pour_base_et_majoration_497 + + montant_verse_complement_pour_forfaitaire_469)))) + else: + local_var_500 = money_of_cents_string("0") + except EmptyError: + raise EmptyError + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=105, start_column=10, end_line=105, end_column=23, law_headings=["Prologue"])) - montant_verse_493 = log_variable_definition(["AllocationsFamiliales", - "montant_versé"], local_var_494) - assert (personne_charge_effective_permanente_est_parent_99 or - (not personne_charge_effective_permanente_est_parent_99 and - personne_charge_effective_permanente_remplit_titre__i_100)) - return AllocationsFamilialesOut(montant_verse_out=montant_verse_493) - - -def interface_allocations_familiales(interface_allocations_familiales_in_495: InterfaceAllocationsFamilialesIn): - i_date_courante_496 = interface_allocations_familiales_in_495.i_date_courante_in - i_enfants_497 = interface_allocations_familiales_in_495.i_enfants_in - i_ressources_menage_498 = interface_allocations_familiales_in_495.i_ressources_menage_in - i_residence_499 = interface_allocations_familiales_in_495.i_residence_in - i_personne_charge_effective_permanente_est_parent_500 = interface_allocations_familiales_in_495.i_personne_charge_effective_permanente_est_parent_in - i_personne_charge_effective_permanente_remplit_titre__i_501 = interface_allocations_familiales_in_495.i_personne_charge_effective_permanente_remplit_titre_I_in - i_avait_enfant_a_charge_avant_1er_janvier_2012_502 = interface_allocations_familiales_in_495.i_avait_enfant_a_charge_avant_1er_janvier_2012_in + montant_verse_499 = log_variable_definition(["AllocationsFamiliales", + "montant_versé"], local_var_500) try: - def local_var_505(enfant_506: Any): - if ((enfant_506.d_date_de_naissance + - duration_of_numbers(3, 0, 0)) >= - i_date_courante_496): - local_var_507 = SituationObligationScolaire(SituationObligationScolaire_Code.Avant, - Unit()) - else: - if ((enfant_506.d_date_de_naissance + - duration_of_numbers(16, 0, 0)) >= - i_date_courante_496): - local_var_507 = SituationObligationScolaire(SituationObligationScolaire_Code.Pendant, - Unit()) - else: - local_var_507 = SituationObligationScolaire(SituationObligationScolaire_Code.Apres, - Unit()) - return Enfant(identifiant=enfant_506.d_identifiant, - obligation_scolaire=local_var_507, - remuneration_mensuelle=enfant_506.d_remuneration_mensuelle, - date_de_naissance=enfant_506.d_date_de_naissance, - age=year_of_date((date_of_numbers(0, 1, 1) + - (i_date_courante_496 - enfant_506.d_date_de_naissance))), - prise_en_charge=enfant_506.d_prise_en_charge, - a_deja_ouvert_droit_aux_allocations_familiales=enfant_506.d_a_deja_ouvert_droit_aux_allocations_familiales) - local_var_504 = list_map(local_var_505, i_enfants_497) + local_var_501 = (personne_charge_effective_permanente_est_parent_101 or + (not personne_charge_effective_permanente_est_parent_101 and + personne_charge_effective_permanente_remplit_titre__i_102)) + except EmptyError: + raise NoValueProvided(SourcePosition(filename="./securite_sociale_L.catala_fr", + start_line=230, start_column=5, end_line=234, end_column=6, + law_headings=["Article L521-2", + "Chapitre 1er : Allocations familiales", + "Titre 2 : Prestations générales d'entretien", + "Livre 5 : Prestations familiales et prestations assimilées", + "Partie législative", "Code de la sécurité sociale"])) + assert local_var_501 + return AllocationsFamilialesOut(montant_verse_out=montant_verse_499) + + +def interface_allocations_familiales(interface_allocations_familiales_in_502: InterfaceAllocationsFamilialesIn): + i_date_courante_503 = interface_allocations_familiales_in_502.i_date_courante_in + i_enfants_504 = interface_allocations_familiales_in_502.i_enfants_in + i_ressources_menage_505 = interface_allocations_familiales_in_502.i_ressources_menage_in + i_residence_506 = interface_allocations_familiales_in_502.i_residence_in + i_personne_charge_effective_permanente_est_parent_507 = interface_allocations_familiales_in_502.i_personne_charge_effective_permanente_est_parent_in + i_personne_charge_effective_permanente_remplit_titre__i_508 = interface_allocations_familiales_in_502.i_personne_charge_effective_permanente_remplit_titre_I_in + i_avait_enfant_a_charge_avant_1er_janvier_2012_509 = interface_allocations_familiales_in_502.i_avait_enfant_a_charge_avant_1er_janvier_2012_in + try: + try: + try: + def local_var_512(enfant_513: Any): + if ((enfant_513.d_date_de_naissance + + duration_of_numbers(3, 0, 0)) >= + i_date_courante_503): + local_var_514 = SituationObligationScolaire(SituationObligationScolaire_Code.Avant, + Unit()) + else: + if ((enfant_513.d_date_de_naissance + + duration_of_numbers(16, 0, 0)) >= + i_date_courante_503): + local_var_514 = SituationObligationScolaire(SituationObligationScolaire_Code.Pendant, + Unit()) + else: + local_var_514 = SituationObligationScolaire(SituationObligationScolaire_Code.Apres, + Unit()) + return Enfant(identifiant=enfant_513.d_identifiant, + obligation_scolaire=local_var_514, + remuneration_mensuelle=enfant_513.d_remuneration_mensuelle, + date_de_naissance=enfant_513.d_date_de_naissance, + age=year_of_date((date_of_numbers(0, 1, 1) + + (i_date_courante_503 - + enfant_513.d_date_de_naissance))), + prise_en_charge=enfant_513.d_prise_en_charge, + a_deja_ouvert_droit_aux_allocations_familiales=enfant_513.d_a_deja_ouvert_droit_aux_allocations_familiales) + local_var_511 = list_map(local_var_512, i_enfants_504) + except EmptyError: + raise EmptyError + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./epilogue.catala_fr", start_line=74, start_column=11, end_line=74, end_column=27, law_headings=["Interface du programme", "Épilogue", "Décrets divers"])) - enfants_a_charge_503 = log_variable_definition(["InterfaceAllocationsFamiliales", - "enfants_à_charge"], local_var_504) + enfants_a_charge_510 = log_variable_definition(["InterfaceAllocationsFamiliales", + "enfants_à_charge"], local_var_511) try: try: - if log_decision_taken(SourcePosition(filename="./epilogue.catala_fr", - start_line=90, start_column=20, end_line=90, end_column=69, - law_headings=["Interface du programme", "Épilogue", - "Décrets divers"]), i_personne_charge_effective_permanente_est_parent_500): - local_var_510 = True - else: + try: + if log_decision_taken(SourcePosition(filename="./epilogue.catala_fr", + start_line=90, start_column=20, + end_line=90, end_column=69, + law_headings=["Interface du programme", "Épilogue", + "Décrets divers"]), i_personne_charge_effective_permanente_est_parent_507): + local_var_517 = True + else: + raise EmptyError + except EmptyError: raise EmptyError except EmptyError: - local_var_510 = False - local_var_509 = log_variable_definition(["InterfaceAllocationsFamiliales", + local_var_517 = False + local_var_516 = log_variable_definition(["InterfaceAllocationsFamiliales", "allocations_familiales.personne_charge_effective_permanente_est_parent"], - local_var_510) + local_var_517) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=90, start_column=10, end_line=90, end_column=57, law_headings=["Prologue"])) - allocations_familiales_dot_personne_charge_effective_permanente_est_parent_508 = local_var_509 + allocations_familiales_dot_personne_charge_effective_permanente_est_parent_515 = local_var_516 try: try: - if log_decision_taken(SourcePosition(filename="./epilogue.catala_fr", - start_line=93, start_column=20, end_line=93, end_column=74, - law_headings=["Interface du programme", "Épilogue", - "Décrets divers"]), i_personne_charge_effective_permanente_remplit_titre__i_501): - local_var_513 = True - else: + try: + if log_decision_taken(SourcePosition(filename="./epilogue.catala_fr", + start_line=93, start_column=20, + end_line=93, end_column=74, + law_headings=["Interface du programme", "Épilogue", + "Décrets divers"]), i_personne_charge_effective_permanente_remplit_titre__i_508): + local_var_520 = True + else: + raise EmptyError + except EmptyError: raise EmptyError except EmptyError: - local_var_513 = False - local_var_512 = log_variable_definition(["InterfaceAllocationsFamiliales", + local_var_520 = False + local_var_519 = log_variable_definition(["InterfaceAllocationsFamiliales", "allocations_familiales.personne_charge_effective_permanente_remplit_titre_I"], - local_var_513) + local_var_520) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=91, start_column=10, end_line=91, end_column=62, law_headings=["Prologue"])) - allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i_511 = local_var_512 + allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i_518 = local_var_519 try: - local_var_515 = log_variable_definition(["InterfaceAllocationsFamiliales", - "allocations_familiales.ressources_ménage"], - i_ressources_menage_498) + try: + try: + local_var_523 = i_ressources_menage_505 + except EmptyError: + raise EmptyError + except EmptyError: + raise EmptyError + local_var_522 = log_variable_definition(["InterfaceAllocationsFamiliales", + "allocations_familiales.ressources_ménage"], local_var_523) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=92, start_column=10, end_line=92, end_column=27, law_headings=["Prologue"])) - allocations_familiales_dot_ressources_menage_514 = local_var_515 + allocations_familiales_dot_ressources_menage_521 = local_var_522 try: - local_var_517 = log_variable_definition(["InterfaceAllocationsFamiliales", - "allocations_familiales.résidence"], i_residence_499) + try: + try: + local_var_526 = i_residence_506 + except EmptyError: + raise EmptyError + except EmptyError: + raise EmptyError + local_var_525 = log_variable_definition(["InterfaceAllocationsFamiliales", + "allocations_familiales.résidence"], local_var_526) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=93, start_column=10, end_line=93, end_column=19, law_headings=["Prologue"])) - allocations_familiales_dot_residence_516 = local_var_517 + allocations_familiales_dot_residence_524 = local_var_525 try: - local_var_519 = log_variable_definition(["InterfaceAllocationsFamiliales", - "allocations_familiales.date_courante"], i_date_courante_496) + try: + try: + local_var_529 = i_date_courante_503 + except EmptyError: + raise EmptyError + except EmptyError: + raise EmptyError + local_var_528 = log_variable_definition(["InterfaceAllocationsFamiliales", + "allocations_familiales.date_courante"], local_var_529) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=96, start_column=10, end_line=96, end_column=23, law_headings=["Prologue"])) - allocations_familiales_dot_date_courante_518 = local_var_519 + allocations_familiales_dot_date_courante_527 = local_var_528 try: - local_var_521 = log_variable_definition(["InterfaceAllocationsFamiliales", - "allocations_familiales.enfants_à_charge"], - enfants_a_charge_503) + try: + try: + local_var_532 = enfants_a_charge_510 + except EmptyError: + raise EmptyError + except EmptyError: + raise EmptyError + local_var_531 = log_variable_definition(["InterfaceAllocationsFamiliales", + "allocations_familiales.enfants_à_charge"], local_var_532) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=99, start_column=10, end_line=99, end_column=26, law_headings=["Prologue"])) - allocations_familiales_dot_enfants_a_charge_520 = local_var_521 + allocations_familiales_dot_enfants_a_charge_530 = local_var_531 try: try: - if log_decision_taken(SourcePosition(filename="./epilogue.catala_fr", - start_line=96, start_column=20, end_line=96, end_column=66, - law_headings=["Interface du programme", "Épilogue", - "Décrets divers"]), i_avait_enfant_a_charge_avant_1er_janvier_2012_502): - local_var_524 = True - else: + try: + if log_decision_taken(SourcePosition(filename="./epilogue.catala_fr", + start_line=96, start_column=20, + end_line=96, end_column=66, + law_headings=["Interface du programme", "Épilogue", + "Décrets divers"]), i_avait_enfant_a_charge_avant_1er_janvier_2012_509): + local_var_535 = True + else: + raise EmptyError + except EmptyError: raise EmptyError except EmptyError: - local_var_524 = False - local_var_523 = log_variable_definition(["InterfaceAllocationsFamiliales", + local_var_535 = False + local_var_534 = log_variable_definition(["InterfaceAllocationsFamiliales", "allocations_familiales.avait_enfant_à_charge_avant_1er_janvier_2012"], - local_var_524) + local_var_535) except EmptyError: raise NoValueProvided(SourcePosition(filename="./prologue.catala_fr", start_line=120, start_column=10, end_line=120, end_column=54, law_headings=["Prologue"])) - allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012_522 = local_var_523 - result_525 = log_end_call(["InterfaceAllocationsFamiliales", + allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012_533 = local_var_534 + result_536 = log_end_call(["InterfaceAllocationsFamiliales", "allocations_familiales", "AllocationsFamiliales"], log_begin_call(["InterfaceAllocationsFamiliales", "allocations_familiales", "AllocationsFamiliales"], allocations_familiales, - AllocationsFamilialesIn(personne_charge_effective_permanente_est_parent_in=allocations_familiales_dot_personne_charge_effective_permanente_est_parent_508, - personne_charge_effective_permanente_remplit_titre_I_in=allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i_511, - ressources_menage_in=allocations_familiales_dot_ressources_menage_514, - residence_in=allocations_familiales_dot_residence_516, - date_courante_in=allocations_familiales_dot_date_courante_518, - enfants_a_charge_in=allocations_familiales_dot_enfants_a_charge_520, - avait_enfant_a_charge_avant_1er_janvier_2012_in=allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012_522))) - allocations_familiales_dot_montant_verse_526 = result_525.montant_verse_out + AllocationsFamilialesIn(personne_charge_effective_permanente_est_parent_in=allocations_familiales_dot_personne_charge_effective_permanente_est_parent_515, + personne_charge_effective_permanente_remplit_titre_I_in=allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i_518, + ressources_menage_in=allocations_familiales_dot_ressources_menage_521, + residence_in=allocations_familiales_dot_residence_524, + date_courante_in=allocations_familiales_dot_date_courante_527, + enfants_a_charge_in=allocations_familiales_dot_enfants_a_charge_530, + avait_enfant_a_charge_avant_1er_janvier_2012_in=allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012_533))) + allocations_familiales_dot_montant_verse_537 = result_536.montant_verse_out try: - local_var_528 = allocations_familiales_dot_montant_verse_526 + try: + try: + local_var_539 = allocations_familiales_dot_montant_verse_537 + except EmptyError: + raise EmptyError + except EmptyError: + raise EmptyError except EmptyError: raise NoValueProvided(SourcePosition(filename="./epilogue.catala_fr", start_line=78, start_column=10, end_line=78, end_column=25, law_headings=["Interface du programme", "Épilogue", "Décrets divers"])) - i_montant_verse_527 = log_variable_definition(["InterfaceAllocationsFamiliales", - "i_montant_versé"], local_var_528) - return InterfaceAllocationsFamilialesOut(i_montant_verse_out=i_montant_verse_527) + i_montant_verse_538 = log_variable_definition(["InterfaceAllocationsFamiliales", + "i_montant_versé"], local_var_539) + return InterfaceAllocationsFamilialesOut(i_montant_verse_out=i_montant_verse_538) From 48f064ccea5da79513bb30bd83776cec023f874b Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Tue, 15 Feb 2022 11:38:56 +0100 Subject: [PATCH 089/102] Adapt translation to new i/o invariants, bug discovered --- compiler/dcalc/binded_representation.ml | 31 ++--- compiler/lcalc/compile_without_exceptions.ml | 135 ++++++++++--------- compiler/lcalc/print.ml | 2 +- 3 files changed, 87 insertions(+), 81 deletions(-) diff --git a/compiler/dcalc/binded_representation.ml b/compiler/dcalc/binded_representation.ml index 3b5343cd6..af7721436 100644 --- a/compiler/dcalc/binded_representation.ml +++ b/compiler/dcalc/binded_representation.ml @@ -81,18 +81,13 @@ let bind_scope_lets (acc : scope_lets Bindlib.box) (scope_let : D.scope_let) : scope_lets Bindlib.box = let pos = snd scope_let.D.scope_let_var in - Cli.debug_print - @@ Format.asprintf "binding let %a. Variable occurs = %b" Print.format_var - (fst scope_let.D.scope_let_var) - (Bindlib.occur (fst scope_let.D.scope_let_var) acc); - + (* Cli.debug_print @@ Format.asprintf "binding let %a. Variable occurs = %b" Print.format_var (fst + scope_let.D.scope_let_var) (Bindlib.occur (fst scope_let.D.scope_let_var) acc); *) let binder = Bindlib.bind_var (fst scope_let.D.scope_let_var) acc in Bindlib.box_apply2 (fun expr binder -> - Cli.debug_print - @@ Format.asprintf "free variables in expression: %a" - (Format.pp_print_list Print.format_var) - (D.free_vars expr); + (* Cli.debug_print @@ Format.asprintf "free variables in expression: %a" (Format.pp_print_list + Print.format_var) (D.free_vars expr); *) ScopeLet { scope_let_kind = scope_let.D.scope_let_kind; @@ -111,15 +106,15 @@ let bind_scope_body (body : D.scope_body) : scope_body Bindlib.box = ~f:(Fun.flip bind_scope_lets) in - Cli.debug_print @@ Format.asprintf "binding arg %a" Print.format_var body.D.scope_body_arg; + (* Cli.debug_print @@ Format.asprintf "binding arg %a" Print.format_var body.D.scope_body_arg; *) let scope_body_result = Bindlib.bind_var body.D.scope_body_arg body_result in - Cli.debug_print - @@ Format.asprintf "isfinal term is closed: %b" (Bindlib.is_closed scope_body_result); + (* Cli.debug_print @@ Format.asprintf "isfinal term is closed: %b" (Bindlib.is_closed + scope_body_result); *) Bindlib.box_apply (fun scope_body_result -> - Cli.debug_print - @@ Format.asprintf "rank of the final term: %i" (Bindlib.binder_rank scope_body_result); + (* Cli.debug_print @@ Format.asprintf "rank of the final term: %i" (Bindlib.binder_rank + scope_body_result); *) { scope_body_output_struct = body.D.scope_body_output_struct; scope_body_input_struct = body.D.scope_body_input_struct; @@ -137,10 +132,6 @@ let bind_scope let bind_scopes (scopes : (D.ScopeName.t * D.expr Bindlib.var * D.scope_body) list) : scopes Bindlib.box = let result = ListLabels.fold_right scopes ~init:(Bindlib.box Nil) ~f:bind_scope in - - Cli.debug_print - @@ Format.asprintf "free variable in the program : [%a]" - (Format.pp_print_list Print.format_var) - (free_vars_scopes (Bindlib.unbox result)); - + (* Cli.debug_print @@ Format.asprintf "free variable in the program : [%a]" (Format.pp_print_list + Print.format_var) (free_vars_scopes (Bindlib.unbox result)); *) result diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index c41315610..f48bff9da 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -49,10 +49,12 @@ type info = { expr : A.expr Pos.marked Bindlib.box; var : A.expr Bindlib.var; is let pp_info (fmt : Format.formatter) (info : info) = Format.fprintf fmt "{var: %a; is_pure: %b}" Print.format_var info.var info.is_pure -type ctx = info D.VarMap.t -(** information context about variables in the current scope *) +type ctx = { + decl_ctx : D.decl_ctx; + vars : info D.VarMap.t; (** information context about variables in the current scope *) +} -let pp_ctx (fmt : Format.formatter) (ctx : ctx) = +let _pp_ctx (fmt : Format.formatter) (ctx : ctx) = let pp_binding (fmt : Format.formatter) ((v, info) : D.Var.t * info) = Format.fprintf fmt "%a: %a" Dcalc.Print.format_var v pp_info info in @@ -61,16 +63,13 @@ let pp_ctx (fmt : Format.formatter) (ctx : ctx) = Format.pp_print_list ~pp_sep:(fun fmt () -> Format.pp_print_string fmt "; ") pp_binding in - Format.fprintf fmt "@[<2>[%a]@]" pp_bindings (D.VarMap.bindings ctx) + Format.fprintf fmt "@[<2>[%a]@]" pp_bindings (D.VarMap.bindings ctx.vars) (** [find ~info n ctx] is a warpper to ocaml's Map.find that handle errors in a slightly better way. *) let find ?(info : string = "none") (n : D.Var.t) (ctx : ctx) : info = - let _ = - Format.asprintf "Searching for variable %a inside context %a" Dcalc.Print.format_var n pp_ctx - ctx - |> Cli.debug_print - in - try D.VarMap.find n ctx + (* let _ = Format.asprintf "Searching for variable %a inside context %a" Dcalc.Print.format_var n + pp_ctx ctx |> Cli.debug_print in *) + try D.VarMap.find n ctx.vars with Not_found -> Errors.raise_spanned_error (Format.asprintf @@ -86,10 +85,9 @@ let add_var (pos : Pos.t) (var : D.Var.t) (is_pure : bool) (ctx : ctx) : ctx = let new_var = A.Var.make (Bindlib.name_of var, pos) in let expr = A.make_var (new_var, pos) in - Cli.debug_print - @@ Format.asprintf "D.%a |-> A.%a" Dcalc.Print.format_var var Print.format_var new_var; - - D.VarMap.update var (fun _ -> Some { expr; var = new_var; is_pure }) ctx + (* Cli.debug_print @@ Format.asprintf "D.%a |-> A.%a" Dcalc.Print.format_var var Print.format_var + new_var; *) + { ctx with vars = D.VarMap.update var (fun _ -> Some { expr; var = new_var; is_pure }) ctx.vars } (** [tau' = translate_typ tau] translate the a dcalc type into a lcalc type. @@ -150,22 +148,18 @@ let rec translate_and_hoist (ctx : ctx) (e : D.expr Pos.marked) : thunked, hence matched in the next case. This assumption can change in the future, and this case is here for this reason. *) let v, pos_v = v in - if not (find ~info:"search for a variable" v ctx).is_pure then begin + if not (find ~info:"search for a variable" v ctx).is_pure then let v' = A.Var.make (Bindlib.name_of v, pos_v) in - Cli.debug_print - @@ Format.asprintf "Found an unpure variable %a, created a variable %a to replace it" - Dcalc.Print.format_var v Print.format_var v'; + (* Cli.debug_print @@ Format.asprintf "Found an unpure variable %a, created a variable %a to + replace it" Dcalc.Print.format_var v Print.format_var v'; *) (A.make_var (v', pos), A.VarMap.singleton v' e) - end else ((find ~info:"should never happend" v ctx).expr, A.VarMap.empty) | D.EApp ((D.EVar (v, pos_v), p), [ (D.ELit D.LUnit, _) ]) -> - if not (find ~info:"search for a variable" v ctx).is_pure then begin + if not (find ~info:"search for a variable" v ctx).is_pure then let v' = A.Var.make (Bindlib.name_of v, pos_v) in - Cli.debug_print - @@ Format.asprintf "Found an unpure variable %a, created a variable %a to replace it" - Dcalc.Print.format_var v Print.format_var v'; + (* Cli.debug_print @@ Format.asprintf "Found an unpure variable %a, created a variable %a to + replace it" Dcalc.Print.format_var v Print.format_var v'; *) (A.make_var (v', pos), A.VarMap.singleton v' (D.EVar (v, pos_v), p)) - end else Errors.raise_spanned_error "Internal error: an pure variable was found in an unpure environment." pos @@ -282,16 +276,12 @@ and translate_expr ?(append_esome = true) (ctx : ctx) (e : D.expr Pos.marked) : let _pos = Pos.get_position e in (* build the hoists *) - Cli.debug_print - @@ Format.asprintf "hoist for the expression: [%a]" - (Format.pp_print_list Print.format_var) - (List.map fst hoists); - + (* Cli.debug_print @@ Format.asprintf "hoist for the expression: [%a]" (Format.pp_print_list + Print.format_var) (List.map fst hoists); *) ListLabels.fold_left hoists ~init:(if append_esome then A.make_some e' else e') ~f:(fun acc (v, (hoist, pos_hoist)) -> - Cli.debug_print @@ Format.asprintf "hoist using A.%a" Print.format_var v; - + (* Cli.debug_print @@ Format.asprintf "hoist using A.%a" Print.format_var v; *) let c' : A.expr Pos.marked Bindlib.box = match hoist with (* Here we have to handle only the cases appearing in hoists, as defined the @@ -335,7 +325,7 @@ and translate_expr ?(append_esome = true) (ctx : ctx) (e : D.expr Pos.marked) : in (* [ match {{ c' }} with | None -> None | Some {{ v }} -> {{ acc }} end ] *) - Cli.debug_print @@ Format.asprintf "build matchopt using %a" Print.format_var v; + (* Cli.debug_print @@ Format.asprintf "build matchopt using %a" Print.format_var v; *) A.make_matchopt pos_hoist v (D.TAny, pos_hoist) c' (A.make_none pos_hoist) acc) let rec translate_scope_let (ctx : ctx) (lets : scope_lets) = @@ -349,21 +339,42 @@ let rec translate_scope_let (ctx : ctx) (lets : scope_lets) = scope_let_next = next; scope_let_pos = pos; } -> - (* special case : the subscope variable is always thunked. We remove this thunking. *) + (* special case : the subscope variable is thunked (context i/o). We remove this thunking. *) let _, expr = Bindlib.unmbind binder in let var_is_pure = true in let var, next = Bindlib.unbind next in - Cli.debug_print @@ Format.asprintf "unbinding %a" Dcalc.Print.format_var var; + (* Cli.debug_print @@ Format.asprintf "unbinding %a" Dcalc.Print.format_var var; *) + let ctx' = add_var pos var var_is_pure ctx in + let new_var = (find ~info:"variable that was just created" var ctx').var in + A.make_let_in new_var (translate_typ typ) + (translate_expr ctx ~append_esome:false expr) + (translate_scope_let ctx' next) + | ScopeLet + { + scope_let_kind = SubScopeVarDefinition; + scope_let_typ = typ; + scope_let_expr = (D.ErrorOnEmpty _, _) as expr; + scope_let_next = next; + scope_let_pos = pos; + } -> + (* special case: regular input to the subscope *) + let var_is_pure = true in + let var, next = Bindlib.unbind next in + (* Cli.debug_print @@ Format.asprintf "unbinding %a" Dcalc.Print.format_var var; *) let ctx' = add_var pos var var_is_pure ctx in let new_var = (find ~info:"variable that was just created" var ctx').var in A.make_let_in new_var (translate_typ typ) - (translate_expr ctx ~append_esome:true expr) + (translate_expr ctx ~append_esome:false expr) (translate_scope_let ctx' next) - | ScopeLet { scope_let_kind = SubScopeVarDefinition; scope_let_pos = pos; _ } -> + | ScopeLet + { scope_let_kind = SubScopeVarDefinition; scope_let_pos = pos; scope_let_expr = expr; _ } -> Errors.raise_spanned_error - "Internal Error: found an SubScopeVarDefinition that does not satisfy the thunked \ - invariant when translating Dcalc to Lcalc without exceptions." + (Format.asprintf + "Internal Error: found an SubScopeVarDefinition that does not satisfy the invariants \ + when translating Dcalc to Lcalc without exceptions: @[%a@]" + (Dcalc.Print.format_expr ctx.decl_ctx) + expr) pos | ScopeLet { @@ -375,21 +386,25 @@ let rec translate_scope_let (ctx : ctx) (lets : scope_lets) = } -> let var_is_pure = match kind with - | DestructuringInputStruct -> false + | DestructuringInputStruct -> ( + (* Here, we have to distinguish between context and input variables. We can do so by + looking at the typ of the destructuring: if it's thunked, then the variable is + context. If it's not thunked, it's a regular input. *) + match Pos.unmark typ with D.TArrow ((D.TLit D.TUnit, _), _) -> false | _ -> true) | ScopeVarDefinition | SubScopeVarDefinition | CallingSubScope | DestructuringSubScopeResults | Assertion -> true in let var, next = Bindlib.unbind next in - Cli.debug_print @@ Format.asprintf "unbinding %a" Dcalc.Print.format_var var; + (* Cli.debug_print @@ Format.asprintf "unbinding %a" Dcalc.Print.format_var var; *) let ctx' = add_var pos var var_is_pure ctx in let new_var = (find ~info:"variable that was just created" var ctx').var in A.make_let_in new_var (translate_typ typ) (translate_expr ctx ~append_esome:false expr) (translate_scope_let ctx' next) -let translate_scope_body (scope_pos : Pos.t) (_decl_ctx : D.decl_ctx) (ctx : ctx) - (body : scope_body) : A.expr Pos.marked Bindlib.box = +let translate_scope_body (scope_pos : Pos.t) (ctx : ctx) (body : scope_body) : + A.expr Pos.marked Bindlib.box = match body with | { scope_body_result = result; @@ -404,8 +419,7 @@ let translate_scope_body (scope_pos : Pos.t) (_decl_ctx : D.decl_ctx) (ctx : ctx [ (D.TTuple ([], Some input_struct), Pos.no_pos) ] Pos.no_pos -let rec translate_scopes (decl_ctx : D.decl_ctx) (ctx : ctx) (scopes : scopes) : - Ast.scope_body list Bindlib.box = +let rec translate_scopes (ctx : ctx) (scopes : scopes) : Ast.scope_body list Bindlib.box = match scopes with | Nil -> Bindlib.box [] | ScopeDef { scope_name; scope_body; scope_next } -> @@ -415,8 +429,8 @@ let rec translate_scopes (decl_ctx : D.decl_ctx) (ctx : ctx) (scopes : scopes) : let scope_pos = Pos.get_position (D.ScopeName.get_info scope_name) in - let new_body = translate_scope_body scope_pos decl_ctx ctx scope_body in - let tail = translate_scopes decl_ctx new_ctx next in + let new_body = translate_scope_body scope_pos ctx scope_body in + let tail = translate_scopes new_ctx next in Bindlib.box_apply2 (fun body tail -> @@ -428,8 +442,8 @@ let rec translate_scopes (decl_ctx : D.decl_ctx) (ctx : ctx) (scopes : scopes) : :: tail) new_body tail -let translate_scopes (decl_ctx : D.decl_ctx) (ctx : ctx) (scopes : scopes) : Ast.scope_body list = - Bindlib.unbox (translate_scopes decl_ctx ctx scopes) +let translate_scopes (ctx : ctx) (scopes : scopes) : Ast.scope_body list = + Bindlib.unbox (translate_scopes ctx scopes) let translate_program (prgm : D.program) : A.program = (* modify the *) @@ -438,32 +452,33 @@ let translate_program (prgm : D.program) : A.program = body.D.scope_body_input_struct :: acc) in - Cli.debug_print - @@ Format.asprintf "List of structs to modify: [%a]" - (Format.pp_print_list D.StructName.format_t) - inputs_structs; - + (* Cli.debug_print @@ Format.asprintf "List of structs to modify: [%a]" (Format.pp_print_list + D.StructName.format_t) inputs_structs; *) let decl_ctx = { + prgm.decl_ctx with D.ctx_enums = prgm.decl_ctx.ctx_enums |> D.EnumMap.add A.option_enum A.option_enum_config; + } + in + let decl_ctx = + { + decl_ctx with D.ctx_structs = prgm.decl_ctx.ctx_structs |> D.StructMap.mapi (fun n l -> if List.mem n inputs_structs then ListLabels.map l ~f:(fun (n, tau) -> - Cli.debug_print - @@ Format.asprintf "Input type: %a" (Dcalc.Print.format_typ prgm.decl_ctx) tau; - Cli.debug_print - @@ Format.asprintf "Output type: %a" - (Dcalc.Print.format_typ prgm.decl_ctx) - (translate_typ tau); + (* Cli.debug_print @@ Format.asprintf "Input type: %a" (Dcalc.Print.format_typ + decl_ctx) tau; Cli.debug_print @@ Format.asprintf "Output type: %a" + (Dcalc.Print.format_typ decl_ctx) (translate_typ tau); *) (n, translate_typ tau)) else l); } in let scopes = - prgm.scopes |> bind_scopes |> Bindlib.unbox |> translate_scopes decl_ctx D.VarMap.empty + prgm.scopes |> bind_scopes |> Bindlib.unbox + |> translate_scopes { decl_ctx; vars = D.VarMap.empty } in { scopes; decl_ctx } diff --git a/compiler/lcalc/print.ml b/compiler/lcalc/print.ml index 86fa42f8b..161c0574c 100644 --- a/compiler/lcalc/print.ml +++ b/compiler/lcalc/print.ml @@ -111,7 +111,7 @@ let rec format_expr (ctx : Dcalc.Ast.decl_ctx) ?(debug : bool = false) (fmt : Fo (fst (List.nth (Dcalc.Ast.EnumMap.find en ctx.ctx_enums) n)) format_expr e | EMatch (e, es, e_name) -> - Format.fprintf fmt "@[%a@ @[%a@]@ %a@ %a@]" format_keyword "match" format_expr e + Format.fprintf fmt "@[%a@ %a@ %a@ %a@]" format_keyword "match" format_expr e format_keyword "with" (Format.pp_print_list ~pp_sep:(fun fmt () -> Format.fprintf fmt "@\n") From 19bf2d934f3f7019a3a63fe23dcf1c0bd931dac7 Mon Sep 17 00:00:00 2001 From: Alain Date: Fri, 18 Feb 2022 15:31:52 +0100 Subject: [PATCH 090/102] dcalc review --- compiler/dcalc/ast.ml | 13 ++++++------ compiler/dcalc/ast.mli | 1 - compiler/dcalc/binded_representation.ml | 25 ++++++++---------------- compiler/dcalc/binded_representation.mli | 11 +++++------ compiler/dcalc/dune | 2 +- 5 files changed, 21 insertions(+), 31 deletions(-) diff --git a/compiler/dcalc/ast.ml b/compiler/dcalc/ast.ml index d698f66fc..6b4b6a582 100644 --- a/compiler/dcalc/ast.ml +++ b/compiler/dcalc/ast.ml @@ -133,7 +133,6 @@ type scope_let_kind = | CallingSubScope | DestructuringSubScopeResults | Assertion -[@@deriving show] type scope_let = { scope_let_var : expr Bindlib.var Pos.marked; @@ -145,9 +144,9 @@ type scope_let = { type scope_body = { scope_body_lets : scope_let list; scope_body_result : expr Pos.marked Bindlib.box; - (* {x1 = x1; x2 = x2; x3 = x3; ... } *) + (** {x1 = x1; x2 = x2; x3 = x3; ... } *) scope_body_arg : expr Bindlib.var; - (* x: input_struct *) + (** x: input_struct *) scope_body_input_struct : StructName.t; scope_body_output_struct : StructName.t; } @@ -167,9 +166,10 @@ end module VarMap = Map.Make (Var) -let union = VarMap.union (fun _ _ _ -> Some ()) +let union: unit VarMap.t -> unit VarMap.t -> unit VarMap.t = VarMap.union (fun _ _ _ -> Some ()) -let rec fv e = + +let rec fv (e: expr Pos.marked) : unit VarMap.t = match Pos.unmark e with | EVar (v, _) -> VarMap.singleton v () | ETuple (es, _) | EArray es -> es |> List.map fv |> List.fold_left union VarMap.empty @@ -184,7 +184,8 @@ let rec fv e = let vs, body = Bindlib.unmbind binder in Array.fold_right VarMap.remove vs (fv body) -let free_vars e = fv e |> VarMap.bindings |> List.map fst + +let free_vars (e: expr Pos.marked): Var.t list = fv e |> VarMap.bindings |> List.map fst type vars = expr Bindlib.mvar diff --git a/compiler/dcalc/ast.mli b/compiler/dcalc/ast.mli index 20c205c95..bcc2c588a 100644 --- a/compiler/dcalc/ast.mli +++ b/compiler/dcalc/ast.mli @@ -145,7 +145,6 @@ type scope_let_kind = | CallingSubScope (** [let result = s ({ x = s.x; y = s.x; ...}) ]*) | DestructuringSubScopeResults (** [let s.x = result.x ]**) | Assertion (** [let _ = assert e]*) -[@@deriving show] type scope_let = { scope_let_var : expr Bindlib.var Pos.marked; diff --git a/compiler/dcalc/binded_representation.ml b/compiler/dcalc/binded_representation.ml index af7721436..718d777cf 100644 --- a/compiler/dcalc/binded_representation.ml +++ b/compiler/dcalc/binded_representation.ml @@ -15,12 +15,6 @@ open Utils module D = Ast -(** Alternative representation of the Dcalc Ast. It is currently used in the transformation without - exceptions. We make heavy use of bindlib, binding each scope-let-variable and each scope - explicitly. *) - -(** In [Ast], [Ast.scope_lets] is defined as a list of kind, var, and boxed expression. This - representation binds using bindlib the tail of the list with the variable defined in the let. *) type scope_lets = | Result of D.expr Pos.marked | ScopeLet of { @@ -45,24 +39,21 @@ type scopes = scope_next : (D.expr, scopes) Bindlib.binder; } -let union = D.VarMap.union (fun _ _ _ -> Some ()) - -(** free variables. For each construction, we define two free variables functions. The first one - generates [unit D.VarMap.t], since there is no [D.VarSet.t]. And the second returns a list. The - second one is better from pretty printing in debug. *) +let union: unit D.VarMap.t -> unit D.VarMap.t -> unit D.VarMap.t = D.VarMap.union (fun _ _ _ -> Some ()) -let rec fv_scope_lets scope_lets = +let rec fv_scope_lets (scope_lets: scope_lets) : unit D.VarMap.t = match scope_lets with | Result e -> D.fv e | ScopeLet { scope_let_expr = e; scope_let_next = next; _ } -> let v, body = Bindlib.unbind next in union (D.fv e) (D.VarMap.remove v (fv_scope_lets body)) -let fv_scope_body { scope_body_result = binder; _ } = +let fv_scope_body (scope_body: scope_body) : unit D.VarMap.t = + let { scope_body_result = binder; _ } = scope_body in let v, body = Bindlib.unbind binder in D.VarMap.remove v (fv_scope_lets body) -let rec fv_scopes scopes = +let rec fv_scopes (scopes: scopes) : unit D.VarMap.t = match scopes with | Nil -> D.VarMap.empty | ScopeDef { scope_body = body; scope_next = next; _ } -> @@ -70,11 +61,11 @@ let rec fv_scopes scopes = union (D.VarMap.remove v (fv_scopes next)) (fv_scope_body body) -let free_vars_scope_lets scope_lets = fv_scope_lets scope_lets |> D.VarMap.bindings |> List.map fst +let free_vars_scope_lets (scope_lets: scope_lets) : D.Var.t list = fv_scope_lets scope_lets |> D.VarMap.bindings |> List.map fst -let free_vars_scope_body scope_body = fv_scope_body scope_body |> D.VarMap.bindings |> List.map fst +let free_vars_scope_body (scope_body: scope_body) : D.Var.t list = fv_scope_body scope_body |> D.VarMap.bindings |> List.map fst -let free_vars_scopes scopes = fv_scopes scopes |> D.VarMap.bindings |> List.map fst +let free_vars_scopes (scopes: scopes): D.Var.t list = fv_scopes scopes |> D.VarMap.bindings |> List.map fst (** Actual transformation for scopes. *) let bind_scope_lets (acc : scope_lets Bindlib.box) (scope_let : D.scope_let) : diff --git a/compiler/dcalc/binded_representation.mli b/compiler/dcalc/binded_representation.mli index ff144d7fb..fced39f32 100644 --- a/compiler/dcalc/binded_representation.mli +++ b/compiler/dcalc/binded_representation.mli @@ -33,14 +33,13 @@ type scope_lets = (** As a consequence, the scope_body contains only a result and input/output signature, as the other elements are stored inside the scope_let. The binder present is the argument of type [scope_body_input_struct]. *) - type scope_body = { scope_body_input_struct : D.StructName.t; scope_body_output_struct : D.StructName.t; scope_body_result : (D.expr, scope_lets) Bindlib.binder; } -(* finally, we do the same transformation for the whole program for the kinded lets. This permit us +(** Finally, we do the same transformation for the whole program for the kinded lets. This permit us to use bindlib variables for scopes names. *) type scopes = | Nil @@ -50,15 +49,15 @@ type scopes = scope_next : (D.expr, scopes) Bindlib.binder; } -(* List of variables not binded inside a scope_lets *) +(** List of variables not binded inside a scope_lets *) val free_vars_scope_lets : scope_lets -> D.Var.t list -(* List of variables not binded inside a scope_body. *) +(** List of variables not binded inside a scope_body. *) val free_vars_scope_body : scope_body -> D.Var.t list -(* List of variables not binded inside scopes*) +(** List of variables not binded inside scopes*) val free_vars_scopes : scopes -> D.Var.t list -(* Transform a list of scopes into our representation of scopes. It requires that scopes are +(** Transform a list of scopes into our representation of scopes. It requires that scopes are topologically-well-ordered, and ensure there is no free variables in the returned [scopes] *) val bind_scopes : (D.ScopeName.t * D.expr Bindlib.var * D.scope_body) list -> scopes Bindlib.box diff --git a/compiler/dcalc/dune b/compiler/dcalc/dune index 0402e8f09..e450c5702 100644 --- a/compiler/dcalc/dune +++ b/compiler/dcalc/dune @@ -3,7 +3,7 @@ (public_name catala.dcalc) (libraries bindlib unionFind utils re camomile runtime) (preprocess - (pps visitors.ppx ppx_deriving.show))) + (pps visitors.ppx))) (documentation (package catala) From 7e1057c5411db6509225fc5f41a29f4bc9641f67 Mon Sep 17 00:00:00 2001 From: Alain Date: Fri, 18 Feb 2022 15:47:54 +0100 Subject: [PATCH 091/102] review of lcalc --- compiler/lcalc/ast.ml | 6 ++---- compiler/lcalc/ast.mli | 4 +--- compiler/lcalc/compile_with_exceptions.mli | 2 +- compiler/lcalc/compile_without_exceptions.mli | 2 +- compiler/lcalc/dune | 2 +- compiler/lcalc/optimizations.ml | 2 +- compiler/lcalc/to_ocaml.ml | 8 ++++---- 7 files changed, 11 insertions(+), 15 deletions(-) diff --git a/compiler/lcalc/ast.ml b/compiler/lcalc/ast.ml index 717ea0120..601391172 100644 --- a/compiler/lcalc/ast.ml +++ b/compiler/lcalc/ast.ml @@ -24,7 +24,7 @@ type lit = | LDate of Runtime.date | LDuration of Runtime.duration -type except = ConflictError | EmptyError | NoValueProvided | Crash [@@deriving show] +type except = ConflictError | EmptyError | NoValueProvided | Crash type expr = | EVar of expr Bindlib.var Pos.marked @@ -91,8 +91,7 @@ let some_constr : D.EnumConstructor.t = D.EnumConstructor.fresh ("ESome", Pos.no let option_enum_config : (D.EnumConstructor.t * D.typ Pos.marked) list = [ (none_constr, (D.TLit D.TUnit, Pos.no_pos)); (some_constr, (D.TAny, Pos.no_pos)) ] -let make_none (pos : Pos.t) = - (* Hack: type is not printed in to_ocaml, so I ignore it. *) +let make_none (pos : Pos.t): expr Pos.marked Bindlib.box = let mark : 'a -> 'a Pos.marked = Pos.mark pos in Bindlib.box @@ mark @@ EInj (mark @@ ELit LUnit, 0, option_enum, []) @@ -103,7 +102,6 @@ let make_some (e : expr Pos.marked Bindlib.box) : expr Pos.marked Bindlib.box = let+ e = e in mark @@ EInj (e, 1, option_enum, []) -let make_some' (e : expr Pos.marked) : expr = EInj (e, 1, option_enum, []) (** [make_matchopt_with_abs_arms arg e_none e_some] build an expression [match arg with |None -> e_none | Some -> e_some] and requires e_some and e_none to be in the diff --git a/compiler/lcalc/ast.mli b/compiler/lcalc/ast.mli index 1c02a536a..2119dc2bd 100644 --- a/compiler/lcalc/ast.mli +++ b/compiler/lcalc/ast.mli @@ -30,7 +30,7 @@ type lit = | LDate of Runtime.date | LDuration of Runtime.duration -type except = ConflictError | EmptyError | NoValueProvided | Crash [@@deriving show] +type except = ConflictError | EmptyError | NoValueProvided | Crash type expr = | EVar of expr Bindlib.var Pos.marked @@ -102,8 +102,6 @@ val make_none : Pos.t -> expr Pos.marked Bindlib.box val make_some : expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box -val make_some' : expr Pos.marked -> expr - val make_matchopt_with_abs_arms : expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box -> diff --git a/compiler/lcalc/compile_with_exceptions.mli b/compiler/lcalc/compile_with_exceptions.mli index 6e4acf406..d005545ba 100644 --- a/compiler/lcalc/compile_with_exceptions.mli +++ b/compiler/lcalc/compile_with_exceptions.mli @@ -12,6 +12,6 @@ or implied. See the License for the specific language governing permissions and limitations under the License. *) -(** Translation from the default calculus to the lambda calculus *) +(** Translation from the default calculus to the lambda calculus. This translation uses exceptions handle empty default terms. *) val translate_program : Dcalc.Ast.program -> Ast.program diff --git a/compiler/lcalc/compile_without_exceptions.mli b/compiler/lcalc/compile_without_exceptions.mli index c11259473..c980c4f89 100644 --- a/compiler/lcalc/compile_without_exceptions.mli +++ b/compiler/lcalc/compile_without_exceptions.mli @@ -12,6 +12,6 @@ or implied. See the License for the specific language governing permissions and limitations under the License. *) -(** Translation from the default calculus to the lambda calculus *) +(** Translation from the default calculus to the lambda calculus. This translation uses an option monad to handle empty defaults terms. *) val translate_program : Dcalc.Ast.program -> Ast.program diff --git a/compiler/lcalc/dune b/compiler/lcalc/dune index be662001f..7fa1bcb3e 100644 --- a/compiler/lcalc/dune +++ b/compiler/lcalc/dune @@ -3,7 +3,7 @@ (public_name catala.lcalc) (libraries bindlib dcalc scopelang runtime) (preprocess - (pps visitors.ppx ppx_deriving.show))) + (pps visitors.ppx))) (documentation (package catala) diff --git a/compiler/lcalc/optimizations.ml b/compiler/lcalc/optimizations.ml index c800e9e34..4b4eed077 100644 --- a/compiler/lcalc/optimizations.ml +++ b/compiler/lcalc/optimizations.ml @@ -104,6 +104,7 @@ let iota_optimizations (p : program) : program = p.scopes; } +(* TODO: beta optimizations apply inlining of the program. We left the inclusion of beta-optimization as future work since its produce code that is harder to read, and can produce exponential blowup of the size of the generated program. *) let _beta_optimizations (p : program) : program = { p with @@ -143,4 +144,3 @@ let peephole_optimizations (p : program) : program = } let optimize_program (p : program) : program = p |> iota_optimizations |> peephole_optimizations -(* |> beta_optimizations *) diff --git a/compiler/lcalc/to_ocaml.ml b/compiler/lcalc/to_ocaml.ml index b099f214d..417818bd4 100644 --- a/compiler/lcalc/to_ocaml.ml +++ b/compiler/lcalc/to_ocaml.ml @@ -17,7 +17,7 @@ open Ast open Backends module D = Dcalc.Ast -let find_struct s ctx = +let find_struct (s: D.StructName.t) (ctx: D.decl_ctx) : (D.StructFieldName.t * D.typ Pos.marked) list = try D.StructMap.find s ctx.D.ctx_structs with Not_found -> let s_name, pos = D.StructName.get_info s in @@ -26,7 +26,7 @@ let find_struct s ctx = s_name) pos -let find_enum en ctx = +let find_enum (en: D.EnumName.t) (ctx: D.decl_ctx) : (D.EnumConstructor.t * D.typ Pos.marked) list = try D.EnumMap.find en ctx.D.ctx_enums with Not_found -> let en_name, pos = D.EnumName.get_info en in @@ -100,7 +100,7 @@ let format_unop (fmt : Format.formatter) (op : Dcalc.Ast.unop Pos.marked) : unit | Not -> Format.fprintf fmt "%s" "not" | Log (_entry, _infos) -> Errors.raise_spanned_error - "Internal error: a log operator has not been caught by the\n expression match" + "Internal error: a log operator has not been caught by the expression match" (Pos.get_position op) | Length -> Format.fprintf fmt "%s" "array_length" | IntToRat -> Format.fprintf fmt "%s" "decimal_of_integer" @@ -195,7 +195,7 @@ let format_var (fmt : Format.formatter) (v : Var.t) : unit = || Dcalc.Print.begins_with_uppercase (Bindlib.name_of v) then Format.fprintf fmt "%s" lowercase_name else if lowercase_name = "_" then Format.fprintf fmt "%s" lowercase_name - else Format.fprintf fmt "%s_%i_" lowercase_name (Bindlib.uid_of v) + else Format.fprintf fmt "%s_" lowercase_name let needs_parens (e : expr Pos.marked) : bool = match Pos.unmark e with From d512b27e2cfa2b933e91df23ec33b8ef2f87bfbd Mon Sep 17 00:00:00 2001 From: Alain Date: Fri, 18 Feb 2022 15:49:23 +0100 Subject: [PATCH 092/102] fmt --- compiler/dcalc/ast.ml | 14 +++++--------- compiler/dcalc/binded_representation.ml | 18 +++++++++++------- compiler/dcalc/binded_representation.mli | 18 +++++++++--------- compiler/dcalc/print.ml | 4 ++-- compiler/lcalc/ast.ml | 3 +-- compiler/lcalc/compile_with_exceptions.mli | 3 ++- compiler/lcalc/compile_without_exceptions.mli | 3 ++- compiler/lcalc/optimizations.ml | 4 +++- compiler/lcalc/to_ocaml.ml | 6 ++++-- 9 files changed, 39 insertions(+), 34 deletions(-) diff --git a/compiler/dcalc/ast.ml b/compiler/dcalc/ast.ml index 6b4b6a582..a319aaa0b 100644 --- a/compiler/dcalc/ast.ml +++ b/compiler/dcalc/ast.ml @@ -143,10 +143,8 @@ type scope_let = { type scope_body = { scope_body_lets : scope_let list; - scope_body_result : expr Pos.marked Bindlib.box; - (** {x1 = x1; x2 = x2; x3 = x3; ... } *) - scope_body_arg : expr Bindlib.var; - (** x: input_struct *) + scope_body_result : expr Pos.marked Bindlib.box; (** {x1 = x1; x2 = x2; x3 = x3; ... } *) + scope_body_arg : expr Bindlib.var; (** x: input_struct *) scope_body_input_struct : StructName.t; scope_body_output_struct : StructName.t; } @@ -166,10 +164,9 @@ end module VarMap = Map.Make (Var) -let union: unit VarMap.t -> unit VarMap.t -> unit VarMap.t = VarMap.union (fun _ _ _ -> Some ()) +let union : unit VarMap.t -> unit VarMap.t -> unit VarMap.t = VarMap.union (fun _ _ _ -> Some ()) - -let rec fv (e: expr Pos.marked) : unit VarMap.t = +let rec fv (e : expr Pos.marked) : unit VarMap.t = match Pos.unmark e with | EVar (v, _) -> VarMap.singleton v () | ETuple (es, _) | EArray es -> es |> List.map fv |> List.fold_left union VarMap.empty @@ -184,8 +181,7 @@ let rec fv (e: expr Pos.marked) : unit VarMap.t = let vs, body = Bindlib.unmbind binder in Array.fold_right VarMap.remove vs (fv body) - -let free_vars (e: expr Pos.marked): Var.t list = fv e |> VarMap.bindings |> List.map fst +let free_vars (e : expr Pos.marked) : Var.t list = fv e |> VarMap.bindings |> List.map fst type vars = expr Bindlib.mvar diff --git a/compiler/dcalc/binded_representation.ml b/compiler/dcalc/binded_representation.ml index 718d777cf..d7fd66ea4 100644 --- a/compiler/dcalc/binded_representation.ml +++ b/compiler/dcalc/binded_representation.ml @@ -39,21 +39,22 @@ type scopes = scope_next : (D.expr, scopes) Bindlib.binder; } -let union: unit D.VarMap.t -> unit D.VarMap.t -> unit D.VarMap.t = D.VarMap.union (fun _ _ _ -> Some ()) +let union : unit D.VarMap.t -> unit D.VarMap.t -> unit D.VarMap.t = + D.VarMap.union (fun _ _ _ -> Some ()) -let rec fv_scope_lets (scope_lets: scope_lets) : unit D.VarMap.t = +let rec fv_scope_lets (scope_lets : scope_lets) : unit D.VarMap.t = match scope_lets with | Result e -> D.fv e | ScopeLet { scope_let_expr = e; scope_let_next = next; _ } -> let v, body = Bindlib.unbind next in union (D.fv e) (D.VarMap.remove v (fv_scope_lets body)) -let fv_scope_body (scope_body: scope_body) : unit D.VarMap.t = +let fv_scope_body (scope_body : scope_body) : unit D.VarMap.t = let { scope_body_result = binder; _ } = scope_body in let v, body = Bindlib.unbind binder in D.VarMap.remove v (fv_scope_lets body) -let rec fv_scopes (scopes: scopes) : unit D.VarMap.t = +let rec fv_scopes (scopes : scopes) : unit D.VarMap.t = match scopes with | Nil -> D.VarMap.empty | ScopeDef { scope_body = body; scope_next = next; _ } -> @@ -61,11 +62,14 @@ let rec fv_scopes (scopes: scopes) : unit D.VarMap.t = union (D.VarMap.remove v (fv_scopes next)) (fv_scope_body body) -let free_vars_scope_lets (scope_lets: scope_lets) : D.Var.t list = fv_scope_lets scope_lets |> D.VarMap.bindings |> List.map fst +let free_vars_scope_lets (scope_lets : scope_lets) : D.Var.t list = + fv_scope_lets scope_lets |> D.VarMap.bindings |> List.map fst -let free_vars_scope_body (scope_body: scope_body) : D.Var.t list = fv_scope_body scope_body |> D.VarMap.bindings |> List.map fst +let free_vars_scope_body (scope_body : scope_body) : D.Var.t list = + fv_scope_body scope_body |> D.VarMap.bindings |> List.map fst -let free_vars_scopes (scopes: scopes): D.Var.t list = fv_scopes scopes |> D.VarMap.bindings |> List.map fst +let free_vars_scopes (scopes : scopes) : D.Var.t list = + fv_scopes scopes |> D.VarMap.bindings |> List.map fst (** Actual transformation for scopes. *) let bind_scope_lets (acc : scope_lets Bindlib.box) (scope_let : D.scope_let) : diff --git a/compiler/dcalc/binded_representation.mli b/compiler/dcalc/binded_representation.mli index fced39f32..6343505f0 100644 --- a/compiler/dcalc/binded_representation.mli +++ b/compiler/dcalc/binded_representation.mli @@ -30,17 +30,17 @@ type scope_lets = scope_let_pos : Utils.Pos.t; } -(** As a consequence, the scope_body contains only a result and input/output signature, as the other - elements are stored inside the scope_let. The binder present is the argument of type - [scope_body_input_struct]. *) type scope_body = { scope_body_input_struct : D.StructName.t; scope_body_output_struct : D.StructName.t; scope_body_result : (D.expr, scope_lets) Bindlib.binder; } +(** As a consequence, the scope_body contains only a result and input/output signature, as the other + elements are stored inside the scope_let. The binder present is the argument of type + [scope_body_input_struct]. *) (** Finally, we do the same transformation for the whole program for the kinded lets. This permit us - to use bindlib variables for scopes names. *) + to use bindlib variables for scopes names. *) type scopes = | Nil | ScopeDef of { @@ -49,15 +49,15 @@ type scopes = scope_next : (D.expr, scopes) Bindlib.binder; } -(** List of variables not binded inside a scope_lets *) val free_vars_scope_lets : scope_lets -> D.Var.t list +(** List of variables not binded inside a scope_lets *) -(** List of variables not binded inside a scope_body. *) val free_vars_scope_body : scope_body -> D.Var.t list +(** List of variables not binded inside a scope_body. *) -(** List of variables not binded inside scopes*) val free_vars_scopes : scopes -> D.Var.t list +(** List of variables not binded inside scopes*) -(** Transform a list of scopes into our representation of scopes. It requires that scopes are - topologically-well-ordered, and ensure there is no free variables in the returned [scopes] *) val bind_scopes : (D.ScopeName.t * D.expr Bindlib.var * D.scope_body) list -> scopes Bindlib.box +(** Transform a list of scopes into our representation of scopes. It requires that scopes are + topologically-well-ordered, and ensure there is no free variables in the returned [scopes] *) diff --git a/compiler/dcalc/print.ml b/compiler/dcalc/print.ml index 1b7daa01f..80dff59b6 100644 --- a/compiler/dcalc/print.ml +++ b/compiler/dcalc/print.ml @@ -288,8 +288,8 @@ let rec format_expr ?(debug : bool = false) (ctx : Ast.decl_ctx) (fmt : Format.f (Format.pp_print_list ~pp_sep:(fun fmt () -> Format.fprintf fmt "%a@ " format_punctuation ",") format_expr) - exceptions format_punctuation "|" format_expr just format_punctuation "⊢" format_expr cons - format_punctuation "⟩" + exceptions format_punctuation "|" format_expr just format_punctuation "⊢" format_expr + cons format_punctuation "⟩" | ErrorOnEmpty e' -> Format.fprintf fmt "%a@ %a" format_operator "error_empty" format_with_parens e' | EAssert e' -> diff --git a/compiler/lcalc/ast.ml b/compiler/lcalc/ast.ml index 601391172..4d1830eca 100644 --- a/compiler/lcalc/ast.ml +++ b/compiler/lcalc/ast.ml @@ -91,7 +91,7 @@ let some_constr : D.EnumConstructor.t = D.EnumConstructor.fresh ("ESome", Pos.no let option_enum_config : (D.EnumConstructor.t * D.typ Pos.marked) list = [ (none_constr, (D.TLit D.TUnit, Pos.no_pos)); (some_constr, (D.TAny, Pos.no_pos)) ] -let make_none (pos : Pos.t): expr Pos.marked Bindlib.box = +let make_none (pos : Pos.t) : expr Pos.marked Bindlib.box = let mark : 'a -> 'a Pos.marked = Pos.mark pos in Bindlib.box @@ mark @@ EInj (mark @@ ELit LUnit, 0, option_enum, []) @@ -102,7 +102,6 @@ let make_some (e : expr Pos.marked Bindlib.box) : expr Pos.marked Bindlib.box = let+ e = e in mark @@ EInj (e, 1, option_enum, []) - (** [make_matchopt_with_abs_arms arg e_none e_some] build an expression [match arg with |None -> e_none | Some -> e_some] and requires e_some and e_none to be in the form [EAbs ...].*) diff --git a/compiler/lcalc/compile_with_exceptions.mli b/compiler/lcalc/compile_with_exceptions.mli index d005545ba..13fa7cd28 100644 --- a/compiler/lcalc/compile_with_exceptions.mli +++ b/compiler/lcalc/compile_with_exceptions.mli @@ -12,6 +12,7 @@ or implied. See the License for the specific language governing permissions and limitations under the License. *) -(** Translation from the default calculus to the lambda calculus. This translation uses exceptions handle empty default terms. *) +(** Translation from the default calculus to the lambda calculus. This translation uses exceptions + handle empty default terms. *) val translate_program : Dcalc.Ast.program -> Ast.program diff --git a/compiler/lcalc/compile_without_exceptions.mli b/compiler/lcalc/compile_without_exceptions.mli index c980c4f89..9af31a00a 100644 --- a/compiler/lcalc/compile_without_exceptions.mli +++ b/compiler/lcalc/compile_without_exceptions.mli @@ -12,6 +12,7 @@ or implied. See the License for the specific language governing permissions and limitations under the License. *) -(** Translation from the default calculus to the lambda calculus. This translation uses an option monad to handle empty defaults terms. *) +(** Translation from the default calculus to the lambda calculus. This translation uses an option + monad to handle empty defaults terms. *) val translate_program : Dcalc.Ast.program -> Ast.program diff --git a/compiler/lcalc/optimizations.ml b/compiler/lcalc/optimizations.ml index 4b4eed077..62e952e12 100644 --- a/compiler/lcalc/optimizations.ml +++ b/compiler/lcalc/optimizations.ml @@ -104,7 +104,9 @@ let iota_optimizations (p : program) : program = p.scopes; } -(* TODO: beta optimizations apply inlining of the program. We left the inclusion of beta-optimization as future work since its produce code that is harder to read, and can produce exponential blowup of the size of the generated program. *) +(* TODO: beta optimizations apply inlining of the program. We left the inclusion of + beta-optimization as future work since its produce code that is harder to read, and can produce + exponential blowup of the size of the generated program. *) let _beta_optimizations (p : program) : program = { p with diff --git a/compiler/lcalc/to_ocaml.ml b/compiler/lcalc/to_ocaml.ml index 417818bd4..a23ab4c5d 100644 --- a/compiler/lcalc/to_ocaml.ml +++ b/compiler/lcalc/to_ocaml.ml @@ -17,7 +17,8 @@ open Ast open Backends module D = Dcalc.Ast -let find_struct (s: D.StructName.t) (ctx: D.decl_ctx) : (D.StructFieldName.t * D.typ Pos.marked) list = +let find_struct (s : D.StructName.t) (ctx : D.decl_ctx) : + (D.StructFieldName.t * D.typ Pos.marked) list = try D.StructMap.find s ctx.D.ctx_structs with Not_found -> let s_name, pos = D.StructName.get_info s in @@ -26,7 +27,8 @@ let find_struct (s: D.StructName.t) (ctx: D.decl_ctx) : (D.StructFieldName.t * D s_name) pos -let find_enum (en: D.EnumName.t) (ctx: D.decl_ctx) : (D.EnumConstructor.t * D.typ Pos.marked) list = +let find_enum (en : D.EnumName.t) (ctx : D.decl_ctx) : (D.EnumConstructor.t * D.typ Pos.marked) list + = try D.EnumMap.find en ctx.D.ctx_enums with Not_found -> let en_name, pos = D.EnumName.get_info en in From 137fb8c5526f1f3eefccb6f5e67d46d966b91893 Mon Sep 17 00:00:00 2001 From: Alain Date: Fri, 18 Feb 2022 15:54:40 +0100 Subject: [PATCH 093/102] util review --- compiler/utils/pos.ml | 5 ++--- compiler/utils/pos.mli | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/compiler/utils/pos.ml b/compiler/utils/pos.ml index e1e954d50..f45a98d3f 100644 --- a/compiler/utils/pos.ml +++ b/compiler/utils/pos.ml @@ -12,8 +12,7 @@ or implied. See the License for the specific language governing permissions and limitations under the License. *) -type t = { code_pos : Lexing.position * Lexing.position; [@opaque] law_pos : string list } -[@@deriving show] +type t = { code_pos : Lexing.position * Lexing.position; law_pos : string list } let from_lpos (p : Lexing.position * Lexing.position) : t = { code_pos = p; law_pos = [] } @@ -168,7 +167,7 @@ let retrieve_loc_text (pos : t) : string = else Cli.print_with_style blue_style "%*s+-+ " (spaces + (2 * i) - 1) "")) with Sys_error _ -> "Location:" ^ to_string pos -type 'a marked = 'a * t [@@deriving show] +type 'a marked = 'a * t let no_pos : t = let zero_pos = diff --git a/compiler/utils/pos.mli b/compiler/utils/pos.mli index 198d1587a..b1f3d519f 100644 --- a/compiler/utils/pos.mli +++ b/compiler/utils/pos.mli @@ -14,7 +14,7 @@ (** Source code position *) -type t [@@deriving show] +type t (** A position in the source code is a file, as well as begin and end location of the form col:line *) (** Custom visitor for the [Pos.marked] type *) @@ -58,7 +58,7 @@ val retrieve_loc_text : t -> string (**{2 AST markings}*) -type 'a marked = 'a * t [@@deriving show] +type 'a marked = 'a * t (** Everything related to the source code should keep its position stored, to improve error messages *) val no_pos : t From f54b3b317c18fb1ed5d6b564189c265cb11d4420 Mon Sep 17 00:00:00 2001 From: Alain Date: Fri, 18 Feb 2022 15:55:37 +0100 Subject: [PATCH 094/102] review lcalc --- compiler/lcalc/compile_without_exceptions.ml | 3 --- 1 file changed, 3 deletions(-) diff --git a/compiler/lcalc/compile_without_exceptions.ml b/compiler/lcalc/compile_without_exceptions.ml index f48bff9da..90d200ec1 100644 --- a/compiler/lcalc/compile_without_exceptions.ml +++ b/compiler/lcalc/compile_without_exceptions.ml @@ -17,8 +17,6 @@ module D = Dcalc.Ast module A = Ast open Dcalc.Binded_representation -(*** hoisting *) - (** The main idea around this pass is to compile Dcalc to Lcalc without using [raise EmptyError] nor [try _ with EmptyError -> _]. To do so, we use the same technique as in rust or erlang to handle this kind of exceptions. Each [raise EmptyError] will be translated as [None] and each @@ -446,7 +444,6 @@ let translate_scopes (ctx : ctx) (scopes : scopes) : Ast.scope_body list = Bindlib.unbox (translate_scopes ctx scopes) let translate_program (prgm : D.program) : A.program = - (* modify the *) let inputs_structs = ListLabels.fold_left prgm.scopes ~init:[] ~f:(fun acc (_, _, body) -> body.D.scope_body_input_struct :: acc) From 4b1f235e6c2c4ee9d3369cd410e3d038e9db4a34 Mon Sep 17 00:00:00 2001 From: Alain Date: Fri, 18 Feb 2022 15:56:36 +0100 Subject: [PATCH 095/102] util review (bis) --- compiler/utils/dune | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/compiler/utils/dune b/compiler/utils/dune index 250d4142f..2d1789a00 100644 --- a/compiler/utils/dune +++ b/compiler/utils/dune @@ -1,9 +1,7 @@ (library (name utils) (public_name catala.utils) - (libraries cmdliner ANSITerminal re) - (preprocess - (pps ppx_deriving.show))) + (libraries cmdliner ANSITerminal re)) (documentation (package catala) From 5c9996e4275c372af46396bccc2ed53eb8475f70 Mon Sep 17 00:00:00 2001 From: Alain Date: Fri, 18 Feb 2022 15:59:35 +0100 Subject: [PATCH 096/102] more comment --- compiler/lcalc/compile_without_exceptions.mli | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/lcalc/compile_without_exceptions.mli b/compiler/lcalc/compile_without_exceptions.mli index 9af31a00a..54c46c57e 100644 --- a/compiler/lcalc/compile_without_exceptions.mli +++ b/compiler/lcalc/compile_without_exceptions.mli @@ -13,6 +13,7 @@ the License. *) (** Translation from the default calculus to the lambda calculus. This translation uses an option - monad to handle empty defaults terms. *) + monad to handle empty defaults terms. This transformation is one piece to permit to compile + toward legacy languages that does not contains exceptions. *) val translate_program : Dcalc.Ast.program -> Ast.program From d7b9aa9492cf8a4239c3714f93a6e05087fe586c Mon Sep 17 00:00:00 2001 From: Alain Date: Fri, 18 Feb 2022 16:11:22 +0100 Subject: [PATCH 097/102] fixing if-then-else bug --- compiler/dcalc/optimizations.ml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/compiler/dcalc/optimizations.ml b/compiler/dcalc/optimizations.ml index d7d7ff3cc..040ddfe98 100644 --- a/compiler/dcalc/optimizations.ml +++ b/compiler/dcalc/optimizations.ml @@ -125,8 +125,14 @@ let rec partial_evaluation (ctx : partial_evaluation_ctx) (e : expr Pos.marked) (ELit LEmptyError, pos) | [], just, cons -> (* without exceptions, a default is just an [if then else] raising an error in the - else case *) - (EIfThenElse (just, cons, (ELit LEmptyError, pos)), pos) + else case. *) + + (* TODO : this exception is only valid in the context of compilation_with_exceptions, + so we desactivate it for now. In the future it would be benificial to add a global + flag to know if we will be compiling using exceptions or the option monad. *) + + (* (EIfThenElse (just, cons, (ELit LEmptyError, pos)), pos) *) + (EDefault ([], just, cons), pos) | exceptions, just, cons -> (EDefault (exceptions, just, cons), pos)) (List.map rec_helper exceptions |> Bindlib.box_list) (rec_helper just) (rec_helper cons) From 6fe75f34861a77d897e7aba638e6c402159f38a9 Mon Sep 17 00:00:00 2001 From: Alain Date: Mon, 21 Feb 2022 11:51:01 +0100 Subject: [PATCH 098/102] fv --> free_vars_set free_vars --> free_vars_list --- compiler/dcalc/ast.ml | 19 ++++++++------- compiler/dcalc/ast.mli | 4 ++-- compiler/dcalc/binded_representation.ml | 30 ++++++++++++------------ compiler/dcalc/binded_representation.mli | 6 ++--- 4 files changed, 31 insertions(+), 28 deletions(-) diff --git a/compiler/dcalc/ast.ml b/compiler/dcalc/ast.ml index a319aaa0b..6441ffc67 100644 --- a/compiler/dcalc/ast.ml +++ b/compiler/dcalc/ast.ml @@ -166,22 +166,25 @@ module VarMap = Map.Make (Var) let union : unit VarMap.t -> unit VarMap.t -> unit VarMap.t = VarMap.union (fun _ _ _ -> Some ()) -let rec fv (e : expr Pos.marked) : unit VarMap.t = +let rec free_vars_set (e : expr Pos.marked) : unit VarMap.t = match Pos.unmark e with | EVar (v, _) -> VarMap.singleton v () - | ETuple (es, _) | EArray es -> es |> List.map fv |> List.fold_left union VarMap.empty - | ETupleAccess (e1, _, _, _) | EAssert e1 | ErrorOnEmpty e1 | EInj (e1, _, _, _) -> fv e1 + | ETuple (es, _) | EArray es -> es |> List.map free_vars_set |> List.fold_left union VarMap.empty + | ETupleAccess (e1, _, _, _) | EAssert e1 | ErrorOnEmpty e1 | EInj (e1, _, _, _) -> + free_vars_set e1 | EApp (e1, es) | EMatch (e1, es, _) -> - e1 :: es |> List.map fv |> List.fold_left union VarMap.empty + e1 :: es |> List.map free_vars_set |> List.fold_left union VarMap.empty | EDefault (es, ejust, econs) -> - ejust :: econs :: es |> List.map fv |> List.fold_left union VarMap.empty + ejust :: econs :: es |> List.map free_vars_set |> List.fold_left union VarMap.empty | EOp _ | ELit _ -> VarMap.empty - | EIfThenElse (e1, e2, e3) -> [ e1; e2; e3 ] |> List.map fv |> List.fold_left union VarMap.empty + | EIfThenElse (e1, e2, e3) -> + [ e1; e2; e3 ] |> List.map free_vars_set |> List.fold_left union VarMap.empty | EAbs ((binder, _), _) -> let vs, body = Bindlib.unmbind binder in - Array.fold_right VarMap.remove vs (fv body) + Array.fold_right VarMap.remove vs (free_vars_set body) -let free_vars (e : expr Pos.marked) : Var.t list = fv e |> VarMap.bindings |> List.map fst +let free_vars_list (e : expr Pos.marked) : Var.t list = + free_vars_set e |> VarMap.bindings |> List.map fst type vars = expr Bindlib.mvar diff --git a/compiler/dcalc/ast.mli b/compiler/dcalc/ast.mli index bcc2c588a..453d22fa6 100644 --- a/compiler/dcalc/ast.mli +++ b/compiler/dcalc/ast.mli @@ -183,9 +183,9 @@ end module VarMap : Map.S with type key = Var.t -val fv : expr Pos.marked -> unit VarMap.t +val free_vars_set : expr Pos.marked -> unit VarMap.t -val free_vars : expr Pos.marked -> Var.t list +val free_vars_list : expr Pos.marked -> Var.t list type vars = expr Bindlib.mvar diff --git a/compiler/dcalc/binded_representation.ml b/compiler/dcalc/binded_representation.ml index d7fd66ea4..f254e50ec 100644 --- a/compiler/dcalc/binded_representation.ml +++ b/compiler/dcalc/binded_representation.ml @@ -42,34 +42,34 @@ type scopes = let union : unit D.VarMap.t -> unit D.VarMap.t -> unit D.VarMap.t = D.VarMap.union (fun _ _ _ -> Some ()) -let rec fv_scope_lets (scope_lets : scope_lets) : unit D.VarMap.t = +let rec free_vars_set_scope_lets (scope_lets : scope_lets) : unit D.VarMap.t = match scope_lets with - | Result e -> D.fv e + | Result e -> D.free_vars_set e | ScopeLet { scope_let_expr = e; scope_let_next = next; _ } -> let v, body = Bindlib.unbind next in - union (D.fv e) (D.VarMap.remove v (fv_scope_lets body)) + union (D.free_vars_set e) (D.VarMap.remove v (free_vars_set_scope_lets body)) -let fv_scope_body (scope_body : scope_body) : unit D.VarMap.t = +let free_vars_set_scope_body (scope_body : scope_body) : unit D.VarMap.t = let { scope_body_result = binder; _ } = scope_body in let v, body = Bindlib.unbind binder in - D.VarMap.remove v (fv_scope_lets body) + D.VarMap.remove v (free_vars_set_scope_lets body) -let rec fv_scopes (scopes : scopes) : unit D.VarMap.t = +let rec free_vars_set_scopes (scopes : scopes) : unit D.VarMap.t = match scopes with | Nil -> D.VarMap.empty | ScopeDef { scope_body = body; scope_next = next; _ } -> let v, next = Bindlib.unbind next in - union (D.VarMap.remove v (fv_scopes next)) (fv_scope_body body) + union (D.VarMap.remove v (free_vars_set_scopes next)) (free_vars_set_scope_body body) -let free_vars_scope_lets (scope_lets : scope_lets) : D.Var.t list = - fv_scope_lets scope_lets |> D.VarMap.bindings |> List.map fst +let free_vars_list_scope_lets (scope_lets : scope_lets) : D.Var.t list = + free_vars_set_scope_lets scope_lets |> D.VarMap.bindings |> List.map fst -let free_vars_scope_body (scope_body : scope_body) : D.Var.t list = - fv_scope_body scope_body |> D.VarMap.bindings |> List.map fst +let free_vars_list_scope_body (scope_body : scope_body) : D.Var.t list = + free_vars_set_scope_body scope_body |> D.VarMap.bindings |> List.map fst -let free_vars_scopes (scopes : scopes) : D.Var.t list = - fv_scopes scopes |> D.VarMap.bindings |> List.map fst +let free_vars_list_scopes (scopes : scopes) : D.Var.t list = + free_vars_set_scopes scopes |> D.VarMap.bindings |> List.map fst (** Actual transformation for scopes. *) let bind_scope_lets (acc : scope_lets Bindlib.box) (scope_let : D.scope_let) : @@ -82,7 +82,7 @@ let bind_scope_lets (acc : scope_lets Bindlib.box) (scope_let : D.scope_let) : Bindlib.box_apply2 (fun expr binder -> (* Cli.debug_print @@ Format.asprintf "free variables in expression: %a" (Format.pp_print_list - Print.format_var) (D.free_vars expr); *) + Print.format_var) (D.free_vars_list expr); *) ScopeLet { scope_let_kind = scope_let.D.scope_let_kind; @@ -128,5 +128,5 @@ let bind_scopes (scopes : (D.ScopeName.t * D.expr Bindlib.var * D.scope_body) li scopes Bindlib.box = let result = ListLabels.fold_right scopes ~init:(Bindlib.box Nil) ~f:bind_scope in (* Cli.debug_print @@ Format.asprintf "free variable in the program : [%a]" (Format.pp_print_list - Print.format_var) (free_vars_scopes (Bindlib.unbox result)); *) + Print.format_var) (free_vars_list_scopes (Bindlib.unbox result)); *) result diff --git a/compiler/dcalc/binded_representation.mli b/compiler/dcalc/binded_representation.mli index 6343505f0..352028a94 100644 --- a/compiler/dcalc/binded_representation.mli +++ b/compiler/dcalc/binded_representation.mli @@ -49,13 +49,13 @@ type scopes = scope_next : (D.expr, scopes) Bindlib.binder; } -val free_vars_scope_lets : scope_lets -> D.Var.t list +val free_vars_list_scope_lets : scope_lets -> D.Var.t list (** List of variables not binded inside a scope_lets *) -val free_vars_scope_body : scope_body -> D.Var.t list +val free_vars_list_scope_body : scope_body -> D.Var.t list (** List of variables not binded inside a scope_body. *) -val free_vars_scopes : scopes -> D.Var.t list +val free_vars_list_scopes : scopes -> D.Var.t list (** List of variables not binded inside scopes*) val bind_scopes : (D.ScopeName.t * D.expr Bindlib.var * D.scope_body) list -> scopes Bindlib.box From f7b70b8f19bea5aa854cffb58bc3c10c95a323d2 Mon Sep 17 00:00:00 2001 From: Alain Date: Mon, 21 Feb 2022 11:55:39 +0100 Subject: [PATCH 099/102] add typing information to make_none and make_some --- compiler/lcalc/ast.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/lcalc/ast.ml b/compiler/lcalc/ast.ml index 4d1830eca..963df7dba 100644 --- a/compiler/lcalc/ast.ml +++ b/compiler/lcalc/ast.ml @@ -93,14 +93,14 @@ let option_enum_config : (D.EnumConstructor.t * D.typ Pos.marked) list = let make_none (pos : Pos.t) : expr Pos.marked Bindlib.box = let mark : 'a -> 'a Pos.marked = Pos.mark pos in - Bindlib.box @@ mark @@ EInj (mark @@ ELit LUnit, 0, option_enum, []) + Bindlib.box @@ mark @@ EInj (mark @@ ELit LUnit, 0, option_enum, [ (D.TLit D.TUnit, pos) ]) let make_some (e : expr Pos.marked Bindlib.box) : expr Pos.marked Bindlib.box = let pos = Pos.get_position @@ Bindlib.unbox e in let mark : 'a -> 'a Pos.marked = Pos.mark pos in let+ e = e in - mark @@ EInj (e, 1, option_enum, []) + mark @@ EInj (e, 1, option_enum, [ (D.TAny, pos) ]) (** [make_matchopt_with_abs_arms arg e_none e_some] build an expression [match arg with |None -> e_none | Some -> e_some] and requires e_some and e_none to be in the From 4ee9b71e0058075e8258a8ab21010d93a0b307ce Mon Sep 17 00:00:00 2001 From: Alain Date: Mon, 21 Feb 2022 11:58:26 +0100 Subject: [PATCH 100/102] to_lcalc option type printing --- compiler/lcalc/to_ocaml.ml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/compiler/lcalc/to_ocaml.ml b/compiler/lcalc/to_ocaml.ml index a23ab4c5d..e9f67401e 100644 --- a/compiler/lcalc/to_ocaml.ml +++ b/compiler/lcalc/to_ocaml.ml @@ -174,12 +174,12 @@ let rec format_typ (fmt : Format.formatter) (typ : Dcalc.Ast.typ Pos.marked) : u format_typ_with_parens) ts | TTuple (_, Some s) -> Format.fprintf fmt "%a" format_struct_name s - | TEnum (ts, e) when D.EnumName.compare e Ast.option_enum = 0 -> - Format.fprintf fmt "@[(%a)@] %a" - (Format.pp_print_list - ~pp_sep:(fun fmt () -> Format.fprintf fmt "@ ,@ ") - format_typ_with_parens) - ts format_enum_name e + | TEnum ([ t ], e) when D.EnumName.compare e Ast.option_enum = 0 -> + Format.fprintf fmt "@[(%a)@] %a" format_typ_with_parens t format_enum_name e + | TEnum (_, e) when D.EnumName.compare e Ast.option_enum = 0 -> + Errors.raise_spanned_error + "Internal Error: found an typing parameter for an eoption type of the wrong lenght." + (Pos.get_position typ) | TEnum (_ts, e) -> Format.fprintf fmt "%a" format_enum_name e | TArrow (t1, t2) -> Format.fprintf fmt "@[%a ->@ %a@]" format_typ_with_parens t1 format_typ_with_parens t2 From c65c38a2d5c7130ec2a169783012f67535374603 Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Thu, 24 Feb 2022 16:46:02 +0100 Subject: [PATCH 101/102] Correct flag for enabling optimization --- compiler/dcalc/optimizations.ml | 14 +- compiler/dcalc/print.ml | 4 +- compiler/driver.ml | 1 + compiler/utils/cli.ml | 2 + compiler/utils/cli.mli | 3 + .../law_source/allocations_familiales.ml | 1165 ++++++++--------- 6 files changed, 566 insertions(+), 623 deletions(-) diff --git a/compiler/dcalc/optimizations.ml b/compiler/dcalc/optimizations.ml index 040ddfe98..c762762bd 100644 --- a/compiler/dcalc/optimizations.ml +++ b/compiler/dcalc/optimizations.ml @@ -123,16 +123,12 @@ let rec partial_evaluation (ctx : partial_evaluation_ctx) (e : expr Pos.marked) ((ELit (LBool false) | EApp ((EOp (Unop (Log _)), _), [ (ELit (LBool false), _) ])), _), _ ) -> (ELit LEmptyError, pos) - | [], just, cons -> + | [], just, cons when not !Cli.avoid_exceptions_flag -> (* without exceptions, a default is just an [if then else] raising an error in the - else case. *) - - (* TODO : this exception is only valid in the context of compilation_with_exceptions, - so we desactivate it for now. In the future it would be benificial to add a global - flag to know if we will be compiling using exceptions or the option monad. *) - - (* (EIfThenElse (just, cons, (ELit LEmptyError, pos)), pos) *) - (EDefault ([], just, cons), pos) + else case. This exception is only valid in the context of + compilation_with_exceptions, so we desactivate with a global flag to know if we + will be compiling using exceptions or the option monad. *) + (EIfThenElse (just, cons, (ELit LEmptyError, pos)), pos) | exceptions, just, cons -> (EDefault (exceptions, just, cons), pos)) (List.map rec_helper exceptions |> Bindlib.box_list) (rec_helper just) (rec_helper cons) diff --git a/compiler/dcalc/print.ml b/compiler/dcalc/print.ml index 80dff59b6..1b7daa01f 100644 --- a/compiler/dcalc/print.ml +++ b/compiler/dcalc/print.ml @@ -288,8 +288,8 @@ let rec format_expr ?(debug : bool = false) (ctx : Ast.decl_ctx) (fmt : Format.f (Format.pp_print_list ~pp_sep:(fun fmt () -> Format.fprintf fmt "%a@ " format_punctuation ",") format_expr) - exceptions format_punctuation "|" format_expr just format_punctuation "⊢" format_expr - cons format_punctuation "⟩" + exceptions format_punctuation "|" format_expr just format_punctuation "⊢" format_expr cons + format_punctuation "⟩" | ErrorOnEmpty e' -> Format.fprintf fmt "%a@ %a" format_operator "error_empty" format_with_parens e' | EAssert e' -> diff --git a/compiler/driver.ml b/compiler/driver.ml index c61f41a83..2ec17a025 100644 --- a/compiler/driver.ml +++ b/compiler/driver.ml @@ -36,6 +36,7 @@ let driver (source_file : Pos.input_file) (debug : bool) (unstyled : bool) Cli.trace_flag := trace; Cli.optimize_flag := optimize; Cli.disable_counterexamples := disable_counterexamples; + Cli.avoid_exceptions_flag := avoid_exceptions; Cli.debug_print "Reading files..."; let filename = ref "" in (match source_file with FileName f -> filename := f | Contents c -> Cli.contents := c); diff --git a/compiler/utils/cli.ml b/compiler/utils/cli.ml index 29e456ed5..ef604a1f3 100644 --- a/compiler/utils/cli.ml +++ b/compiler/utils/cli.ml @@ -36,6 +36,8 @@ let optimize_flag = ref false let disable_counterexamples = ref false +let avoid_exceptions_flag = ref false + open Cmdliner let file = diff --git a/compiler/utils/cli.mli b/compiler/utils/cli.mli index e020d8510..cf2825b28 100644 --- a/compiler/utils/cli.mli +++ b/compiler/utils/cli.mli @@ -38,6 +38,9 @@ val trace_flag : bool ref val disable_counterexamples : bool ref (** Disables model-generated counterexamples for proofs that fail. *) +val avoid_exceptions_flag : bool ref +(** Avoids using [try ... with] exceptions when compiling the default calculus. *) + (** {2 CLI terms} *) val file : string Cmdliner.Term.t diff --git a/french_law/ocaml/law_source/allocations_familiales.ml b/french_law/ocaml/law_source/allocations_familiales.ml index 5f93ad294..9f1ac8bf8 100644 --- a/french_law/ocaml/law_source/allocations_familiales.ml +++ b/french_law/ocaml/law_source/allocations_familiales.ml @@ -287,9 +287,9 @@ let embed_interface_allocations_familiales_in (x : interface_allocations_familia ] ) let smic (smic_in : smic_in) = - let date_courante_2011_ : date = smic_in.date_courante_in in - let residence_2012_ : collectivite = smic_in.residence_in in - let brut_horaire_2013_ : money = + let date_courante_ : date = smic_in.date_courante_in in + let residence_ : collectivite = smic_in.residence_in in + let brut_horaire_ : money = log_variable_definition [ "Smic"; "brut_horaire" ] embed_money (try handle_default @@ -313,9 +313,9 @@ let smic (smic_in : smic_in) = "Décrets divers"; ]; } - (date_courante_2011_ >=@ date_of_numbers 2021 1 1 - && date_courante_2011_ <=@ date_of_numbers 2021 12 31 - && residence_2012_ = Mayotte ()) + (date_courante_ >=@ date_of_numbers 2021 1 1 + && date_courante_ <=@ date_of_numbers 2021 12 31 + && residence_ = Mayotte ()) then money_of_cents_string "774" else raise EmptyError with EmptyError -> raise EmptyError); @@ -338,14 +338,13 @@ let smic (smic_in : smic_in) = "Décrets divers"; ]; } - (date_courante_2011_ >=@ date_of_numbers 2021 1 1 - && date_courante_2011_ <=@ date_of_numbers 2021 12 31 - && (residence_2012_ = Metropole () || residence_2012_ = Guadeloupe () - || residence_2012_ = Guyane () || residence_2012_ = Martinique () - || residence_2012_ = LaReunion () - || residence_2012_ = SaintBarthelemy () - || residence_2012_ = SaintMartin () - || residence_2012_ = SaintPierreEtMiquelon ())) + (date_courante_ >=@ date_of_numbers 2021 1 1 + && date_courante_ <=@ date_of_numbers 2021 12 31 + && (residence_ = Metropole () || residence_ = Guadeloupe () + || residence_ = Guyane () || residence_ = Martinique () + || residence_ = LaReunion () || residence_ = SaintBarthelemy () + || residence_ = SaintMartin () + || residence_ = SaintPierreEtMiquelon ())) then money_of_cents_string "1025" else raise EmptyError with EmptyError -> raise EmptyError); @@ -368,9 +367,9 @@ let smic (smic_in : smic_in) = "Décrets divers"; ]; } - (date_courante_2011_ >=@ date_of_numbers 2020 1 1 - && date_courante_2011_ <=@ date_of_numbers 2020 12 31 - && residence_2012_ = Mayotte ()) + (date_courante_ >=@ date_of_numbers 2020 1 1 + && date_courante_ <=@ date_of_numbers 2020 12 31 + && residence_ = Mayotte ()) then money_of_cents_string "766" else raise EmptyError with EmptyError -> raise EmptyError); @@ -393,14 +392,13 @@ let smic (smic_in : smic_in) = "Décrets divers"; ]; } - (date_courante_2011_ >=@ date_of_numbers 2020 1 1 - && date_courante_2011_ <=@ date_of_numbers 2020 12 31 - && (residence_2012_ = Metropole () || residence_2012_ = Guadeloupe () - || residence_2012_ = Guyane () || residence_2012_ = Martinique () - || residence_2012_ = LaReunion () - || residence_2012_ = SaintBarthelemy () - || residence_2012_ = SaintMartin () - || residence_2012_ = SaintPierreEtMiquelon ())) + (date_courante_ >=@ date_of_numbers 2020 1 1 + && date_courante_ <=@ date_of_numbers 2020 12 31 + && (residence_ = Metropole () || residence_ = Guadeloupe () + || residence_ = Guyane () || residence_ = Martinique () + || residence_ = LaReunion () || residence_ = SaintBarthelemy () + || residence_ = SaintMartin () + || residence_ = SaintPierreEtMiquelon ())) then money_of_cents_string "1015" else raise EmptyError with EmptyError -> raise EmptyError); @@ -423,9 +421,9 @@ let smic (smic_in : smic_in) = "Décrets divers"; ]; } - (date_courante_2011_ >=@ date_of_numbers 2019 1 1 - && date_courante_2011_ <=@ date_of_numbers 2019 12 31 - && residence_2012_ = Mayotte ()) + (date_courante_ >=@ date_of_numbers 2019 1 1 + && date_courante_ <=@ date_of_numbers 2019 12 31 + && residence_ = Mayotte ()) then money_of_cents_string "757" else raise EmptyError with EmptyError -> raise EmptyError); @@ -448,14 +446,13 @@ let smic (smic_in : smic_in) = "Décrets divers"; ]; } - (date_courante_2011_ >=@ date_of_numbers 2019 1 1 - && date_courante_2011_ <=@ date_of_numbers 2019 12 31 - && (residence_2012_ = Metropole () || residence_2012_ = Guadeloupe () - || residence_2012_ = Guyane () || residence_2012_ = Martinique () - || residence_2012_ = LaReunion () - || residence_2012_ = SaintBarthelemy () - || residence_2012_ = SaintMartin () - || residence_2012_ = SaintPierreEtMiquelon ())) + (date_courante_ >=@ date_of_numbers 2019 1 1 + && date_courante_ <=@ date_of_numbers 2019 12 31 + && (residence_ = Metropole () || residence_ = Guadeloupe () + || residence_ = Guyane () || residence_ = Martinique () + || residence_ = LaReunion () || residence_ = SaintBarthelemy () + || residence_ = SaintMartin () + || residence_ = SaintPierreEtMiquelon ())) then money_of_cents_string "1003" else raise EmptyError with EmptyError -> raise EmptyError); @@ -484,11 +481,11 @@ let smic (smic_in : smic_in) = law_headings = [ "Prologue" ]; })) in - { brut_horaire_out = brut_horaire_2013_ } + { brut_horaire_out = brut_horaire_ } let allocation_familiales_avril2008 (allocation_familiales_avril2008_in : allocation_familiales_avril2008_in) = - let age_minimum_alinea_1_l521_3_2023_ : integer = + let age_minimum_alinea_1_l521_3_ : integer = log_variable_definition [ "AllocationFamilialesAvril2008"; "âge_minimum_alinéa_1_l521_3" ] embed_integer @@ -505,11 +502,11 @@ let allocation_familiales_avril2008 law_headings = [ "Prologue" ]; })) in - { age_minimum_alinea_1_l521_3_out = age_minimum_alinea_1_l521_3_2023_ } + { age_minimum_alinea_1_l521_3_out = age_minimum_alinea_1_l521_3_ } let enfant_le_plus_age (enfant_le_plus_age_in : enfant_le_plus_age_in) = - let enfants_2025_ : enfant array = enfant_le_plus_age_in.enfants_in in - let le_plus_age_2026_ : enfant = + let enfants_ : enfant array = enfant_le_plus_age_in.enfants_in in + let le_plus_age_ : enfant = log_variable_definition [ "EnfantLePlusÂgé"; "le_plus_âgé" ] embed_enfant @@ -517,8 +514,7 @@ let enfant_le_plus_age (enfant_le_plus_age_in : enfant_le_plus_age_in) = try try Array.fold_left - (fun (acc_2027_ : _) (item_2028_ : _) -> - if acc_2027_.age >! item_2028_.age then acc_2027_ else item_2028_) + (fun (acc_ : _) (item_ : _) -> if acc_.age >! item_.age then acc_ else item_) { identifiant = ~-!(integer_of_string "1"); obligation_scolaire = Pendant (); @@ -528,7 +524,7 @@ let enfant_le_plus_age (enfant_le_plus_age_in : enfant_le_plus_age_in) = prise_en_charge = EffectiveEtPermanente (); a_deja_ouvert_droit_aux_allocations_familiales = false; } - enfants_2025_ + enfants_ with EmptyError -> raise EmptyError with EmptyError -> raise EmptyError with EmptyError -> @@ -543,15 +539,15 @@ let enfant_le_plus_age (enfant_le_plus_age_in : enfant_le_plus_age_in) = law_headings = [ "Prologue" ]; })) in - { le_plus_age_out = le_plus_age_2026_ } + { le_plus_age_out = le_plus_age_ } let prestations_familiales (prestations_familiales_in : prestations_familiales_in) = - let date_courante_2030_ : date = prestations_familiales_in.date_courante_in in - let prestation_courante_2031_ : element_prestations_familiales = + let date_courante_ : date = prestations_familiales_in.date_courante_in in + let prestation_courante_ : element_prestations_familiales = prestations_familiales_in.prestation_courante_in in - let residence_2032_ : collectivite = prestations_familiales_in.residence_in in - let age_l512_3_2_2033_ : integer = + let residence_ : collectivite = prestations_familiales_in.residence_in in + let age_l512_3_2_ : integer = log_variable_definition [ "PrestationsFamiliales"; "âge_l512_3_2" ] embed_integer @@ -568,7 +564,7 @@ let prestations_familiales (prestations_familiales_in : prestations_familiales_i law_headings = [ "Prologue" ]; })) in - let base_mensuelle_2034_ : money = + let base_mensuelle_ : money = log_variable_definition [ "PrestationsFamiliales"; "base_mensuelle" ] embed_money @@ -596,8 +592,8 @@ let prestations_familiales (prestations_familiales_in : prestations_familiales_i "Décrets divers"; ]; } - (date_courante_2030_ >=@ date_of_numbers 2021 4 1 - && date_courante_2030_ <@ date_of_numbers 2022 4 1) + (date_courante_ >=@ date_of_numbers 2021 4 1 + && date_courante_ <@ date_of_numbers 2022 4 1) then money_of_cents_string "41481" else raise EmptyError with EmptyError -> raise EmptyError); @@ -622,8 +618,8 @@ let prestations_familiales (prestations_familiales_in : prestations_familiales_i "Décrets divers"; ]; } - (date_courante_2030_ >=@ date_of_numbers 2020 4 1 - && date_courante_2030_ <@ date_of_numbers 2021 4 1) + (date_courante_ >=@ date_of_numbers 2020 4 1 + && date_courante_ <@ date_of_numbers 2021 4 1) then money_of_cents_string "41404" else raise EmptyError with EmptyError -> raise EmptyError); @@ -646,8 +642,8 @@ let prestations_familiales (prestations_familiales_in : prestations_familiales_i "Décrets divers"; ]; } - (date_courante_2030_ >=@ date_of_numbers 2019 4 1 - && date_courante_2030_ <@ date_of_numbers 2020 4 1) + (date_courante_ >=@ date_of_numbers 2019 4 1 + && date_courante_ <@ date_of_numbers 2020 4 1) then money_of_cents_string "41316" else raise EmptyError with EmptyError -> raise EmptyError); @@ -676,12 +672,12 @@ let prestations_familiales (prestations_familiales_in : prestations_familiales_i law_headings = [ "Prologue" ]; })) in - let smic_dot_date_courante_2040_ : date = + let smic_dot_date_courante_ : date = try log_variable_definition [ "PrestationsFamiliales"; "smic.date_courante" ] embed_date - (try try date_courante_2030_ with EmptyError -> raise EmptyError + (try try date_courante_ with EmptyError -> raise EmptyError with EmptyError -> raise EmptyError) with EmptyError -> raise @@ -695,12 +691,12 @@ let prestations_familiales (prestations_familiales_in : prestations_familiales_i law_headings = [ "Prologue" ]; }) in - let smic_dot_residence_2041_ : collectivite = + let smic_dot_residence_ : collectivite = try log_variable_definition [ "PrestationsFamiliales"; "smic.résidence" ] embed_collectivite - (try try residence_2032_ with EmptyError -> raise EmptyError + (try try residence_ with EmptyError -> raise EmptyError with EmptyError -> raise EmptyError) with EmptyError -> raise @@ -714,19 +710,16 @@ let prestations_familiales (prestations_familiales_in : prestations_familiales_i law_headings = [ "Prologue" ]; }) in - let result_2042_ : smic_out = + let result_ : smic_out = log_end_call [ "PrestationsFamiliales"; "smic"; "Smic" ] (log_begin_call [ "PrestationsFamiliales"; "smic"; "Smic" ] smic - { - date_courante_in = smic_dot_date_courante_2040_; - residence_in = smic_dot_residence_2041_; - }) + { date_courante_in = smic_dot_date_courante_; residence_in = smic_dot_residence_ }) in - let smic_dot_brut_horaire_2043_ : money = result_2042_.brut_horaire_out in - let regime_outre_mer_l751_1_2044_ : bool = + let smic_dot_brut_horaire_ : money = result_.brut_horaire_out in + let regime_outre_mer_l751_1_ : bool = log_variable_definition [ "PrestationsFamiliales"; "régime_outre_mer_l751_1" ] embed_bool @@ -752,10 +745,9 @@ let prestations_familiales (prestations_familiales_in : prestations_familiales_i "Code de la sécurité sociale"; ]; } - (residence_2032_ = Guadeloupe () || residence_2032_ = Guyane () - || residence_2032_ = Martinique () || residence_2032_ = LaReunion () - || residence_2032_ = SaintBarthelemy () - || residence_2032_ = SaintMartin ()) + (residence_ = Guadeloupe () || residence_ = Guyane () || residence_ = Martinique () + || residence_ = LaReunion () || residence_ = SaintBarthelemy () + || residence_ = SaintMartin ()) then true else raise EmptyError with EmptyError -> raise EmptyError @@ -772,7 +764,7 @@ let prestations_familiales (prestations_familiales_in : prestations_familiales_i law_headings = [ "Prologue" ]; })) in - let plafond_l512_3_2_2045_ : money = + let plafond_l512_3_2_ : money = log_variable_definition [ "PrestationsFamiliales"; "plafond_l512_3_2" ] embed_money @@ -798,13 +790,12 @@ let prestations_familiales (prestations_familiales_in : prestations_familiales_i "Code de la sécurité sociale"; ]; } - regime_outre_mer_l751_1_2044_ - then - smic_dot_brut_horaire_2043_ *$ decimal_of_string "0.55" *$ decimal_of_string "169." + regime_outre_mer_l751_1_ + then smic_dot_brut_horaire_ *$ decimal_of_string "0.55" *$ decimal_of_string "169." else raise EmptyError with EmptyError -> raise EmptyError with EmptyError -> ( - try smic_dot_brut_horaire_2043_ *$ decimal_of_string "0.55" *$ decimal_of_string "169." + try smic_dot_brut_horaire_ *$ decimal_of_string "0.55" *$ decimal_of_string "169." with EmptyError -> raise EmptyError) with EmptyError -> raise EmptyError with EmptyError -> @@ -819,12 +810,12 @@ let prestations_familiales (prestations_familiales_in : prestations_familiales_i law_headings = [ "Prologue" ]; })) in - let conditions_hors_age_2046_ : enfant -> bool = + let conditions_hors_age_ : enfant -> bool = log_variable_definition [ "PrestationsFamiliales"; "conditions_hors_âge" ] unembeddable (try - fun (param_2047_ : enfant) -> + fun (param_ : enfant) -> try try try @@ -846,20 +837,20 @@ let prestations_familiales (prestations_familiales_in : prestations_familiales_i "Code de la sécurité sociale"; ]; } - (((match param_2047_.obligation_scolaire with + (((match param_.obligation_scolaire with | Avant _ -> true | Pendant _ -> false | Apres _ -> false) - || (match param_2047_.obligation_scolaire with + || (match param_.obligation_scolaire with | Avant _ -> false | Pendant _ -> true | Apres _ -> false) || - match param_2047_.obligation_scolaire with + match param_.obligation_scolaire with | Avant _ -> false | Pendant _ -> false | Apres _ -> true) - && param_2047_.remuneration_mensuelle <=$ plafond_l512_3_2_2045_) + && param_.remuneration_mensuelle <=$ plafond_l512_3_2_) then true else raise EmptyError with EmptyError -> raise EmptyError @@ -887,12 +878,12 @@ let prestations_familiales (prestations_familiales_in : prestations_familiales_i law_headings = [ "Prologue" ]; })) in - let droit_ouvert_2057_ : enfant -> bool = + let droit_ouvert_ : enfant -> bool = log_variable_definition [ "PrestationsFamiliales"; "droit_ouvert" ] unembeddable (try - fun (param_2058_ : enfant) -> + fun (param_ : enfant) -> try handle_default [| @@ -916,12 +907,12 @@ let prestations_familiales (prestations_familiales_in : prestations_familiales_i "Code de la sécurité sociale"; ]; } - ((match param_2058_.obligation_scolaire with + ((match param_.obligation_scolaire with | Avant _ -> false | Pendant _ -> false | Apres _ -> true) - && param_2058_.remuneration_mensuelle <=$ plafond_l512_3_2_2045_ - && param_2058_.age raise EmptyError); @@ -945,12 +936,12 @@ let prestations_familiales (prestations_familiales_in : prestations_familiales_i "Code de la sécurité sociale"; ]; } - ((match param_2058_.obligation_scolaire with + ((match param_.obligation_scolaire with | Avant _ -> true | Pendant _ -> false | Apres _ -> false) || - match param_2058_.obligation_scolaire with + match param_.obligation_scolaire with | Avant _ -> false | Pendant _ -> true | Apres _ -> false) @@ -994,33 +985,33 @@ let prestations_familiales (prestations_familiales_in : prestations_familiales_i })) in { - droit_ouvert_out = droit_ouvert_2057_; - conditions_hors_age_out = conditions_hors_age_2046_; - age_l512_3_2_out = age_l512_3_2_2033_; - regime_outre_mer_l751_1_out = regime_outre_mer_l751_1_2044_; - base_mensuelle_out = base_mensuelle_2034_; + droit_ouvert_out = droit_ouvert_; + conditions_hors_age_out = conditions_hors_age_; + age_l512_3_2_out = age_l512_3_2_; + regime_outre_mer_l751_1_out = regime_outre_mer_l751_1_; + base_mensuelle_out = base_mensuelle_; } let allocations_familiales (allocations_familiales_in : allocations_familiales_in) = - let personne_charge_effective_permanente_est_parent_2073_ : bool = + let personne_charge_effective_permanente_est_parent_ : bool = allocations_familiales_in.personne_charge_effective_permanente_est_parent_in in - let personne_charge_effective_permanente_remplit_titre__i_2074_ : bool = + let personne_charge_effective_permanente_remplit_titre__i_ : bool = allocations_familiales_in.personne_charge_effective_permanente_remplit_titre_I_in in - let ressources_menage_2075_ : money = allocations_familiales_in.ressources_menage_in in - let residence_2076_ : collectivite = allocations_familiales_in.residence_in in - let date_courante_2077_ : date = allocations_familiales_in.date_courante_in in - let enfants_a_charge_2078_ : enfant array = allocations_familiales_in.enfants_a_charge_in in - let avait_enfant_a_charge_avant_1er_janvier_2012_2079_ : bool = + let ressources_menage_ : money = allocations_familiales_in.ressources_menage_in in + let residence_ : collectivite = allocations_familiales_in.residence_in in + let date_courante_ : date = allocations_familiales_in.date_courante_in in + let enfants_a_charge_ : enfant array = allocations_familiales_in.enfants_a_charge_in in + let avait_enfant_a_charge_avant_1er_janvier_2012_ : bool = allocations_familiales_in.avait_enfant_a_charge_avant_1er_janvier_2012_in in - let prise_en_compte_2080_ : enfant -> prise_en_compte = + let prise_en_compte_ : enfant -> prise_en_compte = log_variable_definition [ "AllocationsFamiliales"; "prise_en_compte" ] unembeddable (try - fun (param_2081_ : enfant) -> + fun (param_ : enfant) -> try handle_default [| @@ -1044,7 +1035,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Code de la sécurité sociale"; ]; } - (match param_2081_.prise_en_charge with + (match param_.prise_en_charge with | GardeAlterneePartageAllocations _ -> false | GardeAlterneeAllocataireUnique _ -> false | EffectiveEtPermanente _ -> false @@ -1073,7 +1064,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Code de la sécurité sociale"; ]; } - (match param_2081_.prise_en_charge with + (match param_.prise_en_charge with | GardeAlterneePartageAllocations _ -> false | GardeAlterneeAllocataireUnique _ -> false | EffectiveEtPermanente _ -> false @@ -1102,7 +1093,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Code de la sécurité sociale"; ]; } - (match param_2081_.prise_en_charge with + (match param_.prise_en_charge with | GardeAlterneePartageAllocations _ -> true | GardeAlterneeAllocataireUnique _ -> false | EffectiveEtPermanente _ -> false @@ -1131,7 +1122,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Code de la sécurité sociale"; ]; } - (match param_2081_.prise_en_charge with + (match param_.prise_en_charge with | GardeAlterneePartageAllocations _ -> false | GardeAlterneeAllocataireUnique _ -> true | EffectiveEtPermanente _ -> false @@ -1160,7 +1151,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Code de la sécurité sociale"; ]; } - (match param_2081_.prise_en_charge with + (match param_.prise_en_charge with | GardeAlterneePartageAllocations _ -> false | GardeAlterneeAllocataireUnique _ -> false | EffectiveEtPermanente _ -> true @@ -1205,12 +1196,12 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let versement_2114_ : enfant -> versement_allocations = + let versement_ : enfant -> versement_allocations = log_variable_definition [ "AllocationsFamiliales"; "versement" ] unembeddable (try - fun (param_2115_ : enfant) -> + fun (param_ : enfant) -> try handle_default [| @@ -1234,7 +1225,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Code de la sécurité sociale"; ]; } - (match param_2115_.prise_en_charge with + (match param_.prise_en_charge with | GardeAlterneePartageAllocations _ -> false | GardeAlterneeAllocataireUnique _ -> false | EffectiveEtPermanente _ -> false @@ -1263,7 +1254,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Code de la sécurité sociale"; ]; } - (match param_2115_.prise_en_charge with + (match param_.prise_en_charge with | GardeAlterneePartageAllocations _ -> false | GardeAlterneeAllocataireUnique _ -> false | EffectiveEtPermanente _ -> false @@ -1292,7 +1283,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Code de la sécurité sociale"; ]; } - (match param_2115_.prise_en_charge with + (match param_.prise_en_charge with | GardeAlterneePartageAllocations _ -> true | GardeAlterneeAllocataireUnique _ -> false | EffectiveEtPermanente _ -> false @@ -1321,7 +1312,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Code de la sécurité sociale"; ]; } - (match param_2115_.prise_en_charge with + (match param_.prise_en_charge with | GardeAlterneePartageAllocations _ -> false | GardeAlterneeAllocataireUnique _ -> true | EffectiveEtPermanente _ -> false @@ -1350,7 +1341,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Code de la sécurité sociale"; ]; } - (match param_2115_.prise_en_charge with + (match param_.prise_en_charge with | GardeAlterneePartageAllocations _ -> false | GardeAlterneeAllocataireUnique _ -> false | EffectiveEtPermanente _ -> true @@ -1395,7 +1386,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let nombre_enfants_l521_1_2148_ : integer = + let nombre_enfants_l521_1_ : integer = log_variable_definition [ "AllocationsFamiliales"; "nombre_enfants_l521_1" ] embed_integer @@ -1412,7 +1403,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let nombre_enfants_alinea_2_l521_3_2149_ : integer = + let nombre_enfants_alinea_2_l521_3_ : integer = log_variable_definition [ "AllocationsFamiliales"; "nombre_enfants_alinéa_2_l521_3" ] embed_integer @@ -1429,22 +1420,22 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let result_2150_ : allocation_familiales_avril2008_out = + let result_ : allocation_familiales_avril2008_out = log_end_call [ "AllocationsFamiliales"; "version_avril_2008"; "AllocationFamilialesAvril2008" ] (log_begin_call [ "AllocationsFamiliales"; "version_avril_2008"; "AllocationFamilialesAvril2008" ] allocation_familiales_avril2008 ()) in - let version_avril_2008_dot_age_minimum_alinea_1_l521_3_2151_ : integer = - result_2150_.age_minimum_alinea_1_l521_3_out + let version_avril_2008_dot_age_minimum_alinea_1_l521_3_ : integer = + result_.age_minimum_alinea_1_l521_3_out in - let prestations_familiales_dot_date_courante_2152_ : date = + let prestations_familiales_dot_date_courante_ : date = try log_variable_definition [ "AllocationsFamiliales"; "prestations_familiales.date_courante" ] embed_date - (try try date_courante_2077_ with EmptyError -> raise EmptyError + (try try date_courante_ with EmptyError -> raise EmptyError with EmptyError -> raise EmptyError) with EmptyError -> raise @@ -1458,7 +1449,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; }) in - let prestations_familiales_dot_prestation_courante_2153_ : element_prestations_familiales = + let prestations_familiales_dot_prestation_courante_ : element_prestations_familiales = try log_variable_definition [ "AllocationsFamiliales"; "prestations_familiales.prestation_courante" ] @@ -1477,12 +1468,12 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; }) in - let prestations_familiales_dot_residence_2154_ : collectivite = + let prestations_familiales_dot_residence_ : collectivite = try log_variable_definition [ "AllocationsFamiliales"; "prestations_familiales.résidence" ] embed_collectivite - (try try residence_2076_ with EmptyError -> raise EmptyError + (try try residence_ with EmptyError -> raise EmptyError with EmptyError -> raise EmptyError) with EmptyError -> raise @@ -1496,35 +1487,33 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; }) in - let result_2155_ : prestations_familiales_out = + let result_ : prestations_familiales_out = log_end_call [ "AllocationsFamiliales"; "prestations_familiales"; "PrestationsFamiliales" ] (log_begin_call [ "AllocationsFamiliales"; "prestations_familiales"; "PrestationsFamiliales" ] prestations_familiales { - date_courante_in = prestations_familiales_dot_date_courante_2152_; - prestation_courante_in = prestations_familiales_dot_prestation_courante_2153_; - residence_in = prestations_familiales_dot_residence_2154_; + date_courante_in = prestations_familiales_dot_date_courante_; + prestation_courante_in = prestations_familiales_dot_prestation_courante_; + residence_in = prestations_familiales_dot_residence_; }) in - let prestations_familiales_dot_droit_ouvert_2156_ : enfant -> bool = - result_2155_.droit_ouvert_out + let prestations_familiales_dot_droit_ouvert_ : enfant -> bool = result_.droit_ouvert_out in + let prestations_familiales_dot_conditions_hors_age_ : enfant -> bool = + result_.conditions_hors_age_out in - let prestations_familiales_dot_conditions_hors_age_2157_ : enfant -> bool = - result_2155_.conditions_hors_age_out + let prestations_familiales_dot_age_l512_3_2_ : integer = result_.age_l512_3_2_out in + let prestations_familiales_dot_regime_outre_mer_l751_1_ : bool = + result_.regime_outre_mer_l751_1_out in - let prestations_familiales_dot_age_l512_3_2_2158_ : integer = result_2155_.age_l512_3_2_out in - let prestations_familiales_dot_regime_outre_mer_l751_1_2159_ : bool = - result_2155_.regime_outre_mer_l751_1_out - in - let prestations_familiales_dot_base_mensuelle_2160_ : money = result_2155_.base_mensuelle_out in - let enfant_le_plus_age_dot_enfants_2161_ : enfant array = + let prestations_familiales_dot_base_mensuelle_ : money = result_.base_mensuelle_out in + let enfant_le_plus_age_dot_enfants_ : enfant array = try log_variable_definition [ "AllocationsFamiliales"; "enfant_le_plus_âgé.enfants" ] (embed_array embed_enfant) - (try try enfants_a_charge_2078_ with EmptyError -> raise EmptyError + (try try enfants_a_charge_ with EmptyError -> raise EmptyError with EmptyError -> raise EmptyError) with EmptyError -> raise @@ -1538,21 +1527,21 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; }) in - let result_2162_ : enfant_le_plus_age_out = + let result_ : enfant_le_plus_age_out = log_end_call [ "AllocationsFamiliales"; "enfant_le_plus_âgé"; "EnfantLePlusÂgé" ] (log_begin_call [ "AllocationsFamiliales"; "enfant_le_plus_âgé"; "EnfantLePlusÂgé" ] enfant_le_plus_age - { enfants_in = enfant_le_plus_age_dot_enfants_2161_ }) + { enfants_in = enfant_le_plus_age_dot_enfants_ }) in - let enfant_le_plus_age_dot_le_plus_age_2163_ : enfant = result_2162_.le_plus_age_out in - let age_minimum_alinea_1_l521_3_2164_ : enfant -> integer = + let enfant_le_plus_age_dot_le_plus_age_ : enfant = result_.le_plus_age_out in + let age_minimum_alinea_1_l521_3_ : enfant -> integer = log_variable_definition [ "AllocationsFamiliales"; "âge_minimum_alinéa_1_l521_3" ] unembeddable (try - fun (param_2165_ : enfant) -> + fun (param_ : enfant) -> try try try @@ -1575,9 +1564,9 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Code de la sécurité sociale"; ]; } - (param_2165_.date_de_naissance +@ duration_of_numbers 11 0 0 + (param_.date_de_naissance +@ duration_of_numbers 11 0 0 <=@ date_of_numbers 2008 4 30) - then version_avril_2008_dot_age_minimum_alinea_1_l521_3_2151_ + then version_avril_2008_dot_age_minimum_alinea_1_l521_3_ else raise EmptyError with EmptyError -> raise EmptyError with EmptyError -> integer_of_string "14" @@ -1605,7 +1594,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let enfants_a_charge_droit_ouvert_prestation_familiale_2166_ : enfant array = + let enfants_a_charge_droit_ouvert_prestation_familiale_ : enfant array = log_variable_definition [ "AllocationsFamiliales"; "enfants_à_charge_droit_ouvert_prestation_familiale" ] (embed_array embed_enfant) @@ -1613,7 +1602,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i try try array_filter - (fun (enfant_2167_ : _) -> + (fun (enfant_ : _) -> log_end_call [ "PrestationsFamiliales"; "droit_ouvert" ] (log_variable_definition @@ -1621,11 +1610,11 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i unembeddable (log_begin_call [ "PrestationsFamiliales"; "droit_ouvert" ] - prestations_familiales_dot_droit_ouvert_2156_ + prestations_familiales_dot_droit_ouvert_ (log_variable_definition [ "PrestationsFamiliales"; "droit_ouvert"; "input" ] - unembeddable enfant_2167_)))) - enfants_a_charge_2078_ + unembeddable enfant_)))) + enfants_a_charge_ with EmptyError -> raise EmptyError with EmptyError -> raise EmptyError with EmptyError -> @@ -1640,15 +1629,15 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let est_enfant_le_plus_age_2168_ : enfant -> bool = + let est_enfant_le_plus_age_ : enfant -> bool = log_variable_definition [ "AllocationsFamiliales"; "est_enfant_le_plus_âgé" ] unembeddable (try - fun (param_2169_ : enfant) -> + fun (param_ : enfant) -> try try - try enfant_le_plus_age_dot_le_plus_age_2163_ = param_2169_ + try enfant_le_plus_age_dot_le_plus_age_ = param_ with EmptyError -> raise EmptyError with EmptyError -> raise EmptyError with EmptyError -> @@ -1674,7 +1663,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let plafond__i_i_d521_3_2170_ : money = + let plafond__i_i_d521_3_ : money = log_variable_definition [ "AllocationsFamiliales"; "plafond_II_d521_3" ] embed_money @@ -1703,13 +1692,13 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - (date_courante_2077_ >=@ date_of_numbers 2021 1 1 - && date_courante_2077_ <=@ date_of_numbers 2021 12 31) + (date_courante_ >=@ date_of_numbers 2021 1 1 + && date_courante_ <=@ date_of_numbers 2021 12 31) then money_of_cents_string "8155800" +$ money_of_cents_string "582700" *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_) + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_) else raise EmptyError with EmptyError -> raise EmptyError); (fun (_ : _) -> @@ -1733,13 +1722,13 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - (date_courante_2077_ >=@ date_of_numbers 2020 1 1 - && date_courante_2077_ <=@ date_of_numbers 2020 12 31) + (date_courante_ >=@ date_of_numbers 2020 1 1 + && date_courante_ <=@ date_of_numbers 2020 12 31) then money_of_cents_string "8083100" +$ money_of_cents_string "577500" *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_) + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_) else raise EmptyError with EmptyError -> raise EmptyError); (fun (_ : _) -> @@ -1763,13 +1752,13 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - (date_courante_2077_ >=@ date_of_numbers 2019 1 1 - && date_courante_2077_ <=@ date_of_numbers 2019 12 31) + (date_courante_ >=@ date_of_numbers 2019 1 1 + && date_courante_ <=@ date_of_numbers 2019 12 31) then money_of_cents_string "7955800" +$ money_of_cents_string "568400" *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_) + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_) else raise EmptyError with EmptyError -> raise EmptyError); (fun (_ : _) -> @@ -1793,13 +1782,13 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - (date_courante_2077_ >=@ date_of_numbers 2018 1 1 - && date_courante_2077_ <=@ date_of_numbers 2018 12 31) + (date_courante_ >=@ date_of_numbers 2018 1 1 + && date_courante_ <=@ date_of_numbers 2018 12 31) then money_of_cents_string "7877000" +$ money_of_cents_string "562800" *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_) + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_) else raise EmptyError with EmptyError -> raise EmptyError); |] @@ -1819,7 +1808,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i money_of_cents_string "7830000" +$ money_of_cents_string "559500" *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_) + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_) with EmptyError -> raise EmptyError) with EmptyError -> raise EmptyError with EmptyError -> @@ -1834,7 +1823,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let plafond__i_d521_3_2177_ : money = + let plafond__i_d521_3_ : money = log_variable_definition [ "AllocationsFamiliales"; "plafond_I_d521_3" ] embed_money @@ -1863,13 +1852,13 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - (date_courante_2077_ >=@ date_of_numbers 2021 1 1 - && date_courante_2077_ <=@ date_of_numbers 2021 12 31) + (date_courante_ >=@ date_of_numbers 2021 1 1 + && date_courante_ <=@ date_of_numbers 2021 12 31) then money_of_cents_string "5827900" +$ money_of_cents_string "582700" *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_) + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_) else raise EmptyError with EmptyError -> raise EmptyError); (fun (_ : _) -> @@ -1893,13 +1882,13 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - (date_courante_2077_ >=@ date_of_numbers 2020 1 1 - && date_courante_2077_ <=@ date_of_numbers 2020 12 31) + (date_courante_ >=@ date_of_numbers 2020 1 1 + && date_courante_ <=@ date_of_numbers 2020 12 31) then money_of_cents_string "5775900" +$ money_of_cents_string "577500" *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_) + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_) else raise EmptyError with EmptyError -> raise EmptyError); (fun (_ : _) -> @@ -1923,13 +1912,13 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - (date_courante_2077_ >=@ date_of_numbers 2019 1 1 - && date_courante_2077_ <=@ date_of_numbers 2019 12 31) + (date_courante_ >=@ date_of_numbers 2019 1 1 + && date_courante_ <=@ date_of_numbers 2019 12 31) then money_of_cents_string "5684900" +$ money_of_cents_string "568400" *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_) + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_) else raise EmptyError with EmptyError -> raise EmptyError); (fun (_ : _) -> @@ -1953,13 +1942,13 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - (date_courante_2077_ >=@ date_of_numbers 2018 1 1 - && date_courante_2077_ <=@ date_of_numbers 2018 12 31) + (date_courante_ >=@ date_of_numbers 2018 1 1 + && date_courante_ <=@ date_of_numbers 2018 12 31) then money_of_cents_string "5628600" +$ money_of_cents_string "562800" *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_) + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_) else raise EmptyError with EmptyError -> raise EmptyError); |] @@ -1979,7 +1968,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i money_of_cents_string "5595000" +$ money_of_cents_string "559500" *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_) + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_) with EmptyError -> raise EmptyError) with EmptyError -> raise EmptyError with EmptyError -> @@ -1994,7 +1983,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let droit_ouvert_complement_2184_ : bool = + let droit_ouvert_complement_ : bool = log_variable_definition [ "AllocationsFamiliales"; "droit_ouvert_complément" ] embed_bool @@ -2021,8 +2010,8 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Code de la sécurité sociale"; ]; } - (prestations_familiales_dot_regime_outre_mer_l751_1_2159_ - && array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + (prestations_familiales_dot_regime_outre_mer_l751_1_ + && array_length enfants_a_charge_droit_ouvert_prestation_familiale_ = integer_of_string "1") then false else raise EmptyError @@ -2041,12 +2030,12 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let droit_ouvert_forfaitaire_2185_ : enfant -> bool = + let droit_ouvert_forfaitaire_ : enfant -> bool = log_variable_definition [ "AllocationsFamiliales"; "droit_ouvert_forfaitaire" ] unembeddable (try - fun (param_2186_ : enfant) -> + fun (param_ : enfant) -> try try try @@ -2070,8 +2059,8 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Code de la sécurité sociale"; ]; } - (prestations_familiales_dot_regime_outre_mer_l751_1_2159_ - && array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + (prestations_familiales_dot_regime_outre_mer_l751_1_ + && array_length enfants_a_charge_droit_ouvert_prestation_familiale_ = integer_of_string "1") then false else raise EmptyError @@ -2096,9 +2085,9 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Code de la sécurité sociale"; ]; } - (array_length enfants_a_charge_2078_ >=! nombre_enfants_alinea_2_l521_3_2149_ - && param_2186_.age = prestations_familiales_dot_age_l512_3_2_2158_ - && param_2186_.a_deja_ouvert_droit_aux_allocations_familiales + (array_length enfants_a_charge_ >=! nombre_enfants_alinea_2_l521_3_ + && param_.age = prestations_familiales_dot_age_l512_3_2_ + && param_.a_deja_ouvert_droit_aux_allocations_familiales && log_end_call [ "PrestationsFamiliales"; "conditions_hors_âge" ] (log_variable_definition @@ -2106,10 +2095,10 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i unembeddable (log_begin_call [ "PrestationsFamiliales"; "conditions_hors_âge" ] - prestations_familiales_dot_conditions_hors_age_2157_ + prestations_familiales_dot_conditions_hors_age_ (log_variable_definition [ "PrestationsFamiliales"; "conditions_hors_âge"; "input" ] - unembeddable param_2186_)))) + unembeddable param_)))) then true else raise EmptyError with EmptyError -> raise EmptyError) @@ -2137,7 +2126,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let montant_initial_base_quatrieme_enfant_et_plus_mayotte_2187_ : money = + let montant_initial_base_quatrieme_enfant_et_plus_mayotte_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_initial_base_quatrième_enfant_et_plus_mayotte" ] embed_money @@ -2145,12 +2134,12 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i try try if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "3" then - prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.0463" + prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.0463" *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_ -! integer_of_string "3") else money_of_cents_string "0" with EmptyError -> raise EmptyError @@ -2167,7 +2156,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let montant_initial_base_troisieme_enfant_mayotte_2188_ : money = + let montant_initial_base_troisieme_enfant_mayotte_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_initial_base_troisième_enfant_mayotte" ] embed_money @@ -2194,14 +2183,13 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - (date_courante_2077_ >=@ date_of_numbers 2020 1 1 - && date_courante_2077_ <=@ date_of_numbers 2020 12 31) + (date_courante_ >=@ date_of_numbers 2020 1 1 + && date_courante_ <=@ date_of_numbers 2020 12 31) then if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "2" - then - prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.143" + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.143" else money_of_cents_string "0" else raise EmptyError with EmptyError -> raise EmptyError); @@ -2224,14 +2212,13 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - (date_courante_2077_ >=@ date_of_numbers 2019 1 1 - && date_courante_2077_ <=@ date_of_numbers 2019 12 31) + (date_courante_ >=@ date_of_numbers 2019 1 1 + && date_courante_ <=@ date_of_numbers 2019 12 31) then if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "2" - then - prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.1259" + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.1259" else money_of_cents_string "0" else raise EmptyError with EmptyError -> raise EmptyError); @@ -2254,14 +2241,13 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - (date_courante_2077_ >=@ date_of_numbers 2018 1 1 - && date_courante_2077_ <=@ date_of_numbers 2018 12 31) + (date_courante_ >=@ date_of_numbers 2018 1 1 + && date_courante_ <=@ date_of_numbers 2018 12 31) then if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "2" - then - prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.1089" + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.1089" else money_of_cents_string "0" else raise EmptyError with EmptyError -> raise EmptyError); @@ -2284,14 +2270,13 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - (date_courante_2077_ >=@ date_of_numbers 2017 1 1 - && date_courante_2077_ <=@ date_of_numbers 2017 12 31) + (date_courante_ >=@ date_of_numbers 2017 1 1 + && date_courante_ <=@ date_of_numbers 2017 12 31) then if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "2" - then - prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.0918" + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.0918" else money_of_cents_string "0" else raise EmptyError with EmptyError -> raise EmptyError); @@ -2314,14 +2299,13 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - (date_courante_2077_ >=@ date_of_numbers 2016 1 1 - && date_courante_2077_ <=@ date_of_numbers 2016 12 31) + (date_courante_ >=@ date_of_numbers 2016 1 1 + && date_courante_ <=@ date_of_numbers 2016 12 31) then if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "2" - then - prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.0842" + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.0842" else money_of_cents_string "0" else raise EmptyError with EmptyError -> raise EmptyError); @@ -2344,14 +2328,13 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - (date_courante_2077_ >=@ date_of_numbers 2015 1 1 - && date_courante_2077_ <=@ date_of_numbers 2015 12 31) + (date_courante_ >=@ date_of_numbers 2015 1 1 + && date_courante_ <=@ date_of_numbers 2015 12 31) then if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "2" - then - prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.0766" + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.0766" else money_of_cents_string "0" else raise EmptyError with EmptyError -> raise EmptyError); @@ -2374,14 +2357,13 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - (date_courante_2077_ >=@ date_of_numbers 2014 1 1 - && date_courante_2077_ <=@ date_of_numbers 2014 12 31) + (date_courante_ >=@ date_of_numbers 2014 1 1 + && date_courante_ <=@ date_of_numbers 2014 12 31) then if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "2" - then - prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.069" + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.069" else money_of_cents_string "0" else raise EmptyError with EmptyError -> raise EmptyError); @@ -2404,14 +2386,13 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - (date_courante_2077_ >=@ date_of_numbers 2013 1 1 - && date_courante_2077_ <=@ date_of_numbers 2013 12 31) + (date_courante_ >=@ date_of_numbers 2013 1 1 + && date_courante_ <=@ date_of_numbers 2013 12 31) then if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "2" - then - prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.075" + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.075" else money_of_cents_string "0" else raise EmptyError with EmptyError -> raise EmptyError); @@ -2434,14 +2415,13 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - (date_courante_2077_ >=@ date_of_numbers 2012 1 1 - && date_courante_2077_ <=@ date_of_numbers 2012 12 31) + (date_courante_ >=@ date_of_numbers 2012 1 1 + && date_courante_ <=@ date_of_numbers 2012 12 31) then if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "2" - then - prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.0539" + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.0539" else money_of_cents_string "0" else raise EmptyError with EmptyError -> raise EmptyError); @@ -2464,14 +2444,13 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - (date_courante_2077_ >=@ date_of_numbers 2011 1 1 - && date_courante_2077_ <=@ date_of_numbers 2011 12 31) + (date_courante_ >=@ date_of_numbers 2011 1 1 + && date_courante_ <=@ date_of_numbers 2011 12 31) then if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "2" - then - prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.0463" + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.0463" else money_of_cents_string "0" else raise EmptyError with EmptyError -> raise EmptyError); @@ -2490,9 +2469,9 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i (fun (_ : _) -> try if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "2" - then prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.16" + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.16" else money_of_cents_string "0" with EmptyError -> raise EmptyError) with EmptyError -> raise EmptyError @@ -2508,7 +2487,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let montant_initial_base_deuxieme_enfant_mayotte_2201_ : money = + let montant_initial_base_deuxieme_enfant_mayotte_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_initial_base_deuxième_enfant_mayotte" ] embed_money @@ -2535,14 +2514,13 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - (date_courante_2077_ >=@ date_of_numbers 2020 1 1 - && date_courante_2077_ <=@ date_of_numbers 2020 12 31) + (date_courante_ >=@ date_of_numbers 2020 1 1 + && date_courante_ <=@ date_of_numbers 2020 12 31) then if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "1" - then - prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.3068" + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.3068" else money_of_cents_string "0" else raise EmptyError with EmptyError -> raise EmptyError); @@ -2565,14 +2543,13 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - (date_courante_2077_ >=@ date_of_numbers 2019 1 1 - && date_courante_2077_ <=@ date_of_numbers 2019 12 31) + (date_courante_ >=@ date_of_numbers 2019 1 1 + && date_courante_ <=@ date_of_numbers 2019 12 31) then if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "1" - then - prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.2936" + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.2936" else money_of_cents_string "0" else raise EmptyError with EmptyError -> raise EmptyError); @@ -2595,14 +2572,13 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - (date_courante_2077_ >=@ date_of_numbers 2018 1 1 - && date_courante_2077_ <=@ date_of_numbers 2018 12 31) + (date_courante_ >=@ date_of_numbers 2018 1 1 + && date_courante_ <=@ date_of_numbers 2018 12 31) then if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "1" - then - prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.284" + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.284" else money_of_cents_string "0" else raise EmptyError with EmptyError -> raise EmptyError); @@ -2625,14 +2601,13 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - (date_courante_2077_ >=@ date_of_numbers 2017 1 1 - && date_courante_2077_ <=@ date_of_numbers 2017 12 31) + (date_courante_ >=@ date_of_numbers 2017 1 1 + && date_courante_ <=@ date_of_numbers 2017 12 31) then if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "1" - then - prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.2672" + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.2672" else money_of_cents_string "0" else raise EmptyError with EmptyError -> raise EmptyError); @@ -2655,14 +2630,13 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - (date_courante_2077_ >=@ date_of_numbers 2016 1 1 - && date_courante_2077_ <=@ date_of_numbers 2016 12 31) + (date_courante_ >=@ date_of_numbers 2016 1 1 + && date_courante_ <=@ date_of_numbers 2016 12 31) then if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "1" - then - prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.273" + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.273" else money_of_cents_string "0" else raise EmptyError with EmptyError -> raise EmptyError); @@ -2685,14 +2659,13 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - (date_courante_2077_ >=@ date_of_numbers 2015 1 1 - && date_courante_2077_ <=@ date_of_numbers 2015 12 31) + (date_courante_ >=@ date_of_numbers 2015 1 1 + && date_courante_ <=@ date_of_numbers 2015 12 31) then if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "1" - then - prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.2555" + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.2555" else money_of_cents_string "0" else raise EmptyError with EmptyError -> raise EmptyError); @@ -2715,14 +2688,13 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - (date_courante_2077_ >=@ date_of_numbers 2014 1 1 - && date_courante_2077_ <=@ date_of_numbers 2014 12 31) + (date_courante_ >=@ date_of_numbers 2014 1 1 + && date_courante_ <=@ date_of_numbers 2014 12 31) then if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "1" - then - prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.2496" + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.2496" else money_of_cents_string "0" else raise EmptyError with EmptyError -> raise EmptyError); @@ -2745,14 +2717,13 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - (date_courante_2077_ >=@ date_of_numbers 2013 1 1 - && date_courante_2077_ <=@ date_of_numbers 2013 12 31) + (date_courante_ >=@ date_of_numbers 2013 1 1 + && date_courante_ <=@ date_of_numbers 2013 12 31) then if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "1" - then - prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.2437" + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.2437" else money_of_cents_string "0" else raise EmptyError with EmptyError -> raise EmptyError); @@ -2775,14 +2746,13 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - (date_courante_2077_ >=@ date_of_numbers 2012 1 1 - && date_courante_2077_ <=@ date_of_numbers 2012 12 31) + (date_courante_ >=@ date_of_numbers 2012 1 1 + && date_courante_ <=@ date_of_numbers 2012 12 31) then if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "1" - then - prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.2379" + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.2379" else money_of_cents_string "0" else raise EmptyError with EmptyError -> raise EmptyError); @@ -2805,14 +2775,13 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - (date_courante_2077_ >=@ date_of_numbers 2011 1 1 - && date_courante_2077_ <=@ date_of_numbers 2011 12 31) + (date_courante_ >=@ date_of_numbers 2011 1 1 + && date_courante_ <=@ date_of_numbers 2011 12 31) then if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "1" - then - prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.232" + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.232" else money_of_cents_string "0" else raise EmptyError with EmptyError -> raise EmptyError); @@ -2831,9 +2800,9 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i (fun (_ : _) -> try if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "1" - then prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.32" + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.32" else money_of_cents_string "0" with EmptyError -> raise EmptyError) with EmptyError -> raise EmptyError @@ -2849,7 +2818,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let montant_initial_base_premier_enfant_mayotte_2214_ : money = + let montant_initial_base_premier_enfant_mayotte_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_initial_base_premier_enfant_mayotte" ] embed_money @@ -2876,10 +2845,10 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - avait_enfant_a_charge_avant_1er_janvier_2012_2079_ + avait_enfant_a_charge_avant_1er_janvier_2012_ then if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "0" then money_of_cents_string "5728" else money_of_cents_string "0" @@ -2904,15 +2873,14 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - (date_courante_2077_ >=@ date_of_numbers 2020 1 1 - && date_courante_2077_ <=@ date_of_numbers 2020 12 31 - && not avait_enfant_a_charge_avant_1er_janvier_2012_2079_) + (date_courante_ >=@ date_of_numbers 2020 1 1 + && date_courante_ <=@ date_of_numbers 2020 12 31 + && not avait_enfant_a_charge_avant_1er_janvier_2012_) then if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "0" - then - prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.0717" + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.0717" else money_of_cents_string "0" else raise EmptyError with EmptyError -> raise EmptyError); @@ -2935,15 +2903,14 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - (date_courante_2077_ >=@ date_of_numbers 2019 1 1 - && date_courante_2077_ <=@ date_of_numbers 2019 12 31 - && not avait_enfant_a_charge_avant_1er_janvier_2012_2079_) + (date_courante_ >=@ date_of_numbers 2019 1 1 + && date_courante_ <=@ date_of_numbers 2019 12 31 + && not avait_enfant_a_charge_avant_1er_janvier_2012_) then if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "0" - then - prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.0847" + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.0847" else money_of_cents_string "0" else raise EmptyError with EmptyError -> raise EmptyError); @@ -2966,15 +2933,14 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - (date_courante_2077_ >=@ date_of_numbers 2018 1 1 - && date_courante_2077_ <=@ date_of_numbers 2018 12 31 - && not avait_enfant_a_charge_avant_1er_janvier_2012_2079_) + (date_courante_ >=@ date_of_numbers 2018 1 1 + && date_courante_ <=@ date_of_numbers 2018 12 31 + && not avait_enfant_a_charge_avant_1er_janvier_2012_) then if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "0" - then - prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.0976" + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.0976" else money_of_cents_string "0" else raise EmptyError with EmptyError -> raise EmptyError); @@ -2997,15 +2963,14 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - (date_courante_2077_ >=@ date_of_numbers 2017 1 1 - && date_courante_2077_ <=@ date_of_numbers 2017 12 31 - && not avait_enfant_a_charge_avant_1er_janvier_2012_2079_) + (date_courante_ >=@ date_of_numbers 2017 1 1 + && date_courante_ <=@ date_of_numbers 2017 12 31 + && not avait_enfant_a_charge_avant_1er_janvier_2012_) then if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "0" - then - prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.115" + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.115" else money_of_cents_string "0" else raise EmptyError with EmptyError -> raise EmptyError); @@ -3028,15 +2993,14 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - (date_courante_2077_ >=@ date_of_numbers 2016 1 1 - && date_courante_2077_ <=@ date_of_numbers 2016 12 31 - && not avait_enfant_a_charge_avant_1er_janvier_2012_2079_) + (date_courante_ >=@ date_of_numbers 2016 1 1 + && date_courante_ <=@ date_of_numbers 2016 12 31 + && not avait_enfant_a_charge_avant_1er_janvier_2012_) then if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "0" - then - prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.1163" + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.1163" else money_of_cents_string "0" else raise EmptyError with EmptyError -> raise EmptyError); @@ -3059,15 +3023,14 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - (date_courante_2077_ >=@ date_of_numbers 2015 1 1 - && date_courante_2077_ <=@ date_of_numbers 2015 12 31 - && not avait_enfant_a_charge_avant_1er_janvier_2012_2079_) + (date_courante_ >=@ date_of_numbers 2015 1 1 + && date_courante_ <=@ date_of_numbers 2015 12 31 + && not avait_enfant_a_charge_avant_1er_janvier_2012_) then if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "0" - then - prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.122" + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.122" else money_of_cents_string "0" else raise EmptyError with EmptyError -> raise EmptyError); @@ -3090,15 +3053,14 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - (date_courante_2077_ >=@ date_of_numbers 2014 1 1 - && date_courante_2077_ <=@ date_of_numbers 2014 12 31 - && not avait_enfant_a_charge_avant_1er_janvier_2012_2079_) + (date_courante_ >=@ date_of_numbers 2014 1 1 + && date_courante_ <=@ date_of_numbers 2014 12 31 + && not avait_enfant_a_charge_avant_1er_janvier_2012_) then if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "0" - then - prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.1278" + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.1278" else money_of_cents_string "0" else raise EmptyError with EmptyError -> raise EmptyError); @@ -3121,15 +3083,14 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - (date_courante_2077_ >=@ date_of_numbers 2013 1 1 - && date_courante_2077_ <=@ date_of_numbers 2013 12 31 - && not avait_enfant_a_charge_avant_1er_janvier_2012_2079_) + (date_courante_ >=@ date_of_numbers 2013 1 1 + && date_courante_ <=@ date_of_numbers 2013 12 31 + && not avait_enfant_a_charge_avant_1er_janvier_2012_) then if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "0" - then - prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.1335" + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.1335" else money_of_cents_string "0" else raise EmptyError with EmptyError -> raise EmptyError); @@ -3152,15 +3113,14 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - (date_courante_2077_ >=@ date_of_numbers 2012 1 1 - && date_courante_2077_ <=@ date_of_numbers 2012 12 31 - && not avait_enfant_a_charge_avant_1er_janvier_2012_2079_) + (date_courante_ >=@ date_of_numbers 2012 1 1 + && date_courante_ <=@ date_of_numbers 2012 12 31 + && not avait_enfant_a_charge_avant_1er_janvier_2012_) then if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "0" - then - prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.1393" + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.1393" else money_of_cents_string "0" else raise EmptyError with EmptyError -> raise EmptyError); @@ -3183,15 +3143,14 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - (date_courante_2077_ >=@ date_of_numbers 2011 1 1 - && date_courante_2077_ <=@ date_of_numbers 2011 12 31 - && not avait_enfant_a_charge_avant_1er_janvier_2012_2079_) + (date_courante_ >=@ date_of_numbers 2011 1 1 + && date_courante_ <=@ date_of_numbers 2011 12 31 + && not avait_enfant_a_charge_avant_1er_janvier_2012_) then if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "0" - then - prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.145" + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.145" else money_of_cents_string "0" else raise EmptyError with EmptyError -> raise EmptyError); @@ -3210,9 +3169,9 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i (fun (_ : _) -> try if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "0" - then prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.0588" + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.0588" else money_of_cents_string "0" with EmptyError -> raise EmptyError) with EmptyError -> raise EmptyError @@ -3228,15 +3187,13 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let nombre_total_enfants_2228_ : decimal = + let nombre_total_enfants_ : decimal = log_variable_definition [ "AllocationsFamiliales"; "nombre_total_enfants" ] embed_decimal (try try - try - decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_) + try decimal_of_integer (array_length enfants_a_charge_droit_ouvert_prestation_familiale_) with EmptyError -> raise EmptyError with EmptyError -> raise EmptyError with EmptyError -> @@ -3251,7 +3208,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let nombre_moyen_enfants_2229_ : decimal = + let nombre_moyen_enfants_ : decimal = log_variable_definition [ "AllocationsFamiliales"; "nombre_moyen_enfants" ] embed_decimal @@ -3259,8 +3216,8 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i try try Array.fold_left - (fun (acc_2230_ : decimal) (enfant_2231_ : _) -> - acc_2230_ + (fun (acc_ : decimal) (enfant_ : _) -> + acc_ +& match log_end_call @@ -3270,15 +3227,15 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i unembeddable (log_begin_call [ "AllocationsFamiliales"; "prise_en_compte" ] - prise_en_compte_2080_ + prise_en_compte_ (log_variable_definition [ "AllocationsFamiliales"; "prise_en_compte"; "input" ] - unembeddable enfant_2231_))) + unembeddable enfant_))) with | Complete _ -> decimal_of_string "1." | Partagee _ -> decimal_of_string "0.5" | Zero _ -> decimal_of_string "0.") - (decimal_of_string "0.") enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + (decimal_of_string "0.") enfants_a_charge_droit_ouvert_prestation_familiale_ with EmptyError -> raise EmptyError with EmptyError -> raise EmptyError with EmptyError -> @@ -3293,7 +3250,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let montant_initial_base_premier_enfant_2235_ : money = + let montant_initial_base_premier_enfant_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_initial_base_premier_enfant" ] embed_money @@ -3319,10 +3276,10 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Code de la sécurité sociale"; ]; } - (prestations_familiales_dot_regime_outre_mer_l751_1_2159_ - && array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + (prestations_familiales_dot_regime_outre_mer_l751_1_ + && array_length enfants_a_charge_droit_ouvert_prestation_familiale_ = integer_of_string "1") - then prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.0588" + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.0588" else raise EmptyError with EmptyError -> raise EmptyError with EmptyError -> money_of_cents_string "0" @@ -3339,7 +3296,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let droit_ouvert_base_2236_ : bool = + let droit_ouvert_base_ : bool = log_variable_definition [ "AllocationsFamiliales"; "droit_ouvert_base" ] embed_bool @@ -3366,8 +3323,8 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - (residence_2076_ = Mayotte () - && array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + (residence_ = Mayotte () + && array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >=! integer_of_string "1") then true else raise EmptyError @@ -3393,8 +3350,8 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Code de la sécurité sociale"; ]; } - (prestations_familiales_dot_regime_outre_mer_l751_1_2159_ - && array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + (prestations_familiales_dot_regime_outre_mer_l751_1_ + && array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >=! integer_of_string "1") then true else raise EmptyError @@ -3431,7 +3388,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Code de la sécurité sociale"; ]; } - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >=! integer_of_string "2") then true else raise EmptyError @@ -3449,12 +3406,12 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let droit_ouvert_majoration_2241_ : enfant -> bool = + let droit_ouvert_majoration_ : enfant -> bool = log_variable_definition [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] unembeddable (try - fun (param_2242_ : enfant) -> + fun (param_ : enfant) -> try try try @@ -3477,9 +3434,9 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Code de la sécurité sociale"; ]; } - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ - >=! nombre_enfants_alinea_2_l521_3_2149_ - && param_2242_.age + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_ + >=! nombre_enfants_alinea_2_l521_3_ + && param_.age >=! log_end_call [ "AllocationsFamiliales"; "âge_minimum_alinéa_1_l521_3" ] (log_variable_definition @@ -3491,14 +3448,14 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i unembeddable (log_begin_call [ "AllocationsFamiliales"; "âge_minimum_alinéa_1_l521_3" ] - age_minimum_alinea_1_l521_3_2164_ + age_minimum_alinea_1_l521_3_ (log_variable_definition [ "AllocationsFamiliales"; "âge_minimum_alinéa_1_l521_3"; "input"; ] - unembeddable param_2242_)))) + unembeddable param_)))) then true else raise EmptyError with EmptyError -> raise EmptyError @@ -3530,13 +3487,13 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i unembeddable (log_begin_call [ "AllocationsFamiliales"; "est_enfant_le_plus_âgé" ] - est_enfant_le_plus_age_2168_ + est_enfant_le_plus_age_ (log_variable_definition [ "AllocationsFamiliales"; "est_enfant_le_plus_âgé"; "input"; ] - unembeddable param_2242_))))) - && param_2242_.age + unembeddable param_))))) + && param_.age >=! log_end_call [ "AllocationsFamiliales"; "âge_minimum_alinéa_1_l521_3" ] (log_variable_definition @@ -3548,14 +3505,14 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i unembeddable (log_begin_call [ "AllocationsFamiliales"; "âge_minimum_alinéa_1_l521_3" ] - age_minimum_alinea_1_l521_3_2164_ + age_minimum_alinea_1_l521_3_ (log_variable_definition [ "AllocationsFamiliales"; "âge_minimum_alinéa_1_l521_3"; "input"; ] - unembeddable param_2242_)))) + unembeddable param_)))) then true else raise EmptyError with EmptyError -> raise EmptyError) @@ -3583,12 +3540,12 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let complement_degressif_2243_ : money -> money = + let complement_degressif_ : money -> money = log_variable_definition [ "AllocationsFamiliales"; "complément_dégressif" ] unembeddable (try - fun (param_2244_ : money) -> + fun (param_ : money) -> try try handle_default @@ -3613,13 +3570,12 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Code de la sécurité sociale"; ]; } - (ressources_menage_2075_ >$ plafond__i_i_d521_3_2170_ - && ressources_menage_2075_ - <=$ plafond__i_i_d521_3_2170_ - +$ (param_2244_ *$ decimal_of_string "12.")) + (ressources_menage_ >$ plafond__i_i_d521_3_ + && ressources_menage_ + <=$ plafond__i_i_d521_3_ +$ (param_ *$ decimal_of_string "12.")) then - (plafond__i_i_d521_3_2170_ - +$ ((param_2244_ *$ decimal_of_string "12.") -$ ressources_menage_2075_)) + (plafond__i_i_d521_3_ + +$ ((param_ *$ decimal_of_string "12.") -$ ressources_menage_)) *$ (decimal_of_string "1." /& decimal_of_string "12.") else raise EmptyError with EmptyError -> raise EmptyError); @@ -3643,13 +3599,12 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Code de la sécurité sociale"; ]; } - (ressources_menage_2075_ >$ plafond__i_d521_3_2177_ - && ressources_menage_2075_ - <=$ plafond__i_d521_3_2177_ +$ (param_2244_ *$ decimal_of_string "12.") - ) + (ressources_menage_ >$ plafond__i_d521_3_ + && ressources_menage_ + <=$ plafond__i_d521_3_ +$ (param_ *$ decimal_of_string "12.")) then - (plafond__i_d521_3_2177_ - +$ ((param_2244_ *$ decimal_of_string "12.") -$ ressources_menage_2075_)) + (plafond__i_d521_3_ + +$ ((param_ *$ decimal_of_string "12.") -$ ressources_menage_)) *$ (decimal_of_string "1." /& decimal_of_string "12.") else raise EmptyError with EmptyError -> raise EmptyError); @@ -3690,7 +3645,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let montant_verse_forfaitaire_par_enfant_2249_ : money = + let montant_verse_forfaitaire_par_enfant_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_versé_forfaitaire_par_enfant" ] embed_money @@ -3717,8 +3672,8 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Code de la sécurité sociale"; ]; } - (ressources_menage_2075_ >$ plafond__i_i_d521_3_2170_) - then prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.0559" + (ressources_menage_ >$ plafond__i_i_d521_3_) + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.0559" else raise EmptyError with EmptyError -> raise EmptyError); (fun (_ : _) -> @@ -3741,9 +3696,9 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Code de la sécurité sociale"; ]; } - (ressources_menage_2075_ >$ plafond__i_d521_3_2177_ - && ressources_menage_2075_ <=$ plafond__i_i_d521_3_2170_) - then prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.1117" + (ressources_menage_ >$ plafond__i_d521_3_ + && ressources_menage_ <=$ plafond__i_i_d521_3_) + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.1117" else raise EmptyError with EmptyError -> raise EmptyError); (fun (_ : _) -> @@ -3766,8 +3721,8 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Code de la sécurité sociale"; ]; } - (ressources_menage_2075_ <=$ plafond__i_d521_3_2177_) - then prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.20234" + (ressources_menage_ <=$ plafond__i_d521_3_) + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.20234" else raise EmptyError with EmptyError -> raise EmptyError); |] @@ -3795,7 +3750,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let montant_initial_base_troisieme_enfant_et_plus_2255_ : money = + let montant_initial_base_troisieme_enfant_et_plus_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_initial_base_troisième_enfant_et_plus" ] embed_money @@ -3822,15 +3777,15 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Code de la sécurité sociale"; ]; } - (ressources_menage_2075_ >$ plafond__i_i_d521_3_2170_) + (ressources_menage_ >$ plafond__i_i_d521_3_) then if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "2" then - prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.1025" + prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.1025" *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_ -! integer_of_string "2") else money_of_cents_string "0" else raise EmptyError @@ -3855,16 +3810,16 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Code de la sécurité sociale"; ]; } - (ressources_menage_2075_ >$ plafond__i_d521_3_2177_ - && ressources_menage_2075_ <=$ plafond__i_i_d521_3_2170_) + (ressources_menage_ >$ plafond__i_d521_3_ + && ressources_menage_ <=$ plafond__i_i_d521_3_) then if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "2" then - prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.205" + prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.205" *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_ -! integer_of_string "2") else money_of_cents_string "0" else raise EmptyError @@ -3889,15 +3844,15 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Code de la sécurité sociale"; ]; } - (ressources_menage_2075_ <=$ plafond__i_d521_3_2177_) + (ressources_menage_ <=$ plafond__i_d521_3_) then if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "2" then - prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.41" + prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.41" *$ decimal_of_integer - (array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + (array_length enfants_a_charge_droit_ouvert_prestation_familiale_ -! integer_of_string "2") else money_of_cents_string "0" else raise EmptyError @@ -3927,7 +3882,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let montant_initial_base_deuxieme_enfant_2261_ : money = + let montant_initial_base_deuxieme_enfant_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_initial_base_deuxième_enfant" ] embed_money @@ -3954,12 +3909,12 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Code de la sécurité sociale"; ]; } - (ressources_menage_2075_ >$ plafond__i_i_d521_3_2170_) + (ressources_menage_ >$ plafond__i_i_d521_3_) then if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "1" - then prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.08" + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.08" else money_of_cents_string "0" else raise EmptyError with EmptyError -> raise EmptyError); @@ -3983,13 +3938,13 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Code de la sécurité sociale"; ]; } - (ressources_menage_2075_ >$ plafond__i_d521_3_2177_ - && ressources_menage_2075_ <=$ plafond__i_i_d521_3_2170_) + (ressources_menage_ >$ plafond__i_d521_3_ + && ressources_menage_ <=$ plafond__i_i_d521_3_) then if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "1" - then prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.16" + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.16" else money_of_cents_string "0" else raise EmptyError with EmptyError -> raise EmptyError); @@ -4013,12 +3968,12 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Code de la sécurité sociale"; ]; } - (ressources_menage_2075_ <=$ plafond__i_d521_3_2177_) + (ressources_menage_ <=$ plafond__i_d521_3_) then if - array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + array_length enfants_a_charge_droit_ouvert_prestation_familiale_ >! integer_of_string "1" - then prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.32" + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.32" else money_of_cents_string "0" else raise EmptyError with EmptyError -> raise EmptyError); @@ -4047,15 +4002,15 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let rapport_enfants_total_moyen_2267_ : decimal = + let rapport_enfants_total_moyen_ : decimal = log_variable_definition [ "AllocationsFamiliales"; "rapport_enfants_total_moyen" ] embed_decimal (try try try - if nombre_total_enfants_2228_ = decimal_of_string "0." then decimal_of_string "0." - else nombre_moyen_enfants_2229_ /& nombre_total_enfants_2228_ + if nombre_total_enfants_ = decimal_of_string "0." then decimal_of_string "0." + else nombre_moyen_enfants_ /& nombre_total_enfants_ with EmptyError -> raise EmptyError with EmptyError -> raise EmptyError with EmptyError -> @@ -4070,12 +4025,12 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let montant_initial_metropole_majoration_2268_ : enfant -> money = + let montant_initial_metropole_majoration_ : enfant -> money = log_variable_definition [ "AllocationsFamiliales"; "montant_initial_métropole_majoration" ] unembeddable (try - fun (param_2269_ : enfant) -> + fun (param_ : enfant) -> try handle_default [| @@ -4099,14 +4054,14 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i unembeddable (log_begin_call [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - droit_ouvert_majoration_2241_ + droit_ouvert_majoration_ (log_variable_definition [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "input"; ] - unembeddable param_2269_))))) + unembeddable param_))))) then money_of_cents_string "0" else raise EmptyError with EmptyError -> raise EmptyError); @@ -4130,7 +4085,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Code de la sécurité sociale"; ]; } - (ressources_menage_2075_ >$ plafond__i_i_d521_3_2170_ + (ressources_menage_ >$ plafond__i_i_d521_3_ && log_end_call [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] (log_variable_definition @@ -4138,14 +4093,13 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i unembeddable (log_begin_call [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - droit_ouvert_majoration_2241_ + droit_ouvert_majoration_ (log_variable_definition [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "input"; ] - unembeddable param_2269_)))) - then - prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.04" + unembeddable param_)))) + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.04" else raise EmptyError with EmptyError -> raise EmptyError); (fun (_ : _) -> @@ -4168,8 +4122,8 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Code de la sécurité sociale"; ]; } - ((ressources_menage_2075_ >$ plafond__i_d521_3_2177_ - && ressources_menage_2075_ <=$ plafond__i_i_d521_3_2170_) + ((ressources_menage_ >$ plafond__i_d521_3_ + && ressources_menage_ <=$ plafond__i_i_d521_3_) && log_end_call [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] (log_variable_definition @@ -4177,14 +4131,13 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i unembeddable (log_begin_call [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - droit_ouvert_majoration_2241_ + droit_ouvert_majoration_ (log_variable_definition [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "input"; ] - unembeddable param_2269_)))) - then - prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.08" + unembeddable param_)))) + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.08" else raise EmptyError with EmptyError -> raise EmptyError); (fun (_ : _) -> @@ -4207,7 +4160,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Code de la sécurité sociale"; ]; } - (ressources_menage_2075_ <=$ plafond__i_d521_3_2177_ + (ressources_menage_ <=$ plafond__i_d521_3_ && log_end_call [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] (log_variable_definition @@ -4215,14 +4168,13 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i unembeddable (log_begin_call [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - droit_ouvert_majoration_2241_ + droit_ouvert_majoration_ (log_variable_definition [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "input"; ] - unembeddable param_2269_)))) - then - prestations_familiales_dot_base_mensuelle_2160_ *$ decimal_of_string "0.16" + unembeddable param_)))) + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.16" else raise EmptyError with EmptyError -> raise EmptyError); |] @@ -4261,17 +4213,17 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let montant_verse_forfaitaire_2276_ : money = + let montant_verse_forfaitaire_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_versé_forfaitaire" ] embed_money (try try try - montant_verse_forfaitaire_par_enfant_2249_ + montant_verse_forfaitaire_par_enfant_ *$ decimal_of_integer (Array.fold_left - (fun (acc_2277_ : integer) (enfant_2278_ : _) -> + (fun (acc_ : integer) (enfant_ : _) -> if log_end_call [ "AllocationsFamiliales"; "droit_ouvert_forfaitaire" ] @@ -4280,13 +4232,13 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i unembeddable (log_begin_call [ "AllocationsFamiliales"; "droit_ouvert_forfaitaire" ] - droit_ouvert_forfaitaire_2185_ + droit_ouvert_forfaitaire_ (log_variable_definition [ "AllocationsFamiliales"; "droit_ouvert_forfaitaire"; "input" ] - unembeddable enfant_2278_))) - then acc_2277_ +! integer_of_string "1" - else acc_2277_) - (integer_of_string "0") enfants_a_charge_2078_) + unembeddable enfant_))) + then acc_ +! integer_of_string "1" + else acc_) + (integer_of_string "0") enfants_a_charge_) with EmptyError -> raise EmptyError with EmptyError -> raise EmptyError with EmptyError -> @@ -4301,7 +4253,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let montant_initial_base_2279_ : money = + let montant_initial_base_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_initial_base" ] embed_money @@ -4328,12 +4280,12 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Décrets divers"; ]; } - (residence_2076_ = Mayotte ()) + (residence_ = Mayotte ()) then - montant_initial_base_premier_enfant_mayotte_2214_ - +$ (montant_initial_base_deuxieme_enfant_mayotte_2201_ - +$ (montant_initial_base_troisieme_enfant_mayotte_2188_ - +$ montant_initial_base_quatrieme_enfant_et_plus_mayotte_2187_)) + montant_initial_base_premier_enfant_mayotte_ + +$ (montant_initial_base_deuxieme_enfant_mayotte_ + +$ (montant_initial_base_troisieme_enfant_mayotte_ + +$ montant_initial_base_quatrieme_enfant_et_plus_mayotte_)) else raise EmptyError with EmptyError -> raise EmptyError); (fun (_ : _) -> @@ -4356,10 +4308,10 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Code de la sécurité sociale"; ]; } - (prestations_familiales_dot_regime_outre_mer_l751_1_2159_ - && array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + (prestations_familiales_dot_regime_outre_mer_l751_1_ + && array_length enfants_a_charge_droit_ouvert_prestation_familiale_ = integer_of_string "1") - then montant_initial_base_premier_enfant_2235_ + then montant_initial_base_premier_enfant_ else raise EmptyError with EmptyError -> raise EmptyError); |] @@ -4376,8 +4328,8 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i true) (fun (_ : _) -> try - montant_initial_base_deuxieme_enfant_2261_ - +$ montant_initial_base_troisieme_enfant_et_plus_2255_ + montant_initial_base_deuxieme_enfant_ + +$ montant_initial_base_troisieme_enfant_et_plus_ with EmptyError -> raise EmptyError) with EmptyError -> raise EmptyError with EmptyError -> @@ -4392,12 +4344,12 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let montant_initial_majoration_2284_ : enfant -> money = + let montant_initial_majoration_ : enfant -> money = log_variable_definition [ "AllocationsFamiliales"; "montant_initial_majoration" ] unembeddable (try - fun (param_2285_ : enfant) -> + fun (param_ : enfant) -> try try handle_default @@ -4429,19 +4381,17 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i unembeddable (log_begin_call [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - droit_ouvert_majoration_2241_ + droit_ouvert_majoration_ (log_variable_definition [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "input"; ] - unembeddable param_2285_))) - && prestations_familiales_dot_regime_outre_mer_l751_1_2159_ - && array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + unembeddable param_))) + && prestations_familiales_dot_regime_outre_mer_l751_1_ + && array_length enfants_a_charge_droit_ouvert_prestation_familiale_ = integer_of_string "1" - && param_2285_.age >=! integer_of_string "16") - then - prestations_familiales_dot_base_mensuelle_2160_ - *$ decimal_of_string "0.0567" + && param_.age >=! integer_of_string "16") + then prestations_familiales_dot_base_mensuelle_ *$ decimal_of_string "0.0567" else raise EmptyError with EmptyError -> raise EmptyError); (fun (_ : _) -> @@ -4471,20 +4421,18 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i unembeddable (log_begin_call [ "AllocationsFamiliales"; "droit_ouvert_majoration" ] - droit_ouvert_majoration_2241_ + droit_ouvert_majoration_ (log_variable_definition [ "AllocationsFamiliales"; "droit_ouvert_majoration"; "input"; ] - unembeddable param_2285_))) - && prestations_familiales_dot_regime_outre_mer_l751_1_2159_ - && array_length enfants_a_charge_droit_ouvert_prestation_familiale_2166_ + unembeddable param_))) + && prestations_familiales_dot_regime_outre_mer_l751_1_ + && array_length enfants_a_charge_droit_ouvert_prestation_familiale_ = integer_of_string "1" - && param_2285_.age >=! integer_of_string "11" - && param_2285_.age =! integer_of_string "11" + && param_.age raise EmptyError); |] @@ -4512,14 +4460,14 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i unembeddable (log_begin_call [ "AllocationsFamiliales"; "montant_initial_métropole_majoration" ] - montant_initial_metropole_majoration_2268_ + montant_initial_metropole_majoration_ (log_variable_definition [ "AllocationsFamiliales"; "montant_initial_métropole_majoration"; "input"; ] - unembeddable param_2285_))) + unembeddable param_))) with EmptyError -> raise EmptyError) with EmptyError -> raise EmptyError with EmptyError -> @@ -4545,7 +4493,7 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let montant_verse_complement_pour_forfaitaire_2290_ : money = + let montant_verse_complement_pour_forfaitaire_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_versé_complément_pour_forfaitaire" ] embed_money @@ -4573,14 +4521,14 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Code de la sécurité sociale"; ]; } - (ressources_menage_2075_ >$ plafond__i_i_d521_3_2170_ - && ressources_menage_2075_ - <=$ plafond__i_i_d521_3_2170_ - +$ (montant_verse_forfaitaire_2276_ *$ decimal_of_string "12.")) + (ressources_menage_ >$ plafond__i_i_d521_3_ + && ressources_menage_ + <=$ plafond__i_i_d521_3_ + +$ (montant_verse_forfaitaire_ *$ decimal_of_string "12.")) then - (plafond__i_i_d521_3_2170_ - +$ ((montant_verse_forfaitaire_2276_ *$ decimal_of_string "12.") - -$ ressources_menage_2075_)) + (plafond__i_i_d521_3_ + +$ ((montant_verse_forfaitaire_ *$ decimal_of_string "12.") + -$ ressources_menage_)) *$ (decimal_of_string "1." /& decimal_of_string "12.") else raise EmptyError with EmptyError -> raise EmptyError); @@ -4604,14 +4552,14 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i "Code de la sécurité sociale"; ]; } - (ressources_menage_2075_ >$ plafond__i_d521_3_2177_ - && ressources_menage_2075_ - <=$ plafond__i_d521_3_2177_ - +$ (montant_verse_forfaitaire_2276_ *$ decimal_of_string "12.")) + (ressources_menage_ >$ plafond__i_d521_3_ + && ressources_menage_ + <=$ plafond__i_d521_3_ + +$ (montant_verse_forfaitaire_ *$ decimal_of_string "12.")) then - (plafond__i_d521_3_2177_ - +$ ((montant_verse_forfaitaire_2276_ *$ decimal_of_string "12.") - -$ ressources_menage_2075_)) + (plafond__i_d521_3_ + +$ ((montant_verse_forfaitaire_ *$ decimal_of_string "12.") + -$ ressources_menage_)) *$ (decimal_of_string "1." /& decimal_of_string "12.") else raise EmptyError with EmptyError -> raise EmptyError); @@ -4641,13 +4589,13 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let montant_avec_garde_alternee_base_2295_ : money = + let montant_avec_garde_alternee_base_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_avec_garde_alternée_base" ] embed_money (try try - try montant_initial_base_2279_ *$ rapport_enfants_total_moyen_2267_ + try montant_initial_base_ *$ rapport_enfants_total_moyen_ with EmptyError -> raise EmptyError with EmptyError -> raise EmptyError with EmptyError -> @@ -4662,12 +4610,12 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let montant_avec_garde_alternee_majoration_2296_ : enfant -> money = + let montant_avec_garde_alternee_majoration_ : enfant -> money = log_variable_definition [ "AllocationsFamiliales"; "montant_avec_garde_alternée_majoration" ] unembeddable (try - fun (param_2297_ : enfant) -> + fun (param_ : enfant) -> try try try @@ -4678,10 +4626,10 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i unembeddable (log_begin_call [ "AllocationsFamiliales"; "montant_initial_majoration" ] - montant_initial_majoration_2284_ + montant_initial_majoration_ (log_variable_definition [ "AllocationsFamiliales"; "montant_initial_majoration"; "input" ] - unembeddable param_2297_))) + unembeddable param_))) *$ match log_end_call @@ -4691,10 +4639,10 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i unembeddable (log_begin_call [ "AllocationsFamiliales"; "prise_en_compte" ] - prise_en_compte_2080_ + prise_en_compte_ (log_variable_definition [ "AllocationsFamiliales"; "prise_en_compte"; "input" ] - unembeddable param_2297_))) + unembeddable param_))) with | Complete _ -> decimal_of_string "1." | Partagee _ -> decimal_of_string "0.5" @@ -4724,14 +4672,14 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let montant_verse_base_2301_ : money = + let montant_verse_base_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_versé_base" ] embed_money (try try try - if droit_ouvert_base_2236_ then montant_avec_garde_alternee_base_2295_ + if droit_ouvert_base_ then montant_avec_garde_alternee_base_ else money_of_cents_string "0" with EmptyError -> raise EmptyError with EmptyError -> raise EmptyError @@ -4747,17 +4695,17 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let montant_verse_majoration_2302_ : money = + let montant_verse_majoration_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_versé_majoration" ] embed_money (try try try - if droit_ouvert_base_2236_ then + if droit_ouvert_base_ then Array.fold_left - (fun (acc_2303_ : money) (enfant_2304_ : _) -> - acc_2303_ + (fun (acc_ : money) (enfant_ : _) -> + acc_ +$ log_end_call [ "AllocationsFamiliales"; "montant_avec_garde_alternée_majoration" ] (log_variable_definition @@ -4769,15 +4717,15 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i unembeddable (log_begin_call [ "AllocationsFamiliales"; "montant_avec_garde_alternée_majoration" ] - montant_avec_garde_alternee_majoration_2296_ + montant_avec_garde_alternee_majoration_ (log_variable_definition [ "AllocationsFamiliales"; "montant_avec_garde_alternée_majoration"; "input"; ] - unembeddable enfant_2304_)))) - (money_of_cents_string "0") enfants_a_charge_2078_ + unembeddable enfant_)))) + (money_of_cents_string "0") enfants_a_charge_ else money_of_cents_string "0" with EmptyError -> raise EmptyError with EmptyError -> raise EmptyError @@ -4793,13 +4741,13 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let montant_base_complement_pour_base_et_majoration_2305_ : money = + let montant_base_complement_pour_base_et_majoration_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_base_complément_pour_base_et_majoration" ] embed_money (try try - try montant_verse_base_2301_ +$ montant_verse_majoration_2302_ + try montant_verse_base_ +$ montant_verse_majoration_ with EmptyError -> raise EmptyError with EmptyError -> raise EmptyError with EmptyError -> @@ -4814,14 +4762,14 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let montant_verse_complement_pour_base_et_majoration_2306_ : money = + let montant_verse_complement_pour_base_et_majoration_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_versé_complément_pour_base_et_majoration" ] embed_money (try try try - if droit_ouvert_complement_2184_ then + if droit_ouvert_complement_ then log_end_call [ "AllocationsFamiliales"; "complément_dégressif" ] (log_variable_definition @@ -4829,10 +4777,10 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i unembeddable (log_begin_call [ "AllocationsFamiliales"; "complément_dégressif" ] - complement_degressif_2243_ + complement_degressif_ (log_variable_definition [ "AllocationsFamiliales"; "complément_dégressif"; "input" ] - unembeddable montant_base_complement_pour_base_et_majoration_2305_))) + unembeddable montant_base_complement_pour_base_et_majoration_))) else money_of_cents_string "0" with EmptyError -> raise EmptyError with EmptyError -> raise EmptyError @@ -4848,19 +4796,19 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i law_headings = [ "Prologue" ]; })) in - let montant_verse_2307_ : money = + let montant_verse_ : money = log_variable_definition [ "AllocationsFamiliales"; "montant_versé" ] embed_money (try try try - if droit_ouvert_base_2236_ then - montant_verse_base_2301_ - +$ (montant_verse_majoration_2302_ - +$ (montant_verse_forfaitaire_2276_ - +$ (montant_verse_complement_pour_base_et_majoration_2306_ - +$ montant_verse_complement_pour_forfaitaire_2290_))) + if droit_ouvert_base_ then + montant_verse_base_ + +$ (montant_verse_majoration_ + +$ (montant_verse_forfaitaire_ + +$ (montant_verse_complement_pour_base_et_majoration_ + +$ montant_verse_complement_pour_forfaitaire_))) else money_of_cents_string "0" with EmptyError -> raise EmptyError with EmptyError -> raise EmptyError @@ -4879,9 +4827,9 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i let (_ : unit) = if try - personne_charge_effective_permanente_est_parent_2073_ - || (not personne_charge_effective_permanente_est_parent_2073_) - && personne_charge_effective_permanente_remplit_titre__i_2074_ + personne_charge_effective_permanente_est_parent_ + || (not personne_charge_effective_permanente_est_parent_) + && personne_charge_effective_permanente_remplit_titre__i_ with EmptyError -> raise (NoValueProvided @@ -4904,26 +4852,24 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i then () else raise AssertionFailed in - { montant_verse_out = montant_verse_2307_ } + { montant_verse_out = montant_verse_ } let interface_allocations_familiales (interface_allocations_familiales_in : interface_allocations_familiales_in) = - let i_date_courante_2310_ : date = interface_allocations_familiales_in.i_date_courante_in in - let i_enfants_2311_ : enfant_entree array = interface_allocations_familiales_in.i_enfants_in in - let i_ressources_menage_2312_ : money = - interface_allocations_familiales_in.i_ressources_menage_in - in - let i_residence_2313_ : collectivite = interface_allocations_familiales_in.i_residence_in in - let i_personne_charge_effective_permanente_est_parent_2314_ : bool = + let i_date_courante_ : date = interface_allocations_familiales_in.i_date_courante_in in + let i_enfants_ : enfant_entree array = interface_allocations_familiales_in.i_enfants_in in + let i_ressources_menage_ : money = interface_allocations_familiales_in.i_ressources_menage_in in + let i_residence_ : collectivite = interface_allocations_familiales_in.i_residence_in in + let i_personne_charge_effective_permanente_est_parent_ : bool = interface_allocations_familiales_in.i_personne_charge_effective_permanente_est_parent_in in - let i_personne_charge_effective_permanente_remplit_titre__i_2315_ : bool = + let i_personne_charge_effective_permanente_remplit_titre__i_ : bool = interface_allocations_familiales_in.i_personne_charge_effective_permanente_remplit_titre_I_in in - let i_avait_enfant_a_charge_avant_1er_janvier_2012_2316_ : bool = + let i_avait_enfant_a_charge_avant_1er_janvier_2012_ : bool = interface_allocations_familiales_in.i_avait_enfant_a_charge_avant_1er_janvier_2012_in in - let enfants_a_charge_2317_ : enfant array = + let enfants_a_charge_ : enfant array = log_variable_definition [ "InterfaceAllocationsFamiliales"; "enfants_à_charge" ] (embed_array embed_enfant) @@ -4931,30 +4877,27 @@ let interface_allocations_familiales try try Array.map - (fun (enfant_2318_ : _) -> + (fun (enfant_ : _) -> { - identifiant = enfant_2318_.d_identifiant; + identifiant = enfant_.d_identifiant; obligation_scolaire = (if - enfant_2318_.d_date_de_naissance +@ duration_of_numbers 3 0 0 - >=@ i_date_courante_2310_ + enfant_.d_date_de_naissance +@ duration_of_numbers 3 0 0 >=@ i_date_courante_ then Avant () else if - enfant_2318_.d_date_de_naissance +@ duration_of_numbers 16 0 0 - >=@ i_date_courante_2310_ + enfant_.d_date_de_naissance +@ duration_of_numbers 16 0 0 >=@ i_date_courante_ then Pendant () else Apres ()); - remuneration_mensuelle = enfant_2318_.d_remuneration_mensuelle; - date_de_naissance = enfant_2318_.d_date_de_naissance; + remuneration_mensuelle = enfant_.d_remuneration_mensuelle; + date_de_naissance = enfant_.d_date_de_naissance; age = year_of_date - (date_of_numbers 0 1 1 - +@ (i_date_courante_2310_ -@ enfant_2318_.d_date_de_naissance)); - prise_en_charge = enfant_2318_.d_prise_en_charge; + (date_of_numbers 0 1 1 +@ (i_date_courante_ -@ enfant_.d_date_de_naissance)); + prise_en_charge = enfant_.d_prise_en_charge; a_deja_ouvert_droit_aux_allocations_familiales = - enfant_2318_.d_a_deja_ouvert_droit_aux_allocations_familiales; + enfant_.d_a_deja_ouvert_droit_aux_allocations_familiales; }) - i_enfants_2311_ + i_enfants_ with EmptyError -> raise EmptyError with EmptyError -> raise EmptyError with EmptyError -> @@ -4969,7 +4912,7 @@ let interface_allocations_familiales law_headings = [ "Interface du programme"; "Épilogue"; "Décrets divers" ]; })) in - let allocations_familiales_dot_personne_charge_effective_permanente_est_parent_2319_ : bool = + let allocations_familiales_dot_personne_charge_effective_permanente_est_parent_ : bool = try log_variable_definition [ @@ -4989,7 +4932,7 @@ let interface_allocations_familiales end_column = 69; law_headings = [ "Interface du programme"; "Épilogue"; "Décrets divers" ]; } - i_personne_charge_effective_permanente_est_parent_2314_ + i_personne_charge_effective_permanente_est_parent_ then true else raise EmptyError with EmptyError -> raise EmptyError @@ -5006,8 +4949,7 @@ let interface_allocations_familiales law_headings = [ "Prologue" ]; }) in - let allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i_2320_ : bool - = + let allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i_ : bool = try log_variable_definition [ @@ -5027,7 +4969,7 @@ let interface_allocations_familiales end_column = 74; law_headings = [ "Interface du programme"; "Épilogue"; "Décrets divers" ]; } - i_personne_charge_effective_permanente_remplit_titre__i_2315_ + i_personne_charge_effective_permanente_remplit_titre__i_ then true else raise EmptyError with EmptyError -> raise EmptyError @@ -5044,12 +4986,12 @@ let interface_allocations_familiales law_headings = [ "Prologue" ]; }) in - let allocations_familiales_dot_ressources_menage_2321_ : money = + let allocations_familiales_dot_ressources_menage_ : money = try log_variable_definition [ "InterfaceAllocationsFamiliales"; "allocations_familiales.ressources_ménage" ] embed_money - (try try i_ressources_menage_2312_ with EmptyError -> raise EmptyError + (try try i_ressources_menage_ with EmptyError -> raise EmptyError with EmptyError -> raise EmptyError) with EmptyError -> raise @@ -5063,12 +5005,12 @@ let interface_allocations_familiales law_headings = [ "Prologue" ]; }) in - let allocations_familiales_dot_residence_2322_ : collectivite = + let allocations_familiales_dot_residence_ : collectivite = try log_variable_definition [ "InterfaceAllocationsFamiliales"; "allocations_familiales.résidence" ] embed_collectivite - (try try i_residence_2313_ with EmptyError -> raise EmptyError + (try try i_residence_ with EmptyError -> raise EmptyError with EmptyError -> raise EmptyError) with EmptyError -> raise @@ -5082,12 +5024,12 @@ let interface_allocations_familiales law_headings = [ "Prologue" ]; }) in - let allocations_familiales_dot_date_courante_2323_ : date = + let allocations_familiales_dot_date_courante_ : date = try log_variable_definition [ "InterfaceAllocationsFamiliales"; "allocations_familiales.date_courante" ] embed_date - (try try i_date_courante_2310_ with EmptyError -> raise EmptyError + (try try i_date_courante_ with EmptyError -> raise EmptyError with EmptyError -> raise EmptyError) with EmptyError -> raise @@ -5101,12 +5043,12 @@ let interface_allocations_familiales law_headings = [ "Prologue" ]; }) in - let allocations_familiales_dot_enfants_a_charge_2324_ : enfant array = + let allocations_familiales_dot_enfants_a_charge_ : enfant array = try log_variable_definition [ "InterfaceAllocationsFamiliales"; "allocations_familiales.enfants_à_charge" ] (embed_array embed_enfant) - (try try enfants_a_charge_2317_ with EmptyError -> raise EmptyError + (try try enfants_a_charge_ with EmptyError -> raise EmptyError with EmptyError -> raise EmptyError) with EmptyError -> raise @@ -5120,7 +5062,7 @@ let interface_allocations_familiales law_headings = [ "Prologue" ]; }) in - let allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012_2325_ : bool = + let allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012_ : bool = try log_variable_definition [ @@ -5140,7 +5082,7 @@ let interface_allocations_familiales end_column = 66; law_headings = [ "Interface du programme"; "Épilogue"; "Décrets divers" ]; } - i_avait_enfant_a_charge_avant_1er_janvier_2012_2316_ + i_avait_enfant_a_charge_avant_1er_janvier_2012_ then true else raise EmptyError with EmptyError -> raise EmptyError @@ -5157,7 +5099,7 @@ let interface_allocations_familiales law_headings = [ "Prologue" ]; }) in - let result_2326_ : allocations_familiales_out = + let result_ : allocations_familiales_out = log_end_call [ "InterfaceAllocationsFamiliales"; "allocations_familiales"; "AllocationsFamiliales" ] (log_begin_call @@ -5165,25 +5107,24 @@ let interface_allocations_familiales allocations_familiales { personne_charge_effective_permanente_est_parent_in = - allocations_familiales_dot_personne_charge_effective_permanente_est_parent_2319_; + allocations_familiales_dot_personne_charge_effective_permanente_est_parent_; personne_charge_effective_permanente_remplit_titre_I_in = - allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i_2320_; - ressources_menage_in = allocations_familiales_dot_ressources_menage_2321_; - residence_in = allocations_familiales_dot_residence_2322_; - date_courante_in = allocations_familiales_dot_date_courante_2323_; - enfants_a_charge_in = allocations_familiales_dot_enfants_a_charge_2324_; + allocations_familiales_dot_personne_charge_effective_permanente_remplit_titre__i_; + ressources_menage_in = allocations_familiales_dot_ressources_menage_; + residence_in = allocations_familiales_dot_residence_; + date_courante_in = allocations_familiales_dot_date_courante_; + enfants_a_charge_in = allocations_familiales_dot_enfants_a_charge_; avait_enfant_a_charge_avant_1er_janvier_2012_in = - allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012_2325_; + allocations_familiales_dot_avait_enfant_a_charge_avant_1er_janvier_2012_; }) in - let allocations_familiales_dot_montant_verse_2327_ : money = result_2326_.montant_verse_out in - let i_montant_verse_2328_ : money = + let allocations_familiales_dot_montant_verse_ : money = result_.montant_verse_out in + let i_montant_verse_ : money = log_variable_definition [ "InterfaceAllocationsFamiliales"; "i_montant_versé" ] embed_money (try - try - try allocations_familiales_dot_montant_verse_2327_ with EmptyError -> raise EmptyError + try try allocations_familiales_dot_montant_verse_ with EmptyError -> raise EmptyError with EmptyError -> raise EmptyError with EmptyError -> raise @@ -5197,4 +5138,4 @@ let interface_allocations_familiales law_headings = [ "Interface du programme"; "Épilogue"; "Décrets divers" ]; })) in - { i_montant_verse_out = i_montant_verse_2328_ } + { i_montant_verse_out = i_montant_verse_ } From ddacc94de268848ea304b6217ab643b859ff1181 Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Thu, 24 Feb 2022 16:49:18 +0100 Subject: [PATCH 102/102] Correct types for make_some and make_none --- compiler/lcalc/ast.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/lcalc/ast.ml b/compiler/lcalc/ast.ml index 963df7dba..489fea96f 100644 --- a/compiler/lcalc/ast.ml +++ b/compiler/lcalc/ast.ml @@ -93,14 +93,14 @@ let option_enum_config : (D.EnumConstructor.t * D.typ Pos.marked) list = let make_none (pos : Pos.t) : expr Pos.marked Bindlib.box = let mark : 'a -> 'a Pos.marked = Pos.mark pos in - Bindlib.box @@ mark @@ EInj (mark @@ ELit LUnit, 0, option_enum, [ (D.TLit D.TUnit, pos) ]) + Bindlib.box @@ mark + @@ EInj (mark @@ ELit LUnit, 0, option_enum, [ (D.TLit D.TUnit, pos); (D.TAny, pos) ]) let make_some (e : expr Pos.marked Bindlib.box) : expr Pos.marked Bindlib.box = let pos = Pos.get_position @@ Bindlib.unbox e in let mark : 'a -> 'a Pos.marked = Pos.mark pos in - let+ e = e in - mark @@ EInj (e, 1, option_enum, [ (D.TAny, pos) ]) + mark @@ EInj (e, 1, option_enum, [ (D.TLit D.TUnit, pos); (D.TAny, pos) ]) (** [make_matchopt_with_abs_arms arg e_none e_some] build an expression [match arg with |None -> e_none | Some -> e_some] and requires e_some and e_none to be in the