Information about variable I/O in log events (#469)

This commit is contained in:
Denis Merigoux 2023-06-01 18:34:46 +02:00 committed by GitHub
commit a4eb2bfc2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
30 changed files with 36547 additions and 33994 deletions

View File

@ -2,8 +2,14 @@
# (only depends on the opam files)
FROM ocamlpro/ocaml:4.14-2023-04-02 AS dev-build-context
# pandoc is not in alpine stable yet, install it manually with an explicit repository
# pandoc and ninja are not in alpine stable yet, install it manually with an explicit repository
RUN sudo apk add pandoc --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community/
# In order to compiler rescript for `npm install` in french_law/js we need
# the following dependencies (according to https://github.com/GlancingMind/rescript-alpine-docker)
RUN sudo apk add python3
RUN sudo ln -s /usr/bin/python3 /usr/bin/python
RUN sudo apk add g++
RUN sudo apk add make
RUN mkdir catala
WORKDIR catala
@ -16,7 +22,8 @@ ENV OPAMVAR_cataladevmode=1
ENV OPAMVAR_catalaz3mode=1
# Get a switch with all the dependencies installed
RUN opam --cli=2.1 switch create catala ocaml-system && \
RUN opam --cli=2.1 update && \
opam --cli=2.1 switch create catala ocaml-system && \
opam --cli=2.1 pin . --no-action && \
opam --cli=2.1 install . --with-test --with-doc --depext-only && \
opam --cli=2.1 install . --with-test --with-doc --deps-only && \

View File

@ -25,7 +25,7 @@ type scope_var_ctx = {
type scope_input_var_ctx = {
scope_input_name : StructField.t;
scope_input_io : Desugared.Ast.io_input Mark.pos;
scope_input_io : Runtime.io_input Mark.pos;
scope_input_typ : naked_typ;
}
@ -191,9 +191,9 @@ let thunk_scope_arg ~is_func io_in e =
let silent_var = Var.make "_" in
let pos = Mark.get io_in in
match Mark.remove io_in with
| Desugared.Ast.NoInput -> invalid_arg "thunk_scope_arg"
| Desugared.Ast.OnlyInput -> Expr.eerroronempty e (Mark.get e)
| Desugared.Ast.Reentrant ->
| Runtime.NoInput -> invalid_arg "thunk_scope_arg"
| Runtime.OnlyInput -> Expr.eerroronempty e (Mark.get e)
| Runtime.Reentrant ->
(* we don't need to thunk expressions that are already functions *)
if is_func then e
else Expr.make_abs [| silent_var |] e [TLit TUnit, pos] pos
@ -256,7 +256,7 @@ let rec translate_expr (ctx : 'm ctx) (e : 'm Scopelang.Ast.expr) :
(fun var_name (str_field : scope_input_var_ctx option) expr ->
let expr =
match str_field, expr with
| Some { scope_input_io = Desugared.Ast.Reentrant, _; _ }, None ->
| Some { scope_input_io = Reentrant, _; _ }, None ->
Some (Expr.unbox (Expr.eemptyerror (mark_tany m pos)))
| _ -> expr
in
@ -307,7 +307,12 @@ let rec translate_expr (ctx : 'm ctx) (e : 'm Scopelang.Ast.expr) :
in
let single_arg =
tag_with_log_entry arg_struct
(VarDef (TStruct sc_sig.scope_sig_input_struct))
(VarDef
{
log_typ = TStruct sc_sig.scope_sig_input_struct;
log_io_output = false;
log_io_input = OnlyInput;
})
[
ScopeName.get_info scope;
Mark.add (Expr.pos e) "direct";
@ -377,14 +382,24 @@ let rec translate_expr (ctx : 'm ctx) (e : 'm Scopelang.Ast.expr) :
~f:(fun i (param_var, t_in) ->
tag_with_log_entry
(Expr.make_var param_var (Expr.with_ty m t_in))
(VarDef (Mark.remove t_in))
(VarDef
{
log_typ = Mark.remove t_in;
log_io_output = false;
log_io_input = OnlyInput;
})
(f_markings
@ [
Mark.add (Expr.pos e)
("input" ^ string_of_int i);
])))
(Expr.with_ty m t_out))
(VarDef (Mark.remove t_out))
(VarDef
{
log_typ = Mark.remove t_out;
log_io_output = true;
log_io_input = NoInput;
})
(f_markings @ [Mark.add (Expr.pos e) "output"]))
EndCall f_markings)
ts_in (Expr.pos e)
@ -422,7 +437,12 @@ let rec translate_expr (ctx : 'm ctx) (e : 'm Scopelang.Ast.expr) :
result_eta_expanded
(tag_with_log_entry
(tag_with_log_entry if_then_else_returned
(VarDef (TStruct sc_sig.scope_sig_output_struct))
(VarDef
{
log_typ = TStruct sc_sig.scope_sig_output_struct;
log_io_output = true;
log_io_input = NoInput;
})
direct_output_info)
EndCall
[ScopeName.get_info scope; Mark.add (Expr.pos e) "direct"])
@ -486,7 +506,13 @@ let rec translate_expr (ctx : 'm ctx) (e : 'm Scopelang.Ast.expr) :
~f:(fun i (new_arg, input_typ) ->
match markings with
| _ :: _ as m ->
tag_with_log_entry new_arg (VarDef input_typ)
tag_with_log_entry new_arg
(VarDef
{
log_typ = input_typ;
log_io_output = false;
log_io_input = OnlyInput;
})
(m @ [Mark.add (Expr.pos e) ("input" ^ string_of_int i)])
| _ -> new_arg)
in
@ -497,7 +523,13 @@ let rec translate_expr (ctx : 'm ctx) (e : 'm Scopelang.Ast.expr) :
| [] -> new_e
| m ->
tag_with_log_entry
(tag_with_log_entry new_e (VarDef output_typ)
(tag_with_log_entry new_e
(VarDef
{
log_typ = output_typ;
log_io_output = true;
log_io_input = NoInput;
})
(m @ [Mark.add (Expr.pos e) "output"]))
EndCall m
in
@ -591,7 +623,12 @@ let translate_rule
in
let merged_expr =
tag_with_log_entry merged_expr
(VarDef (Mark.remove tau))
(VarDef
{
log_typ = Mark.remove tau;
log_io_output = Mark.remove a_io.io_output;
log_io_input = Mark.remove a_io.io_input;
})
[sigma_name, pos_sigma; a_name]
in
( (fun next ->
@ -628,7 +665,12 @@ let translate_rule
let a_var = Var.make (Mark.remove a_name) in
let new_e =
tag_with_log_entry (translate_expr ctx e)
(VarDef (Mark.remove tau))
(VarDef
{
log_typ = Mark.remove tau;
log_io_output = false;
log_io_input = Mark.remove a_io.Desugared.Ast.io_input;
})
[sigma_name, pos_sigma; a_name]
in
let is_func = match Mark.remove tau with TArrow _ -> true | _ -> false in

View File

@ -91,8 +91,7 @@ module ExprMap = Map.Make (struct
let compare = Expr.compare
end)
type io_input = NoInput | OnlyInput | Reentrant
type io = { io_output : bool Mark.pos; io_input : io_input Mark.pos }
type io = { io_output : bool Mark.pos; io_input : Runtime.io_input Mark.pos }
type exception_situation =
| BaseCase

View File

@ -84,24 +84,10 @@ type meta_assertion =
| FixedBy of reference_typ Mark.pos
| VariesWith of unit * variation_typ Mark.pos option
(** This type characterizes the three levels of visibility for a given scope
variable with regards to the scope's input and possible redefinitions inside
the scope.. *)
type io_input =
| NoInput
(** For an internal variable defined only in the scope, and does not
appear in the input. *)
| OnlyInput
(** For variables that should not be redefined in the scope, because they
appear in the input. *)
| Reentrant
(** For variables defined in the scope that can also be redefined by the
caller as they appear in the input. *)
type io = {
io_output : bool Mark.pos;
(** [true] is present in the output of the scope. *)
io_input : io_input Mark.pos;
io_input : Runtime.io_input Mark.pos;
}
(** Characterization of the input/output status of a scope variable. *)

View File

@ -1286,9 +1286,9 @@ let attribute_to_io (attr : Surface.Ast.scope_decl_context_io) : Ast.io =
Mark.map
(fun io ->
match io with
| Surface.Ast.Input -> Ast.OnlyInput
| Surface.Ast.Internal -> Ast.NoInput
| Surface.Ast.Context -> Ast.Reentrant)
| Surface.Ast.Input -> Runtime.OnlyInput
| Surface.Ast.Internal -> Runtime.NoInput
| Surface.Ast.Context -> Runtime.Reentrant)
attr.scope_decl_context_io_input;
}
@ -1333,7 +1333,7 @@ let init_scope_defs
(let original_io = attribute_to_io v_sig.var_sig_io in
let io_input =
if i = 0 then original_io.io_input
else Ast.NoInput, Mark.get (StateName.get_info state)
else NoInput, Mark.get (StateName.get_info state)
in
let io_output =
if i = List.length states - 1 then original_io.io_output

View File

@ -30,7 +30,7 @@ let detect_empty_definitions (p : program) : unit =
&& (not scope_def.scope_def_is_condition)
&&
match Mark.remove scope_def.scope_def_io.io_input with
| Ast.NoInput -> true
| NoInput -> true
| _ -> false
then
Errors.format_spanned_warning

View File

@ -315,10 +315,19 @@ let rec format_expr (ctx : decl_ctx) (fmt : Format.formatter) (e : 'm expr) :
when !Cli.trace_flag ->
Format.fprintf fmt "(log_begin_call@ %a@ %a)@ %a" format_uid_list info
format_with_parens f format_with_parens arg
| EApp { f = EOp { op = Log (VarDef tau, info); _ }, _; args = [arg1] }
| EApp
{ f = EOp { op = Log (VarDef var_def_info, info); _ }, _; args = [arg1] }
when !Cli.trace_flag ->
Format.fprintf fmt "(log_variable_definition@ %a@ (%a)@ %a)" format_uid_list
info typ_embedding_name (tau, Pos.no_pos) format_with_parens arg1
Format.fprintf fmt
"(log_variable_definition@ %a@ {io_input=%s;@ io_output=%b}@ (%a)@ %a)"
format_uid_list info
(match var_def_info.log_io_input with
| NoInput -> "NoInput"
| OnlyInput -> "OnlyInput"
| Reentrant -> "Reentrant")
var_def_info.log_io_output typ_embedding_name
(var_def_info.log_typ, Pos.no_pos)
format_with_parens arg1
| EApp { f = EOp { op = Log (PosRecordIfTrueBool, _); _ }, m; args = [arg1] }
when !Cli.trace_flag ->
let pos = Expr.mark_pos m in

View File

@ -13,7 +13,6 @@
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations under
the License. *)
[@@@warning "-32-27"]
open Catala_utils
open Shared_ast
@ -42,16 +41,9 @@ let format_lit (fmt : Format.formatter) (l : lit Mark.pos) : unit =
let years, months, days = Runtime.duration_to_years_months_days d in
Format.fprintf fmt "duration_of_numbers(%d,%d,%d)" years months days
let format_log_entry (fmt : Format.formatter) (entry : log_entry) : unit =
match entry with
| VarDef _ -> Format.pp_print_string fmt ":="
| BeginCall -> Format.pp_print_string fmt ""
| EndCall -> Format.fprintf fmt "%s" ""
| PosRecordIfTrueBool -> Format.pp_print_string fmt ""
let format_op (fmt : Format.formatter) (op : operator Mark.pos) : unit =
match Mark.remove op with
| Log (entry, infos) -> assert false
| Log (_entry, _infos) -> assert false
| Minus_int | Minus_rat | Minus_mon | Minus_dur ->
Format.pp_print_string fmt "-"
(* Todo: use the names from [Operator.name] *)
@ -247,14 +239,6 @@ let format_func_name (fmt : Format.formatter) (v : FuncName.t) : unit =
let v_str = Mark.remove (FuncName.get_info v) in
format_name_cleaned fmt v_str
let format_var_name (fmt : Format.formatter) (v : VarName.t) : unit =
Format.fprintf fmt "%a_%s" VarName.format_t v (string_of_int (VarName.hash v))
let needs_parens (e : expr) : bool =
match Mark.remove e with
| ELit (LBool _ | LUnit) | EVar _ | EOp _ -> false
| _ -> true
let format_exception (fmt : Format.formatter) (exc : except Mark.pos) : unit =
let pos = Mark.get exc in
match Mark.remove exc with
@ -325,9 +309,16 @@ let rec format_expression (ctx : decl_ctx) (fmt : Format.formatter) (e : expr) :
when !Cli.trace_flag ->
Format.fprintf fmt "log_begin_call(%a,@ %a,@ %a)" format_uid_list info
(format_expression ctx) f (format_expression ctx) arg
| EApp ((EOp (Log (VarDef tau, info)), _), [arg1]) when !Cli.trace_flag ->
Format.fprintf fmt "log_variable_definition(%a,@ %a)" format_uid_list info
(format_expression ctx) arg1
| EApp ((EOp (Log (VarDef var_def_info, info)), _), [arg1])
when !Cli.trace_flag ->
Format.fprintf fmt
"log_variable_definition(%a,@ LogIO(io_input=%s,@ io_output=%b),@ %a)"
format_uid_list info
(match var_def_info.log_io_input with
| Runtime.NoInput -> "NoInput"
| Runtime.OnlyInput -> "OnlyInput"
| Runtime.Reentrant -> "Reentrant")
var_def_info.log_io_output (format_expression ctx) arg1
| EApp ((EOp (Log (PosRecordIfTrueBool, _)), pos), [arg1])
when !Cli.trace_flag ->
Format.fprintf fmt
@ -556,7 +547,7 @@ let format_ctx
format_enum_name enum_name
(Format.pp_print_list
~pp_sep:(fun fmt () -> Format.fprintf fmt "@\n")
(fun fmt (i, enum_cons, enum_cons_type) ->
(fun fmt (i, enum_cons, _enum_cons_type) ->
Format.fprintf fmt "%a = %d" format_enum_cons_name enum_cons i))
(List.mapi
(fun i (x, y) -> i, x, y)

View File

@ -225,7 +225,7 @@ let rule_to_exception_graph (scope : Desugared.Ast.scope) = function
((match
Mark.remove scope_def.Desugared.Ast.scope_def_io.io_input
with
| Desugared.Ast.NoInput -> true
| NoInput -> true
| _ -> false)
&& RuleName.Map.is_empty scope_def.scope_def_rules))
scope.scope_defs
@ -244,7 +244,7 @@ let rule_to_exception_graph (scope : Desugared.Ast.scope) = function
(match
Mark.remove scope_def.Desugared.Ast.scope_def_io.io_input
with
| Desugared.Ast.NoInput ->
| NoInput ->
Errors.raise_multispanned_error
(( Some "Incriminated subscope:",
Mark.get (SubScopeName.get_info sscope) )
@ -627,7 +627,7 @@ let translate_rule
((match
Mark.remove scope_def.Desugared.Ast.scope_def_io.io_input
with
| Desugared.Ast.NoInput -> true
| NoInput -> true
| _ -> false)
&& RuleName.Map.is_empty scope_def.scope_def_rules))
scope.scope_defs
@ -647,7 +647,7 @@ let translate_rule
(match
Mark.remove scope_def.Desugared.Ast.scope_def_io.io_input
with
| Desugared.Ast.NoInput -> assert false (* error already raised *)
| NoInput -> assert false (* error already raised *)
| OnlyInput when RuleName.Map.is_empty def && not is_cond ->
assert false (* error already raised *)
| _ -> ());

View File

@ -156,10 +156,16 @@ type date = Runtime.date
type date_rounding = Runtime.date_rounding
type duration = Runtime.duration
type var_def_log = {
log_typ : naked_typ;
log_io_input : Runtime.io_input;
log_io_output : bool;
}
type log_entry =
| VarDef of naked_typ
| VarDef of var_def_log
(** During code generation, we need to know the type of the variable being
logged for embedding *)
logged for embedding as well as its I/O properties. *)
| BeginCall
| EndCall
| PosRecordIfTrueBool

View File

@ -112,7 +112,21 @@ let name : type a. a t -> string = function
let compare_log_entries l1 l2 =
match l1, l2 with
| VarDef t1, VarDef t2 -> Type.compare (t1, Pos.no_pos) (t2, Pos.no_pos)
| VarDef t1, VarDef t2 ->
let tcompare =
Type.compare (t1.log_typ, Pos.no_pos) (t2.log_typ, Pos.no_pos)
in
if tcompare = 0 then
let ocompare = Bool.compare t1.log_io_output t2.log_io_output in
if ocompare = 0 then
match t1.log_io_input, t2.log_io_input with
| NoInput, NoInput | OnlyInput, OnlyInput | Reentrant, Reentrant -> 0
| NoInput, _ -> 1
| _, NoInput -> -1
| OnlyInput, _ -> 1
| _, OnlyInput -> -1
else ocompare
else tcompare
| BeginCall, BeginCall
| EndCall, EndCall
| PosRecordIfTrueBool, PosRecordIfTrueBool ->

View File

@ -10,6 +10,6 @@
],
"suffix": ".bs.js",
"bs-dependencies": [
"@catala-lang/rescript-catala"
"@catala-lang/rescript-catala"
]
}

1
french_law/js/dune Normal file
View File

@ -0,0 +1 @@
(dirs src)

View File

@ -1,19 +1,32 @@
{
"name": "@catala-lang/french-law",
"version": "0.8.0",
"version": "0.8.3-b.3",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@catala-lang/french-law",
"version": "0.8.0",
"version": "0.8.3-b.3",
"license": "Apache-2.0",
"dependencies": {
"benchmark": "^2.1.4",
"lodash": "^4.17.21",
"platform": "^1.3.6"
},
"devDependencies": {}
"devDependencies": {
"@catala-lang/rescript-catala": "^0.8.1-b.0",
"rescript": "^10.1.4"
}
},
"node_modules/@catala-lang/rescript-catala": {
"version": "0.8.1-b.0",
"resolved": "https://registry.npmjs.org/@catala-lang/rescript-catala/-/rescript-catala-0.8.1-b.0.tgz",
"integrity": "sha512-rOCwTFZE8u7r1WUqohU5r1Aq/cNJYZEJ4/S/MEJkrKUrwdV7tU0Pr8bU6i0MuYRWssclEUUy38yx2mm2dD29Cg==",
"dev": true,
"dependencies": {
"decco": "^1.6.0",
"rescript": "^10.1.4"
}
},
"node_modules/benchmark": {
"version": "2.1.4",
@ -24,6 +37,30 @@
"platform": "^1.3.3"
}
},
"node_modules/bs-platform": {
"version": "9.0.2",
"resolved": "https://registry.npmjs.org/bs-platform/-/bs-platform-9.0.2.tgz",
"integrity": "sha512-Ye9JqJ4Oa7mcjjoOVRYI8Uc2Cf8N7jQLWDcdUplY7996d/YErSR7WitmV7XnSwr4EvdrbwjEsg1NxNjUQv3ChA==",
"dev": true,
"hasInstallScript": true,
"peer": true,
"bin": {
"bsb": "bsb",
"bsc": "bsc",
"bsrefmt": "bsrefmt",
"bstracing": "lib/bstracing"
}
},
"node_modules/decco": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/decco/-/decco-1.6.0.tgz",
"integrity": "sha512-gdeDDPOh45Hz8YGvTkDP7ySo3Ll3ty+KfuFj21+jRbiCoE8HTCNB++pozCiMljxJx39CfvrHRYBY5FO5PMyXzw==",
"dev": true,
"hasInstallScript": true,
"peerDependencies": {
"bs-platform": "6 || 7 || 8 || 9"
}
},
"node_modules/lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
@ -33,9 +70,32 @@
"version": "1.3.6",
"resolved": "https://registry.npmjs.org/platform/-/platform-1.3.6.tgz",
"integrity": "sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg=="
},
"node_modules/rescript": {
"version": "10.1.4",
"resolved": "https://registry.npmjs.org/rescript/-/rescript-10.1.4.tgz",
"integrity": "sha512-FFKlS9AG/XrLepWsyw7B+A9DtQBPWEPDPDKghV831Y2KGbie+eeFBOS0xtRHp0xbt7S0N2Dm6hhX+kTZQ/3Ybg==",
"dev": true,
"hasInstallScript": true,
"bin": {
"bsc": "bsc",
"bsrefmt": "bsrefmt",
"bstracing": "lib/bstracing",
"rescript": "rescript"
}
}
},
"dependencies": {
"@catala-lang/rescript-catala": {
"version": "0.8.1-b.0",
"resolved": "https://registry.npmjs.org/@catala-lang/rescript-catala/-/rescript-catala-0.8.1-b.0.tgz",
"integrity": "sha512-rOCwTFZE8u7r1WUqohU5r1Aq/cNJYZEJ4/S/MEJkrKUrwdV7tU0Pr8bU6i0MuYRWssclEUUy38yx2mm2dD29Cg==",
"dev": true,
"requires": {
"decco": "^1.6.0",
"rescript": "^10.1.4"
}
},
"benchmark": {
"version": "2.1.4",
"resolved": "https://registry.npmjs.org/benchmark/-/benchmark-2.1.4.tgz",
@ -45,6 +105,20 @@
"platform": "^1.3.3"
}
},
"bs-platform": {
"version": "9.0.2",
"resolved": "https://registry.npmjs.org/bs-platform/-/bs-platform-9.0.2.tgz",
"integrity": "sha512-Ye9JqJ4Oa7mcjjoOVRYI8Uc2Cf8N7jQLWDcdUplY7996d/YErSR7WitmV7XnSwr4EvdrbwjEsg1NxNjUQv3ChA==",
"dev": true,
"peer": true
},
"decco": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/decco/-/decco-1.6.0.tgz",
"integrity": "sha512-gdeDDPOh45Hz8YGvTkDP7ySo3Ll3ty+KfuFj21+jRbiCoE8HTCNB++pozCiMljxJx39CfvrHRYBY5FO5PMyXzw==",
"dev": true,
"requires": {}
},
"lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
@ -54,6 +128,12 @@
"version": "1.3.6",
"resolved": "https://registry.npmjs.org/platform/-/platform-1.3.6.tgz",
"integrity": "sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg=="
},
"rescript": {
"version": "10.1.4",
"resolved": "https://registry.npmjs.org/rescript/-/rescript-10.1.4.tgz",
"integrity": "sha512-FFKlS9AG/XrLepWsyw7B+A9DtQBPWEPDPDKghV831Y2KGbie+eeFBOS0xtRHp0xbt7S0N2Dm6hhX+kTZQ/3Ybg==",
"dev": true
}
}
}

View File

@ -1,6 +1,6 @@
{
"name": "@catala-lang/french-law",
"version": "0.8.2",
"version": "0.8.3-b.3",
"description": "Library of computations defined by French legislative texts, extract from Catala programs (https://catala-lang.org)",
"main": "index.js",
"dependencies": {
@ -8,8 +8,14 @@
"lodash": "^4.17.21",
"platform": "^1.3.6"
},
"devDependencies": {},
"devDependencies": {
"@catala-lang/rescript-catala": "^0.8.1-b.0",
"rescript": "^10.1.4"
},
"scripts": {
"clean": "rescript clean",
"build": "rescript build -with-deps",
"watch": "yarn run build -w",
"test": "node examples.js"
},
"repository": {

File diff suppressed because one or more lines are too long

44
french_law/js/yarn.lock generated Normal file
View File

@ -0,0 +1,44 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@catala-lang/rescript-catala@^0.8.1-b.0":
version "0.8.1-b.0"
resolved "https://registry.npmjs.org/@catala-lang/rescript-catala/-/rescript-catala-0.8.1-b.0.tgz"
integrity sha512-rOCwTFZE8u7r1WUqohU5r1Aq/cNJYZEJ4/S/MEJkrKUrwdV7tU0Pr8bU6i0MuYRWssclEUUy38yx2mm2dD29Cg==
dependencies:
decco "^1.6.0"
rescript "^10.1.4"
benchmark@^2.1.4:
version "2.1.4"
resolved "https://registry.npmjs.org/benchmark/-/benchmark-2.1.4.tgz"
integrity sha1-CfPeMckWQl1JjMLuVloOvzwqVik=
dependencies:
lodash "^4.17.4"
platform "^1.3.3"
"bs-platform@6 || 7 || 8 || 9":
version "9.0.2"
resolved "https://registry.npmjs.org/bs-platform/-/bs-platform-9.0.2.tgz"
integrity sha512-Ye9JqJ4Oa7mcjjoOVRYI8Uc2Cf8N7jQLWDcdUplY7996d/YErSR7WitmV7XnSwr4EvdrbwjEsg1NxNjUQv3ChA==
decco@^1.6.0:
version "1.6.0"
resolved "https://registry.npmjs.org/decco/-/decco-1.6.0.tgz"
integrity sha512-gdeDDPOh45Hz8YGvTkDP7ySo3Ll3ty+KfuFj21+jRbiCoE8HTCNB++pozCiMljxJx39CfvrHRYBY5FO5PMyXzw==
lodash@^4.17.21, lodash@^4.17.4:
version "4.17.21"
resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
platform@^1.3.3, platform@^1.3.6:
version "1.3.6"
resolved "https://registry.npmjs.org/platform/-/platform-1.3.6.tgz"
integrity sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==
rescript@^10.1.4:
version "10.1.4"
resolved "https://registry.npmjs.org/rescript/-/rescript-10.1.4.tgz"
integrity sha512-FFKlS9AG/XrLepWsyw7B+A9DtQBPWEPDPDKghV831Y2KGbie+eeFBOS0xtRHp0xbt7S0N2Dm6hhX+kTZQ/3Ybg==

File diff suppressed because it is too large Load Diff

View File

@ -380,7 +380,7 @@ let embed_interface_allocations_familiales_in (x: InterfaceAllocationsFamiliales
let allocation_familiales_avril2008 (allocation_familiales_avril2008_in: AllocationFamilialesAvril2008In.t) : AllocationFamilialesAvril2008.t =
let age_minimum_alinea_1_l521_3_: duration = (log_variable_definition
["AllocationFamilialesAvril2008"; "âge_minimum_alinéa_1_l521_3"]
(embed_duration) (
{io_input=NoInput; io_output=true} (embed_duration) (
try
(handle_default
{filename = ""; start_line=0; start_column=1;
@ -407,7 +407,8 @@ let allocation_familiales_avril2008 (allocation_familiales_avril2008_in: Allocat
let enfant_le_plus_age (enfant_le_plus_age_in: EnfantLePlusAgeIn.t) : EnfantLePlusAge.t =
let enfants_: Enfant.t array = enfant_le_plus_age_in.EnfantLePlusAgeIn.enfants_in in
let le_plus_age_: Enfant.t = (log_variable_definition
["EnfantLePlusÂgé"; "le_plus_âgé"] (embed_enfant) (
["EnfantLePlusÂgé"; "le_plus_âgé"] {io_input=NoInput; io_output=true}
(embed_enfant) (
try
(handle_default
{filename = ""; start_line=0; start_column=1;
@ -457,7 +458,7 @@ let verification_age_inferieur_ou_egal_a (verification_age_inferieur_ou_egal_a_i
let annees_: duration = verification_age_inferieur_ou_egal_a_in.VerificationAgeInferieurOuEgalAIn.annees_in in
let est_inferieur_ou_egal_: bool = (log_variable_definition
["VérificationÂgeInférieurOuÉgalÀ"; "est_inférieur_ou_égal"]
(embed_bool) (
{io_input=NoInput; io_output=true} (embed_bool) (
try
(handle_default
{filename = ""; start_line=0; start_column=1;
@ -484,7 +485,8 @@ let verification_age_superieur_a (verification_age_superieur_a_in: VerificationA
let date_courante_: date = verification_age_superieur_a_in.VerificationAgeSuperieurAIn.date_courante_in in
let annees_: duration = verification_age_superieur_a_in.VerificationAgeSuperieurAIn.annees_in in
let est_superieur_: bool = (log_variable_definition
["VérificationÂgeSupérieurÀ"; "est_supérieur"] (embed_bool) (
["VérificationÂgeSupérieurÀ"; "est_supérieur"] {io_input=NoInput;
io_output=true} (embed_bool) (
try
(handle_default
{filename = ""; start_line=0; start_column=1;
@ -526,7 +528,8 @@ let smic (smic_in: SmicIn.t) : Smic.t =
law_headings=["Prologue";
"Montant du salaire minimum de croissance"]}) in
let brut_horaire_: money = (log_variable_definition
["Smic"; "brut_horaire"] (embed_money) (
["Smic"; "brut_horaire"] {io_input=NoInput; io_output=true} (embed_money)
(
try
(handle_default
{filename = ""; start_line=0; start_column=1;
@ -1059,7 +1062,8 @@ let base_mensuelle_allocations_familiales (base_mensuelle_allocations_familiales
end_line=10; end_column=42;
law_headings=["Montant de la base mensuelle des allocations familiales"]}) in
let montant_: money = (log_variable_definition
["BaseMensuelleAllocationsFamiliales"; "montant"] (embed_money) (
["BaseMensuelleAllocationsFamiliales"; "montant"] {io_input=NoInput;
io_output=true} (embed_money) (
try
(handle_default
{filename = ""; start_line=0; start_column=1;
@ -1158,7 +1162,8 @@ let prestations_familiales (prestations_familiales_in: PrestationsFamilialesIn.t
let date_courante_: date = prestations_familiales_in.PrestationsFamilialesIn.date_courante_in in
let residence_: Collectivite.t = prestations_familiales_in.PrestationsFamilialesIn.residence_in in
let age_l512_3_2_: duration = (log_variable_definition
["PrestationsFamiliales"; "âge_l512_3_2"] (embed_duration) (
["PrestationsFamiliales"; "âge_l512_3_2"] {io_input=NoInput;
io_output=true} (embed_duration) (
try
(handle_default
{filename = ""; start_line=0; start_column=1;
@ -1181,7 +1186,8 @@ let prestations_familiales (prestations_familiales_in: PrestationsFamilialesIn.t
"Prologue"]})))) in
let smic_dot_date_courante_: date =
try ((log_variable_definition
["PrestationsFamiliales"; "smic.date_courante"] (embed_date)
["PrestationsFamiliales"; "smic.date_courante"] {io_input=OnlyInput;
io_output=false} (embed_date)
(handle_default
{filename = ""; start_line=0; start_column=1;
end_line=0; end_column=1; law_headings=[]} ([||])
@ -1199,7 +1205,8 @@ let prestations_familiales (prestations_familiales_in: PrestationsFamilialesIn.t
"Prologue"]})) in
let smic_dot_residence_: Collectivite.t =
try ((log_variable_definition
["PrestationsFamiliales"; "smic.résidence"] (embed_collectivite)
["PrestationsFamiliales"; "smic.résidence"] {io_input=OnlyInput;
io_output=false} (embed_collectivite)
(handle_default
{filename = ""; start_line=0; start_column=1;
end_line=0; end_column=1; law_headings=[]} ([||])
@ -1222,7 +1229,8 @@ let prestations_familiales (prestations_familiales_in: PrestationsFamilialesIn.t
SmicIn.residence_in = smic_dot_residence_}))) in
let smic_dot_brut_horaire_: money = result_.Smic.brut_horaire in
let regime_outre_mer_l751_1_: bool = (log_variable_definition
["PrestationsFamiliales"; "régime_outre_mer_l751_1"] (embed_bool) (
["PrestationsFamiliales"; "régime_outre_mer_l751_1"] {io_input=NoInput;
io_output=true} (embed_bool) (
try
(handle_default
{filename = ""; start_line=0; start_column=1;
@ -1266,7 +1274,8 @@ let prestations_familiales (prestations_familiales_in: PrestationsFamilialesIn.t
law_headings=["Prestations familiales"; "Champs d'applications";
"Prologue"]})))) in
let plafond_l512_3_2_: money = (log_variable_definition
["PrestationsFamiliales"; "plafond_l512_3_2"] (embed_money) (
["PrestationsFamiliales"; "plafond_l512_3_2"] {io_input=NoInput;
io_output=false} (embed_money) (
try
(handle_default
{filename = ""; start_line=0; start_column=1;
@ -1311,7 +1320,8 @@ let prestations_familiales (prestations_familiales_in: PrestationsFamilialesIn.t
law_headings=["Prestations familiales"; "Champs d'applications";
"Prologue"]})))) in
let conditions_hors_age_: Enfant.t -> bool = (log_variable_definition
["PrestationsFamiliales"; "conditions_hors_âge"] (unembeddable)
["PrestationsFamiliales"; "conditions_hors_âge"] {io_input=NoInput;
io_output=true} (unembeddable)
(fun (enfant_: Enfant.t) ->
try
(handle_default
@ -1372,7 +1382,8 @@ let prestations_familiales (prestations_familiales_in: PrestationsFamilialesIn.t
law_headings=["Prestations familiales"; "Champs d'applications";
"Prologue"]})))) in
let droit_ouvert_: Enfant.t -> bool = (log_variable_definition
["PrestationsFamiliales"; "droit_ouvert"] (unembeddable)
["PrestationsFamiliales"; "droit_ouvert"] {io_input=NoInput;
io_output=true} (unembeddable)
(fun (enfant_: Enfant.t) ->
try
(handle_default
@ -1505,7 +1516,8 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
let enfants_a_charge_: Enfant.t array = allocations_familiales_in.AllocationsFamilialesIn.enfants_a_charge_in in
let avait_enfant_a_charge_avant_1er_janvier_2012_: bool = allocations_familiales_in.AllocationsFamilialesIn.avait_enfant_a_charge_avant_1er_janvier_2012_in in
let prise_en_compte_: Enfant.t -> PriseEnCompte.t = (log_variable_definition
["AllocationsFamiliales"; "prise_en_compte"] (unembeddable)
["AllocationsFamiliales"; "prise_en_compte"] {io_input=NoInput;
io_output=false} (unembeddable)
(fun (enfant_: Enfant.t) ->
try
(handle_default
@ -1664,7 +1676,8 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
law_headings=["Allocations familiales"; "Champs d'applications";
"Prologue"]})))) in
let versement_: Enfant.t -> VersementAllocations.t = (log_variable_definition
["AllocationsFamiliales"; "versement"] (unembeddable)
["AllocationsFamiliales"; "versement"] {io_input=NoInput; io_output=true}
(unembeddable)
(fun (enfant_: Enfant.t) ->
try
(handle_default
@ -1836,7 +1849,7 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
"Prologue"]})))) in
let nombre_enfants_alinea_2_l521_3_: integer = (log_variable_definition
["AllocationsFamiliales"; "nombre_enfants_alinéa_2_l521_3"]
(embed_integer) (
{io_input=NoInput; io_output=false} (embed_integer) (
try
(handle_default
{filename = ""; start_line=0; start_column=1;
@ -1859,7 +1872,7 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
"Prologue"]})))) in
let nombre_enfants_alinea_2_l521_1_: integer = (log_variable_definition
["AllocationsFamiliales"; "nombre_enfants_alinéa_2_l521_1"]
(embed_integer) (
{io_input=NoInput; io_output=false} (embed_integer) (
try
(handle_default
{filename = ""; start_line=0; start_column=1;
@ -1917,7 +1930,8 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
"Code de la sécurité sociale"]}) in
let bmaf_dot_date_courante_: date =
try ((log_variable_definition
["AllocationsFamiliales"; "bmaf.date_courante"] (embed_date)
["AllocationsFamiliales"; "bmaf.date_courante"] {io_input=OnlyInput;
io_output=false} (embed_date)
(handle_default
{filename = ""; start_line=0; start_column=1;
end_line=0; end_column=1; law_headings=[]} ([||])
@ -1944,7 +1958,7 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
let prestations_familiales_dot_date_courante_: date =
try ((log_variable_definition
["AllocationsFamiliales"; "prestations_familiales.date_courante"]
(embed_date)
{io_input=OnlyInput; io_output=false} (embed_date)
(handle_default
{filename = ""; start_line=0; start_column=1;
end_line=0; end_column=1; law_headings=[]} ([||])
@ -1963,7 +1977,7 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
let prestations_familiales_dot_residence_: Collectivite.t =
try ((log_variable_definition
["AllocationsFamiliales"; "prestations_familiales.résidence"]
(embed_collectivite)
{io_input=OnlyInput; io_output=false} (embed_collectivite)
(handle_default
{filename = ""; start_line=0; start_column=1;
end_line=0; end_column=1; law_headings=[]} ([||])
@ -1995,7 +2009,7 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
let enfant_le_plus_age_dot_enfants_: Enfant.t array =
try ((log_variable_definition
["AllocationsFamiliales"; "enfant_le_plus_âgé.enfants"]
(embed_array (embed_enfant))
{io_input=OnlyInput; io_output=false} (embed_array (embed_enfant))
(handle_default
{filename = ""; start_line=0; start_column=1;
end_line=0; end_column=1; law_headings=[]} ([||])
@ -2017,7 +2031,8 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
({EnfantLePlusAgeIn.enfants_in = enfant_le_plus_age_dot_enfants_}))) in
let enfant_le_plus_age_dot_le_plus_age_: Enfant.t = result_.EnfantLePlusAge.le_plus_age in
let age_minimum_alinea_1_l521_3_: Enfant.t -> duration = (log_variable_definition
["AllocationsFamiliales"; "âge_minimum_alinéa_1_l521_3"] (unembeddable)
["AllocationsFamiliales"; "âge_minimum_alinéa_1_l521_3"]
{io_input=NoInput; io_output=false} (unembeddable)
(fun (enfant_: Enfant.t) ->
try
(handle_default
@ -2063,7 +2078,7 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
let enfants_a_charge_droit_ouvert_prestation_familiale_: Enfant.t array = (log_variable_definition
["AllocationsFamiliales";
"enfants_à_charge_droit_ouvert_prestation_familiale"]
(embed_array (embed_enfant)) (
{io_input=NoInput; io_output=false} (embed_array (embed_enfant)) (
try
(handle_default
{filename = ""; start_line=0; start_column=1;
@ -2083,12 +2098,13 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
["PrestationsFamiliales"; "droit_ouvert"]
((log_variable_definition
["PrestationsFamiliales"; "droit_ouvert"; "output"]
(embed_bool) ((log_begin_call
["PrestationsFamiliales"; "droit_ouvert"]
{io_input=NoInput; io_output=true} (embed_bool)
((log_begin_call ["PrestationsFamiliales"; "droit_ouvert"]
prestations_familiales_dot_droit_ouvert_)
((log_variable_definition
["PrestationsFamiliales"; "droit_ouvert"; "input0"]
(embed_enfant) enfant_))))))) enfants_a_charge_))
{io_input=OnlyInput; io_output=false} (embed_enfant)
enfant_))))))) enfants_a_charge_))
with
EmptyError -> (raise (NoValueProvided
{filename = "examples/allocations_familiales/prologue.catala_fr";
@ -2096,7 +2112,8 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
law_headings=["Allocations familiales"; "Champs d'applications";
"Prologue"]})))) in
let est_enfant_le_plus_age_: Enfant.t -> bool = (log_variable_definition
["AllocationsFamiliales"; "est_enfant_le_plus_âgé"] (unembeddable)
["AllocationsFamiliales"; "est_enfant_le_plus_âgé"] {io_input=NoInput;
io_output=false} (unembeddable)
(fun (enfant_: Enfant.t) ->
try
(handle_default
@ -2115,7 +2132,8 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
law_headings=["Allocations familiales"; "Champs d'applications";
"Prologue"]})))) in
let plafond__i_i_d521_3_: money = (log_variable_definition
["AllocationsFamiliales"; "plafond_II_d521_3"] (embed_money) (
["AllocationsFamiliales"; "plafond_II_d521_3"] {io_input=NoInput;
io_output=false} (embed_money) (
try
(handle_default
{filename = ""; start_line=0; start_column=1;
@ -2250,7 +2268,8 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
law_headings=["Allocations familiales"; "Champs d'applications";
"Prologue"]})))) in
let plafond__i_d521_3_: money = (log_variable_definition
["AllocationsFamiliales"; "plafond_I_d521_3"] (embed_money) (
["AllocationsFamiliales"; "plafond_I_d521_3"] {io_input=NoInput;
io_output=false} (embed_money) (
try
(handle_default
{filename = ""; start_line=0; start_column=1;
@ -2385,7 +2404,8 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
law_headings=["Allocations familiales"; "Champs d'applications";
"Prologue"]})))) in
let droit_ouvert_complement_: bool = (log_variable_definition
["AllocationsFamiliales"; "droit_ouvert_complément"] (embed_bool) (
["AllocationsFamiliales"; "droit_ouvert_complément"] {io_input=NoInput;
io_output=false} (embed_bool) (
try
(handle_default
{filename = ""; start_line=0; start_column=1;
@ -2435,7 +2455,8 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
law_headings=["Allocations familiales"; "Champs d'applications";
"Prologue"]})))) in
let droit_ouvert_forfaitaire_: Enfant.t -> bool = (log_variable_definition
["AllocationsFamiliales"; "droit_ouvert_forfaitaire"] (unembeddable)
["AllocationsFamiliales"; "droit_ouvert_forfaitaire"] {io_input=NoInput;
io_output=false} (unembeddable)
(fun (enfant_: Enfant.t) ->
try
(handle_default
@ -2496,6 +2517,7 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
((log_variable_definition
["PrestationsFamiliales";
"conditions_hors_âge"; "output"]
{io_input=NoInput; io_output=true}
(embed_bool) ((log_begin_call
["PrestationsFamiliales";
"conditions_hors_âge"]
@ -2503,6 +2525,7 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
((log_variable_definition
["PrestationsFamiliales";
"conditions_hors_âge"; "input0"]
{io_input=OnlyInput; io_output=false}
(embed_enfant) enfant_))))))))))))
(fun (_: unit) -> true))|])
(fun (_: unit) -> (log_decision_taken
@ -2520,8 +2543,8 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
"Prologue"]})))) in
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)
(
"montant_initial_base_quatrième_enfant_et_plus_mayotte"]
{io_input=NoInput; io_output=false} (embed_money) (
try
(handle_default
{filename = ""; start_line=0; start_column=1;
@ -2556,7 +2579,8 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
"Prologue"]})))) in
let montant_initial_base_troisieme_enfant_mayotte_: money = (log_variable_definition
["AllocationsFamiliales";
"montant_initial_base_troisième_enfant_mayotte"] (embed_money) (
"montant_initial_base_troisième_enfant_mayotte"] {io_input=NoInput;
io_output=false} (embed_money) (
try
(handle_default
{filename = ""; start_line=0; start_column=1;
@ -2884,7 +2908,8 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
law_headings=["Allocations familiales"; "Champs d'applications";
"Prologue"]})))) in
let nombre_total_enfants_: decimal = (log_variable_definition
["AllocationsFamiliales"; "nombre_total_enfants"] (embed_decimal) (
["AllocationsFamiliales"; "nombre_total_enfants"] {io_input=NoInput;
io_output=false} (embed_decimal) (
try
(handle_default
{filename = ""; start_line=0; start_column=1;
@ -2908,7 +2933,8 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
law_headings=["Allocations familiales"; "Champs d'applications";
"Prologue"]})))) in
let nombre_moyen_enfants_: decimal = (log_variable_definition
["AllocationsFamiliales"; "nombre_moyen_enfants"] (embed_decimal) (
["AllocationsFamiliales"; "nombre_moyen_enfants"] {io_input=NoInput;
io_output=false} (embed_decimal) (
try
(handle_default
{filename = ""; start_line=0; start_column=1;
@ -2932,11 +2958,13 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
["AllocationsFamiliales"; "prise_en_compte"]
((log_variable_definition
["AllocationsFamiliales"; "prise_en_compte"; "output"]
{io_input=NoInput; io_output=true}
(embed_prise_en_compte) ((log_begin_call
["AllocationsFamiliales"; "prise_en_compte"]
prise_en_compte_) ((log_variable_definition
["AllocationsFamiliales"; "prise_en_compte"; "input0"]
(embed_enfant) enfant_)))))))
{io_input=OnlyInput; io_output=false} (embed_enfant)
enfant_)))))))
with
| PriseEnCompte.Complete _ -> (decimal_of_string "1.")
| PriseEnCompte.Partagee _ -> (decimal_of_string "0.5")
@ -2950,7 +2978,7 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
"Prologue"]})))) in
let montant_initial_base_premier_enfant_: money = (log_variable_definition
["AllocationsFamiliales"; "montant_initial_base_premier_enfant"]
(embed_money) (
{io_input=NoInput; io_output=false} (embed_money) (
try
(handle_default
{filename = ""; start_line=0; start_column=1;
@ -3393,7 +3421,8 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
law_headings=["Allocations familiales"; "Champs d'applications";
"Prologue"]})))) in
let droit_ouvert_base_: bool = (log_variable_definition
["AllocationsFamiliales"; "droit_ouvert_base"] (embed_bool) (
["AllocationsFamiliales"; "droit_ouvert_base"] {io_input=NoInput;
io_output=false} (embed_bool) (
try
(handle_default
{filename = ""; start_line=0; start_column=1;
@ -3489,7 +3518,8 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
law_headings=["Allocations familiales"; "Champs d'applications";
"Prologue"]})))) in
let droit_ouvert_majoration_: Enfant.t -> bool = (log_variable_definition
["AllocationsFamiliales"; "droit_ouvert_majoration"] (unembeddable)
["AllocationsFamiliales"; "droit_ouvert_majoration"] {io_input=NoInput;
io_output=false} (unembeddable)
(fun (enfant_: Enfant.t) ->
try
(handle_default
@ -3528,7 +3558,8 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
((log_variable_definition
["AllocationsFamiliales";
"âge_minimum_alinéa_1_l521_3";
"output"] (embed_duration)
"output"] {io_input=NoInput;
io_output=true} (embed_duration)
((log_begin_call
["AllocationsFamiliales";
"âge_minimum_alinéa_1_l521_3"]
@ -3536,7 +3567,8 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
((log_variable_definition
["AllocationsFamiliales";
"âge_minimum_alinéa_1_l521_3";
"input0"] (embed_enfant)
"input0"] {io_input=OnlyInput;
io_output=false} (embed_enfant)
enfant_)))))))) date_courante_))))
(fun (_: unit) -> true))|])
(fun (_: unit) -> (log_decision_taken
@ -3556,13 +3588,15 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
((log_variable_definition
["AllocationsFamiliales";
"est_enfant_le_plus_âgé"; "output"]
(embed_bool) ((log_begin_call
{io_input=NoInput; io_output=true} (embed_bool)
((log_begin_call
["AllocationsFamiliales";
"est_enfant_le_plus_âgé"]
est_enfant_le_plus_age_)
((log_variable_definition
["AllocationsFamiliales";
"est_enfant_le_plus_âgé"; "input0"]
{io_input=OnlyInput; io_output=false}
(embed_enfant) enfant_))))))))
(o_lte_dat_dat
(o_add_dat_dur AbortOnRound
@ -3573,6 +3607,7 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
((log_variable_definition
["AllocationsFamiliales";
"âge_minimum_alinéa_1_l521_3"; "output"]
{io_input=NoInput; io_output=true}
(embed_duration) ((log_begin_call
["AllocationsFamiliales";
"âge_minimum_alinéa_1_l521_3"]
@ -3580,6 +3615,7 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
((log_variable_definition
["AllocationsFamiliales";
"âge_minimum_alinéa_1_l521_3"; "input0"]
{io_input=OnlyInput; io_output=false}
(embed_enfant) enfant_)))))))) date_courante_))))
(fun (_: unit) -> true))|])
(fun (_: unit) -> (log_decision_taken
@ -3596,7 +3632,8 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
law_headings=["Allocations familiales"; "Champs d'applications";
"Prologue"]})))) in
let complement_degressif_: money -> money = (log_variable_definition
["AllocationsFamiliales"; "complément_dégressif"] (unembeddable)
["AllocationsFamiliales"; "complément_dégressif"] {io_input=NoInput;
io_output=false} (unembeddable)
(fun (allocation_: money) ->
try
(handle_default
@ -3694,7 +3731,7 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
"Prologue"]})))) in
let montant_verse_forfaitaire_par_enfant_: money = (log_variable_definition
["AllocationsFamiliales"; "montant_versé_forfaitaire_par_enfant"]
(embed_money) (
{io_input=NoInput; io_output=false} (embed_money) (
try
(handle_default
{filename = ""; start_line=0; start_column=1;
@ -3772,7 +3809,8 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
"Prologue"]})))) in
let montant_initial_base_troisieme_enfant_et_plus_: money = (log_variable_definition
["AllocationsFamiliales";
"montant_initial_base_troisième_enfant_et_plus"] (embed_money) (
"montant_initial_base_troisième_enfant_et_plus"] {io_input=NoInput;
io_output=false} (embed_money) (
try
(handle_default
{filename = ""; start_line=0; start_column=1;
@ -3886,7 +3924,7 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
"Prologue"]})))) in
let montant_initial_base_deuxieme_enfant_: money = (log_variable_definition
["AllocationsFamiliales"; "montant_initial_base_deuxième_enfant"]
(embed_money) (
{io_input=NoInput; io_output=false} (embed_money) (
try
(handle_default
{filename = ""; start_line=0; start_column=1;
@ -4314,8 +4352,8 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
law_headings=["Allocations familiales"; "Champs d'applications";
"Prologue"]})))) in
let rapport_enfants_total_moyen_: decimal = (log_variable_definition
["AllocationsFamiliales"; "rapport_enfants_total_moyen"] (embed_decimal)
(
["AllocationsFamiliales"; "rapport_enfants_total_moyen"]
{io_input=NoInput; io_output=false} (embed_decimal) (
try
(handle_default
{filename = ""; start_line=0; start_column=1;
@ -4341,7 +4379,7 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
"Prologue"]})))) in
let montant_initial_metropole_majoration_: Enfant.t -> money = (log_variable_definition
["AllocationsFamiliales"; "montant_initial_métropole_majoration"]
(unembeddable)
{io_input=NoInput; io_output=false} (unembeddable)
(fun (enfant_: Enfant.t) ->
try
(handle_default
@ -4375,6 +4413,7 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
((log_variable_definition
["AllocationsFamiliales";
"droit_ouvert_majoration"; "output"]
{io_input=NoInput; io_output=true}
(embed_bool) ((log_begin_call
["AllocationsFamiliales";
"droit_ouvert_majoration"]
@ -4382,6 +4421,7 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
((log_variable_definition
["AllocationsFamiliales";
"droit_ouvert_majoration"; "input0"]
{io_input=OnlyInput; io_output=false}
(embed_enfant) enfant_))))))))))
(fun (_: unit) ->
o_mult_mon_rat bmaf_dot_montant_
@ -4412,6 +4452,7 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
((log_variable_definition
["AllocationsFamiliales";
"droit_ouvert_majoration"; "output"]
{io_input=NoInput; io_output=true}
(embed_bool) ((log_begin_call
["AllocationsFamiliales";
"droit_ouvert_majoration"]
@ -4419,6 +4460,7 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
((log_variable_definition
["AllocationsFamiliales";
"droit_ouvert_majoration"; "input0"]
{io_input=OnlyInput; io_output=false}
(embed_enfant) enfant_))))))))))
(fun (_: unit) ->
o_mult_mon_rat bmaf_dot_montant_
@ -4446,6 +4488,7 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
((log_variable_definition
["AllocationsFamiliales";
"droit_ouvert_majoration"; "output"]
{io_input=NoInput; io_output=true}
(embed_bool) ((log_begin_call
["AllocationsFamiliales";
"droit_ouvert_majoration"]
@ -4453,6 +4496,7 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
((log_variable_definition
["AllocationsFamiliales";
"droit_ouvert_majoration"; "input0"]
{io_input=OnlyInput; io_output=false}
(embed_enfant) enfant_))))))))))
(fun (_: unit) ->
o_mult_mon_rat bmaf_dot_montant_
@ -4473,6 +4517,7 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
((log_variable_definition
["AllocationsFamiliales";
"droit_ouvert_majoration"; "output"]
{io_input=NoInput; io_output=true}
(embed_bool) ((log_begin_call
["AllocationsFamiliales";
"droit_ouvert_majoration"]
@ -4480,6 +4525,7 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
((log_variable_definition
["AllocationsFamiliales";
"droit_ouvert_majoration"; "input0"]
{io_input=OnlyInput; io_output=false}
(embed_enfant) enfant_))))))))))
(fun (_: unit) -> money_of_cents_string "0"))|])
(fun (_: unit) -> false) (fun (_: unit) -> raise EmptyError)))
@ -4490,7 +4536,8 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
law_headings=["Allocations familiales"; "Champs d'applications";
"Prologue"]})))) in
let montant_verse_forfaitaire_: money = (log_variable_definition
["AllocationsFamiliales"; "montant_versé_forfaitaire"] (embed_money) (
["AllocationsFamiliales"; "montant_versé_forfaitaire"]
{io_input=NoInput; io_output=false} (embed_money) (
try
(handle_default
{filename = ""; start_line=0; start_column=1;
@ -4515,13 +4562,15 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
((log_variable_definition
["AllocationsFamiliales";
"droit_ouvert_forfaitaire"; "output"]
(embed_bool) ((log_begin_call
{io_input=NoInput; io_output=true} (embed_bool)
((log_begin_call
["AllocationsFamiliales";
"droit_ouvert_forfaitaire"]
droit_ouvert_forfaitaire_)
((log_variable_definition
["AllocationsFamiliales";
"droit_ouvert_forfaitaire"; "input0"]
{io_input=OnlyInput; io_output=false}
(embed_enfant) enfant_))))))) enfants_a_charge_)))))
with
EmptyError -> (raise (NoValueProvided
@ -4530,7 +4579,8 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
law_headings=["Allocations familiales"; "Champs d'applications";
"Prologue"]})))) in
let montant_initial_base_: money = (log_variable_definition
["AllocationsFamiliales"; "montant_initial_base"] (embed_money) (
["AllocationsFamiliales"; "montant_initial_base"] {io_input=NoInput;
io_output=false} (embed_money) (
try
(handle_default
{filename = ""; start_line=0; start_column=1;
@ -4609,7 +4659,8 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
law_headings=["Allocations familiales"; "Champs d'applications";
"Prologue"]})))) in
let montant_initial_majoration_: Enfant.t -> money = (log_variable_definition
["AllocationsFamiliales"; "montant_initial_majoration"] (unembeddable)
["AllocationsFamiliales"; "montant_initial_majoration"]
{io_input=NoInput; io_output=false} (unembeddable)
(fun (enfant_: Enfant.t) ->
try
(handle_default
@ -4645,6 +4696,7 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
((log_variable_definition
["AllocationsFamiliales";
"droit_ouvert_majoration"; "output"]
{io_input=NoInput; io_output=true}
(embed_bool) ((log_begin_call
["AllocationsFamiliales";
"droit_ouvert_majoration"]
@ -4652,6 +4704,7 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
((log_variable_definition
["AllocationsFamiliales";
"droit_ouvert_majoration"; "input0"]
{io_input=OnlyInput; io_output=false}
(embed_enfant) enfant_)))))))
(o_and
prestations_familiales_dot_regime_outre_mer_l751_1_
@ -4695,6 +4748,7 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
((log_variable_definition
["AllocationsFamiliales";
"droit_ouvert_majoration"; "output"]
{io_input=NoInput; io_output=true}
(embed_bool) ((log_begin_call
["AllocationsFamiliales";
"droit_ouvert_majoration"]
@ -4702,6 +4756,7 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
((log_variable_definition
["AllocationsFamiliales";
"droit_ouvert_majoration"; "input0"]
{io_input=OnlyInput; io_output=false}
(embed_enfant) enfant_)))))))
(o_and
prestations_familiales_dot_regime_outre_mer_l751_1_
@ -4735,14 +4790,16 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
((log_variable_definition
["AllocationsFamiliales";
"montant_initial_métropole_majoration"; "output"]
(embed_money) ((log_begin_call
{io_input=NoInput; io_output=true} (embed_money)
((log_begin_call
["AllocationsFamiliales";
"montant_initial_métropole_majoration"]
montant_initial_metropole_majoration_)
((log_variable_definition
["AllocationsFamiliales";
"montant_initial_métropole_majoration"; "input0"]
(embed_enfant) enfant_))))))))
{io_input=OnlyInput; io_output=false} (embed_enfant)
enfant_))))))))
with
EmptyError -> (raise (NoValueProvided
{filename = "examples/allocations_familiales/prologue.catala_fr";
@ -4751,7 +4808,7 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
"Prologue"]})))) in
let montant_verse_complement_pour_forfaitaire_: money = (log_variable_definition
["AllocationsFamiliales"; "montant_versé_complément_pour_forfaitaire"]
(embed_money) (
{io_input=NoInput; io_output=false} (embed_money) (
try
(handle_default
{filename = ""; start_line=0; start_column=1;
@ -4851,7 +4908,7 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
"Prologue"]})))) in
let montant_avec_garde_alternee_base_: money = (log_variable_definition
["AllocationsFamiliales"; "montant_avec_garde_alternée_base"]
(embed_money) (
{io_input=NoInput; io_output=false} (embed_money) (
try
(handle_default
{filename = ""; start_line=0; start_column=1;
@ -4875,7 +4932,7 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
"Prologue"]})))) in
let montant_avec_garde_alternee_majoration_: Enfant.t -> money = (log_variable_definition
["AllocationsFamiliales"; "montant_avec_garde_alternée_majoration"]
(unembeddable)
{io_input=NoInput; io_output=false} (unembeddable)
(fun (enfant_: Enfant.t) ->
try
(handle_default
@ -4895,20 +4952,24 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
["AllocationsFamiliales"; "montant_initial_majoration"]
((log_variable_definition
["AllocationsFamiliales"; "montant_initial_majoration";
"output"] (embed_money) ((log_begin_call
"output"] {io_input=NoInput; io_output=true} (embed_money)
((log_begin_call
["AllocationsFamiliales"; "montant_initial_majoration"]
montant_initial_majoration_) ((log_variable_definition
["AllocationsFamiliales"; "montant_initial_majoration";
"input0"] (embed_enfant) enfant_)))))))
"input0"] {io_input=OnlyInput; io_output=false}
(embed_enfant) enfant_)))))))
(match ((log_end_call
["AllocationsFamiliales"; "prise_en_compte"]
((log_variable_definition
["AllocationsFamiliales"; "prise_en_compte"; "output"]
{io_input=NoInput; io_output=true}
(embed_prise_en_compte) ((log_begin_call
["AllocationsFamiliales"; "prise_en_compte"]
prise_en_compte_) ((log_variable_definition
["AllocationsFamiliales"; "prise_en_compte"; "input0"]
(embed_enfant) enfant_)))))))
{io_input=OnlyInput; io_output=false} (embed_enfant)
enfant_)))))))
with
| PriseEnCompte.Complete _ -> (decimal_of_string "1.")
| PriseEnCompte.Partagee _ -> (decimal_of_string "0.5")
@ -4920,7 +4981,8 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
law_headings=["Allocations familiales"; "Champs d'applications";
"Prologue"]})))) in
let montant_verse_base_: money = (log_variable_definition
["AllocationsFamiliales"; "montant_versé_base"] (embed_money) (
["AllocationsFamiliales"; "montant_versé_base"] {io_input=NoInput;
io_output=false} (embed_money) (
try
(handle_default
{filename = ""; start_line=0; start_column=1;
@ -4939,7 +5001,8 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
law_headings=["Allocations familiales"; "Champs d'applications";
"Prologue"]})))) in
let montant_verse_majoration_: money = (log_variable_definition
["AllocationsFamiliales"; "montant_versé_majoration"] (embed_money) (
["AllocationsFamiliales"; "montant_versé_majoration"] {io_input=NoInput;
io_output=false} (embed_money) (
try
(handle_default
{filename = ""; start_line=0; start_column=1;
@ -4960,14 +5023,16 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
((log_variable_definition
["AllocationsFamiliales";
"montant_avec_garde_alternée_majoration"; "output"]
(embed_money) ((log_begin_call
{io_input=NoInput; io_output=true} (embed_money)
((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"; "input0"]
(embed_enfant) enfant_))))))) enfants_a_charge_)) else
{io_input=OnlyInput; io_output=false} (embed_enfant)
enfant_))))))) enfants_a_charge_)) else
(money_of_cents_string "0")))
with
EmptyError -> (raise (NoValueProvided
@ -4977,7 +5042,8 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
"Prologue"]})))) in
let montant_base_complement_pour_base_et_majoration_: money = (log_variable_definition
["AllocationsFamiliales";
"montant_base_complément_pour_base_et_majoration"] (embed_money) (
"montant_base_complément_pour_base_et_majoration"] {io_input=NoInput;
io_output=false} (embed_money) (
try
(handle_default
{filename = ""; start_line=0; start_column=1;
@ -5001,7 +5067,8 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
"Prologue"]})))) in
let montant_verse_complement_pour_base_et_majoration_: money = (log_variable_definition
["AllocationsFamiliales";
"montant_versé_complément_pour_base_et_majoration"] (embed_money) (
"montant_versé_complément_pour_base_et_majoration"]
{io_input=NoInput; io_output=false} (embed_money) (
try
(handle_default
{filename = ""; start_line=0; start_column=1;
@ -5021,11 +5088,12 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
["AllocationsFamiliales"; "complément_dégressif"]
((log_variable_definition
["AllocationsFamiliales"; "complément_dégressif"; "output"]
(embed_money) ((log_begin_call
{io_input=NoInput; io_output=true} (embed_money)
((log_begin_call
["AllocationsFamiliales"; "complément_dégressif"]
complement_degressif_) ((log_variable_definition
["AllocationsFamiliales"; "complément_dégressif"; "input0"]
(embed_money)
{io_input=OnlyInput; io_output=false} (embed_money)
montant_base_complement_pour_base_et_majoration_))))))) else
(money_of_cents_string "0")))
with
@ -5035,7 +5103,8 @@ let allocations_familiales (allocations_familiales_in: AllocationsFamilialesIn.t
law_headings=["Allocations familiales"; "Champs d'applications";
"Prologue"]})))) in
let montant_verse_: money = (log_variable_definition
["AllocationsFamiliales"; "montant_versé"] (embed_money) (
["AllocationsFamiliales"; "montant_versé"] {io_input=NoInput;
io_output=true} (embed_money) (
try
(handle_default
{filename = ""; start_line=0; start_column=1;
@ -5074,7 +5143,7 @@ let interface_allocations_familiales (interface_allocations_familiales_in: Inter
let i_avait_enfant_a_charge_avant_1er_janvier_2012_: bool = interface_allocations_familiales_in.InterfaceAllocationsFamilialesIn.i_avait_enfant_a_charge_avant_1er_janvier_2012_in in
let enfants_a_charge_: Enfant.t array = (log_variable_definition
["InterfaceAllocationsFamiliales"; "enfants_à_charge"]
(embed_array (embed_enfant)) (
{io_input=NoInput; io_output=false} (embed_array (embed_enfant)) (
try
(handle_default
{filename = ""; start_line=0; start_column=1;
@ -5124,7 +5193,7 @@ let interface_allocations_familiales (interface_allocations_familiales_in: Inter
try ((log_variable_definition
["InterfaceAllocationsFamiliales";
"allocations_familiales.personne_charge_effective_permanente_est_parent"]
(embed_bool)
{io_input=OnlyInput; io_output=false} (embed_bool)
(handle_default
{filename = ""; start_line=0; start_column=1;
end_line=0; end_column=1; law_headings=[]}
@ -5153,7 +5222,7 @@ let interface_allocations_familiales (interface_allocations_familiales_in: Inter
try ((log_variable_definition
["InterfaceAllocationsFamiliales";
"allocations_familiales.personne_charge_effective_permanente_remplit_titre_I"]
(embed_bool)
{io_input=OnlyInput; io_output=false} (embed_bool)
(handle_default
{filename = ""; start_line=0; start_column=1;
end_line=0; end_column=1; law_headings=[]}
@ -5181,7 +5250,8 @@ let interface_allocations_familiales (interface_allocations_familiales_in: Inter
let allocations_familiales_dot_ressources_menage_: money =
try ((log_variable_definition
["InterfaceAllocationsFamiliales";
"allocations_familiales.ressources_ménage"] (embed_money)
"allocations_familiales.ressources_ménage"] {io_input=OnlyInput;
io_output=false} (embed_money)
(handle_default
{filename = ""; start_line=0; start_column=1;
end_line=0; end_column=1; law_headings=[]} ([||])
@ -5198,7 +5268,7 @@ let interface_allocations_familiales (interface_allocations_familiales_in: Inter
let allocations_familiales_dot_residence_: Collectivite.t =
try ((log_variable_definition
["InterfaceAllocationsFamiliales"; "allocations_familiales.résidence"]
(embed_collectivite)
{io_input=OnlyInput; io_output=false} (embed_collectivite)
(handle_default
{filename = ""; start_line=0; start_column=1;
end_line=0; end_column=1; law_headings=[]} ([||])
@ -5215,7 +5285,8 @@ let interface_allocations_familiales (interface_allocations_familiales_in: Inter
let allocations_familiales_dot_date_courante_: date =
try ((log_variable_definition
["InterfaceAllocationsFamiliales";
"allocations_familiales.date_courante"] (embed_date)
"allocations_familiales.date_courante"] {io_input=OnlyInput;
io_output=false} (embed_date)
(handle_default
{filename = ""; start_line=0; start_column=1;
end_line=0; end_column=1; law_headings=[]} ([||])
@ -5232,8 +5303,8 @@ let interface_allocations_familiales (interface_allocations_familiales_in: Inter
let allocations_familiales_dot_enfants_a_charge_: Enfant.t array =
try ((log_variable_definition
["InterfaceAllocationsFamiliales";
"allocations_familiales.enfants_à_charge"]
(embed_array (embed_enfant))
"allocations_familiales.enfants_à_charge"] {io_input=OnlyInput;
io_output=false} (embed_array (embed_enfant))
(handle_default
{filename = ""; start_line=0; start_column=1;
end_line=0; end_column=1; law_headings=[]} ([||])
@ -5251,7 +5322,7 @@ let interface_allocations_familiales (interface_allocations_familiales_in: Inter
try ((log_variable_definition
["InterfaceAllocationsFamiliales";
"allocations_familiales.avait_enfant_à_charge_avant_1er_janvier_2012"]
(embed_bool)
{io_input=OnlyInput; io_output=false} (embed_bool)
(handle_default
{filename = ""; start_line=0; start_column=1;
end_line=0; end_column=1; law_headings=[]}
@ -5299,7 +5370,8 @@ let interface_allocations_familiales (interface_allocations_familiales_in: Inter
VersementAllocations.t = result_.AllocationsFamiliales.versement in
let allocations_familiales_dot_montant_verse_: money = result_.AllocationsFamiliales.montant_verse in
let i_montant_verse_: money = (log_variable_definition
["InterfaceAllocationsFamiliales"; "i_montant_versé"] (embed_money) (
["InterfaceAllocationsFamiliales"; "i_montant_versé"] {io_input=NoInput;
io_output=true} (embed_money) (
try
(handle_default
{filename = ""; start_line=0; start_column=1;

View File

@ -3798,9 +3798,9 @@ def smic(smic_in:SmicIn):
return False
def temp_brut_horaire_2(_:Unit):
def temp_brut_horaire_3(_:Unit):
return money_of_cents_string("851")
return money_of_cents_string("870")
def temp_brut_horaire_4(_:Unit):
return ((date_courante_6 >= date_of_numbers(2023,1,1)) and
return ((date_courante_6 >= date_of_numbers(2023,5,1)) and
(residence == Collectivite(Collectivite_Code.Mayotte,
Unit())))
return handle_default(SourcePosition(filename="", start_line=0,
@ -3809,9 +3809,9 @@ def smic(smic_in:SmicIn):
temp_brut_horaire_3)
def temp_brut_horaire_5(_:Unit):
def temp_brut_horaire_6(_:Unit):
return money_of_cents_string("1127")
return money_of_cents_string("1152")
def temp_brut_horaire_7(_:Unit):
return ((date_courante_6 >= date_of_numbers(2023,1,1)) and
return ((date_courante_6 >= date_of_numbers(2023,5,1)) and
((residence == Collectivite(Collectivite_Code.Metropole,
Unit())) or ((residence ==
Collectivite(Collectivite_Code.Guadeloupe, Unit())) or
@ -3832,10 +3832,10 @@ def smic(smic_in:SmicIn):
temp_brut_horaire_6)
def temp_brut_horaire_8(_:Unit):
def temp_brut_horaire_9(_:Unit):
return money_of_cents_string("835")
return money_of_cents_string("851")
def temp_brut_horaire_10(_:Unit):
return ((date_courante_6 >= date_of_numbers(2022,8,1)) and
((date_courante_6 <= date_of_numbers(2022,12,31)) and
return ((date_courante_6 >= date_of_numbers(2023,1,1)) and
((date_courante_6 < date_of_numbers(2023,5,1)) and
(residence == Collectivite(Collectivite_Code.Mayotte,
Unit()))))
return handle_default(SourcePosition(filename="", start_line=0,
@ -3844,10 +3844,10 @@ def smic(smic_in:SmicIn):
temp_brut_horaire_9)
def temp_brut_horaire_11(_:Unit):
def temp_brut_horaire_12(_:Unit):
return money_of_cents_string("1107")
return money_of_cents_string("1127")
def temp_brut_horaire_13(_:Unit):
return ((date_courante_6 >= date_of_numbers(2022,8,1)) and
((date_courante_6 <= date_of_numbers(2022,12,31)) and
return ((date_courante_6 >= date_of_numbers(2023,1,1)) and
((date_courante_6 < date_of_numbers(2023,5,1)) and
((residence == Collectivite(Collectivite_Code.Metropole,
Unit())) or ((residence ==
Collectivite(Collectivite_Code.Guadeloupe, Unit())) or
@ -3868,10 +3868,10 @@ def smic(smic_in:SmicIn):
temp_brut_horaire_12)
def temp_brut_horaire_14(_:Unit):
def temp_brut_horaire_15(_:Unit):
return money_of_cents_string("819")
return money_of_cents_string("835")
def temp_brut_horaire_16(_:Unit):
return ((date_courante_6 >= date_of_numbers(2022,5,1)) and
((date_courante_6 <= date_of_numbers(2022,7,31)) and
return ((date_courante_6 >= date_of_numbers(2022,8,1)) and
((date_courante_6 <= date_of_numbers(2022,12,31)) and
(residence == Collectivite(Collectivite_Code.Mayotte,
Unit()))))
return handle_default(SourcePosition(filename="", start_line=0,
@ -3880,10 +3880,10 @@ def smic(smic_in:SmicIn):
temp_brut_horaire_15)
def temp_brut_horaire_17(_:Unit):
def temp_brut_horaire_18(_:Unit):
return money_of_cents_string("1085")
return money_of_cents_string("1107")
def temp_brut_horaire_19(_:Unit):
return ((date_courante_6 >= date_of_numbers(2022,5,1)) and
((date_courante_6 <= date_of_numbers(2022,7,31)) and
return ((date_courante_6 >= date_of_numbers(2022,8,1)) and
((date_courante_6 <= date_of_numbers(2022,12,31)) and
((residence == Collectivite(Collectivite_Code.Metropole,
Unit())) or ((residence ==
Collectivite(Collectivite_Code.Guadeloupe, Unit())) or
@ -3904,10 +3904,10 @@ def smic(smic_in:SmicIn):
temp_brut_horaire_18)
def temp_brut_horaire_20(_:Unit):
def temp_brut_horaire_21(_:Unit):
return money_of_cents_string("798")
return money_of_cents_string("819")
def temp_brut_horaire_22(_:Unit):
return ((date_courante_6 >= date_of_numbers(2022,1,1)) and
((date_courante_6 <= date_of_numbers(2022,4,30)) and
return ((date_courante_6 >= date_of_numbers(2022,5,1)) and
((date_courante_6 <= date_of_numbers(2022,7,31)) and
(residence == Collectivite(Collectivite_Code.Mayotte,
Unit()))))
return handle_default(SourcePosition(filename="", start_line=0,
@ -3916,10 +3916,10 @@ def smic(smic_in:SmicIn):
temp_brut_horaire_21)
def temp_brut_horaire_23(_:Unit):
def temp_brut_horaire_24(_:Unit):
return money_of_cents_string("1057")
return money_of_cents_string("1085")
def temp_brut_horaire_25(_:Unit):
return ((date_courante_6 >= date_of_numbers(2022,1,1)) and
((date_courante_6 <= date_of_numbers(2022,4,30)) and
return ((date_courante_6 >= date_of_numbers(2022,5,1)) and
((date_courante_6 <= date_of_numbers(2022,7,31)) and
((residence == Collectivite(Collectivite_Code.Metropole,
Unit())) or ((residence ==
Collectivite(Collectivite_Code.Guadeloupe, Unit())) or
@ -3940,10 +3940,10 @@ def smic(smic_in:SmicIn):
temp_brut_horaire_24)
def temp_brut_horaire_26(_:Unit):
def temp_brut_horaire_27(_:Unit):
return money_of_cents_string("774")
return money_of_cents_string("798")
def temp_brut_horaire_28(_:Unit):
return ((date_courante_6 >= date_of_numbers(2021,1,1)) and
((date_courante_6 <= date_of_numbers(2021,12,31)) and
return ((date_courante_6 >= date_of_numbers(2022,1,1)) and
((date_courante_6 <= date_of_numbers(2022,4,30)) and
(residence == Collectivite(Collectivite_Code.Mayotte,
Unit()))))
return handle_default(SourcePosition(filename="", start_line=0,
@ -3952,10 +3952,10 @@ def smic(smic_in:SmicIn):
temp_brut_horaire_27)
def temp_brut_horaire_29(_:Unit):
def temp_brut_horaire_30(_:Unit):
return money_of_cents_string("1025")
return money_of_cents_string("1057")
def temp_brut_horaire_31(_:Unit):
return ((date_courante_6 >= date_of_numbers(2021,1,1)) and
((date_courante_6 <= date_of_numbers(2021,12,31)) and
return ((date_courante_6 >= date_of_numbers(2022,1,1)) and
((date_courante_6 <= date_of_numbers(2022,4,30)) and
((residence == Collectivite(Collectivite_Code.Metropole,
Unit())) or ((residence ==
Collectivite(Collectivite_Code.Guadeloupe, Unit())) or
@ -3976,10 +3976,10 @@ def smic(smic_in:SmicIn):
temp_brut_horaire_30)
def temp_brut_horaire_32(_:Unit):
def temp_brut_horaire_33(_:Unit):
return money_of_cents_string("766")
return money_of_cents_string("774")
def temp_brut_horaire_34(_:Unit):
return ((date_courante_6 >= date_of_numbers(2020,1,1)) and
((date_courante_6 <= date_of_numbers(2020,12,31)) and
return ((date_courante_6 >= date_of_numbers(2021,1,1)) and
((date_courante_6 <= date_of_numbers(2021,12,31)) and
(residence == Collectivite(Collectivite_Code.Mayotte,
Unit()))))
return handle_default(SourcePosition(filename="", start_line=0,
@ -3988,10 +3988,10 @@ def smic(smic_in:SmicIn):
temp_brut_horaire_33)
def temp_brut_horaire_35(_:Unit):
def temp_brut_horaire_36(_:Unit):
return money_of_cents_string("1015")
return money_of_cents_string("1025")
def temp_brut_horaire_37(_:Unit):
return ((date_courante_6 >= date_of_numbers(2020,1,1)) and
((date_courante_6 <= date_of_numbers(2020,12,31)) and
return ((date_courante_6 >= date_of_numbers(2021,1,1)) and
((date_courante_6 <= date_of_numbers(2021,12,31)) and
((residence == Collectivite(Collectivite_Code.Metropole,
Unit())) or ((residence ==
Collectivite(Collectivite_Code.Guadeloupe, Unit())) or
@ -4012,10 +4012,10 @@ def smic(smic_in:SmicIn):
temp_brut_horaire_36)
def temp_brut_horaire_38(_:Unit):
def temp_brut_horaire_39(_:Unit):
return money_of_cents_string("757")
return money_of_cents_string("766")
def temp_brut_horaire_40(_:Unit):
return ((date_courante_6 >= date_of_numbers(2019,1,1)) and
((date_courante_6 <= date_of_numbers(2019,12,31)) and
return ((date_courante_6 >= date_of_numbers(2020,1,1)) and
((date_courante_6 <= date_of_numbers(2020,12,31)) and
(residence == Collectivite(Collectivite_Code.Mayotte,
Unit()))))
return handle_default(SourcePosition(filename="", start_line=0,
@ -4024,10 +4024,10 @@ def smic(smic_in:SmicIn):
temp_brut_horaire_39)
def temp_brut_horaire_41(_:Unit):
def temp_brut_horaire_42(_:Unit):
return money_of_cents_string("1003")
return money_of_cents_string("1015")
def temp_brut_horaire_43(_:Unit):
return ((date_courante_6 >= date_of_numbers(2019,1,1)) and
((date_courante_6 <= date_of_numbers(2019,12,31)) and
return ((date_courante_6 >= date_of_numbers(2020,1,1)) and
((date_courante_6 <= date_of_numbers(2020,12,31)) and
((residence == Collectivite(Collectivite_Code.Metropole,
Unit())) or ((residence ==
Collectivite(Collectivite_Code.Guadeloupe, Unit())) or
@ -4046,10 +4046,48 @@ def smic(smic_in:SmicIn):
start_column=1, end_line=0, end_column=1,
law_headings=[]), [], temp_brut_horaire_43,
temp_brut_horaire_42)
temp_brut_horaire_44 = handle_default(SourcePosition(filename="",
def temp_brut_horaire_44(_:Unit):
def temp_brut_horaire_45(_:Unit):
return money_of_cents_string("757")
def temp_brut_horaire_46(_:Unit):
return ((date_courante_6 >= date_of_numbers(2019,1,1)) and
((date_courante_6 <= date_of_numbers(2019,12,31)) and
(residence == Collectivite(Collectivite_Code.Mayotte,
Unit()))))
return handle_default(SourcePosition(filename="", start_line=0,
start_column=1, end_line=0, end_column=1,
law_headings=[]), [], temp_brut_horaire_46,
temp_brut_horaire_45)
def temp_brut_horaire_47(_:Unit):
def temp_brut_horaire_48(_:Unit):
return money_of_cents_string("1003")
def temp_brut_horaire_49(_:Unit):
return ((date_courante_6 >= date_of_numbers(2019,1,1)) and
((date_courante_6 <= date_of_numbers(2019,12,31)) and
((residence == Collectivite(Collectivite_Code.Metropole,
Unit())) or ((residence ==
Collectivite(Collectivite_Code.Guadeloupe, Unit())) or
((residence == Collectivite(Collectivite_Code.Guyane,
Unit())) or ((residence ==
Collectivite(Collectivite_Code.Martinique, Unit())) or
((residence == Collectivite(Collectivite_Code.LaReunion,
Unit())) or ((residence ==
Collectivite(Collectivite_Code.SaintBarthelemy,
Unit())) or ((residence ==
Collectivite(Collectivite_Code.SaintMartin, Unit())) or
(residence ==
Collectivite(Collectivite_Code.SaintPierreEtMiquelon,
Unit())))))))))))
return handle_default(SourcePosition(filename="", start_line=0,
start_column=1, end_line=0, end_column=1,
law_headings=[]), [], temp_brut_horaire_49,
temp_brut_horaire_48)
temp_brut_horaire_50 = handle_default(SourcePosition(filename="",
start_line=0, start_column=1,
end_line=0, end_column=1,
law_headings=[]), [temp_brut_horaire_41,
law_headings=[]), [temp_brut_horaire_47,
temp_brut_horaire_44,
temp_brut_horaire_41,
temp_brut_horaire_38,
temp_brut_horaire_35,
temp_brut_horaire_32,
@ -4066,13 +4104,13 @@ def smic(smic_in:SmicIn):
temp_brut_horaire_1,
temp_brut_horaire)
except EmptyError:
temp_brut_horaire_44 = dead_value
temp_brut_horaire_50 = dead_value
raise NoValueProvided(SourcePosition(filename="examples/aides_logement/../prestations_familiales/../smic/smic.catala_fr",
start_line=11, start_column=12,
end_line=11, end_column=24,
law_headings=["Prologue",
"Montant du salaire minimum de croissance"]))
brut_horaire = temp_brut_horaire_44
brut_horaire = temp_brut_horaire_50
return Smic(brut_horaire = brut_horaire)
def arrondi_centaine_superieure(ressources_menage:Money):
@ -13501,22 +13539,22 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen
match_arg_393 = residence_5
if match_arg_393.code == Collectivite_Code.Guadeloupe:
_ = match_arg_393.value
temp_abattement_forfaitaire_d823_17_49 = True
temp_abattement_forfaitaire_d823_17_49 = False
elif match_arg_393.code == Collectivite_Code.Guyane:
_ = match_arg_393.value
temp_abattement_forfaitaire_d823_17_49 = False
elif match_arg_393.code == Collectivite_Code.Martinique:
_ = match_arg_393.value
temp_abattement_forfaitaire_d823_17_49 = True
temp_abattement_forfaitaire_d823_17_49 = False
elif match_arg_393.code == Collectivite_Code.LaReunion:
_ = match_arg_393.value
temp_abattement_forfaitaire_d823_17_49 = True
temp_abattement_forfaitaire_d823_17_49 = False
elif match_arg_393.code == Collectivite_Code.SaintBarthelemy:
_ = match_arg_393.value
temp_abattement_forfaitaire_d823_17_49 = True
temp_abattement_forfaitaire_d823_17_49 = False
elif match_arg_393.code == Collectivite_Code.SaintMartin:
_ = match_arg_393.value
temp_abattement_forfaitaire_d823_17_49 = True
temp_abattement_forfaitaire_d823_17_49 = False
elif match_arg_393.code == Collectivite_Code.Metropole:
_ = match_arg_393.value
temp_abattement_forfaitaire_d823_17_49 = False
@ -13574,22 +13612,22 @@ def calcul_aide_personnalisee_logement_locatif(calcul_aide_personnalisee_logemen
match_arg_395 = residence_5
if match_arg_395.code == Collectivite_Code.Guadeloupe:
_ = match_arg_395.value
temp_abattement_forfaitaire_d823_17_53 = True
temp_abattement_forfaitaire_d823_17_53 = False
elif match_arg_395.code == Collectivite_Code.Guyane:
_ = match_arg_395.value
temp_abattement_forfaitaire_d823_17_53 = False
elif match_arg_395.code == Collectivite_Code.Martinique:
_ = match_arg_395.value
temp_abattement_forfaitaire_d823_17_53 = True
temp_abattement_forfaitaire_d823_17_53 = False
elif match_arg_395.code == Collectivite_Code.LaReunion:
_ = match_arg_395.value
temp_abattement_forfaitaire_d823_17_53 = True
temp_abattement_forfaitaire_d823_17_53 = False
elif match_arg_395.code == Collectivite_Code.SaintBarthelemy:
_ = match_arg_395.value
temp_abattement_forfaitaire_d823_17_53 = True
temp_abattement_forfaitaire_d823_17_53 = False
elif match_arg_395.code == Collectivite_Code.SaintMartin:
_ = match_arg_395.value
temp_abattement_forfaitaire_d823_17_53 = True
temp_abattement_forfaitaire_d823_17_53 = False
elif match_arg_395.code == Collectivite_Code.Metropole:
_ = match_arg_395.value
temp_abattement_forfaitaire_d823_17_53 = False

View File

@ -647,9 +647,9 @@ def smic(smic_in:SmicIn):
return False
def temp_brut_horaire_2(_:Unit):
def temp_brut_horaire_3(_:Unit):
return money_of_cents_string("851")
return money_of_cents_string("870")
def temp_brut_horaire_4(_:Unit):
return ((date_courante_2 >= date_of_numbers(2023,1,1)) and
return ((date_courante_2 >= date_of_numbers(2023,5,1)) and
(residence == Collectivite(Collectivite_Code.Mayotte,
Unit())))
return handle_default(SourcePosition(filename="", start_line=0,
@ -658,9 +658,9 @@ def smic(smic_in:SmicIn):
temp_brut_horaire_3)
def temp_brut_horaire_5(_:Unit):
def temp_brut_horaire_6(_:Unit):
return money_of_cents_string("1127")
return money_of_cents_string("1152")
def temp_brut_horaire_7(_:Unit):
return ((date_courante_2 >= date_of_numbers(2023,1,1)) and
return ((date_courante_2 >= date_of_numbers(2023,5,1)) and
((residence == Collectivite(Collectivite_Code.Metropole,
Unit())) or ((residence ==
Collectivite(Collectivite_Code.Guadeloupe, Unit())) or
@ -681,10 +681,10 @@ def smic(smic_in:SmicIn):
temp_brut_horaire_6)
def temp_brut_horaire_8(_:Unit):
def temp_brut_horaire_9(_:Unit):
return money_of_cents_string("835")
return money_of_cents_string("851")
def temp_brut_horaire_10(_:Unit):
return ((date_courante_2 >= date_of_numbers(2022,8,1)) and
((date_courante_2 <= date_of_numbers(2022,12,31)) and
return ((date_courante_2 >= date_of_numbers(2023,1,1)) and
((date_courante_2 < date_of_numbers(2023,5,1)) and
(residence == Collectivite(Collectivite_Code.Mayotte,
Unit()))))
return handle_default(SourcePosition(filename="", start_line=0,
@ -693,10 +693,10 @@ def smic(smic_in:SmicIn):
temp_brut_horaire_9)
def temp_brut_horaire_11(_:Unit):
def temp_brut_horaire_12(_:Unit):
return money_of_cents_string("1107")
return money_of_cents_string("1127")
def temp_brut_horaire_13(_:Unit):
return ((date_courante_2 >= date_of_numbers(2022,8,1)) and
((date_courante_2 <= date_of_numbers(2022,12,31)) and
return ((date_courante_2 >= date_of_numbers(2023,1,1)) and
((date_courante_2 < date_of_numbers(2023,5,1)) and
((residence == Collectivite(Collectivite_Code.Metropole,
Unit())) or ((residence ==
Collectivite(Collectivite_Code.Guadeloupe, Unit())) or
@ -717,10 +717,10 @@ def smic(smic_in:SmicIn):
temp_brut_horaire_12)
def temp_brut_horaire_14(_:Unit):
def temp_brut_horaire_15(_:Unit):
return money_of_cents_string("819")
return money_of_cents_string("835")
def temp_brut_horaire_16(_:Unit):
return ((date_courante_2 >= date_of_numbers(2022,5,1)) and
((date_courante_2 <= date_of_numbers(2022,7,31)) and
return ((date_courante_2 >= date_of_numbers(2022,8,1)) and
((date_courante_2 <= date_of_numbers(2022,12,31)) and
(residence == Collectivite(Collectivite_Code.Mayotte,
Unit()))))
return handle_default(SourcePosition(filename="", start_line=0,
@ -729,10 +729,10 @@ def smic(smic_in:SmicIn):
temp_brut_horaire_15)
def temp_brut_horaire_17(_:Unit):
def temp_brut_horaire_18(_:Unit):
return money_of_cents_string("1085")
return money_of_cents_string("1107")
def temp_brut_horaire_19(_:Unit):
return ((date_courante_2 >= date_of_numbers(2022,5,1)) and
((date_courante_2 <= date_of_numbers(2022,7,31)) and
return ((date_courante_2 >= date_of_numbers(2022,8,1)) and
((date_courante_2 <= date_of_numbers(2022,12,31)) and
((residence == Collectivite(Collectivite_Code.Metropole,
Unit())) or ((residence ==
Collectivite(Collectivite_Code.Guadeloupe, Unit())) or
@ -753,10 +753,10 @@ def smic(smic_in:SmicIn):
temp_brut_horaire_18)
def temp_brut_horaire_20(_:Unit):
def temp_brut_horaire_21(_:Unit):
return money_of_cents_string("798")
return money_of_cents_string("819")
def temp_brut_horaire_22(_:Unit):
return ((date_courante_2 >= date_of_numbers(2022,1,1)) and
((date_courante_2 <= date_of_numbers(2022,4,30)) and
return ((date_courante_2 >= date_of_numbers(2022,5,1)) and
((date_courante_2 <= date_of_numbers(2022,7,31)) and
(residence == Collectivite(Collectivite_Code.Mayotte,
Unit()))))
return handle_default(SourcePosition(filename="", start_line=0,
@ -765,10 +765,10 @@ def smic(smic_in:SmicIn):
temp_brut_horaire_21)
def temp_brut_horaire_23(_:Unit):
def temp_brut_horaire_24(_:Unit):
return money_of_cents_string("1057")
return money_of_cents_string("1085")
def temp_brut_horaire_25(_:Unit):
return ((date_courante_2 >= date_of_numbers(2022,1,1)) and
((date_courante_2 <= date_of_numbers(2022,4,30)) and
return ((date_courante_2 >= date_of_numbers(2022,5,1)) and
((date_courante_2 <= date_of_numbers(2022,7,31)) and
((residence == Collectivite(Collectivite_Code.Metropole,
Unit())) or ((residence ==
Collectivite(Collectivite_Code.Guadeloupe, Unit())) or
@ -789,10 +789,10 @@ def smic(smic_in:SmicIn):
temp_brut_horaire_24)
def temp_brut_horaire_26(_:Unit):
def temp_brut_horaire_27(_:Unit):
return money_of_cents_string("774")
return money_of_cents_string("798")
def temp_brut_horaire_28(_:Unit):
return ((date_courante_2 >= date_of_numbers(2021,1,1)) and
((date_courante_2 <= date_of_numbers(2021,12,31)) and
return ((date_courante_2 >= date_of_numbers(2022,1,1)) and
((date_courante_2 <= date_of_numbers(2022,4,30)) and
(residence == Collectivite(Collectivite_Code.Mayotte,
Unit()))))
return handle_default(SourcePosition(filename="", start_line=0,
@ -801,10 +801,10 @@ def smic(smic_in:SmicIn):
temp_brut_horaire_27)
def temp_brut_horaire_29(_:Unit):
def temp_brut_horaire_30(_:Unit):
return money_of_cents_string("1025")
return money_of_cents_string("1057")
def temp_brut_horaire_31(_:Unit):
return ((date_courante_2 >= date_of_numbers(2021,1,1)) and
((date_courante_2 <= date_of_numbers(2021,12,31)) and
return ((date_courante_2 >= date_of_numbers(2022,1,1)) and
((date_courante_2 <= date_of_numbers(2022,4,30)) and
((residence == Collectivite(Collectivite_Code.Metropole,
Unit())) or ((residence ==
Collectivite(Collectivite_Code.Guadeloupe, Unit())) or
@ -825,10 +825,10 @@ def smic(smic_in:SmicIn):
temp_brut_horaire_30)
def temp_brut_horaire_32(_:Unit):
def temp_brut_horaire_33(_:Unit):
return money_of_cents_string("766")
return money_of_cents_string("774")
def temp_brut_horaire_34(_:Unit):
return ((date_courante_2 >= date_of_numbers(2020,1,1)) and
((date_courante_2 <= date_of_numbers(2020,12,31)) and
return ((date_courante_2 >= date_of_numbers(2021,1,1)) and
((date_courante_2 <= date_of_numbers(2021,12,31)) and
(residence == Collectivite(Collectivite_Code.Mayotte,
Unit()))))
return handle_default(SourcePosition(filename="", start_line=0,
@ -837,10 +837,10 @@ def smic(smic_in:SmicIn):
temp_brut_horaire_33)
def temp_brut_horaire_35(_:Unit):
def temp_brut_horaire_36(_:Unit):
return money_of_cents_string("1015")
return money_of_cents_string("1025")
def temp_brut_horaire_37(_:Unit):
return ((date_courante_2 >= date_of_numbers(2020,1,1)) and
((date_courante_2 <= date_of_numbers(2020,12,31)) and
return ((date_courante_2 >= date_of_numbers(2021,1,1)) and
((date_courante_2 <= date_of_numbers(2021,12,31)) and
((residence == Collectivite(Collectivite_Code.Metropole,
Unit())) or ((residence ==
Collectivite(Collectivite_Code.Guadeloupe, Unit())) or
@ -861,10 +861,10 @@ def smic(smic_in:SmicIn):
temp_brut_horaire_36)
def temp_brut_horaire_38(_:Unit):
def temp_brut_horaire_39(_:Unit):
return money_of_cents_string("757")
return money_of_cents_string("766")
def temp_brut_horaire_40(_:Unit):
return ((date_courante_2 >= date_of_numbers(2019,1,1)) and
((date_courante_2 <= date_of_numbers(2019,12,31)) and
return ((date_courante_2 >= date_of_numbers(2020,1,1)) and
((date_courante_2 <= date_of_numbers(2020,12,31)) and
(residence == Collectivite(Collectivite_Code.Mayotte,
Unit()))))
return handle_default(SourcePosition(filename="", start_line=0,
@ -873,10 +873,10 @@ def smic(smic_in:SmicIn):
temp_brut_horaire_39)
def temp_brut_horaire_41(_:Unit):
def temp_brut_horaire_42(_:Unit):
return money_of_cents_string("1003")
return money_of_cents_string("1015")
def temp_brut_horaire_43(_:Unit):
return ((date_courante_2 >= date_of_numbers(2019,1,1)) and
((date_courante_2 <= date_of_numbers(2019,12,31)) and
return ((date_courante_2 >= date_of_numbers(2020,1,1)) and
((date_courante_2 <= date_of_numbers(2020,12,31)) and
((residence == Collectivite(Collectivite_Code.Metropole,
Unit())) or ((residence ==
Collectivite(Collectivite_Code.Guadeloupe, Unit())) or
@ -895,10 +895,48 @@ def smic(smic_in:SmicIn):
start_column=1, end_line=0, end_column=1,
law_headings=[]), [], temp_brut_horaire_43,
temp_brut_horaire_42)
temp_brut_horaire_44 = handle_default(SourcePosition(filename="",
def temp_brut_horaire_44(_:Unit):
def temp_brut_horaire_45(_:Unit):
return money_of_cents_string("757")
def temp_brut_horaire_46(_:Unit):
return ((date_courante_2 >= date_of_numbers(2019,1,1)) and
((date_courante_2 <= date_of_numbers(2019,12,31)) and
(residence == Collectivite(Collectivite_Code.Mayotte,
Unit()))))
return handle_default(SourcePosition(filename="", start_line=0,
start_column=1, end_line=0, end_column=1,
law_headings=[]), [], temp_brut_horaire_46,
temp_brut_horaire_45)
def temp_brut_horaire_47(_:Unit):
def temp_brut_horaire_48(_:Unit):
return money_of_cents_string("1003")
def temp_brut_horaire_49(_:Unit):
return ((date_courante_2 >= date_of_numbers(2019,1,1)) and
((date_courante_2 <= date_of_numbers(2019,12,31)) and
((residence == Collectivite(Collectivite_Code.Metropole,
Unit())) or ((residence ==
Collectivite(Collectivite_Code.Guadeloupe, Unit())) or
((residence == Collectivite(Collectivite_Code.Guyane,
Unit())) or ((residence ==
Collectivite(Collectivite_Code.Martinique, Unit())) or
((residence == Collectivite(Collectivite_Code.LaReunion,
Unit())) or ((residence ==
Collectivite(Collectivite_Code.SaintBarthelemy,
Unit())) or ((residence ==
Collectivite(Collectivite_Code.SaintMartin, Unit())) or
(residence ==
Collectivite(Collectivite_Code.SaintPierreEtMiquelon,
Unit())))))))))))
return handle_default(SourcePosition(filename="", start_line=0,
start_column=1, end_line=0, end_column=1,
law_headings=[]), [], temp_brut_horaire_49,
temp_brut_horaire_48)
temp_brut_horaire_50 = handle_default(SourcePosition(filename="",
start_line=0, start_column=1,
end_line=0, end_column=1,
law_headings=[]), [temp_brut_horaire_41,
law_headings=[]), [temp_brut_horaire_47,
temp_brut_horaire_44,
temp_brut_horaire_41,
temp_brut_horaire_38,
temp_brut_horaire_35,
temp_brut_horaire_32,
@ -915,13 +953,13 @@ def smic(smic_in:SmicIn):
temp_brut_horaire_1,
temp_brut_horaire)
except EmptyError:
temp_brut_horaire_44 = dead_value
temp_brut_horaire_50 = dead_value
raise NoValueProvided(SourcePosition(filename="examples/allocations_familiales/../smic/smic.catala_fr",
start_line=11, start_column=12,
end_line=11, end_column=24,
law_headings=["Prologue",
"Montant du salaire minimum de croissance"]))
brut_horaire = temp_brut_horaire_44
brut_horaire = temp_brut_horaire_50
return Smic(brut_horaire = brut_horaire)
def base_mensuelle_allocations_familiales(base_mensuelle_allocations_familiales_in:BaseMensuelleAllocationsFamilialesIn):

View File

@ -32,6 +32,7 @@ class type raw_event =
method eventType : Js.js_string Js.t Js.prop
method information : Js.js_string Js.t Js.js_array Js.t Js.prop
method sourcePosition : source_position Js.t Js.optdef Js.prop
method loggedIOJson : Js.js_string Js.t Js.prop
method loggedValueJson : Js.js_string Js.t Js.prop
end
@ -123,13 +124,23 @@ let event_manager : event_manager Js.t =
(match evt with
| BeginCall info
| EndCall info
| VariableDefinition (info, _) ->
| VariableDefinition (info, _, _) ->
List.map Js.string info
| DecisionTaken _ -> []))
val mutable loggedIOJson =
match evt with
| VariableDefinition (_, io, _) ->
io
|> R_ocaml.yojson_of_io_log
|> Yojson.Safe.to_string
|> Js.string
| EndCall _ | BeginCall _ | DecisionTaken _ ->
"unavailable" |> Js.string
val mutable loggedValueJson =
(match evt with
| VariableDefinition (_, v) -> v
| VariableDefinition (_, _, v) -> v
| EndCall _ | BeginCall _ | DecisionTaken _ ->
R_ocaml.unembeddable ())
|> R_ocaml.yojson_of_runtime_value

View File

@ -63,13 +63,17 @@ class type raw_event =
method sourcePosition : source_position Js.t Js.optdef Js.prop
method loggedIOJson : Js.js_string Js.t Js.prop
(** Serialzed [Runtime_ocaml.Runtime.io_log] corresponding to a
`VariableDefinition` raw event. *)
method loggedValueJson : Js.js_string Js.t Js.prop
(** Serialized [Runtime_ocaml.Runtime.runtime_value] corresponding to a
'VariableDefinition' raw event.*)
'VariableDefinition' raw event. *)
end
(** Wrapper for the {!type: Runtime_ocaml.Runtime.event} -- structured log event
parsed from the {!raw_event} ones.*)
parsed from the {!raw_event} ones. *)
class type event =
object
method data : Js.js_string Js.t Js.prop

View File

@ -22,6 +22,8 @@ type date = Dates_calc.Dates.date
type date_rounding = Dates_calc.Dates.date_rounding
type duration = Dates_calc.Dates.period
type 'a eoption = ENone of unit | ESome of 'a
type io_input = NoInput | OnlyInput | Reentrant [@@deriving yojson_of]
type io_log = { io_input : io_input; io_output : bool } [@@deriving yojson_of]
type source_position = {
filename : string;
@ -202,7 +204,7 @@ type information = string list [@@deriving yojson_of]
type raw_event =
| BeginCall of information
| EndCall of information
| VariableDefinition of information * runtime_value
| VariableDefinition of information * io_log * runtime_value
| DecisionTaken of source_position
type event =
@ -218,6 +220,7 @@ type event =
and var_def = {
pos : source_position option;
name : information;
io : io_log;
value : runtime_value;
fun_calls : fun_call list option;
}
@ -241,8 +244,8 @@ let log_end_call info x =
log_ref := EndCall info :: !log_ref;
x
let log_variable_definition (info : string list) embed (x : 'a) =
log_ref := VariableDefinition (info, embed x) :: !log_ref;
let log_variable_definition (info : string list) (io : io_log) embed (x : 'a) =
log_ref := VariableDefinition (info, io, embed x) :: !log_ref;
x
let log_decision_taken pos x =
@ -368,13 +371,28 @@ module EventParser = struct
let empty_ctx = { vars = VarDefMap.empty; events = []; rest = [] }
let io_log_to_string (io : io_log) : string =
match io.io_input, io.io_output with
| NoInput, false -> "internal"
| _ ->
Printf.sprintf "%s%s%s"
(match io.io_input with
| NoInput -> ""
| OnlyInput -> "input"
| Reentrant -> "reentrant")
(match io.io_input, io.io_output with
| (OnlyInput | Reentrant), true -> "/"
| _ -> "")
(if io.io_output then "output" else "")
let raw_event_to_string = function
| BeginCall name ->
Printf.sprintf "BeginCall([ " ^ String.concat ", " name ^ " ])"
| EndCall name ->
Printf.sprintf "EndCall([ " ^ String.concat ", " name ^ " ])"
| VariableDefinition (name, value) ->
Printf.sprintf "VariableDefinition([ %s ], %s)" (String.concat ", " name)
| VariableDefinition (name, io, value) ->
Printf.sprintf "VariableDefinition([ %s ], %s, %s)"
(String.concat ", " name) (io_log_to_string io)
(yojson_of_runtime_value value |> Yojson.Safe.to_string)
| DecisionTaken pos ->
Printf.sprintf "DecisionTaken(%s:%d.%d-%d.%d)" pos.filename pos.start_line
@ -406,11 +424,11 @@ module EventParser = struct
let rec parse_events (ctx : context) : context =
match ctx.rest with
| [] -> { ctx with events = ctx.events |> List.rev }
| VariableDefinition (name, _) :: rest when is_var_def name ->
| VariableDefinition (name, _, _) :: rest when is_var_def name ->
(* VariableDefinition without position corresponds to a function
definition which are ignored for now in structured events. *)
parse_events { ctx with rest }
| DecisionTaken pos :: VariableDefinition (name, value) :: rest
| DecisionTaken pos :: VariableDefinition (name, io, value) :: rest
when is_subscope_input_var_def name -> (
match name with
| [_; var_dot_subscope_var_name] ->
@ -423,18 +441,19 @@ module EventParser = struct
vars =
ctx.vars
|> VarDefMap.add var_name
{ pos = Some pos; name; value; fun_calls = None };
{ pos = Some pos; name; value; fun_calls = None; io };
rest;
}
| _ ->
failwith "unreachable due to the [is_subscope_input_var_def] test")
| DecisionTaken pos :: VariableDefinition (name, value) :: rest
| DecisionTaken pos :: VariableDefinition (name, io, value) :: rest
when is_var_def name || is_output_var_def name ->
parse_events
{
ctx with
events =
VarComputation { pos = Some pos; name; value; fun_calls = None }
VarComputation
{ pos = Some pos; name; value; fun_calls = None; io }
:: ctx.events;
rest;
}
@ -455,10 +474,11 @@ module EventParser = struct
let rest, var_comp =
let rest, fun_calls = parse_fun_calls [] (List.tl ctx.rest) in
match rest with
| VariableDefinition (name, value) :: rest ->
| VariableDefinition (name, io, value) :: rest ->
( rest,
VarComputation
{ pos = Some pos; name; value; fun_calls = Some fun_calls } )
{ pos = Some pos; name; value; fun_calls = Some fun_calls; io }
)
| event :: _ ->
failwith
("Invalid function call ([ "
@ -502,14 +522,15 @@ module EventParser = struct
match
take_while
(function
| VariableDefinition (name, _) -> is_input_var_def name | _ -> false)
| VariableDefinition (name, _, _) -> is_input_var_def name
| _ -> false)
events
with
| inputs, BeginCall infos :: rest when is_function_call infos ->
let fun_inputs =
ListLabels.map inputs ~f:(function
| VariableDefinition (name, value) ->
{ pos = None; name; value; fun_calls = None }
| VariableDefinition (name, io, value) ->
{ pos = None; name; value; fun_calls = None; io }
| _ -> assert false)
in
let rest, body, output =

View File

@ -37,6 +37,27 @@ type source_position = {
type 'a eoption = ENone of unit | ESome of 'a
(** This type characterizes the three levels of visibility for a given scope
variable with regards to the scope's input and possible redefinitions inside
the scope. *)
type io_input =
| NoInput
(** For an internal variable defined only in the scope, and does not
appear in the input. *)
| OnlyInput
(** For variables that should not be redefined in the scope, because they
appear in the input. *)
| Reentrant
(** For variables defined in the scope that can also be redefined by the
caller as they appear in the input. *)
[@@deriving yojson_of]
type io_log = {
io_input : io_input;
io_output : bool; (** [true] if the variable is an output *)
}
[@@deriving yojson_of]
(** {1 Exceptions} *)
exception EmptyError
@ -106,7 +127,7 @@ type information = string list [@@deriving yojson_of]
type raw_event =
| BeginCall of information (** Subscope or function call. *)
| EndCall of information (** End of a subscope or a function call. *)
| VariableDefinition of information * runtime_value
| VariableDefinition of information * io_log * runtime_value
(** Definition of a variable or a function argument. *)
| DecisionTaken of source_position (** Source code position of an event. *)
@ -165,6 +186,7 @@ type event =
and var_def = {
pos : source_position option;
name : information;
io : io_log;
value : runtime_value;
fun_calls : fun_call list option;
}
@ -193,7 +215,10 @@ end
val reset_log : unit -> unit
val log_begin_call : string list -> 'a -> 'a
val log_end_call : string list -> 'a -> 'a
val log_variable_definition : string list -> ('a -> runtime_value) -> 'a -> 'a
val log_variable_definition :
string list -> io_log -> ('a -> runtime_value) -> 'a -> 'a
val log_decision_taken : source_position -> bool -> bool
(** {3 Pretty printers} *)

View File

@ -40,7 +40,7 @@ class Integer:
return Integer(self.value * other.value)
def __truediv__(self, other: 'Integer') -> 'Decimal':
return Decimal (self.value) / Decimal (other.value)
return Decimal(self.value) / Decimal(other.value)
def __neg__(self: 'Integer') -> 'Integer':
return Integer(- self.value)
@ -155,7 +155,7 @@ class Money:
elif isinstance(other, Decimal):
return self * (1. / other.value)
else:
raise Exception("Dividing money and invalid obj")
raise Exception("Dividing money and invalid obj")
def __neg__(self: 'Money') -> 'Money':
return Money(- self.value)
@ -200,11 +200,11 @@ class Date:
def __sub__(self, other: object) -> object:
if isinstance(other, Date):
return Duration(dateutil.relativedelta.relativedelta(days=(self.value - other.value).days))
return Duration(dateutil.relativedelta.relativedelta(days=(self.value - other.value).days))
elif isinstance(other, Duration):
return Date(self.value - other.value)
return Date(self.value - other.value)
else:
raise Exception("Substracting date and invalid obj")
raise Exception("Substracting date and invalid obj")
def __lt__(self, other: 'Date') -> bool:
return self.value < other.value
@ -618,8 +618,8 @@ def handle_default(
def handle_default_opt(
pos: SourcePosition,
exceptions: List[Optional[Any]],
just: Callable[[Unit],Optional[bool]],
cons: Callable[[Unit],Optional[Alpha]]
just: Callable[[Unit], Optional[bool]],
cons: Callable[[Unit], Optional[Alpha]]
) -> Optional[Alpha]:
acc: Optional[Alpha] = None
for exception in exceptions:
@ -666,9 +666,22 @@ class LogEventCode(Enum):
DecisionTaken = 3
class InputIO(Enum):
NoInput = 0
OnlyInput = 1
Reentrant = 2
class LogIO:
def __init__(self, input_io: InputIO, output_io: bool):
self.input_io = input_io
self.output_io = output_io
class LogEvent:
def __init__(self, code: LogEventCode, payload: Union[List[str], SourcePosition, Tuple[List[str], Alpha]]) -> None:
def __init__(self, code: LogEventCode, io: Optional[LogIO], payload: Union[List[str], SourcePosition, Tuple[List[str], Alpha]]) -> None:
self.code = code
self.io = io
self.payload = payload
@ -683,22 +696,22 @@ def retrieve_log() -> List[LogEvent]:
return log
def log_variable_definition(headings: List[str], value: Alpha) -> Alpha:
log.append(LogEvent(LogEventCode.VariableDefinition,
def log_variable_definition(headings: List[str], io: LogIO, value: Alpha) -> Alpha:
log.append(LogEvent(LogEventCode.VariableDefinition, io,
(headings, copy.deepcopy(value))))
return value
def log_begin_call(headings: List[str], f: Callable[[Alpha], Beta], value: Alpha) -> Beta:
log.append(LogEvent(LogEventCode.BeginCall, headings))
log.append(LogEvent(LogEventCode.BeginCall, None, headings))
return f(value)
def log_end_call(headings: List[str], value: Alpha) -> Alpha:
log.append(LogEvent(LogEventCode.EndCall, headings))
log.append(LogEvent(LogEventCode.EndCall, None, headings))
return value
def log_decision_taken(pos: SourcePosition, value: bool) -> bool:
log.append(LogEvent(LogEventCode.DecisionTaken, pos))
log.append(LogEvent(LogEventCode.DecisionTaken, None, pos))
return value

View File

@ -1,6 +1,6 @@
{
"name": "@catala-lang/rescript-catala",
"version": "0.8.0",
"version": "0.8.1-b.0",
"description": "ReScript wrapper for the Catala runtime",
"scripts": {
"clean": "rescript clean",

View File

@ -125,6 +125,18 @@ type eventSerialized = {data: string}
@decco.decode
type information = list<string>
@decco.decode
type io_input =
| NoInput
| OnlyInput
| Reentrant
@decco.decode
type io_log = {
io_input: io_input,
io_output: bool,
}
@decco.decode
type rec event =
| VarComputation(var_def)
@ -134,6 +146,7 @@ type rec event =
and var_def = {
pos: option<sourcePosition>,
name: information,
io: io_log,
value: LoggedValue.t,
fun_calls: option<list<fun_call>>,
}

View File

@ -101,6 +101,18 @@ type eventSerialized = {data: string}
@decco.decode
type information = list<string>
@decco.decode
type io_input =
| NoInput
| OnlyInput
| Reentrant
@decco.decode
type io_log = {
io_input: io_input,
io_output: bool,
}
/* Deserialized log event. */
@decco.decode
type rec event =
@ -111,6 +123,7 @@ type rec event =
and var_def = {
pos: option<sourcePosition>,
name: information,
io: io_log,
value: LoggedValue.t,
fun_calls: option<list<fun_call>>,
}

View File

@ -2,12 +2,17 @@
# yarn lockfile v1
"bs-platform@6 || 7 || 8 || 9":
version "9.0.2"
resolved "https://registry.npmjs.org/bs-platform/-/bs-platform-9.0.2.tgz"
integrity sha512-Ye9JqJ4Oa7mcjjoOVRYI8Uc2Cf8N7jQLWDcdUplY7996d/YErSR7WitmV7XnSwr4EvdrbwjEsg1NxNjUQv3ChA==
decco@^1.6.0:
version "1.6.0"
resolved "https://registry.yarnpkg.com/decco/-/decco-1.6.0.tgz#79a07d518691f92519066a067b77f04ce89b4896"
resolved "https://registry.npmjs.org/decco/-/decco-1.6.0.tgz"
integrity sha512-gdeDDPOh45Hz8YGvTkDP7ySo3Ll3ty+KfuFj21+jRbiCoE8HTCNB++pozCiMljxJx39CfvrHRYBY5FO5PMyXzw==
rescript@^10.1.4:
version "10.1.4"
resolved "https://registry.yarnpkg.com/rescript/-/rescript-10.1.4.tgz#0f37710d371f32a704f17b4e804f66ce3c79a305"
resolved "https://registry.npmjs.org/rescript/-/rescript-10.1.4.tgz"
integrity sha512-FFKlS9AG/XrLepWsyw7B+A9DtQBPWEPDPDKghV831Y2KGbie+eeFBOS0xtRHp0xbt7S0N2Dm6hhX+kTZQ/3Ybg==